From c0a70e35f0d2d0199853b27c875b2a0c00b45db9 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Sun, 14 Jun 2015 02:45:34 -0700 Subject: [PATCH] Fixed widgets not using the theme of the app The problem was that I was passing the base context instead of the view's --- src/org/kde/kdeconnect/UserInterface/SettingsActivity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java b/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java index e28ad8bc..5f9b12b2 100644 --- a/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java +++ b/src/org/kde/kdeconnect/UserInterface/SettingsActivity.java @@ -62,9 +62,10 @@ public class SettingsActivity extends AppCompatPreferenceActivity { final ArrayList preferences = new ArrayList(); for (final String pluginKey : plugins) { - final CheckBoxPreference pref = new CheckBoxPreference(getBaseContext()); PluginFactory.PluginInfo info = PluginFactory.getPluginInfo(getBaseContext(), pluginKey); + + CheckBoxPreference pref = new CheckBoxPreference(preferenceScreen.getContext()); pref.setKey(pluginKey); pref.setTitle(info.getDisplayName()); pref.setSummary(info.getDescription()); @@ -73,7 +74,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity { preferenceScreen.addPreference(pref); if (info.hasSettings()) { - final Preference pluginPreference = new Preference(getBaseContext()); + Preference pluginPreference = new Preference(preferenceScreen.getContext()); pluginPreference.setKey(pluginKey.toLowerCase(Locale.ENGLISH) + "_preferences"); pluginPreference.setSummary(getString(R.string.plugin_settings_with_name, info.getDisplayName())); preferences.add(pluginPreference);