diff options
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java | 21 | ||||
-rw-r--r-- | app/src/main/res/drawable/circular_mastodon.xml | 12 | ||||
-rw-r--r-- | app/src/main/res/drawable/circular_peertube.xml | 12 | ||||
-rw-r--r-- | app/src/main/res/values/colors.xml | 2 |
4 files changed, 36 insertions, 11 deletions
diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java index 636f0dfbf..aae6cbf70 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java @@ -1516,7 +1516,7 @@ public class Helper { if( accounts != null && accounts.size() > 1) { - FloatingActionButton.LayoutParams layoutparmansAcc = new FloatingActionButton.LayoutParams((int) Helper.convertDpToPixel(35, activity), (int) Helper.convertDpToPixel(35, activity)); + FloatingActionButton.LayoutParams layoutparmansAcc = new FloatingActionButton.LayoutParams((int) Helper.convertDpToPixel(37, activity), (int) Helper.convertDpToPixel(37, activity)); FloatingActionButton.LayoutParams layoutparmanImgAcc = new FloatingActionButton.LayoutParams((int) Helper.convertDpToPixel(35, activity), (int) Helper.convertDpToPixel(35, activity)); MenuFloating actionButtonAcc = null; SharedPreferences mSharedPreferences = activity.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); @@ -1601,15 +1601,11 @@ public class Helper { }); if( accounts.size() > 2 ) { - SubActionButton.Builder subActionButtonAccBuilder = itemBuilderAcc; - if (theme == THEME_LIGHT) { - subActionButtonAccBuilder.setBackgroundDrawable(activity.getResources().getDrawable(R.drawable.circular)); - } else if (theme == THEME_DARK) { - subActionButtonAccBuilder.setBackgroundDrawable(activity.getResources().getDrawable(R.drawable.circular_dark)); - } else if (theme == THEME_BLACK) { - subActionButtonAccBuilder.setBackgroundDrawable(activity.getResources().getDrawable(R.drawable.circular_black)); - } - SubActionButton subActionButtonAcc = subActionButtonAccBuilder.setContentView(itemIconAcc, layoutparmanImgAcc) + if(accountChoice.getSocial() != null && accountChoice.getSocial().equals("PEERTUBE")) + itemBuilderAcc.setBackgroundDrawable(activity.getResources().getDrawable(R.drawable.circular_peertube)); + else + itemBuilderAcc.setBackgroundDrawable(activity.getResources().getDrawable(R.drawable.circular_mastodon)); + SubActionButton subActionButtonAcc = itemBuilderAcc.setContentView(itemIconAcc, layoutparmanImgAcc) .setLayoutParams(layoutparmansAcc) .build(); @@ -1621,7 +1617,10 @@ public class Helper { editor.putString(Helper.PREF_KEY_ID, accountChoice.getId()); editor.putString(Helper.PREF_INSTANCE, accountChoice.getInstance().trim()); editor.commit(); - Toasty.info(activity, activity.getString(R.string.toast_account_changed, "@" + accountChoice.getAcct() + "@" + accountChoice.getInstance()), Toast.LENGTH_LONG).show(); + if(accountChoice.getSocial() != null && accountChoice.getSocial().equals("PEERTUBE")) + Toasty.info(activity, activity.getString(R.string.toast_account_changed, "@" + accountChoice.getAcct()), Toast.LENGTH_LONG).show(); + else + Toasty.info(activity, activity.getString(R.string.toast_account_changed, "@" + accountChoice.getAcct() + "@" + accountChoice.getInstance()), Toast.LENGTH_LONG).show(); Intent changeAccount = new Intent(activity, MainActivity.class); changeAccount.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); activity.finish(); diff --git a/app/src/main/res/drawable/circular_mastodon.xml b/app/src/main/res/drawable/circular_mastodon.xml new file mode 100644 index 000000000..6f8bb6b80 --- /dev/null +++ b/app/src/main/res/drawable/circular_mastodon.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + + android:shape="oval" + android:thicknessRatio="1.9" + android:useLevel="false" > + <solid android:color="@color/mastodonC4" /> + + <stroke + android:width="10dp" + android:color="@color/mastodonC4" /> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/circular_peertube.xml b/app/src/main/res/drawable/circular_peertube.xml new file mode 100644 index 000000000..f3607ce86 --- /dev/null +++ b/app/src/main/res/drawable/circular_peertube.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + + android:shape="oval" + android:thicknessRatio="1.9" + android:useLevel="false" > + <solid android:color="@color/peertube_orange" /> + + <stroke + android:width="10dp" + android:color="@color/peertube_orange" /> +</shape>
\ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 97737f071..38bb9c1ec 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -110,4 +110,6 @@ <color name="neutral_thumbs">#606984</color> <color name="positive_thumbs">#2b90d9</color> <color name="negative_thumbs">#F44336</color> + + <color name="peertube_orange">#F1680D</color> </resources> |