From 6b27568ac477a8abf420a38f401c9da88b08853a Mon Sep 17 00:00:00 2001 From: Peter Serwylo Date: Fri, 8 Aug 2014 00:15:52 +0930 Subject: [PATCH] Correct theme applied to swappable apps list. Took a while to figure out, but the problem was that the support libraries ListFragment would only ever use getActivity() when creating widgets. What we really needed was the ability to use an alternative context, namely a ContextThemeWrapper. If this is passed to the constructor of a widget, it is themed appropriately. To make it work, we now create our own list view in onCreateView() (which is really a copy of the code from the android list_content.xml file anyway). There are also some workarounds for a bug in the support library with regards to using your own view. --- res/layout/swap_create.xml | 71 +++++++++++++++---- res/values/styles.xml | 4 +- .../fdroid/views/swap/SelectAppsFragment.java | 17 ++++- 3 files changed, 77 insertions(+), 15 deletions(-) diff --git a/res/layout/swap_create.xml b/res/layout/swap_create.xml index 3fa5bb414..1c30210a6 100644 --- a/res/layout/swap_create.xml +++ b/res/layout/swap_create.xml @@ -1,19 +1,66 @@ - \ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/res/values/styles.xml b/res/values/styles.xml index 153083ffc..a023b427c 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -40,10 +40,12 @@ + +