Gitlab support

This commit is contained in:
stom79 2018-11-18 10:09:32 +01:00
parent 4670576318
commit 76f957227d
9 changed files with 141 additions and 38 deletions

View File

@ -23,7 +23,6 @@ import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.text.SpannableString;
@ -68,12 +67,14 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
private List<Account> designers = new ArrayList<>();
private List<Account> banners = new ArrayList<>();
private List<Account> uxuidesigners = new ArrayList<>();
private List<Account> support = new ArrayList<>();
private AccountSearchDevAdapter accountSearchWebAdapterDeveloper;
private AccountSearchDevAdapter accountSearchWebAdapterDesigner;
private AccountSearchDevAdapter accountSearchWebAdapterContributors;
private AccountSearchDevAdapter accountSearchWebAdapterBanners;
private AccountSearchDevAdapter accountSearchWebAdapterUxUiDesigners;
private AccountSearchDevAdapter accountSearchWebAdapterSupport;
@Override
protected void onCreate(Bundle savedInstanceState) {
@ -130,6 +131,7 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
ExpandableHeightListView lv_contributors = findViewById(R.id.lv_contributors);
ExpandableHeightListView lv_banners = findViewById(R.id.lv_banners);
ExpandableHeightListView lv_ux = findViewById(R.id.lv_ux);
ExpandableHeightListView lv_support = findViewById(R.id.lv_support);
Button about_code = findViewById(R.id.about_code);
Button about_license = findViewById(R.id.about_license);
@ -227,6 +229,7 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
lv_designers.setExpanded(true);
lv_banners.setExpanded(true);
lv_ux.setExpanded(true);
lv_support.setExpanded(true);
accountSearchWebAdapterContributors = new AccountSearchDevAdapter(AboutActivity.this, contributors);
lv_contributors.setAdapter(accountSearchWebAdapterContributors);
@ -238,9 +241,12 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
lv_banners.setAdapter(accountSearchWebAdapterBanners);
accountSearchWebAdapterUxUiDesigners = new AccountSearchDevAdapter(AboutActivity.this, uxuidesigners);
lv_ux.setAdapter(accountSearchWebAdapterUxUiDesigners);
accountSearchWebAdapterSupport = new AccountSearchDevAdapter(AboutActivity.this, support);
lv_support.setAdapter(accountSearchWebAdapterSupport);
new RetrieveRemoteDataAsyncTask(getApplicationContext(), "tom79", "mastodon.social", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(getApplicationContext(), "mmarif", "mastodon.social", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(getApplicationContext(), "guzzisti", "mastodon.social", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(getApplicationContext(), "NateLikesSheep", "mastodon.art", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(getApplicationContext(), "daycode", "mastodon.social", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
new RetrieveRemoteDataAsyncTask(getApplicationContext(), "PhotonQyv", "mastodon.xyz", AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
@ -277,6 +283,10 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
developers.add(account);
accountSearchWebAdapterDeveloper.notifyDataSetChanged();
break;
case "guzzisti":
support.add(account);
accountSearchWebAdapterSupport.notifyDataSetChanged();
break;
case "NateLikesSheep":
banners.add(account);
accountSearchWebAdapterBanners.notifyDataSetChanged();
@ -327,6 +337,11 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
new RetrieveRelationshipAsyncTask(getApplicationContext(), account.getId(),AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
if( support != null){
for(Account account: support){
new RetrieveRelationshipAsyncTask(getApplicationContext(), account.getId(),AboutActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
}
}
@Override
@ -371,5 +386,12 @@ public class AboutActivity extends BaseActivity implements OnRetrieveRemoteAccou
break;
}
}
for( int i = 0 ; i < support.size() ; i++){
if( support.get(i).getId() != null && support.get(i).getId().equals(relationship.getId())){
support.get(i).setFollowing(relationship.isFollowing() || userId.trim().equals(relationship.getId()));
accountSearchWebAdapterSupport.notifyDataSetChanged();
break;
}
}
}
}

View File

@ -1963,6 +1963,16 @@ public abstract class BaseMainActivity extends BaseActivity
Intent intent = new Intent(getApplicationContext(), PartnerShipActivity.class);
startActivity(intent);
return false;
}else if(id == R.id.nav_bug_report){
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("message/rfc822");
i.putExtra(Intent.EXTRA_EMAIL , new String[]{"incoming+tom79/mastalab@incoming.gitlab.com"});
try {
startActivity(Intent.createChooser(i, getString(R.string.bug_report_mail)));
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(getApplicationContext(), R.string.no_mail_client, Toast.LENGTH_SHORT).show();
}
return false;
}
final NavigationView navigationView = findViewById(R.id.nav_view);
unCheckAllMenuItems(navigationView);

View File

@ -272,29 +272,29 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
//Manages theme for icon colors
if( theme == THEME_BLACK){
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(context, holder.status_more, R.color.dark_icon);
changeDrawableColor(context, holder.status_privacy, R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_black);
changeDrawableColor(context, holder.status_more, R.color.action_black);
changeDrawableColor(context, holder.status_privacy, R.color.action_black);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.action_black);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.action_black);
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.dark_text);
changeDrawableColor(context, holder.notification_delete,R.color.dark_text);
}else if( theme == Helper.THEME_DARK ){
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
changeDrawableColor(context, holder.status_more, R.color.dark_icon);
changeDrawableColor(context, holder.status_privacy, R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_dark);
changeDrawableColor(context, holder.status_more, R.color.action_dark);
changeDrawableColor(context, holder.status_privacy, R.color.action_dark);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.action_dark);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.action_dark);
changeDrawableColor(context, R.drawable.ic_photo,R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.mastodonC4);
changeDrawableColor(context, holder.notification_delete,R.color.dark_text);
}else {
changeDrawableColor(context, R.drawable.ic_reply,R.color.black);
changeDrawableColor(context, holder.status_more, R.color.black);
changeDrawableColor(context, holder.status_privacy, R.color.black);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.black);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.black);
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_light);
changeDrawableColor(context, holder.status_more, R.color.action_light);
changeDrawableColor(context, holder.status_privacy, R.color.action_light);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.action_light);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.action_light);
changeDrawableColor(context, R.drawable.ic_photo,R.color.black);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.black);
changeDrawableColor(context, holder.notification_delete,R.color.black);
@ -356,10 +356,12 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
changeDrawableColor(context, R.drawable.ic_star,R.color.marked_icon);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_star);
}else {
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
if( theme == THEME_DARK)
changeDrawableColor(context, R.drawable.ic_star_border,R.color.action_dark);
else if(theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_star_border,R.color.action_black);
else
changeDrawableColor(context, R.drawable.ic_star_border,R.color.black);
changeDrawableColor(context, R.drawable.ic_star_border,R.color.action_light);
imgFav = ContextCompat.getDrawable(context, R.drawable.ic_star_border);
}
@ -367,16 +369,20 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
changeDrawableColor(context, R.drawable.ic_repeat_boost,R.color.boost_icon);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_repeat_boost);
}else {
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
if( theme == THEME_DARK )
changeDrawableColor(context, R.drawable.ic_repeat,R.color.action_dark);
else if(theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_repeat,R.color.action_black);
else
changeDrawableColor(context, R.drawable.ic_repeat,R.color.black);
changeDrawableColor(context, R.drawable.ic_repeat,R.color.action_light);
imgReblog = ContextCompat.getDrawable(context, R.drawable.ic_repeat);
}
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
if( theme == THEME_DARK)
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_dark);
else if(theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_black);
else
changeDrawableColor(context, R.drawable.ic_reply,R.color.black);
changeDrawableColor(context, R.drawable.ic_reply,R.color.action_light);
imgReply = ContextCompat.getDrawable(context, R.drawable.ic_reply);
if( status.getReblog() == null) {
@ -427,14 +433,18 @@ public class NotificationsListAdapter extends RecyclerView.Adapter implements On
holder.status_reblog_count.setCompoundDrawables(imgReblog, null, null, null);
holder.status_reply.setCompoundDrawables(imgReply, null, null, null);
if( theme == THEME_DARK || theme == THEME_BLACK){
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
if( theme == THEME_DARK ){
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.action_dark));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.action_dark));
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.action_dark));
}else if(theme == THEME_BLACK){
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.action_black));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.action_black));
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.action_black));
}else {
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.black));
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.action_light));
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.action_light));
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.action_light));
}
if( type.equals("favourite") || type.equals("reblog")){
holder.status_document_container.setVisibility(View.GONE);

View File

@ -591,7 +591,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
changeDrawableColor(context, R.drawable.ic_photo,R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.mastodonC4);
changeDrawableColor(context, R.drawable.ic_repeat_head_toot,R.color.light_black);
changeDrawableColor(context, R.drawable.ic_repeat_head_toot,R.color.action_light_header);
holder.status_cardview_title.setTextColor(ContextCompat.getColor(context, R.color.light_black));
@ -609,7 +609,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.black_text_toot_header));
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.black_text_toot_header));
}else if( theme == THEME_LIGHT) {
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.light_black));
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.action_light_header));
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.light_black));
}
if( status.isBookmarked())
@ -1191,10 +1191,12 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
changeDrawableColor(context, R.drawable.ic_pin_drop_p,R.color.marked_icon);
imgPin = ContextCompat.getDrawable(context, R.drawable.ic_pin_drop_p);
}else {
if( theme == THEME_DARK || theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_pin_drop,R.color.dark_icon);
if( theme == THEME_DARK )
changeDrawableColor(context, R.drawable.ic_pin_drop,R.color.action_dark);
else if(theme == THEME_BLACK)
changeDrawableColor(context, R.drawable.ic_pin_drop,R.color.action_black);
else
changeDrawableColor(context, R.drawable.ic_pin_drop,R.color.light_black);
changeDrawableColor(context, R.drawable.ic_pin_drop,R.color.action_light);
imgPin = ContextCompat.getDrawable(context, R.drawable.ic_pin_drop);
}
assert imgPin != null;

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M20,8h-2.81c-0.45,-0.78 -1.07,-1.45 -1.82,-1.96L17,4.41 15.59,3l-2.17,2.17C12.96,5.06 12.49,5 12,5c-0.49,0 -0.96,0.06 -1.41,0.17L8.41,3 7,4.41l1.62,1.63C7.88,6.55 7.26,7.22 6.81,8L4,8v2h2.09c-0.05,0.33 -0.09,0.66 -0.09,1v1L4,12v2h2v1c0,0.34 0.04,0.67 0.09,1L4,16v2h2.81c1.04,1.79 2.97,3 5.19,3s4.15,-1.21 5.19,-3L20,18v-2h-2.09c0.05,-0.33 0.09,-0.66 0.09,-1v-1h2v-2h-2v-1c0,-0.34 -0.04,-0.67 -0.09,-1L20,10L20,8zM14,16h-4v-2h4v2zM14,12h-4v-2h4v2z"/>
</vector>

View File

@ -135,6 +135,29 @@
android:divider="@null"
android:scrollbars="none" />
<!-- About Help desk -->
<TextView
android:id="@+id/about_thanks_support"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginTop="10dp"
android:gravity="center_vertical|center_horizontal"
android:padding="5dp"
android:text="@string/thanks_text_support"
android:textColor="?colorAccent"
android:textSize="16sp" />
<fr.gouv.etalab.mastodon.helper.ExpandableHeightListView
android:id="@+id/lv_support"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:layout_marginLeft="150dp"
android:layout_marginRight="150dp"
android:divider="@null"
android:scrollbars="none" />
<!-- About banner designer -->
<TextView
android:id="@+id/about_thanks_banner"

View File

@ -125,7 +125,26 @@
android:layout_height="wrap_content"
android:scrollbars="none"
android:divider="@null"/>
<!-- About logo designer -->
<!-- About Help desk -->
<TextView
android:padding="5dp"
android:layout_marginTop="10dp"
android:id="@+id/about_thanks_support"
android:layout_width="match_parent"
android:textColor="?colorAccent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:textSize="16sp"
android:text="@string/thanks_text_support"/>
<fr.gouv.etalab.mastodon.helper.ExpandableHeightListView
android:id="@+id/lv_support"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:divider="@null"/>
<!-- About banner designer -->
<TextView

View File

@ -87,6 +87,10 @@
android:id="@+id/nav_main_info">
<menu>
<group android:checkableBehavior="single">
<item
android:id="@+id/nav_bug_report"
android:icon="@drawable/ic_bug_report"
android:title="@string/action_bug_report" />
<item
android:id="@+id/nav_about"
android:icon="@drawable/ic_info"

View File

@ -659,6 +659,10 @@
<string name="thanks_text_ux">New UX/UI designer</string>
<string name="set_old_direct_timeline">Use the direct timeline prior to Mastodon 2.6</string>
<string name="set_display_video_preview">Display video previews</string>
<string name="thanks_text_support">Gitlab Support</string>
<string name="action_bug_report">Bug Report</string>
<string name="no_mail_client">There are no email clients installed.</string>
<string name="bug_report_mail">Send a bug report</string>
<string-array name="filter_expire">
<item>Never</item>