From e649122fbe6ea6485b1fb91256ad293b173e7b2e Mon Sep 17 00:00:00 2001 From: Twig N Date: Sat, 8 Feb 2020 15:21:40 +1100 Subject: [PATCH] (WIP) - fixed drawables --- .../core/widget/ListWidgetPreviewAdapter.java | 4 +- .../core/widget/ListWidgetProvider.java | 3 +- .../core/widget/ListWidgetViewsService.java | 4 +- .../details_list_background.xml} | 4 +- .../loading_progress.xml} | 0 ..._light.xml => details_list_background.xml} | 4 +- ...rogress_light.xml => loading_progress.xml} | 0 .../main/res/layout/activity_widgetconfig.xml | 4 +- ...m_widget_dark.xml => list_item_widget.xml} | 4 +- .../res/layout/list_item_widget_light.xml | 70 ------ ...torrents_light.xml => widget_torrents.xml} | 15 +- .../main/res/layout/widget_torrents_dark.xml | 222 ------------------ app/src/main/res/xml/listwidget_info.xml | 4 +- 13 files changed, 18 insertions(+), 320 deletions(-) rename app/src/main/res/{drawable/details_list_background_dark.xml => drawable-night/details_list_background.xml} (84%) rename app/src/main/res/{drawable/loading_progress_dark.xml => drawable-night/loading_progress.xml} (100%) rename app/src/main/res/drawable/{details_list_background_light.xml => details_list_background.xml} (84%) rename app/src/main/res/drawable/{loading_progress_light.xml => loading_progress.xml} (100%) rename app/src/main/res/layout/{list_item_widget_dark.xml => list_item_widget.xml} (94%) delete mode 100644 app/src/main/res/layout/list_item_widget_light.xml rename app/src/main/res/layout/{widget_torrents_light.xml => widget_torrents.xml} (93%) delete mode 100644 app/src/main/res/layout/widget_torrents_dark.xml diff --git a/app/src/main/java/org/transdroid/core/widget/ListWidgetPreviewAdapter.java b/app/src/main/java/org/transdroid/core/widget/ListWidgetPreviewAdapter.java index 6a4f98bd..5c941b0c 100644 --- a/app/src/main/java/org/transdroid/core/widget/ListWidgetPreviewAdapter.java +++ b/app/src/main/java/org/transdroid/core/widget/ListWidgetPreviewAdapter.java @@ -42,7 +42,7 @@ public class ListWidgetPreviewAdapter extends ArrayAdapter { * @param torrents The already-retrieved, non-null list of torrents to show */ public ListWidgetPreviewAdapter(Context context, int foo, List torrents) { - super(context, R.layout.list_item_widget_light, torrents); + super(context, R.layout.list_item_widget, torrents); } @Override @@ -51,7 +51,7 @@ public class ListWidgetPreviewAdapter extends ArrayAdapter { // Get the views ViewHolder holder; if (convertView == null) { - convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_widget_light, parent, false); + convertView = LayoutInflater.from(getContext()).inflate(R.layout.list_item_widget, parent, false); holder = new ViewHolder(); holder.nameText = (TextView) convertView.findViewById(R.id.name_text); holder.progressText = (TextView) convertView.findViewById(R.id.progress_text); diff --git a/app/src/main/java/org/transdroid/core/widget/ListWidgetProvider.java b/app/src/main/java/org/transdroid/core/widget/ListWidgetProvider.java index e660e056..2ef2b471 100644 --- a/app/src/main/java/org/transdroid/core/widget/ListWidgetProvider.java +++ b/app/src/main/java/org/transdroid/core/widget/ListWidgetProvider.java @@ -79,8 +79,7 @@ public class ListWidgetProvider extends AppWidgetProvider { } // Load the dark or light widget layout xml - RemoteViews rv = new RemoteViews(context.getPackageName(), - config.shouldUseDarkTheme() ? R.layout.widget_torrents_dark : R.layout.widget_torrents_light); + RemoteViews rv = new RemoteViews(context.getPackageName(), R.layout.widget_torrents); // Set up the widget's list view loading service which refers to the WidgetViewsFactory Intent data = new Intent(context, ListWidgetViewsService_.class); 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 97b0c0f9..78617019 100644 --- a/app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java +++ b/app/src/main/java/org/transdroid/core/widget/ListWidgetViewsService.java @@ -30,7 +30,6 @@ import org.transdroid.R; import org.transdroid.core.app.settings.*; import org.transdroid.core.gui.lists.LocalTorrent; import org.transdroid.core.gui.log.*; -import org.transdroid.core.service.*; import org.transdroid.daemon.Daemon; import org.transdroid.daemon.IDaemonAdapter; import org.transdroid.daemon.Torrent; @@ -166,8 +165,7 @@ 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(), - config.shouldUseDarkTheme() ? R.layout.list_item_widget_dark : R.layout.list_item_widget_light); + RemoteViews rv = new RemoteViews(context.getPackageName(), 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/drawable/details_list_background_dark.xml b/app/src/main/res/drawable-night/details_list_background.xml similarity index 84% rename from app/src/main/res/drawable/details_list_background_dark.xml rename to app/src/main/res/drawable-night/details_list_background.xml index bbf1fe2f..c4b2c037 100644 --- a/app/src/main/res/drawable/details_list_background_dark.xml +++ b/app/src/main/res/drawable-night/details_list_background.xml @@ -16,6 +16,6 @@ along with Transdroid. If not, see . --> - - + + diff --git a/app/src/main/res/drawable/loading_progress_dark.xml b/app/src/main/res/drawable-night/loading_progress.xml similarity index 100% rename from app/src/main/res/drawable/loading_progress_dark.xml rename to app/src/main/res/drawable-night/loading_progress.xml diff --git a/app/src/main/res/drawable/details_list_background_light.xml b/app/src/main/res/drawable/details_list_background.xml similarity index 84% rename from app/src/main/res/drawable/details_list_background_light.xml rename to app/src/main/res/drawable/details_list_background.xml index a925c811..c4b2c037 100644 --- a/app/src/main/res/drawable/details_list_background_light.xml +++ b/app/src/main/res/drawable/details_list_background.xml @@ -16,6 +16,6 @@ along with Transdroid. If not, see . --> - - + + diff --git a/app/src/main/res/drawable/loading_progress_light.xml b/app/src/main/res/drawable/loading_progress.xml similarity index 100% rename from app/src/main/res/drawable/loading_progress_light.xml rename to app/src/main/res/drawable/loading_progress.xml diff --git a/app/src/main/res/layout/activity_widgetconfig.xml b/app/src/main/res/layout/activity_widgetconfig.xml index e39276ae..05c9cda7 100644 --- a/app/src/main/res/layout/activity_widgetconfig.xml +++ b/app/src/main/res/layout/activity_widgetconfig.xml @@ -28,13 +28,13 @@ android:background="@null" android:padding="@dimen/widget_preview_padding" > - + diff --git a/app/src/main/res/layout/list_item_widget_dark.xml b/app/src/main/res/layout/list_item_widget.xml similarity index 94% rename from app/src/main/res/layout/list_item_widget_dark.xml rename to app/src/main/res/layout/list_item_widget.xml index 5671da12..fdc2f34e 100644 --- a/app/src/main/res/layout/list_item_widget_dark.xml +++ b/app/src/main/res/layout/list_item_widget.xml @@ -36,7 +36,7 @@ android:fontFamily="sans-serif-condensed" android:maxLines="1" android:paddingTop="@dimen/widget_list_item_padding" - android:textColor="@color/text_bright_dark" + android:textColor="@color/transdroid_text_bright" android:textIsSelectable="false" android:textSize="@dimen/text_enlarged" /> @@ -49,6 +49,7 @@ android:layout_marginLeft="@dimen/widget_list_item_padding" android:layout_marginTop="4dip" android:maxLines="1" + android:textColor="@color/transdroid_text_bright" android:paddingBottom="@dimen/widget_list_item_padding" android:textIsSelectable="false" android:textSize="@dimen/text_small" /> @@ -62,6 +63,7 @@ android:layout_marginLeft="@dimen/widget_list_item_padding_left" android:layout_toLeftOf="@id/ratio_text" android:maxLines="1" + android:textColor="@color/transdroid_text_bright" android:textIsSelectable="false" android:textSize="@dimen/text_small" /> diff --git a/app/src/main/res/layout/list_item_widget_light.xml b/app/src/main/res/layout/list_item_widget_light.xml deleted file mode 100644 index 9a81fda7..00000000 --- a/app/src/main/res/layout/list_item_widget_light.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/widget_torrents_light.xml b/app/src/main/res/layout/widget_torrents.xml similarity index 93% rename from app/src/main/res/layout/widget_torrents_light.xml rename to app/src/main/res/layout/widget_torrents.xml index 68b2db32..7868fea3 100644 --- a/app/src/main/res/layout/widget_torrents_light.xml +++ b/app/src/main/res/layout/widget_torrents.xml @@ -19,7 +19,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/background_light"> + android:background="@color/transdroid_background"> @@ -69,8 +68,7 @@ android:layout_marginTop="-4dip" android:ellipsize="marquee" android:fontFamily="sans-serif-light" - android:maxLines="1" - android:textColor="@color/text_actionbar_dark" + android:singleLine="true" android:textIsSelectable="false" android:textSize="@dimen/ui_navigation_server" tools:text="Server"/> @@ -94,7 +92,6 @@ android:fontFamily="sans-serif-light" android:paddingTop="@dimen/ui_serverstatus_signmargin" android:text="↑" - android:textColor="@color/text_bright_dark" android:textSize="@dimen/ui_serverstatus_sign" tools:ignore="HardcodedText" /> @@ -105,7 +102,6 @@ android:layout_toLeftOf="@id/upcount_sign" android:fontFamily="sans-serif-light" android:gravity="end" - android:textColor="@color/text_bright_dark" android:textSize="@dimen/ui_serverstatus_bignumber" /> @@ -127,7 +122,6 @@ android:layout_toLeftOf="@id/downcount_sign" android:fontFamily="sans-serif-light" android:gravity="end" - android:textColor="@color/text_bright_dark" android:textSize="@dimen/ui_serverstatus_bignumber" /> @@ -209,7 +201,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@id/bottomline_view" - android:layout_below="@id/topline_view" android:layout_gravity="center" android:gravity="center" android:maxWidth="400dip" diff --git a/app/src/main/res/layout/widget_torrents_dark.xml b/app/src/main/res/layout/widget_torrents_dark.xml deleted file mode 100644 index f00ca72f..00000000 --- a/app/src/main/res/layout/widget_torrents_dark.xml +++ /dev/null @@ -1,222 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/xml/listwidget_info.xml b/app/src/main/res/xml/listwidget_info.xml index a6a6e086..ee685400 100644 --- a/app/src/main/res/xml/listwidget_info.xml +++ b/app/src/main/res/xml/listwidget_info.xml @@ -17,8 +17,8 @@ -->