From 2d499533b70072a914542b84e9cc8bdb8aca78d8 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Wed, 3 Jun 2015 10:53:03 -0400 Subject: Fix some dark theme issues (Take 2) Now with visible lock patterns! Both light and dark! Bug: 21117509 Bug: 21077345 Bug: 21480587 Bug: 21621900 Change-Id: Ibcf822faf7cbc83be43d757e0a6a9432ef3346af --- res/drawable-hdpi/ic_menu_delete.png | Bin 244 -> 0 bytes res/drawable-mdpi/ic_menu_delete.png | Bin 162 -> 0 bytes res/drawable-xhdpi/ic_menu_delete.png | Bin 208 -> 0 bytes res/drawable-xxhdpi/ic_menu_delete.png | Bin 294 -> 0 bytes res/drawable-xxxhdpi/ic_menu_delete.png | Bin 319 -> 0 bytes res/drawable/ic_menu_add.xml | 20 +++++++++++++++++ res/drawable/ic_menu_delete.xml | 25 +++++++++++++++++++++ res/layout/data_usage_chart.xml | 8 +++---- res/values-night/colors.xml | 4 +++- res/values/colors.xml | 8 +++---- res/values/themes.xml | 2 +- src/com/android/settings/AccountPreference.java | 6 ++--- .../android/settings/accounts/AccountSettings.java | 2 +- .../FingerprintLocationAnimationView.java | 5 ++++- .../android/settings/widget/ChartSweepView.java | 9 +++++--- 15 files changed, 69 insertions(+), 20 deletions(-) delete mode 100644 res/drawable-hdpi/ic_menu_delete.png delete mode 100644 res/drawable-mdpi/ic_menu_delete.png delete mode 100644 res/drawable-xhdpi/ic_menu_delete.png delete mode 100644 res/drawable-xxhdpi/ic_menu_delete.png delete mode 100644 res/drawable-xxxhdpi/ic_menu_delete.png create mode 100644 res/drawable/ic_menu_add.xml create mode 100644 res/drawable/ic_menu_delete.xml diff --git a/res/drawable-hdpi/ic_menu_delete.png b/res/drawable-hdpi/ic_menu_delete.png deleted file mode 100644 index e25b44f..0000000 Binary files a/res/drawable-hdpi/ic_menu_delete.png and /dev/null differ diff --git a/res/drawable-mdpi/ic_menu_delete.png b/res/drawable-mdpi/ic_menu_delete.png deleted file mode 100644 index b0517ad..0000000 Binary files a/res/drawable-mdpi/ic_menu_delete.png and /dev/null differ diff --git a/res/drawable-xhdpi/ic_menu_delete.png b/res/drawable-xhdpi/ic_menu_delete.png deleted file mode 100644 index 33010c6..0000000 Binary files a/res/drawable-xhdpi/ic_menu_delete.png and /dev/null differ diff --git a/res/drawable-xxhdpi/ic_menu_delete.png b/res/drawable-xxhdpi/ic_menu_delete.png deleted file mode 100644 index 6171b5a..0000000 Binary files a/res/drawable-xxhdpi/ic_menu_delete.png and /dev/null differ diff --git a/res/drawable-xxxhdpi/ic_menu_delete.png b/res/drawable-xxxhdpi/ic_menu_delete.png deleted file mode 100644 index e380101..0000000 Binary files a/res/drawable-xxxhdpi/ic_menu_delete.png and /dev/null differ diff --git a/res/drawable/ic_menu_add.xml b/res/drawable/ic_menu_add.xml new file mode 100644 index 0000000..ed58072 --- /dev/null +++ b/res/drawable/ic_menu_add.xml @@ -0,0 +1,20 @@ + + + + diff --git a/res/drawable/ic_menu_delete.xml b/res/drawable/ic_menu_delete.xml new file mode 100644 index 0000000..74f63c3 --- /dev/null +++ b/res/drawable/ic_menu_delete.xml @@ -0,0 +1,25 @@ + + + + diff --git a/res/layout/data_usage_chart.xml b/res/layout/data_usage_chart.xml index 2f9d962..648c7f8 100644 --- a/res/layout/data_usage_chart.xml +++ b/res/layout/data_usage_chart.xml @@ -43,7 +43,7 @@ android:layout_height="match_parent" android:layout_gravity="start|bottom" settings:strokeColor="#00000000" - settings:fillColor="#ff009688" + settings:fillColor="?android:attr/colorAccent" settings:fillColorSecondary="#ff80cbc4" settings:safeRegion="3dp" /> @@ -53,8 +53,8 @@ android:layout_height="match_parent" android:layout_gravity="start|bottom" settings:strokeColor="#00000000" - settings:fillColor="#ff009688" - settings:fillColorSecondary="#ff009688" + settings:fillColor="?android:attr/colorAccent" + settings:fillColorSecondary="?android:attr/colorAccent" settings:safeRegion="3dp" /> #ff424242 - \ No newline at end of file + @*android:color/secondary_text_default_material_dark + + diff --git a/res/values/colors.xml b/res/values/colors.xml index 3bcf1ae..227eb78 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -59,12 +59,11 @@ @android:color/white #fff4511e - #ff009688 + ?android:attr/colorAccent #ffffffff #de000000 - #ff009688 + ?android:attr/colorAccent #20000000 - #ff009688 #ff384248 #ff009587 @@ -76,13 +75,12 @@ #ff7fcac3 #ffe0e0e0 - #ff009688 @*android:color/material_deep_teal_500 #ff5621 #263238 #1fffffff - #ff009688 + ?android:attr/colorAccent #33b5e5 #009688 diff --git a/res/values/themes.xml b/res/values/themes.xml index 76fc04f..c2285e2 100644 --- a/res/values/themes.xml +++ b/res/values/themes.xml @@ -93,7 +93,7 @@ @*android:drawable/ic_menu_moreoverflow_holo_dark @drawable/ic_wps_light @drawable/wifi_signal - @color/wifi_signal_icon_color + ?android:attr/colorAccent @dimen/settings_side_margin diff --git a/src/com/android/settings/AccountPreference.java b/src/com/android/settings/AccountPreference.java index 7547721..64685c0 100644 --- a/src/com/android/settings/AccountPreference.java +++ b/src/com/android/settings/AccountPreference.java @@ -114,7 +114,8 @@ public class AccountPreference extends Preference { int res; switch (status) { case SYNC_ENABLED: - res = R.drawable.ic_sync_green_holo; + case SYNC_IN_PROGRESS: + res = R.drawable.ic_settings_sync; break; case SYNC_DISABLED: res = R.drawable.ic_sync_grey_holo; @@ -122,9 +123,6 @@ public class AccountPreference extends Preference { case SYNC_ERROR: res = R.drawable.ic_sync_red_holo; break; - case SYNC_IN_PROGRESS: - res = R.drawable.ic_sync_green_holo; - break; default: res = R.drawable.ic_sync_red_holo; Log.e(TAG, "Unknown sync status: " + status); diff --git a/src/com/android/settings/accounts/AccountSettings.java b/src/com/android/settings/accounts/AccountSettings.java index ffada53..c010a7b 100644 --- a/src/com/android/settings/accounts/AccountSettings.java +++ b/src/com/android/settings/accounts/AccountSettings.java @@ -296,7 +296,7 @@ public class AccountSettings extends SettingsPreferenceFragment private Preference newAddAccountPreference(Context context) { Preference preference = new Preference(context); preference.setTitle(R.string.add_account_label); - preference.setIcon(R.drawable.ic_menu_add_dark); + preference.setIcon(R.drawable.ic_menu_add); preference.setOnPreferenceClickListener(this); preference.setOrder(ORDER_NEXT_TO_LAST); return preference; diff --git a/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java b/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java index b52fed3..65f38bd 100644 --- a/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java +++ b/src/com/android/settings/fingerprint/FingerprintLocationAnimationView.java @@ -24,6 +24,7 @@ import android.content.Context; import android.graphics.Canvas; import android.graphics.Paint; import android.util.AttributeSet; +import android.util.TypedValue; import android.view.View; import android.view.animation.AnimationUtils; import android.view.animation.Interpolator; @@ -59,7 +60,9 @@ public class FingerprintLocationAnimationView extends View { R.fraction.fingerprint_sensor_location_fraction_x, 1, 1); mFractionCenterY = getResources().getFraction( R.fraction.fingerprint_sensor_location_fraction_y, 1, 1); - int color = getResources().getColor(R.color.fingerprint_dot_color, null); + TypedValue typedValue = new TypedValue(); + context.getTheme().resolveAttribute(android.R.attr.colorAccent, typedValue, true); + int color = getResources().getColor(typedValue.resourceId, null); mDotPaint.setAntiAlias(true); mPulsePaint.setAntiAlias(true); mDotPaint.setColor(color); diff --git a/src/com/android/settings/widget/ChartSweepView.java b/src/com/android/settings/widget/ChartSweepView.java index 04fc862..e8e24aa 100644 --- a/src/com/android/settings/widget/ChartSweepView.java +++ b/src/com/android/settings/widget/ChartSweepView.java @@ -123,14 +123,15 @@ public class ChartSweepView extends View { final TypedArray a = context.obtainStyledAttributes( attrs, R.styleable.ChartSweepView, defStyle, 0); - setSweepDrawable(a.getDrawable(R.styleable.ChartSweepView_sweepDrawable)); + final int color = a.getColor(R.styleable.ChartSweepView_labelColor, Color.BLUE); + setSweepDrawable(a.getDrawable(R.styleable.ChartSweepView_sweepDrawable), color); setFollowAxis(a.getInt(R.styleable.ChartSweepView_followAxis, -1)); setNeighborMargin(a.getDimensionPixelSize(R.styleable.ChartSweepView_neighborMargin, 0)); setSafeRegion(a.getDimensionPixelSize(R.styleable.ChartSweepView_safeRegion, 0)); setLabelMinSize(a.getDimensionPixelSize(R.styleable.ChartSweepView_labelSize, 0)); setLabelTemplate(a.getResourceId(R.styleable.ChartSweepView_labelTemplate, 0)); - setLabelColor(a.getColor(R.styleable.ChartSweepView_labelColor, Color.BLUE)); + setLabelColor(color); // TODO: moved focused state directly into assets setBackgroundResource(R.drawable.data_usage_sweep_background); @@ -213,7 +214,7 @@ public class ChartSweepView extends View { requestLayout(); } - public void setSweepDrawable(Drawable sweep) { + public void setSweepDrawable(Drawable sweep, int color) { if (mSweep != null) { mSweep.setCallback(null); unscheduleDrawable(mSweep); @@ -226,6 +227,8 @@ public class ChartSweepView extends View { } sweep.setVisible(getVisibility() == VISIBLE, false); mSweep = sweep; + // Match the text. + mSweep.setTint(color); sweep.getPadding(mSweepPadding); } else { mSweep = null; -- cgit v1.1