use class name of fragment for saving preferences
This commit is contained in:
parent
87dd8712b4
commit
4aad8c1310
1 changed files with 4 additions and 4 deletions
|
@ -778,8 +778,8 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
|
|
||||||
for (int type = 1; type < PluginBase.LAST; type++) {
|
for (int type = 1; type < PluginBase.LAST; type++) {
|
||||||
for (PluginBase p : pluginList) {
|
for (PluginBase p : pluginList) {
|
||||||
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled";
|
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Enabled";
|
||||||
String settingVisible = "ConfigBuilder_" + type + "_" + p.getName() + "_Visible";
|
String settingVisible = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Visible";
|
||||||
editor.putBoolean(settingEnabled, p.isEnabled(type));
|
editor.putBoolean(settingEnabled, p.isEnabled(type));
|
||||||
editor.putBoolean(settingVisible, p.isVisibleInTabs(type));
|
editor.putBoolean(settingVisible, p.isVisibleInTabs(type));
|
||||||
}
|
}
|
||||||
|
@ -795,8 +795,8 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||||
for (int type = 1; type < PluginBase.LAST; type++) {
|
for (int type = 1; type < PluginBase.LAST; type++) {
|
||||||
for (PluginBase p : pluginList) {
|
for (PluginBase p : pluginList) {
|
||||||
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled";
|
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Enabled";
|
||||||
String settingVisible = "ConfigBuilder_" + type + "_" + p.getName() + "_Visible";
|
String settingVisible = "ConfigBuilder_" + type + "_" + p.getClass().getSimpleName() + "_Visible";
|
||||||
if (SP.contains(settingEnabled))
|
if (SP.contains(settingEnabled))
|
||||||
p.setFragmentEnabled(type, SP.getBoolean(settingEnabled, true));
|
p.setFragmentEnabled(type, SP.getBoolean(settingEnabled, true));
|
||||||
if (SP.contains(settingVisible))
|
if (SP.contains(settingVisible))
|
||||||
|
|
Loading…
Reference in a new issue