diff --git a/res/drawable-hdpi/ic_advanced_black_24dp.png b/res/drawable-hdpi/ic_advanced_black_24dp.png deleted file mode 100644 index ab07536e5d..0000000000 Binary files a/res/drawable-hdpi/ic_advanced_black_24dp.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_brightness_6_black_24dp.png b/res/drawable-hdpi/ic_brightness_6_black_24dp.png deleted file mode 100644 index 7e9f3976ec..0000000000 Binary files a/res/drawable-hdpi/ic_brightness_6_black_24dp.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_forum_black_24dp.png b/res/drawable-hdpi/ic_forum_black_24dp.png deleted file mode 100644 index 373168bd9c..0000000000 Binary files a/res/drawable-hdpi/ic_forum_black_24dp.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_laptop_black_24dp.png b/res/drawable-hdpi/ic_laptop_black_24dp.png deleted file mode 100644 index e175dcb77a..0000000000 Binary files a/res/drawable-hdpi/ic_laptop_black_24dp.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_notifications_black_24dp.png b/res/drawable-hdpi/ic_notifications_black_24dp.png deleted file mode 100644 index 876681f224..0000000000 Binary files a/res/drawable-hdpi/ic_notifications_black_24dp.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_security_black_24dp.png b/res/drawable-hdpi/ic_security_black_24dp.png deleted file mode 100644 index ec30bf1e7d..0000000000 Binary files a/res/drawable-hdpi/ic_security_black_24dp.png and /dev/null differ diff --git a/res/drawable-hdpi/ic_textsms_black_24dp.png b/res/drawable-hdpi/ic_textsms_black_24dp.png deleted file mode 100644 index 0fc43a9a4d..0000000000 Binary files a/res/drawable-hdpi/ic_textsms_black_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_advanced_black_24dp.png b/res/drawable-mdpi/ic_advanced_black_24dp.png deleted file mode 100644 index 2e9ba9c667..0000000000 Binary files a/res/drawable-mdpi/ic_advanced_black_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_brightness_6_black_24dp.png b/res/drawable-mdpi/ic_brightness_6_black_24dp.png deleted file mode 100644 index 66555bac97..0000000000 Binary files a/res/drawable-mdpi/ic_brightness_6_black_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_forum_black_24dp.png b/res/drawable-mdpi/ic_forum_black_24dp.png deleted file mode 100644 index 68f193dcf9..0000000000 Binary files a/res/drawable-mdpi/ic_forum_black_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_laptop_black_24dp.png b/res/drawable-mdpi/ic_laptop_black_24dp.png deleted file mode 100644 index 29b3b50ec8..0000000000 Binary files a/res/drawable-mdpi/ic_laptop_black_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_notifications_black_24dp.png b/res/drawable-mdpi/ic_notifications_black_24dp.png deleted file mode 100644 index 8aebe88250..0000000000 Binary files a/res/drawable-mdpi/ic_notifications_black_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_security_black_24dp.png b/res/drawable-mdpi/ic_security_black_24dp.png deleted file mode 100644 index 677632000c..0000000000 Binary files a/res/drawable-mdpi/ic_security_black_24dp.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_textsms_black_24dp.png b/res/drawable-mdpi/ic_textsms_black_24dp.png deleted file mode 100644 index 1589c3ae92..0000000000 Binary files a/res/drawable-mdpi/ic_textsms_black_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_advanced_black_24dp.png b/res/drawable-xhdpi/ic_advanced_black_24dp.png deleted file mode 100644 index e45089616b..0000000000 Binary files a/res/drawable-xhdpi/ic_advanced_black_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_brightness_6_black_24dp.png b/res/drawable-xhdpi/ic_brightness_6_black_24dp.png deleted file mode 100644 index b9f860428b..0000000000 Binary files a/res/drawable-xhdpi/ic_brightness_6_black_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_forum_black_24dp.png b/res/drawable-xhdpi/ic_forum_black_24dp.png deleted file mode 100644 index 91ef28df28..0000000000 Binary files a/res/drawable-xhdpi/ic_forum_black_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_laptop_black_24dp.png b/res/drawable-xhdpi/ic_laptop_black_24dp.png deleted file mode 100644 index 499b07c444..0000000000 Binary files a/res/drawable-xhdpi/ic_laptop_black_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_notifications_black_24dp.png b/res/drawable-xhdpi/ic_notifications_black_24dp.png deleted file mode 100644 index fbe581dad0..0000000000 Binary files a/res/drawable-xhdpi/ic_notifications_black_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_security_black_24dp.png b/res/drawable-xhdpi/ic_security_black_24dp.png deleted file mode 100644 index b32465602e..0000000000 Binary files a/res/drawable-xhdpi/ic_security_black_24dp.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_textsms_black_24dp.png b/res/drawable-xhdpi/ic_textsms_black_24dp.png deleted file mode 100644 index 37c51f95cd..0000000000 Binary files a/res/drawable-xhdpi/ic_textsms_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_advanced_black_24dp.png b/res/drawable-xxhdpi/ic_advanced_black_24dp.png deleted file mode 100644 index d9de0aa280..0000000000 Binary files a/res/drawable-xxhdpi/ic_advanced_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_brightness_6_black_24dp.png b/res/drawable-xxhdpi/ic_brightness_6_black_24dp.png deleted file mode 100644 index 7664ef8818..0000000000 Binary files a/res/drawable-xxhdpi/ic_brightness_6_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_forum_black_24dp.png b/res/drawable-xxhdpi/ic_forum_black_24dp.png deleted file mode 100644 index 69146b20af..0000000000 Binary files a/res/drawable-xxhdpi/ic_forum_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_laptop_black_24dp.png b/res/drawable-xxhdpi/ic_laptop_black_24dp.png deleted file mode 100644 index 01e1870439..0000000000 Binary files a/res/drawable-xxhdpi/ic_laptop_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_notifications_black_24dp.png b/res/drawable-xxhdpi/ic_notifications_black_24dp.png deleted file mode 100644 index 008f7bc1c5..0000000000 Binary files a/res/drawable-xxhdpi/ic_notifications_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_security_black_24dp.png b/res/drawable-xxhdpi/ic_security_black_24dp.png deleted file mode 100644 index e51bdb32f3..0000000000 Binary files a/res/drawable-xxhdpi/ic_security_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_textsms_black_24dp.png b/res/drawable-xxhdpi/ic_textsms_black_24dp.png deleted file mode 100644 index cbe60ee5a9..0000000000 Binary files a/res/drawable-xxhdpi/ic_textsms_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_advanced_black_24dp.png b/res/drawable-xxxhdpi/ic_advanced_black_24dp.png deleted file mode 100644 index f10eb6d20a..0000000000 Binary files a/res/drawable-xxxhdpi/ic_advanced_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_brightness_6_black_24dp.png b/res/drawable-xxxhdpi/ic_brightness_6_black_24dp.png deleted file mode 100644 index b6148f9181..0000000000 Binary files a/res/drawable-xxxhdpi/ic_brightness_6_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_forum_black_24dp.png b/res/drawable-xxxhdpi/ic_forum_black_24dp.png deleted file mode 100644 index cf8dbb36ee..0000000000 Binary files a/res/drawable-xxxhdpi/ic_forum_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_laptop_black_24dp.png b/res/drawable-xxxhdpi/ic_laptop_black_24dp.png deleted file mode 100644 index 0c4b003176..0000000000 Binary files a/res/drawable-xxxhdpi/ic_laptop_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_notifications_black_24dp.png b/res/drawable-xxxhdpi/ic_notifications_black_24dp.png deleted file mode 100644 index f548f0e919..0000000000 Binary files a/res/drawable-xxxhdpi/ic_notifications_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_security_black_24dp.png b/res/drawable-xxxhdpi/ic_security_black_24dp.png deleted file mode 100644 index cd50cfd7cf..0000000000 Binary files a/res/drawable-xxxhdpi/ic_security_black_24dp.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_textsms_black_24dp.png b/res/drawable-xxxhdpi/ic_textsms_black_24dp.png deleted file mode 100644 index cdf94b91be..0000000000 Binary files a/res/drawable-xxxhdpi/ic_textsms_black_24dp.png and /dev/null differ diff --git a/res/drawable/ic_advanced_24dp.xml b/res/drawable/ic_advanced_24dp.xml new file mode 100644 index 0000000000..4fb9e1ab03 --- /dev/null +++ b/res/drawable/ic_advanced_24dp.xml @@ -0,0 +1,4 @@ + + diff --git a/res/drawable/ic_brightness_6_24dp.xml b/res/drawable/ic_brightness_6_24dp.xml new file mode 100644 index 0000000000..548ad986f4 --- /dev/null +++ b/res/drawable/ic_brightness_6_24dp.xml @@ -0,0 +1,4 @@ + + diff --git a/res/drawable/ic_forum_24dp.xml b/res/drawable/ic_forum_24dp.xml new file mode 100644 index 0000000000..e48c05fd42 --- /dev/null +++ b/res/drawable/ic_forum_24dp.xml @@ -0,0 +1,4 @@ + + diff --git a/res/drawable/ic_laptop_24dp.xml b/res/drawable/ic_laptop_24dp.xml new file mode 100644 index 0000000000..bad7920f97 --- /dev/null +++ b/res/drawable/ic_laptop_24dp.xml @@ -0,0 +1,4 @@ + + diff --git a/res/drawable/ic_notifications_24dp.xml b/res/drawable/ic_notifications_24dp.xml new file mode 100644 index 0000000000..56cd14d7a2 --- /dev/null +++ b/res/drawable/ic_notifications_24dp.xml @@ -0,0 +1,4 @@ + + diff --git a/res/drawable/ic_security_24dp.xml b/res/drawable/ic_security_24dp.xml new file mode 100644 index 0000000000..93bd6f8139 --- /dev/null +++ b/res/drawable/ic_security_24dp.xml @@ -0,0 +1,4 @@ + + diff --git a/res/drawable/ic_textsms_24dp.xml b/res/drawable/ic_textsms_24dp.xml new file mode 100644 index 0000000000..65acf67952 --- /dev/null +++ b/res/drawable/ic_textsms_24dp.xml @@ -0,0 +1,4 @@ + + diff --git a/res/values/attrs.xml b/res/values/attrs.xml index 9a268ab854..17b0ad3010 100644 --- a/res/values/attrs.xml +++ b/res/values/attrs.xml @@ -116,14 +116,7 @@ - - - - - - - - + diff --git a/res/values/themes.xml b/res/values/themes.xml index 718485e2f4..c380d57d01 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -208,13 +208,7 @@ #ff1d85d7 - @drawable/ic_textsms_black_24dp - @drawable/ic_notifications_black_24dp - @drawable/ic_security_black_24dp - @drawable/ic_brightness_6_black_24dp - @drawable/ic_forum_black_24dp - @drawable/ic_laptop_black_24dp - @drawable/ic_advanced_black_24dp + @color/textsecure_primary_dark @drawable/preference_divider_light @@ -340,13 +334,7 @@ @color/textsecure_primary_dark - @drawable/ic_textsms_white_24dp - @drawable/ic_notifications_white_24dp - @drawable/ic_security_white_24dp - @drawable/ic_brightness_6_white_24dp - @drawable/ic_forum_white_24dp - @drawable/ic_laptop_white_24dp - @drawable/ic_advanced_white_24dp + #FFFFFF @drawable/preference_divider_dark diff --git a/res/xml/preferences.xml b/res/xml/preferences.xml index ebb5936e23..373b8392ed 100644 --- a/res/xml/preferences.xml +++ b/res/xml/preferences.xml @@ -3,30 +3,30 @@ + android:icon="@drawable/ic_textsms_24dp"/> + android:icon="@drawable/ic_notifications_24dp"/> + android:icon="@drawable/ic_security_24dp"/> + android:icon="@drawable/ic_brightness_6_24dp"/> + android:icon="@drawable/ic_forum_24dp"/> + android:icon="@drawable/ic_laptop_24dp"/> + android:icon="@drawable/ic_advanced_24dp"/> diff --git a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java index a44edbf62e..011a4ba09e 100644 --- a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java +++ b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java @@ -16,17 +16,24 @@ */ package org.thoughtcrime.securesms; +import android.annotation.TargetApi; +import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.content.res.TypedArray; +import android.graphics.drawable.Drawable; +import android.os.Build; import android.os.Build.VERSION; import android.os.Bundle; import android.preference.Preference; +import android.support.annotation.ColorInt; +import android.support.annotation.DrawableRes; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; -import android.support.v4.preference.PreferenceFragment; -import android.view.View; +import android.support.v4.content.ContextCompat; +import android.support.v4.graphics.drawable.DrawableCompat; import org.thoughtcrime.securesms.crypto.MasterSecret; import org.thoughtcrime.securesms.preferences.AdvancedPreferenceFragment; @@ -145,6 +152,10 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA .setOnPreferenceClickListener(new CategoryClickListener(masterSecret, PREFERENCE_CATEGORY_DEVICES)); this.findPreference(PREFERENCE_CATEGORY_ADVANCED) .setOnPreferenceClickListener(new CategoryClickListener(masterSecret, PREFERENCE_CATEGORY_ADVANCED)); + + if (VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP && VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { + tintIcons(getActivity()); + } } @Override @@ -175,6 +186,35 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA } } + @TargetApi(11) + private void tintIcons(Context context) { + Drawable sms = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_textsms_white_24dp)); + Drawable notifications = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_notifications_white_24dp)); + Drawable privacy = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_security_white_24dp)); + Drawable appearance = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_brightness_6_white_24dp)); + Drawable chats = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_forum_white_24dp)); + Drawable advanced = DrawableCompat.wrap(ContextCompat.getDrawable(context, R.drawable.ic_advanced_white_24dp)); + + int[] tintAttr = new int[]{R.attr.pref_icon_tint}; + TypedArray typedArray = context.obtainStyledAttributes(tintAttr); + int color = typedArray.getColor(0, 0x0); + typedArray.recycle(); + + DrawableCompat.setTint(sms, color); + DrawableCompat.setTint(notifications, color); + DrawableCompat.setTint(privacy, color); + DrawableCompat.setTint(appearance, color); + DrawableCompat.setTint(chats, color); + DrawableCompat.setTint(advanced, color); + + this.findPreference(PREFERENCE_CATEGORY_SMS_MMS).setIcon(sms); + this.findPreference(PREFERENCE_CATEGORY_NOTIFICATIONS).setIcon(notifications); + this.findPreference(PREFERENCE_CATEGORY_APP_PROTECTION).setIcon(privacy); + this.findPreference(PREFERENCE_CATEGORY_APPEARANCE).setIcon(appearance); + this.findPreference(PREFERENCE_CATEGORY_CHATS).setIcon(chats); + this.findPreference(PREFERENCE_CATEGORY_ADVANCED).setIcon(appearance); + } + private class CategoryClickListener implements Preference.OnPreferenceClickListener { private MasterSecret masterSecret; private String category;