From c7ee841a9cd4c40dd097ebbc8325e595e4553b75 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Fri, 26 Dec 2014 11:11:25 -0500 Subject: [PATCH] Fix the spinner drop-down button Requires re-theming the Fragment. I feel like there's got to be a better way, but I have no idea what it would be. --- .../activity/downloader/BookListFragment.java | 17 +++++++++++++++-- app/src/main/res/layout/fragment_download.xml | 3 +-- app/src/main/res/values/styles.xml | 16 +++++----------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/org/bspeice/minimalbible/activity/downloader/BookListFragment.java b/app/src/main/java/org/bspeice/minimalbible/activity/downloader/BookListFragment.java index 1fb615b..c9b919c 100644 --- a/app/src/main/java/org/bspeice/minimalbible/activity/downloader/BookListFragment.java +++ b/app/src/main/java/org/bspeice/minimalbible/activity/downloader/BookListFragment.java @@ -1,10 +1,12 @@ package org.bspeice.minimalbible.activity.downloader; import android.app.AlertDialog; +import android.content.Context; import android.content.DialogInterface; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.util.Log; +import android.view.ContextThemeWrapper; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -88,9 +90,20 @@ public class BookListFragment extends BaseFragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - this.inflater = inflater; - View rootView = inflater.inflate(R.layout.fragment_download, container, + /* + In order to get the spinner arrow button to have the right color, we need to modify + android:textColorSecondary of the parent theme. For whatever reason, applying this + modification in the XML doesn't work. However, I don't want to have a different theme for + the entire activity, so what the below accomplishes is the same as specifying + android:theme in the AndroidManifest for an activity. + So if you ever change the below code: PLEASE, make sure the language selector colors + are correct. + */ + Context ctx = new ContextThemeWrapper(getActivity(), R.style.MinimalBible_DownloadList); + this.inflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + View rootView = this.inflater.inflate(R.layout.fragment_download, container, false); + ButterKnife.inject(this, rootView); displayModules(); diff --git a/app/src/main/res/layout/fragment_download.xml b/app/src/main/res/layout/fragment_download.xml index 57ceb79..6ce7ebd 100644 --- a/app/src/main/res/layout/fragment_download.xml +++ b/app/src/main/res/layout/fragment_download.xml @@ -3,11 +3,10 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - tools:context="org.bspeice.minimalbible.DownloadActivity$PlaceholderFragment" > + tools:context="org.bspeice.minimalbible.DownloadActivity$PlaceholderFragment"> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index d1f31c6..35bef08 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -42,16 +42,10 @@ @color/settingsTextColorSecondary - -