From 60699eddbb99fa859a196a837f608596ad64df5d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 1 Nov 2017 20:43:59 +0100 Subject: [PATCH] preferences update --- .../info/nightscout/androidaps/Config.java | 6 - .../nightscout/androidaps/MainActivity.java | 1 + .../info/nightscout/androidaps/MainApp.java | 18 +- .../androidaps/PreferencesActivity.java | 158 +++++++++--------- .../androidaps/interfaces/PluginBase.java | 1 + .../plugins/Actions/ActionsPlugin.java | 5 + .../Careportal/CareportalFragment.java | 9 - .../plugins/Careportal/CareportalPlugin.java | 14 ++ .../ConfigBuilder/ConfigBuilderFragment.java | 30 +++- .../ConfigBuilder/ConfigBuilderPlugin.java | 7 +- .../ObjectivesPlugin.java | 5 + .../ConstraintsSafety/SafetyPlugin.java | 5 + .../Insulin/InsulinFastactingPlugin.java | 5 + .../InsulinFastactingProlongedPlugin.java | 5 + .../Insulin/InsulinOrefFreePeakPlugin.java | 5 + .../Insulin/InsulinOrefRapidActingPlugin.java | 5 + .../InsulinOrefUltraRapidActingPlugin.java | 5 + .../IobCobCalculatorPlugin.java | 5 + .../androidaps/plugins/Loop/LoopPlugin.java | 5 + .../NSClientInternalPlugin.java | 5 + .../plugins/OpenAPSAMA/OpenAPSAMAPlugin.java | 5 + .../plugins/OpenAPSMA/OpenAPSMAPlugin.java | 5 + .../plugins/Overview/OverviewPlugin.java | 5 + .../PersistentNotificationPlugin.java | 5 + .../CircadianPercentageProfilePlugin.java | 5 + .../ProfileLocal/LocalProfilePlugin.java | 5 + .../plugins/ProfileNS/NSProfilePlugin.java | 5 + .../ProfileSimple/SimpleProfilePlugin.java | 5 + .../plugins/PumpDanaR/DanaRPlugin.java | 5 + .../PumpDanaRKorean/DanaRKoreanPlugin.java | 5 + .../plugins/PumpDanaRS/DanaRSPlugin.java | 5 + .../plugins/PumpDanaRv2/DanaRv2Plugin.java | 5 + .../androidaps/plugins/PumpMDI/MDIPlugin.java | 5 + .../PumpVirtual/VirtualPumpFragment.java | 2 +- .../PumpVirtual/VirtualPumpPlugin.java | 15 +- .../SensitivityAAPSPlugin.java | 5 + .../SensitivityOref0Plugin.java | 5 + .../SensitivityWeightedAveragePlugin.java | 5 + .../SmsCommunicatorPlugin.java | 5 + .../SourceGlimp/SourceGlimpPlugin.java | 5 + .../SourceMM640g/SourceMM640gPlugin.java | 5 + .../SourceNSClient/SourceNSClientPlugin.java | 5 + .../SourceXdrip/SourceXdripPlugin.java | 5 + .../plugins/Treatments/TreatmentsPlugin.java | 5 + .../plugins/Wear/ActionStringHandler.java | 10 +- .../androidaps/plugins/Wear/WearFragment.java | 15 +- .../androidaps/plugins/Wear/WearPlugin.java | 19 +++ .../XDripStatusline/StatuslinePlugin.java | 11 +- .../res/drawable-hdpi-v11/ic_settings.png | Bin 0 -> 526 bytes .../main/res/drawable-hdpi-v9/ic_settings.png | Bin 0 -> 580 bytes .../main/res/drawable-hdpi/ic_settings.png | Bin 0 -> 980 bytes .../res/drawable-mdpi-v11/ic_settings.png | Bin 0 -> 357 bytes .../main/res/drawable-mdpi-v9/ic_settings.png | Bin 0 -> 395 bytes .../main/res/drawable-mdpi/ic_settings.png | Bin 0 -> 669 bytes .../res/drawable-xhdpi-v11/ic_settings.png | Bin 0 -> 688 bytes .../res/drawable-xhdpi-v9/ic_settings.png | Bin 0 -> 756 bytes .../main/res/drawable-xhdpi/ic_settings.png | Bin 0 -> 1328 bytes .../res/drawable-xxhdpi-v11/ic_settings.png | Bin 0 -> 1075 bytes .../res/drawable-xxhdpi-v9/ic_settings.png | Bin 0 -> 1113 bytes .../main/res/drawable-xxhdpi/ic_settings.png | Bin 0 -> 862 bytes .../res/layout/configbuilder_simpleitem.xml | 11 ++ app/src/main/res/xml/pref_openapsama.xml | 12 ++ .../{pref_treatments.xml => pref_safety.xml} | 0 63 files changed, 373 insertions(+), 131 deletions(-) create mode 100644 app/src/main/res/drawable-hdpi-v11/ic_settings.png create mode 100644 app/src/main/res/drawable-hdpi-v9/ic_settings.png create mode 100644 app/src/main/res/drawable-hdpi/ic_settings.png create mode 100644 app/src/main/res/drawable-mdpi-v11/ic_settings.png create mode 100644 app/src/main/res/drawable-mdpi-v9/ic_settings.png create mode 100644 app/src/main/res/drawable-mdpi/ic_settings.png create mode 100644 app/src/main/res/drawable-xhdpi-v11/ic_settings.png create mode 100644 app/src/main/res/drawable-xhdpi-v9/ic_settings.png create mode 100644 app/src/main/res/drawable-xhdpi/ic_settings.png create mode 100644 app/src/main/res/drawable-xxhdpi-v11/ic_settings.png create mode 100644 app/src/main/res/drawable-xxhdpi-v9/ic_settings.png create mode 100644 app/src/main/res/drawable-xxhdpi/ic_settings.png rename app/src/main/res/xml/{pref_treatments.xml => pref_safety.xml} (100%) diff --git a/app/src/main/java/info/nightscout/androidaps/Config.java b/app/src/main/java/info/nightscout/androidaps/Config.java index abda0ca941..2cfc2d96ab 100644 --- a/app/src/main/java/info/nightscout/androidaps/Config.java +++ b/app/src/main/java/info/nightscout/androidaps/Config.java @@ -9,13 +9,9 @@ public class Config { // MAIN FUCTIONALITY public static final boolean APS = BuildConfig.APS; // PLUGINS - public static final boolean OPENAPSENABLED = APS; - public static final boolean LOOPENABLED = APS; - public static final boolean NSCLIENT = BuildConfig.NSCLIENTOLNY; public static final boolean DANAR = true && BuildConfig.PUMPDRIVERS; - public static final boolean DANARv2 = true && BuildConfig.PUMPDRIVERS; public static final boolean ACTION = !BuildConfig.NSCLIENTOLNY; public static final boolean VIRTUALPUMP = !BuildConfig.NSCLIENTOLNY; @@ -26,8 +22,6 @@ public class Config { public static final boolean SMSCOMMUNICATORENABLED = !BuildConfig.NSCLIENTOLNY; - public static final boolean ALLPREFERENCES = !BuildConfig.NSCLIENTOLNY; - public static final boolean detailedLog = true; public static final boolean logFunctionCalls = true; public static final boolean logIncommingData = true; diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.java b/app/src/main/java/info/nightscout/androidaps/MainActivity.java index 291cdd94ac..8f08d284dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.java @@ -336,6 +336,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe @Override public void run() { Intent i = new Intent(v.getContext(), PreferencesActivity.class); + i.putExtra("id", -1); startActivity(i); } }, null); diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index 4398f80e75..cafeec6dd6 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -26,7 +26,7 @@ import info.nightscout.androidaps.interfaces.InsulinInterface; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.plugins.Actions.ActionsFragment; -import info.nightscout.androidaps.plugins.Careportal.CareportalFragment; +import info.nightscout.androidaps.plugins.Careportal.CareportalPlugin; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderFragment; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.ConstraintsObjectives.ObjectivesPlugin; @@ -67,7 +67,7 @@ import info.nightscout.androidaps.plugins.SourceMM640g.SourceMM640gPlugin; import info.nightscout.androidaps.plugins.SourceNSClient.SourceNSClientPlugin; import info.nightscout.androidaps.plugins.SourceXdrip.SourceXdripPlugin; import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; -import info.nightscout.androidaps.plugins.Wear.WearFragment; +import info.nightscout.androidaps.plugins.Wear.WearPlugin; import info.nightscout.androidaps.plugins.XDripStatusline.StatuslinePlugin; import info.nightscout.androidaps.receivers.DataReceiver; import info.nightscout.androidaps.receivers.KeepAliveReceiver; @@ -127,12 +127,12 @@ public class MainApp extends Application { if (Config.DANAR) pluginsList.add(DanaRKoreanPlugin.getPlugin()); if (Config.DANAR) pluginsList.add(DanaRv2Plugin.getPlugin()); if (Config.DANAR) pluginsList.add(DanaRSPlugin.getPlugin()); - pluginsList.add(CareportalFragment.getPlugin()); + pluginsList.add(CareportalPlugin.getPlugin()); if (Config.MDI) pluginsList.add(MDIPlugin.getPlugin()); - if (Config.VIRTUALPUMP) pluginsList.add(VirtualPumpPlugin.getInstance()); - if (Config.LOOPENABLED) pluginsList.add(LoopPlugin.getPlugin()); - if (Config.OPENAPSENABLED) pluginsList.add(OpenAPSMAPlugin.getPlugin()); - if (Config.OPENAPSENABLED) pluginsList.add(OpenAPSAMAPlugin.getPlugin()); + if (Config.VIRTUALPUMP) pluginsList.add(VirtualPumpPlugin.getPlugin()); + if (Config.APS) pluginsList.add(LoopPlugin.getPlugin()); + if (Config.APS) pluginsList.add(OpenAPSMAPlugin.getPlugin()); + if (Config.APS) pluginsList.add(OpenAPSAMAPlugin.getPlugin()); pluginsList.add(NSProfilePlugin.getPlugin()); if (Config.OTHERPROFILES) pluginsList.add(SimpleProfilePlugin.getPlugin()); if (Config.OTHERPROFILES) pluginsList.add(LocalProfileFragment.getPlugin()); @@ -150,8 +150,8 @@ public class MainApp extends Application { pluginsList.add(SourceGlimpPlugin.getPlugin()); if (Config.SMSCOMMUNICATORENABLED) pluginsList.add(SmsCommunicatorPlugin.getPlugin()); - pluginsList.add(WearFragment.getPlugin(this)); - pluginsList.add(StatuslinePlugin.getPlugin(this)); + pluginsList.add(WearPlugin.initPlugin(this)); + pluginsList.add(StatuslinePlugin.initPlugin(this)); pluginsList.add(new PersistentNotificationPlugin(this)); pluginsList.add(NSClientInternalPlugin.getPlugin()); diff --git a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java index d77338d36d..181cb3fa77 100644 --- a/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/PreferencesActivity.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps; +import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.EditTextPreference; @@ -15,18 +16,23 @@ import android.text.TextUtils; import info.nightscout.androidaps.events.EventPreferenceChange; import info.nightscout.androidaps.events.EventRefreshGui; import info.nightscout.androidaps.interfaces.PluginBase; +import info.nightscout.androidaps.plugins.Careportal.CareportalPlugin; +import info.nightscout.androidaps.plugins.ConstraintsSafety.SafetyPlugin; import info.nightscout.androidaps.plugins.Insulin.InsulinOrefFreePeakPlugin; +import info.nightscout.androidaps.plugins.Loop.LoopPlugin; +import info.nightscout.androidaps.plugins.NSClientInternal.NSClientInternalPlugin; +import info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin; +import info.nightscout.androidaps.plugins.OpenAPSMA.OpenAPSMAPlugin; import info.nightscout.androidaps.plugins.PumpDanaR.BluetoothDevicePreference; import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin; import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin; -import info.nightscout.androidaps.plugins.NSClientInternal.NSClientInternalPlugin; -import info.nightscout.androidaps.plugins.OpenAPSAMA.OpenAPSAMAPlugin; import info.nightscout.androidaps.plugins.PumpDanaRS.DanaRSPlugin; import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin; import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin; import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin; import info.nightscout.androidaps.plugins.SensitivityOref0.SensitivityOref0Plugin; import info.nightscout.androidaps.plugins.SensitivityWeightedAverage.SensitivityWeightedAveragePlugin; +import info.nightscout.androidaps.plugins.SmsCommunicator.SmsCommunicatorPlugin; import info.nightscout.androidaps.plugins.Wear.WearPlugin; import info.nightscout.androidaps.plugins.XDripStatusline.StatuslinePlugin; import info.nightscout.utils.LocaleHelper; @@ -40,6 +46,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); myPreferenceFragment = new MyPreferenceFragment(); + myPreferenceFragment.setCaller(getIntent()); getFragmentManager().beginTransaction().replace(android.R.id.content, myPreferenceFragment).commit(); PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this); } @@ -72,15 +79,14 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre if (pref.getKey().contains("password") || pref.getKey().contains("secret")) { pref.setSummary("******"); } else if (pref.getKey().equals(MainApp.sResources.getString(R.string.key_danars_name))) { - pref.setSummary(SP.getString(R.string.key_danars_name,"")); + pref.setSummary(SP.getString(R.string.key_danars_name, "")); } else if (editTextPref.getText() != null && !editTextPref.getText().equals("")) { ((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage()); pref.setSummary(editTextPref.getText()); - } - else if(pref.getKey().contains("smscommunicator_allowednumbers") && TextUtils.isEmpty(editTextPref.getText().toString().trim())){ + } else if (pref.getKey().contains("smscommunicator_allowednumbers") && TextUtils.isEmpty(editTextPref.getText().toString().trim())) { pref.setSummary(MainApp.sResources.getString(R.string.smscommunicator_allowednumbers_summary)); } - } + } if (pref instanceof MultiSelectListPreference) { EditTextPreference editTextPref = (EditTextPreference) pref; pref.setSummary(editTextPref.getText()); @@ -99,85 +105,79 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre } public static class MyPreferenceFragment extends PreferenceFragment { + Intent caller; + + public void setCaller(Intent i) { + caller = i; + } + + void addPreferencesFromResourceIfEnabled(PluginBase p, int type) { + if (p.isEnabled(type) && p.getPreferencesId() != -1) + addPreferencesFromResource(p.getPreferencesId()); + } + @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (Config.ALLPREFERENCES) { - addPreferencesFromResource(R.xml.pref_password); - } - addPreferencesFromResource(R.xml.pref_age); - addPreferencesFromResource(R.xml.pref_language); - if (Config.ALLPREFERENCES) { - addPreferencesFromResource(R.xml.pref_quickwizard); - } - addPreferencesFromResource(R.xml.pref_careportal); - if (Config.ALLPREFERENCES) { - addPreferencesFromResource(R.xml.pref_treatments); - } - if (Config.APS) - addPreferencesFromResource(R.xml.pref_closedmode); - if (Config.OPENAPSENABLED) { - addPreferencesFromResource(R.xml.pref_openapsma); - if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class) != null && MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS)) - addPreferencesFromResource(R.xml.pref_openapsama); - } - if (MainApp.getSpecificPlugin(SensitivityAAPSPlugin.class) != null && MainApp.getSpecificPlugin(SensitivityAAPSPlugin.class).isEnabled(PluginBase.SENSITIVITY) - || MainApp.getSpecificPlugin(SensitivityWeightedAveragePlugin.class) != null && MainApp.getSpecificPlugin(SensitivityWeightedAveragePlugin.class).isEnabled(PluginBase.SENSITIVITY)) - addPreferencesFromResource(R.xml.pref_absorption_aaps); - if (MainApp.getSpecificPlugin(SensitivityOref0Plugin.class) != null && MainApp.getSpecificPlugin(SensitivityOref0Plugin.class).isEnabled(PluginBase.SENSITIVITY)) - addPreferencesFromResource(R.xml.pref_absorption_oref0); - if (Config.ALLPREFERENCES) { - addPreferencesFromResource(R.xml.pref_profile); - } - if (Config.DANAR) { - DanaRPlugin danaRPlugin = MainApp.getSpecificPlugin(DanaRPlugin.class); - DanaRKoreanPlugin danaRKoreanPlugin = MainApp.getSpecificPlugin(DanaRKoreanPlugin.class); - DanaRv2Plugin danaRv2Plugin = MainApp.getSpecificPlugin(DanaRv2Plugin.class); - DanaRSPlugin danaRSPlugin = MainApp.getSpecificPlugin(DanaRSPlugin.class); - if (danaRPlugin.isEnabled(PluginBase.PUMP)) { - addPreferencesFromResource(R.xml.pref_danar); - } - if (danaRKoreanPlugin.isEnabled(PluginBase.PUMP)) { - addPreferencesFromResource(R.xml.pref_danarkorean); - } - if (danaRv2Plugin != null && danaRv2Plugin.isEnabled(PluginBase.PUMP)) { - addPreferencesFromResource(R.xml.pref_danarv2); - } - if (danaRSPlugin != null && danaRSPlugin.isEnabled(PluginBase.PUMP)) { - addPreferencesFromResource(R.xml.pref_danars); - } - if (danaRPlugin.isEnabled(PluginBase.PROFILE) || danaRKoreanPlugin.isEnabled(PluginBase.PROFILE) || danaRv2Plugin != null && danaRv2Plugin.isEnabled(PluginBase.PROFILE)) { - addPreferencesFromResource(R.xml.pref_danarprofile); - } - } - VirtualPumpPlugin virtualPumpPlugin = MainApp.getSpecificPlugin(VirtualPumpPlugin.class); - if (virtualPumpPlugin != null && virtualPumpPlugin.isEnabled(PluginBase.PUMP)) { - addPreferencesFromResource(R.xml.pref_virtualpump); - } - InsulinOrefFreePeakPlugin insulinOrefFreePeakPlugin = MainApp.getSpecificPlugin(InsulinOrefFreePeakPlugin.class); - if (insulinOrefFreePeakPlugin.isEnabled(PluginBase.INSULIN)) { - addPreferencesFromResource(R.xml.pref_insulinoreffreepeak); - } - NSClientInternalPlugin nsClientInternalPlugin = MainApp.getSpecificPlugin(NSClientInternalPlugin.class); - if (nsClientInternalPlugin != null && nsClientInternalPlugin.isEnabled(PluginBase.GENERAL)) { - addPreferencesFromResource(R.xml.pref_nsclientinternal); - } - if (Config.SMSCOMMUNICATORENABLED) - addPreferencesFromResource(R.xml.pref_smscommunicator); - if (Config.ALLPREFERENCES) { - addPreferencesFromResource(R.xml.pref_others); - } - addPreferencesFromResource(R.xml.pref_advanced); + Integer id = caller.getIntExtra("id", -1); - WearPlugin wearPlugin = MainApp.getSpecificPlugin(WearPlugin.class); - if (wearPlugin != null && wearPlugin.isEnabled(PluginBase.GENERAL)) { - addPreferencesFromResource(R.xml.pref_wear); - } + if (id != -1) { + addPreferencesFromResource(id); + } else { + if (!Config.NSCLIENT) { + addPreferencesFromResource(R.xml.pref_password); + } + addPreferencesFromResource(R.xml.pref_age); + addPreferencesFromResource(R.xml.pref_language); - StatuslinePlugin statuslinePlugin = MainApp.getSpecificPlugin(StatuslinePlugin.class); - if (statuslinePlugin != null && statuslinePlugin.isEnabled(PluginBase.GENERAL)) { - addPreferencesFromResource(R.xml.pref_xdripstatus); + if (!Config.NSCLIENT) { + addPreferencesFromResource(R.xml.pref_quickwizard); + } + addPreferencesFromResourceIfEnabled(CareportalPlugin.getPlugin(), PluginBase.GENERAL); + addPreferencesFromResourceIfEnabled(SafetyPlugin.getPlugin(), PluginBase.CONSTRAINTS); + if (Config.APS) { + addPreferencesFromResourceIfEnabled(LoopPlugin.getPlugin(), PluginBase.LOOP); + addPreferencesFromResourceIfEnabled(OpenAPSMAPlugin.getPlugin(), PluginBase.APS); + addPreferencesFromResourceIfEnabled(OpenAPSAMAPlugin.getPlugin(), PluginBase.APS); + } + + addPreferencesFromResourceIfEnabled(SensitivityAAPSPlugin.getPlugin(), PluginBase.SENSITIVITY); + addPreferencesFromResourceIfEnabled(SensitivityWeightedAveragePlugin.getPlugin(), PluginBase.SENSITIVITY); + addPreferencesFromResourceIfEnabled(SensitivityOref0Plugin.getPlugin(), PluginBase.SENSITIVITY); + + if (!Config.NSCLIENT) { + addPreferencesFromResource(R.xml.pref_profile); + } + + if (Config.DANAR) { + addPreferencesFromResourceIfEnabled(DanaRPlugin.getPlugin(), PluginBase.PUMP); + addPreferencesFromResourceIfEnabled(DanaRKoreanPlugin.getPlugin(), PluginBase.PUMP); + addPreferencesFromResourceIfEnabled(DanaRv2Plugin.getPlugin(), PluginBase.PUMP); + addPreferencesFromResourceIfEnabled(DanaRSPlugin.getPlugin(), PluginBase.PUMP); + + if (DanaRPlugin.getPlugin().isEnabled(PluginBase.PROFILE) + || DanaRKoreanPlugin.getPlugin().isEnabled(PluginBase.PROFILE) + || DanaRv2Plugin.getPlugin().isEnabled(PluginBase.PROFILE) + || DanaRSPlugin.getPlugin().isEnabled(PluginBase.PROFILE)) { + addPreferencesFromResource(R.xml.pref_danarprofile); + } + } + + addPreferencesFromResourceIfEnabled(VirtualPumpPlugin.getPlugin(), PluginBase.PUMP); + + addPreferencesFromResourceIfEnabled(InsulinOrefFreePeakPlugin.getPlugin(), PluginBase.INSULIN); + + addPreferencesFromResourceIfEnabled(NSClientInternalPlugin.getPlugin(), PluginBase.GENERAL); + addPreferencesFromResourceIfEnabled(SmsCommunicatorPlugin.getPlugin(), PluginBase.GENERAL); + + if (!Config.NSCLIENT) { + addPreferencesFromResource(R.xml.pref_others); + } + addPreferencesFromResource(R.xml.pref_advanced); + + addPreferencesFromResourceIfEnabled(WearPlugin.getPlugin(), PluginBase.GENERAL); + addPreferencesFromResourceIfEnabled(StatuslinePlugin.getPlugin(), PluginBase.GENERAL); } initSummary(getPreferenceScreen()); diff --git a/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java b/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java index bf5e66f2a1..08db6210d4 100644 --- a/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java +++ b/app/src/main/java/info/nightscout/androidaps/interfaces/PluginBase.java @@ -30,4 +30,5 @@ public interface PluginBase { boolean showInList(int type); void setFragmentEnabled(int type, boolean fragmentEnabled); void setFragmentVisible(int type, boolean fragmentVisible); + int getPreferencesId(); } \ No newline at end of file diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsPlugin.java index 74252e2689..3c71626e64 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/ActionsPlugin.java @@ -74,4 +74,9 @@ public class ActionsPlugin implements PluginBase { if (type == GENERAL) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java index d832d2aab0..bee1c3b923 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalFragment.java @@ -26,8 +26,6 @@ import info.nightscout.androidaps.plugins.Overview.OverviewFragment; public class CareportalFragment extends SubscriberFragment implements View.OnClickListener { - static CareportalPlugin careportalPlugin; - TextView iage; TextView cage; TextView sage; @@ -37,13 +35,6 @@ public class CareportalFragment extends SubscriberFragment implements View.OnCli LinearLayout butonsLayout; View noProfileView; - static public CareportalPlugin getPlugin() { - if (careportalPlugin == null) { - careportalPlugin = new CareportalPlugin(); - } - return careportalPlugin; - } - // date,bg,insulin,carbs,prebolus,duration,percent,absolute,profile,split,temptarget public static final OptionsToShow BGCHECK = new OptionsToShow(R.id.careportal_bgcheck, R.string.careportal_bgcheck).date().bg(); public static final OptionsToShow SNACKBOLUS = new OptionsToShow(R.id.careportal_snackbolus, R.string.careportal_snackbolus).date().bg().insulin().carbs().prebolus(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java index ceab1b1650..fc6dd7fd05 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/CareportalPlugin.java @@ -10,6 +10,15 @@ public class CareportalPlugin implements PluginBase { private boolean fragmentEnabled = true; private boolean fragmentVisible = true; + static CareportalPlugin careportalPlugin; + + static public CareportalPlugin getPlugin() { + if (careportalPlugin == null) { + careportalPlugin = new CareportalPlugin(); + } + return careportalPlugin; + } + @Override public int getType() { return PluginBase.GENERAL; @@ -71,4 +80,9 @@ public class CareportalPlugin implements PluginBase { if (type == GENERAL) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_careportal; + } + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java index 4c868bcc3f..46c2083d0b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderFragment.java @@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.ConfigBuilder; import android.content.Context; +import android.content.Intent; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; @@ -10,6 +11,7 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.CheckBox; +import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ListAdapter; import android.widget.ListView; @@ -22,6 +24,7 @@ import com.crashlytics.android.answers.CustomEvent; import java.util.ArrayList; import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.PreferencesActivity; import info.nightscout.androidaps.R; import info.nightscout.androidaps.events.EventConfigBuilderChange; import info.nightscout.androidaps.events.EventRefreshGui; @@ -194,7 +197,7 @@ public class ConfigBuilderFragment extends Fragment { public PluginCustomAdapter(Context context, int textViewResourceId, ArrayList pluginList, int type) { super(context, textViewResourceId, pluginList); - this.pluginList = new ArrayList(); + this.pluginList = new ArrayList<>(); this.pluginList.addAll(pluginList); this.type = type; } @@ -203,12 +206,14 @@ public class ConfigBuilderFragment extends Fragment { TextView name; CheckBox checkboxEnabled; CheckBox checkboxVisible; + ImageView settings; } @Override public View getView(int position, View view, ViewGroup parent) { PluginViewHolder holder = null; + PluginBase plugin = pluginList.get(position); if (view == null) { view = LayoutInflater.from(parent.getContext()).inflate(R.layout.configbuilder_simpleitem, null); @@ -217,6 +222,13 @@ public class ConfigBuilderFragment extends Fragment { holder.name = (TextView) view.findViewById(R.id.configbuilder_simpleitem_name); holder.checkboxEnabled = (CheckBox) view.findViewById(R.id.configbuilder_simpleitem_checkboxenabled); holder.checkboxVisible = (CheckBox) view.findViewById(R.id.configbuilder_simpleitem_checkboxvisible); + holder.settings = (ImageView) view.findViewById(R.id.configbuilder_simpleitem_settings); + + if (plugin.isEnabled(type) && plugin.getPreferencesId() != -1) + holder.settings.setVisibility(View.VISIBLE); + else + holder.settings.setVisibility(View.INVISIBLE); + view.setTag(holder); holder.checkboxEnabled.setOnClickListener(new View.OnClickListener() { @@ -244,17 +256,31 @@ public class ConfigBuilderFragment extends Fragment { getPlugin().logPluginStatus(); } }); + + holder.settings.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + final PluginBase plugin = (PluginBase) v.getTag(); + PasswordProtection.QueryPassword(getContext(), R.string.settings_password, "settings_password", new Runnable() { + @Override + public void run() { + Intent i = new Intent(getContext(), PreferencesActivity.class); + i.putExtra("id", plugin.getPreferencesId()); + startActivity(i); + } + }, null); + } + }); } else { holder = (PluginViewHolder) view.getTag(); } - PluginBase plugin = pluginList.get(position); holder.name.setText(plugin.getName()); holder.checkboxEnabled.setChecked(plugin.isEnabled(type)); holder.checkboxVisible.setChecked(plugin.isVisibleInTabs(type)); holder.name.setTag(plugin); holder.checkboxEnabled.setTag(plugin); holder.checkboxVisible.setTag(plugin); + holder.settings.setTag(plugin); if (!plugin.canBeHidden(type)) { holder.checkboxEnabled.setEnabled(false); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index b9e13f0426..12f1f46c1c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -146,6 +146,11 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain // Always visible } + @Override + public int getPreferencesId() { + return -1; + } + public void initialize() { pluginList = MainApp.getPluginsList(); loadSettings(); @@ -301,7 +306,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain pluginsInCategory = MainApp.getSpecificPluginsList(PluginBase.PUMP); activePump = (PumpInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.PUMP); if (activePump == null) - activePump = VirtualPumpPlugin.getInstance(); // for NSClient build + activePump = VirtualPumpPlugin.getPlugin(); // for NSClient build if (Config.logConfigBuilder) log.debug("Selected pump interface: " + ((PluginBase) activePump).getName()); for (PluginBase p : pluginsInCategory) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesPlugin.java index 7c353e48e2..04edeb43a1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsObjectives/ObjectivesPlugin.java @@ -104,6 +104,11 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface { if (type == CONSTRAINTS) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + class Objective { Integer num; String objective; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java index 6880d1a21e..a64241a4b9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConstraintsSafety/SafetyPlugin.java @@ -86,6 +86,11 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface { public void setFragmentVisible(int type, boolean fragmentVisible) { } + @Override + public int getPreferencesId() { + return R.xml.pref_safety; + } + @Override public boolean isLoopEnabled() { return MainApp.getConfigBuilder().getPumpDescription().isTempBasalCapable; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingPlugin.java index 46f0b46864..c7164ea60e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingPlugin.java @@ -80,6 +80,11 @@ public class InsulinFastactingPlugin implements PluginBase, InsulinInterface { if (type == INSULIN) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + // Insulin interface @Override public int getId() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingProlongedPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingProlongedPlugin.java index 540151e237..99c35a6c0b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingProlongedPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinFastactingProlongedPlugin.java @@ -80,6 +80,11 @@ public class InsulinFastactingProlongedPlugin implements PluginBase, InsulinInte if (type == INSULIN) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + // Insulin interface @Override public int getId() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefFreePeakPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefFreePeakPlugin.java index 8d19eeb4af..3cc2e6b9ca 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefFreePeakPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefFreePeakPlugin.java @@ -68,6 +68,11 @@ public class InsulinOrefFreePeakPlugin extends InsulinOrefBasePlugin { if (type == INSULIN) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_insulinoreffreepeak; + } + @Override int getPeak() { return SP.getInt(R.string.key_insulin_oref_peak, DEFAULT_PEAK); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefRapidActingPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefRapidActingPlugin.java index be6f70c01f..cae9ac540d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefRapidActingPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefRapidActingPlugin.java @@ -67,6 +67,11 @@ public class InsulinOrefRapidActingPlugin extends InsulinOrefBasePlugin { if (type == INSULIN) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + @Override int getPeak() { return PEAK; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefUltraRapidActingPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefUltraRapidActingPlugin.java index 453620933e..0d390a3ba2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefUltraRapidActingPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Insulin/InsulinOrefUltraRapidActingPlugin.java @@ -67,6 +67,11 @@ public class InsulinOrefUltraRapidActingPlugin extends InsulinOrefBasePlugin { if (type == INSULIN) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + @Override int getPeak() { return PEAK; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java index a76e694372..bf4cef2c39 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/IobCobCalculator/IobCobCalculatorPlugin.java @@ -126,6 +126,11 @@ public class IobCobCalculatorPlugin implements PluginBase { } + @Override + public int getPreferencesId() { + return -1; + } + IobCobCalculatorPlugin() { MainApp.bus().register(this); if (sHandlerThread == null) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java index f1fc88625e..1b6d05664e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java @@ -148,6 +148,11 @@ public class LoopPlugin implements PluginBase { if (type == LOOP) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_closedmode; + } + @Subscribe public void onStatusEvent(final EventTreatmentChange ev) { invoke("EventTreatmentChange", true); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java index 7e8a76ce1b..d5ca87a479 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSClientInternalPlugin.java @@ -135,6 +135,11 @@ public class NSClientInternalPlugin implements PluginBase { if (type == GENERAL) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_nsclientinternal; + } + private ServiceConnection mConnection = new ServiceConnection() { public void onServiceDisconnected(ComponentName name) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java index be7b830880..b64d4b6b08 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/OpenAPSAMAPlugin.java @@ -103,6 +103,11 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface { if (type == APS) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_openapsama; + } + @Override public void setFragmentEnabled(int type, boolean fragmentEnabled) { if (type == APS) this.fragmentEnabled = fragmentEnabled; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java index 4d5f97c1b0..a0d5cddd88 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/OpenAPSMAPlugin.java @@ -101,6 +101,11 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface { if (type == APS) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_openapsma; + } + @Override public void setFragmentEnabled(int type, boolean fragmentEnabled) { if (type == APS) this.fragmentEnabled = fragmentEnabled; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewPlugin.java index d779b82ae9..7eecbada25 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewPlugin.java @@ -103,6 +103,11 @@ public class OverviewPlugin implements PluginBase { // Always visible } + @Override + public int getPreferencesId() { + return -1; + } + @Override public int getType() { return PluginBase.GENERAL; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java index 9432552c1a..f0745afe94 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Persistentnotification/PersistentNotificationPlugin.java @@ -205,6 +205,11 @@ public class PersistentNotificationPlugin implements PluginBase { //no visible fragment } + @Override + public int getPreferencesId() { + return -1; + } + private String deltastring(double deltaMGDL, double deltaMMOL, String units) { String deltastring = ""; if (deltaMGDL >= 0) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileCircadianPercentage/CircadianPercentageProfilePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileCircadianPercentage/CircadianPercentageProfilePlugin.java index 2afb47e034..ea4f32e794 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileCircadianPercentage/CircadianPercentageProfilePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileCircadianPercentage/CircadianPercentageProfilePlugin.java @@ -119,6 +119,11 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte if (type == PROFILE) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + void storeSettings() { if (Config.logPrefsChange) log.debug("Storing settings"); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileLocal/LocalProfilePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileLocal/LocalProfilePlugin.java index 61bff582a5..b9780d7493 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileLocal/LocalProfilePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileLocal/LocalProfilePlugin.java @@ -108,6 +108,11 @@ public class LocalProfilePlugin implements PluginBase, ProfileInterface { if (type == PROFILE) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + public void storeSettings() { SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext()); SharedPreferences.Editor editor = settings.edit(); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java index 53900da781..e4fdabecf9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileNS/NSProfilePlugin.java @@ -104,6 +104,11 @@ public class NSProfilePlugin implements PluginBase, ProfileInterface { if (type == PROFILE) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + @Override public int getType() { return PluginBase.PROFILE; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileSimple/SimpleProfilePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileSimple/SimpleProfilePlugin.java index 8f38cecb92..d0b36d34ca 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ProfileSimple/SimpleProfilePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ProfileSimple/SimpleProfilePlugin.java @@ -111,6 +111,11 @@ public class SimpleProfilePlugin implements PluginBase, ProfileInterface { if (type == PROFILE) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + public void storeSettings() { if (Config.logPrefsChange) log.debug("Storing settings"); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java index 65dd5192e4..115f612f6c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/DanaRPlugin.java @@ -217,6 +217,11 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C fragmentPumpVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_danar; + } + @Override public boolean isFakingTempsByExtendedBoluses() { return useExtendedBoluses; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java index c8b2d04759..c0071ecfca 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/DanaRKoreanPlugin.java @@ -219,6 +219,11 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, DanaRInterf this.fragmentPumpVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_danarkorean; + } + @Override public boolean isFakingTempsByExtendedBoluses() { return useExtendedBoluses; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/DanaRSPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/DanaRSPlugin.java index 468626fe26..5f97999bfa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/DanaRSPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/DanaRSPlugin.java @@ -137,6 +137,11 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface, this.fragmentPumpVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_danars; + } + static boolean fragmentPumpEnabled = false; static boolean fragmentProfileEnabled = false; static boolean fragmentPumpVisible = false; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java index 4a224bd57b..f9156bb430 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/DanaRv2Plugin.java @@ -204,6 +204,11 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, DanaRInterface, this.fragmentPumpVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_danarv2; + } + @Override public boolean isFakingTempsByExtendedBoluses() { return false; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java index ca3f7a62a0..da4ea8157d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpMDI/MDIPlugin.java @@ -99,6 +99,11 @@ public class MDIPlugin implements PluginBase, PumpInterface { if (type == PUMP) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + @Override public int getType() { return PluginBase.PUMP; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpFragment.java index 9d19f9f132..3590af80fe 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpFragment.java @@ -79,7 +79,7 @@ public class VirtualPumpFragment extends SubscriberFragment { activity.runOnUiThread(new Runnable() { @Override public void run() { - VirtualPumpPlugin virtualPump = VirtualPumpPlugin.getInstance(); + VirtualPumpPlugin virtualPump = VirtualPumpPlugin.getPlugin(); basaBasalRateView.setText(virtualPump.getBaseBasalRate() + "U"); if (MainApp.getConfigBuilder().isTempBasalInProgress()) { tempBasalView.setText(MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()).toStringFull()); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java index e7323f48af..2e3be7ab95 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java @@ -64,12 +64,12 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface { return fromNSAreCommingFakedExtendedBoluses; } - private static VirtualPumpPlugin instance = null; - public static VirtualPumpPlugin getInstance() { + private static VirtualPumpPlugin plugin = null; + public static VirtualPumpPlugin getPlugin() { loadFakingStatus(); - if (instance == null) - instance = new VirtualPumpPlugin(); - return instance; + if (plugin == null) + plugin = new VirtualPumpPlugin(); + return plugin; } private VirtualPumpPlugin() { @@ -154,6 +154,11 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface { if (type == PUMP) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_virtualpump; + } + @Override public int getType() { return PluginBase.PUMP; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java index 2cf6b5a4e4..39af16e0ee 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityAAPS/SensitivityAAPSPlugin.java @@ -96,6 +96,11 @@ public class SensitivityAAPSPlugin implements PluginBase, SensitivityInterface{ if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_absorption_aaps; + } + @Override public AutosensResult detectSensitivity(long fromTime, long toTime) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java index da89882a27..6817e17503 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityOref0/SensitivityOref0Plugin.java @@ -94,6 +94,11 @@ public class SensitivityOref0Plugin implements PluginBase, SensitivityInterface if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_absorption_oref0; + } + @Override public AutosensResult detectSensitivity(long fromTime, long toTime) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java index 68537cf47c..596c2477f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SensitivityWeightedAverage/SensitivityWeightedAveragePlugin.java @@ -93,6 +93,11 @@ public class SensitivityWeightedAveragePlugin implements PluginBase, Sensitivity if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_absorption_aaps; + } + @Override public AutosensResult detectSensitivity(long fromTime, long toTime) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java index 67c497a06d..9fdb0152d0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java @@ -186,6 +186,11 @@ public class SmsCommunicatorPlugin implements PluginBase { if (type == GENERAL) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_smscommunicator; + } + @Subscribe public void processSettings(final EventPreferenceChange ev) { if (ev == null || ev.isChanged(R.string.key_smscommunicator_allowednumbers)) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SourceGlimp/SourceGlimpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SourceGlimp/SourceGlimpPlugin.java index 2fbe60cbf5..934635f03b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SourceGlimp/SourceGlimpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SourceGlimp/SourceGlimpPlugin.java @@ -75,5 +75,10 @@ public class SourceGlimpPlugin implements PluginBase, BgSourceInterface { } + @Override + public int getPreferencesId() { + return -1; + } + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SourceMM640g/SourceMM640gPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SourceMM640g/SourceMM640gPlugin.java index 57b32c1ad1..aba07ffe05 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SourceMM640g/SourceMM640gPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SourceMM640g/SourceMM640gPlugin.java @@ -75,5 +75,10 @@ public class SourceMM640gPlugin implements PluginBase, BgSourceInterface { } + @Override + public int getPreferencesId() { + return -1; + } + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java index cc2cb15878..0e85793850 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SourceNSClient/SourceNSClientPlugin.java @@ -77,5 +77,10 @@ public class SourceNSClientPlugin implements PluginBase, BgSourceInterface { } + @Override + public int getPreferencesId() { + return -1; + } + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SourceXdrip/SourceXdripPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SourceXdrip/SourceXdripPlugin.java index 0d0fb07c45..8363f13566 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SourceXdrip/SourceXdripPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SourceXdrip/SourceXdripPlugin.java @@ -75,5 +75,10 @@ public class SourceXdripPlugin implements PluginBase, BgSourceInterface { public void setFragmentVisible(int type, boolean fragmentVisible) { } + @Override + public int getPreferencesId() { + return -1; + } + } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index 6422ec3589..d7c9d1eafe 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -121,6 +121,11 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface { if (type == TREATMENT) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return -1; + } + @Override public int getType() { return PluginBase.TREATMENT; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index 9fbcc31685..a7b90775f1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -324,7 +324,7 @@ public class ActionStringHandler { // send result - WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation(rTitle, rMessage, rAction); + WearPlugin.getPlugin().requestActionConfirmation(rTitle, rMessage, rAction); lastSentTimestamp = System.currentTimeMillis(); lastConfirmActionString = rAction; } @@ -596,7 +596,7 @@ public class ActionStringHandler { msg += MainApp.sResources.getString(R.string.cpp_valuesnotstored); String rTitle = "STATUS"; String rAction = "statusmessage"; - WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation(rTitle, msg, rAction); + WearPlugin.getPlugin().requestActionConfirmation(rTitle, msg, rAction); lastSentTimestamp = System.currentTimeMillis(); lastConfirmActionString = rAction; return; @@ -667,14 +667,14 @@ public class ActionStringHandler { } private synchronized static void sendError(String errormessage) { - WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation("ERROR", errormessage, "error"); + WearPlugin.getPlugin().requestActionConfirmation("ERROR", errormessage, "error"); lastSentTimestamp = System.currentTimeMillis(); lastConfirmActionString = null; lastBolusWizard = null; } private synchronized static void sendStatusmessage(String title, String message) { - WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation(title, message, "statusmessage"); + WearPlugin.getPlugin().requestActionConfirmation(title, message, "statusmessage"); lastSentTimestamp = System.currentTimeMillis(); lastConfirmActionString = null; lastBolusWizard = null; @@ -682,7 +682,7 @@ public class ActionStringHandler { public synchronized static void expectNotificationAction(String message, int id) { String actionstring = "dismissoverviewnotification " + id; - WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation("DISMISS", message, actionstring); + WearPlugin.getPlugin().requestActionConfirmation("DISMISS", message, actionstring); lastSentTimestamp = System.currentTimeMillis(); lastConfirmActionString = actionstring; lastBolusWizard = null; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearFragment.java index d243da7d60..b1b47a4ae2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearFragment.java @@ -15,17 +15,6 @@ import info.nightscout.androidaps.R; public class WearFragment extends Fragment { - private static WearPlugin wearPlugin; - - public static WearPlugin getPlugin(Context ctx) { - - if (wearPlugin == null) { - wearPlugin = new WearPlugin(ctx); - } - - return wearPlugin; - } - @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -34,14 +23,14 @@ public class WearFragment extends Fragment { view.findViewById(R.id.wear_resend).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - getPlugin(getContext()).resendDataToWatch(); + WearPlugin.getPlugin().resendDataToWatch(); } }); view.findViewById(R.id.wear_opensettings).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { - getPlugin(getContext()).openSettings(); + WearPlugin.getPlugin().openSettings(); } }); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearPlugin.java index e0d8d9210d..00f62bd2c0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/WearPlugin.java @@ -34,6 +34,20 @@ public class WearPlugin implements PluginBase { private static WatchUpdaterService watchUS; private final Context ctx; + private static WearPlugin wearPlugin; + + public static WearPlugin getPlugin() { + return wearPlugin; + } + public static WearPlugin initPlugin(Context ctx) { + + if (wearPlugin == null) { + wearPlugin = new WearPlugin(ctx); + } + + return wearPlugin; + } + WearPlugin(Context ctx) { this.ctx = ctx; MainApp.bus().register(this); @@ -105,6 +119,11 @@ public class WearPlugin implements PluginBase { if (type == GENERAL) this.fragmentVisible = fragmentVisible; } + @Override + public int getPreferencesId() { + return R.xml.pref_wear; + } + private void sendDataToWatch(boolean status, boolean basals, boolean bgValue) { if (isEnabled(getType())) { //only start service when this plugin is enabled diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java index 38bb014274..300a2827c1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/XDripStatusline/StatuslinePlugin.java @@ -47,7 +47,11 @@ public class StatuslinePlugin implements PluginBase { private static StatuslinePlugin statuslinePlugin; - public static StatuslinePlugin getPlugin(Context ctx) { + public static StatuslinePlugin getPlugin() { + return statuslinePlugin; + } + + public static StatuslinePlugin initPlugin(Context ctx) { if (statuslinePlugin == null) { statuslinePlugin = new StatuslinePlugin(ctx); @@ -138,6 +142,11 @@ public class StatuslinePlugin implements PluginBase { // do nothing, no gui } + @Override + public int getPreferencesId() { + return R.xml.pref_xdripstatus; + } + private void sendStatus() { diff --git a/app/src/main/res/drawable-hdpi-v11/ic_settings.png b/app/src/main/res/drawable-hdpi-v11/ic_settings.png new file mode 100644 index 0000000000000000000000000000000000000000..8a55c0221f8074631b8ede47067cd19e4fe8a116 GIT binary patch literal 526 zcmV+p0`dKcP))hV?v;!$D-112bXE{E~V|nAGhhUb48`CCc_$$5*+0ZrU(lxYhFfl*kWsn6Gk5WLzs;;36 z%?S@c(xpv-BTfCWuAxD(m{$})heY40VJdG_Jn?Wl*p+NS9oPze%0s)u=l5HS&WK4% zn%WAXb%Ivv5;5tXrZ!7xFM}F7B_=IuYRfu1$cAS8^g|BObX5%(z9E{qg0D*eL=)gcB>9rqN=qEuSA~%muqj#@OSHV_q5~ZZ zQW)dZuff=g!qB4Rt;he?t;566@Nc`9#YB=*QET|k_1pJqiokCD^YL%u3z5o~R5(CG Qf&c&j07*qoM6N<$f~chLrT_o{ literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-hdpi-v9/ic_settings.png b/app/src/main/res/drawable-hdpi-v9/ic_settings.png new file mode 100644 index 0000000000000000000000000000000000000000..23b7ef35297c27367440607f77cbe6d56143f754 GIT binary patch literal 580 zcmV-K0=xZ*P)X_$w zUyH?JFQ3mV9r$kGd=U=MX?Qz4_a%o_fW9sgD8Y(ARjbwhP^t1K??cvvBiw!*Li5Jt z*=+U=y}q<1dn^z;NA&eQ0hE(M$mMc2oB>w=uWjQ=4sxx<3@>s4Le~=L(c59|T@B-F zTDaX(sr25~rYZ0XC=I82a$SVAwvXEZlYu9R3Rd+Xw(JCOU7x`6gZF?|4G6GZs{p5F zK!E=%4~>LL5_U3~jOv4+lUA$s($pd@+?mdG9Ooye=&dn13-et6u2iB2$&34p=^~OG zmnUmFS7JHp*I@3R0F|fG>9jIIMgs{?fFq!oQ}NmO?0Vfa&_-FjvIR+XwBQc%+r|SI z#)~GFN~J#d$bSP889B6VA#m6satL<8Od^q(;JE>MK>5%k;Wu_Oo=hfZ`M(Da0*9S# ztm0000n6S&hI&|Q)BeLdFs3PP0#Q7d_8`bb52y$PyCP3)6?^-sHn)Aot^FV ziy|a1m|(NU8XFsJ4Gj&{+uKWHV`DTiG4Z7W11vDX*6P?}e}6xXkB>)GV1msW>+9>I z;o)H#85xPFzyzB$hPEQ#W6+5SN z06TJKW=1s!8-+7>b#*0np>ht`tg-6qYO1TNQ>nSRSsbLw*x1;R=0jUsTdMrs-Cgl7 zljVcW8mp+NpqiQ*sjx1Tf$h)bqif2*BIokKW{s7WmQrP9rBo=YjLFGKHXo*y(b3Vt z=7Y@|D=sdkva&Lj&}J-fW#G`1#F?C%}uJRs*>h|%^LGRNs5GEVaJ@EokGmbYzM5@>lGbRa=>Pd;pHGNFHfbpxw)_zo0^)EGQehy zWn^SX-(+%fa_HpbByfoz92^A3T5)`QOoxYuflC}?)RHm4W{st#rHKTYa5`gcl$V!_ zaaL9qSu7UT6mEpf%uJDsIk>$2Z$fN+uvud%DJhhin)+#>;Pdmd%GA@-6Q!r8>#7Ad zYb+@#iIS6(b?N5jMrF+HcI&PKHfzjaFi>J*qAuY{!Q=6S2v4?p>wwJ~i;s^N3Ev^G zS!1!Wv6PUIKyh(#5fzwVYjx}qXG%;=OhlENn~RR|p9uUHtgWrBO`O7LZFF?>mkJE9 z!1S}7nxCQkXVY)1)#_VVSfEG^WpklzXb0000+gPz+)-Q`3T=|Cqp^nif=Gv7nTa;P3}xE-0T9h&N-gU?UK7K-F+V z^)M4-K_=9I_dq-Yi0}T#4emnKyod7B2pKL2#IOI84_*SX06q&Q;L-dKh;IY&9Vi|KZ8#$C4zeYnIKh)YHsiBk5`koT6N>RA(|&vw z2m$dM3NqR&P-Z0*4_Q#fAAoo^5I?|U;613Ck5GOFv4tI|c;a!c4sEEbeevpxvMVnG14t4tjvtPK(y84U&i!L^fq<=Hxy00000NkvXXu0mjf DeENX1^@s6IQ*`u0003}NkldD*sl(g1x$q6Qy_4xX<7jo7&k{mY+7n-%5Ci+&-1MT z7C36^SmuNqsH%F@+<}12E+8-h$s3GyTN$xWd*C`2`U!f~ukeOu;|YZ8x*M2|z!>+U zs!=X#u4+%AD9Q(5Rru1Haq!mKfhdYyS(Y`>15aQDSjiGakC literal 0 HcmV?d00001 diff --git a/app/src/main/res/drawable-mdpi/ic_settings.png b/app/src/main/res/drawable-mdpi/ic_settings.png new file mode 100644 index 0000000000000000000000000000000000000000..60b53e614e51173e08b49bd6f327e498602303dd GIT binary patch literal 669 zcmV;O0%HA%P)P000>X1^@s6#OZ}&0007HNkljK7=`l_L{XvyK@Fmy5RqsIS{OtFH-R92VhS}NB7*px+QM3`wDT{-I$hG-Ul6dq zDvCA+L{ReHdj?!~85M5q^1?yf_snxP?!_(8#(E{ z3{pHE->Yu7OXBKuItTsWaUod8NF*W%GikM2luD)O@$r$~-`^!6Z*OnxI{NUzFCGux zt_M$nKtNEt-Da@WYDLrOly()aqmODfo09S1aUp)cpYHGPnZn^P&F6FapPJ2P6bgj| z26$YE$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