From 90e59c54201c3087af1de1ced0e5ff67302f372c Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Wed, 8 Jul 2020 14:41:23 +0200 Subject: [PATCH] Reinstate dark widget; fixes #555 --- .../core/widget/ListWidgetViewsService.java | 4 +- .../main/res/layout/activity_widgetconfig.xml | 2 +- .../main/res/layout/list_item_widget_dark.xml | 71 +++++++++++++++++++ .../res/values-night/colors_transdroid.xml | 2 +- app/src/main/res/values-sw600dp/dimens.xml | 3 +- app/src/main/res/values/colors_transdroid.xml | 5 ++ app/src/main/res/values/dimens.xml | 2 +- app/src/main/res/values/strings.xml | 2 + app/src/main/res/values/styles.xml | 3 - app/src/main/res/values/styles_transdroid.xml | 1 + 10 files changed, 86 insertions(+), 9 deletions(-) create mode 100644 app/src/main/res/layout/list_item_widget_dark.xml diff --git a/app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java b/app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java index 8ba33e9e..2e4c4160 100644 --- a/app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java +++ b/app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java @@ -166,7 +166,9 @@ class WidgetViewsFactory implements RemoteViewsService.RemoteViewsFactory { public RemoteViews getViewAt(int position) { // Load the dark or light widget list item layout xml - RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.list_item_widget); + RemoteViews rv = new RemoteViews(context.getPackageName(), + config.shouldUseDarkTheme() ? R.layout.list_item_widget_dark : R.layout.list_item_widget); + // Bind the torrent details texts and status colour Torrent torrent = torrents.get(position); diff --git a/app/src/main/res/layout/activity_widgetconfig.xml b/app/src/main/res/layout/activity_widgetconfig.xml index 05c9cda7..af18ad13 100644 --- a/app/src/main/res/layout/activity_widgetconfig.xml +++ b/app/src/main/res/layout/activity_widgetconfig.xml @@ -99,7 +99,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/margin_half" android:text="@string/widget_showstatusview" /> - + + + + + + + + + + + + + diff --git a/app/src/main/res/values-night/colors_transdroid.xml b/app/src/main/res/values-night/colors_transdroid.xml index 5b16d3c3..2631796e 100644 --- a/app/src/main/res/values-night/colors_transdroid.xml +++ b/app/src/main/res/values-night/colors_transdroid.xml @@ -20,6 +20,6 @@ #CCaada62 #303030 - #2e2e2e + #000 #fff diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index 11073a4e..79d1f12e 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -39,6 +39,5 @@ 0 30dp -1dp - 300dp - + diff --git a/app/src/main/res/values/colors_transdroid.xml b/app/src/main/res/values/colors_transdroid.xml index db251889..117291fa 100644 --- a/app/src/main/res/values/colors_transdroid.xml +++ b/app/src/main/res/values/colors_transdroid.xml @@ -23,4 +23,9 @@ #fff #000 #fff + + #CCaada62 + #303030 + #000 + #fff diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 9b9eb5bb..fd1676d8 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -49,7 +49,7 @@ 1 20dp 200dp - -1dp + 320dp 46dp 8dp 54dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 63a967a4..136e93cf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -357,11 +357,13 @@ Search history is cleared Import settings %1$s will try to import server, web search, RSS and system settings from: %2$s + %1$s will try to import server, web search, RSS and system settings Use file Use QR code Settings successfully imported Export settings %1$s will export server (including passwords), web search, RSS and system settings to the following plain text JSON file: %2$s + %1$s will export server (including passwords), web search, RSS and system settings To file To QR code Settings successfully exported diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ade74baf..7a450d3b 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -19,9 +19,6 @@ - -