From 2e98b1396f3fd74e4978febd834764e973c86676 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Sat, 8 Apr 2017 15:49:00 +0200 Subject: [PATCH] Do not override the android:* text colors, define our own. This fixes a crash on API 19. Also define them in the attrs xml file and do some grouping in the colors xml. It might be we don't need them at all, but for the time being let's keep them around. --- .../freeyourgadget/gadgetbridge/GBApplication.java | 2 +- app/src/main/res/layout/device_itemv2.xml | 4 ++-- app/src/main/res/values/attrs.xml | 4 ++++ app/src/main/res/values/colors.xml | 3 +++ app/src/main/res/values/styles.xml | 14 ++++++++------ 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java index 82f05c90..34daca68 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java @@ -433,7 +433,7 @@ public class GBApplication extends Application { public static int getTextColor(Context context) { TypedValue typedValue = new TypedValue(); Resources.Theme theme = context.getTheme(); - theme.resolveAttribute(android.R.attr.textColorPrimary, typedValue, true); + theme.resolveAttribute(R.attr.textColorPrimary, typedValue, true); return typedValue.data; } diff --git a/app/src/main/res/layout/device_itemv2.xml b/app/src/main/res/layout/device_itemv2.xml index b8b1afe7..517cd044 100644 --- a/app/src/main/res/layout/device_itemv2.xml +++ b/app/src/main/res/layout/device_itemv2.xml @@ -48,7 +48,7 @@ android:background="?android:attr/selectableItemBackground" android:clickable="true" android:contentDescription="@string/controlcenter_delete_device" - android:tint="?android:textColorTertiary" + android:tint="?attr/textColorTertiary" card_view:srcCompat="@drawable/ic_remove_device" /> @@ -62,7 +62,7 @@ android:clickable="true" android:longClickable="true" android:background="?android:attr/selectableItemBackground" - tools:src="@drawable/ic_device_pebble" + android:src="@drawable/ic_device_pebble" android:layout_marginTop="8dp" /> + + + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 4c3a59cb..4b79886a 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -7,11 +7,14 @@ #f0f03000 #0091ea + #000000 #ffffff + #ff808080 #ffd0d0d0 #ff606060 + #1f000000 #ffab40 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 3c1ab6bd..c79aa948 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,11 +1,12 @@