diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java index da19bd4ac..74107cc02 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java @@ -157,6 +157,7 @@ import fr.gouv.etalab.mastodon.sqlite.StatusStoredDAO; import static fr.gouv.etalab.mastodon.helper.Helper.HOME_TIMELINE_INTENT; import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION; import static fr.gouv.etalab.mastodon.helper.Helper.THEME_LIGHT; +import static fr.gouv.etalab.mastodon.helper.Helper.changeButtonTextColor; import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor; import static fr.gouv.etalab.mastodon.helper.Helper.convertDpToPixel; @@ -2883,8 +2884,6 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface, Toasty.error(getApplicationContext(), getString(R.string.toast_error), Toast.LENGTH_LONG).show(); } } - - private void changeColor(){ final SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK); @@ -2898,6 +2897,13 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface, changeDrawableColor(TootActivity.this, R.drawable.ic_skip_next, R.color.dark_text); changeDrawableColor(TootActivity.this, R.drawable.ic_check, R.color.dark_text); changeDrawableColor(TootActivity.this, R.drawable.emoji_one_category_smileysandpeople, R.color.dark_text); + //bottom action + changeDrawableColor(TootActivity.this, findViewById(R.id.toot_picture), R.color.dark_text); + changeDrawableColor(TootActivity.this, findViewById(R.id.poll_action), R.color.dark_text); + changeDrawableColor(TootActivity.this, findViewById(R.id.toot_visibility), R.color.dark_text); + changeDrawableColor(TootActivity.this, findViewById(R.id.toot_emoji), R.color.dark_text); + changeButtonTextColor(TootActivity.this, findViewById(R.id.toot_cw), R.color.dark_text); + }else { changeDrawableColor(TootActivity.this, R.drawable.ic_public_toot, R.color.white); changeDrawableColor(TootActivity.this, R.drawable.ic_lock_open_toot, R.color.white); @@ -2908,6 +2914,13 @@ public class TootActivity extends BaseActivity implements OnPostActionInterface, changeDrawableColor(TootActivity.this, R.drawable.ic_skip_next, R.color.white); changeDrawableColor(TootActivity.this, R.drawable.ic_check, R.color.white); changeDrawableColor(TootActivity.this, R.drawable.emoji_one_category_smileysandpeople, R.color.black); + //bottom action + changeDrawableColor(TootActivity.this, findViewById(R.id.toot_picture), R.color.black); + changeDrawableColor(TootActivity.this, findViewById(R.id.poll_action), R.color.black); + changeDrawableColor(TootActivity.this, findViewById(R.id.toot_visibility), R.color.black); + changeDrawableColor(TootActivity.this, findViewById(R.id.toot_emoji), R.color.black); + changeButtonTextColor(TootActivity.this, findViewById(R.id.toot_cw), R.color.black); + } } 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 1ed494625..ffb938ac1 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 @@ -95,6 +95,7 @@ import android.webkit.MimeTypeMap; import android.webkit.URLUtil; import android.webkit.WebSettings; import android.webkit.WebView; +import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; @@ -2303,6 +2304,14 @@ public class Helper { imageButton.setColorFilter(context.getResources().getColor(hexaColor)); } + /** + * change color of a drawable + * @param button int the button + * @param hexaColor example 0xffff00 + */ + public static void changeButtonTextColor(Context context, Button button, int hexaColor){ + button.setTextColor(context.getResources().getColor(hexaColor)); + } /** * Returns the current locale of the device * @param context Context diff --git a/app/src/main/res/layout-sw600dp/activity_toot.xml b/app/src/main/res/layout-sw600dp/activity_toot.xml index e693f3ab5..546eb435a 100644 --- a/app/src/main/res/layout-sw600dp/activity_toot.xml +++ b/app/src/main/res/layout-sw600dp/activity_toot.xml @@ -100,7 +100,9 @@ android:layout_width="50dp" android:layout_height="50dp" android:scaleType="centerCrop" + android:padding="5dp" style="@style/Base.Widget.AppCompat.Button.Colored" + android:background="@color/transparent" android:src="@drawable/ic_insert_photo" android:contentDescription="@string/toot_select_image" />