preferences update
This commit is contained in:
parent
ae47183459
commit
60699eddbb
63 changed files with 373 additions and 131 deletions
app/src/main
java/info/nightscout/androidaps
Config.javaMainActivity.javaMainApp.javaPreferencesActivity.java
interfaces
plugins
Actions
Careportal
ConfigBuilder
ConstraintsObjectives
ConstraintsSafety
Insulin
InsulinFastactingPlugin.javaInsulinFastactingProlongedPlugin.javaInsulinOrefFreePeakPlugin.javaInsulinOrefRapidActingPlugin.javaInsulinOrefUltraRapidActingPlugin.java
IobCobCalculator
Loop
NSClientInternal
OpenAPSAMA
OpenAPSMA
Overview
Persistentnotification
ProfileCircadianPercentage
ProfileLocal
ProfileNS
ProfileSimple
PumpDanaR
PumpDanaRKorean
PumpDanaRS
PumpDanaRv2
PumpMDI
PumpVirtual
SensitivityAAPS
SensitivityOref0
SensitivityWeightedAverage
SmsCommunicator
SourceGlimp
SourceMM640g
SourceNSClient
SourceXdrip
Treatments
Wear
XDripStatusline
res
drawable-hdpi-v11
drawable-hdpi-v9
drawable-hdpi
drawable-mdpi-v11
drawable-mdpi-v9
drawable-mdpi
drawable-xhdpi-v11
drawable-xhdpi-v9
drawable-xhdpi
drawable-xxhdpi-v11
drawable-xxhdpi-v9
drawable-xxhdpi
layout
xml
|
@ -9,13 +9,9 @@ public class Config {
|
||||||
// MAIN FUCTIONALITY
|
// MAIN FUCTIONALITY
|
||||||
public static final boolean APS = BuildConfig.APS;
|
public static final boolean APS = BuildConfig.APS;
|
||||||
// PLUGINS
|
// PLUGINS
|
||||||
public static final boolean OPENAPSENABLED = APS;
|
|
||||||
public static final boolean LOOPENABLED = APS;
|
|
||||||
|
|
||||||
public static final boolean NSCLIENT = BuildConfig.NSCLIENTOLNY;
|
public static final boolean NSCLIENT = BuildConfig.NSCLIENTOLNY;
|
||||||
|
|
||||||
public static final boolean DANAR = true && BuildConfig.PUMPDRIVERS;
|
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 ACTION = !BuildConfig.NSCLIENTOLNY;
|
||||||
public static final boolean VIRTUALPUMP = !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 SMSCOMMUNICATORENABLED = !BuildConfig.NSCLIENTOLNY;
|
||||||
|
|
||||||
|
|
||||||
public static final boolean ALLPREFERENCES = !BuildConfig.NSCLIENTOLNY;
|
|
||||||
|
|
||||||
public static final boolean detailedLog = true;
|
public static final boolean detailedLog = true;
|
||||||
public static final boolean logFunctionCalls = true;
|
public static final boolean logFunctionCalls = true;
|
||||||
public static final boolean logIncommingData = true;
|
public static final boolean logIncommingData = true;
|
||||||
|
|
|
@ -336,6 +336,7 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Intent i = new Intent(v.getContext(), PreferencesActivity.class);
|
Intent i = new Intent(v.getContext(), PreferencesActivity.class);
|
||||||
|
i.putExtra("id", -1);
|
||||||
startActivity(i);
|
startActivity(i);
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
|
|
|
@ -26,7 +26,7 @@ import info.nightscout.androidaps.interfaces.InsulinInterface;
|
||||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||||
import info.nightscout.androidaps.interfaces.PumpInterface;
|
import info.nightscout.androidaps.interfaces.PumpInterface;
|
||||||
import info.nightscout.androidaps.plugins.Actions.ActionsFragment;
|
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.ConfigBuilderFragment;
|
||||||
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
|
||||||
import info.nightscout.androidaps.plugins.ConstraintsObjectives.ObjectivesPlugin;
|
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.SourceNSClient.SourceNSClientPlugin;
|
||||||
import info.nightscout.androidaps.plugins.SourceXdrip.SourceXdripPlugin;
|
import info.nightscout.androidaps.plugins.SourceXdrip.SourceXdripPlugin;
|
||||||
import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin;
|
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.plugins.XDripStatusline.StatuslinePlugin;
|
||||||
import info.nightscout.androidaps.receivers.DataReceiver;
|
import info.nightscout.androidaps.receivers.DataReceiver;
|
||||||
import info.nightscout.androidaps.receivers.KeepAliveReceiver;
|
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(DanaRKoreanPlugin.getPlugin());
|
||||||
if (Config.DANAR) pluginsList.add(DanaRv2Plugin.getPlugin());
|
if (Config.DANAR) pluginsList.add(DanaRv2Plugin.getPlugin());
|
||||||
if (Config.DANAR) pluginsList.add(DanaRSPlugin.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.MDI) pluginsList.add(MDIPlugin.getPlugin());
|
||||||
if (Config.VIRTUALPUMP) pluginsList.add(VirtualPumpPlugin.getInstance());
|
if (Config.VIRTUALPUMP) pluginsList.add(VirtualPumpPlugin.getPlugin());
|
||||||
if (Config.LOOPENABLED) pluginsList.add(LoopPlugin.getPlugin());
|
if (Config.APS) pluginsList.add(LoopPlugin.getPlugin());
|
||||||
if (Config.OPENAPSENABLED) pluginsList.add(OpenAPSMAPlugin.getPlugin());
|
if (Config.APS) pluginsList.add(OpenAPSMAPlugin.getPlugin());
|
||||||
if (Config.OPENAPSENABLED) pluginsList.add(OpenAPSAMAPlugin.getPlugin());
|
if (Config.APS) pluginsList.add(OpenAPSAMAPlugin.getPlugin());
|
||||||
pluginsList.add(NSProfilePlugin.getPlugin());
|
pluginsList.add(NSProfilePlugin.getPlugin());
|
||||||
if (Config.OTHERPROFILES) pluginsList.add(SimpleProfilePlugin.getPlugin());
|
if (Config.OTHERPROFILES) pluginsList.add(SimpleProfilePlugin.getPlugin());
|
||||||
if (Config.OTHERPROFILES) pluginsList.add(LocalProfileFragment.getPlugin());
|
if (Config.OTHERPROFILES) pluginsList.add(LocalProfileFragment.getPlugin());
|
||||||
|
@ -150,8 +150,8 @@ public class MainApp extends Application {
|
||||||
pluginsList.add(SourceGlimpPlugin.getPlugin());
|
pluginsList.add(SourceGlimpPlugin.getPlugin());
|
||||||
if (Config.SMSCOMMUNICATORENABLED) pluginsList.add(SmsCommunicatorPlugin.getPlugin());
|
if (Config.SMSCOMMUNICATORENABLED) pluginsList.add(SmsCommunicatorPlugin.getPlugin());
|
||||||
|
|
||||||
pluginsList.add(WearFragment.getPlugin(this));
|
pluginsList.add(WearPlugin.initPlugin(this));
|
||||||
pluginsList.add(StatuslinePlugin.getPlugin(this));
|
pluginsList.add(StatuslinePlugin.initPlugin(this));
|
||||||
pluginsList.add(new PersistentNotificationPlugin(this));
|
pluginsList.add(new PersistentNotificationPlugin(this));
|
||||||
pluginsList.add(NSClientInternalPlugin.getPlugin());
|
pluginsList.add(NSClientInternalPlugin.getPlugin());
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package info.nightscout.androidaps;
|
package info.nightscout.androidaps;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.EditTextPreference;
|
import android.preference.EditTextPreference;
|
||||||
|
@ -15,18 +16,23 @@ import android.text.TextUtils;
|
||||||
import info.nightscout.androidaps.events.EventPreferenceChange;
|
import info.nightscout.androidaps.events.EventPreferenceChange;
|
||||||
import info.nightscout.androidaps.events.EventRefreshGui;
|
import info.nightscout.androidaps.events.EventRefreshGui;
|
||||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
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.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.BluetoothDevicePreference;
|
||||||
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin;
|
import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPlugin;
|
||||||
import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin;
|
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.PumpDanaRS.DanaRSPlugin;
|
||||||
import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin;
|
import info.nightscout.androidaps.plugins.PumpDanaRv2.DanaRv2Plugin;
|
||||||
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;
|
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;
|
||||||
import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin;
|
import info.nightscout.androidaps.plugins.SensitivityAAPS.SensitivityAAPSPlugin;
|
||||||
import info.nightscout.androidaps.plugins.SensitivityOref0.SensitivityOref0Plugin;
|
import info.nightscout.androidaps.plugins.SensitivityOref0.SensitivityOref0Plugin;
|
||||||
import info.nightscout.androidaps.plugins.SensitivityWeightedAverage.SensitivityWeightedAveragePlugin;
|
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.Wear.WearPlugin;
|
||||||
import info.nightscout.androidaps.plugins.XDripStatusline.StatuslinePlugin;
|
import info.nightscout.androidaps.plugins.XDripStatusline.StatuslinePlugin;
|
||||||
import info.nightscout.utils.LocaleHelper;
|
import info.nightscout.utils.LocaleHelper;
|
||||||
|
@ -40,6 +46,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
myPreferenceFragment = new MyPreferenceFragment();
|
myPreferenceFragment = new MyPreferenceFragment();
|
||||||
|
myPreferenceFragment.setCaller(getIntent());
|
||||||
getFragmentManager().beginTransaction().replace(android.R.id.content, myPreferenceFragment).commit();
|
getFragmentManager().beginTransaction().replace(android.R.id.content, myPreferenceFragment).commit();
|
||||||
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
|
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
|
||||||
}
|
}
|
||||||
|
@ -72,12 +79,11 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
||||||
if (pref.getKey().contains("password") || pref.getKey().contains("secret")) {
|
if (pref.getKey().contains("password") || pref.getKey().contains("secret")) {
|
||||||
pref.setSummary("******");
|
pref.setSummary("******");
|
||||||
} else if (pref.getKey().equals(MainApp.sResources.getString(R.string.key_danars_name))) {
|
} 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("")) {
|
} else if (editTextPref.getText() != null && !editTextPref.getText().equals("")) {
|
||||||
((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage());
|
((EditTextPreference) pref).setDialogMessage(editTextPref.getDialogMessage());
|
||||||
pref.setSummary(editTextPref.getText());
|
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));
|
pref.setSummary(MainApp.sResources.getString(R.string.smscommunicator_allowednumbers_summary));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,85 +105,79 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class MyPreferenceFragment extends PreferenceFragment {
|
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
|
@Override
|
||||||
public void onCreate(final Bundle savedInstanceState) {
|
public void onCreate(final Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
if (Config.ALLPREFERENCES) {
|
|
||||||
|
Integer id = caller.getIntExtra("id", -1);
|
||||||
|
|
||||||
|
if (id != -1) {
|
||||||
|
addPreferencesFromResource(id);
|
||||||
|
} else {
|
||||||
|
if (!Config.NSCLIENT) {
|
||||||
addPreferencesFromResource(R.xml.pref_password);
|
addPreferencesFromResource(R.xml.pref_password);
|
||||||
}
|
}
|
||||||
addPreferencesFromResource(R.xml.pref_age);
|
addPreferencesFromResource(R.xml.pref_age);
|
||||||
addPreferencesFromResource(R.xml.pref_language);
|
addPreferencesFromResource(R.xml.pref_language);
|
||||||
if (Config.ALLPREFERENCES) {
|
|
||||||
|
if (!Config.NSCLIENT) {
|
||||||
addPreferencesFromResource(R.xml.pref_quickwizard);
|
addPreferencesFromResource(R.xml.pref_quickwizard);
|
||||||
}
|
}
|
||||||
addPreferencesFromResource(R.xml.pref_careportal);
|
addPreferencesFromResourceIfEnabled(CareportalPlugin.getPlugin(), PluginBase.GENERAL);
|
||||||
if (Config.ALLPREFERENCES) {
|
addPreferencesFromResourceIfEnabled(SafetyPlugin.getPlugin(), PluginBase.CONSTRAINTS);
|
||||||
addPreferencesFromResource(R.xml.pref_treatments);
|
if (Config.APS) {
|
||||||
|
addPreferencesFromResourceIfEnabled(LoopPlugin.getPlugin(), PluginBase.LOOP);
|
||||||
|
addPreferencesFromResourceIfEnabled(OpenAPSMAPlugin.getPlugin(), PluginBase.APS);
|
||||||
|
addPreferencesFromResourceIfEnabled(OpenAPSAMAPlugin.getPlugin(), PluginBase.APS);
|
||||||
}
|
}
|
||||||
if (Config.APS)
|
|
||||||
addPreferencesFromResource(R.xml.pref_closedmode);
|
addPreferencesFromResourceIfEnabled(SensitivityAAPSPlugin.getPlugin(), PluginBase.SENSITIVITY);
|
||||||
if (Config.OPENAPSENABLED) {
|
addPreferencesFromResourceIfEnabled(SensitivityWeightedAveragePlugin.getPlugin(), PluginBase.SENSITIVITY);
|
||||||
addPreferencesFromResource(R.xml.pref_openapsma);
|
addPreferencesFromResourceIfEnabled(SensitivityOref0Plugin.getPlugin(), PluginBase.SENSITIVITY);
|
||||||
if (MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class) != null && MainApp.getSpecificPlugin(OpenAPSAMAPlugin.class).isEnabled(PluginBase.APS))
|
|
||||||
addPreferencesFromResource(R.xml.pref_openapsama);
|
if (!Config.NSCLIENT) {
|
||||||
}
|
|
||||||
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);
|
addPreferencesFromResource(R.xml.pref_profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.DANAR) {
|
if (Config.DANAR) {
|
||||||
DanaRPlugin danaRPlugin = MainApp.getSpecificPlugin(DanaRPlugin.class);
|
addPreferencesFromResourceIfEnabled(DanaRPlugin.getPlugin(), PluginBase.PUMP);
|
||||||
DanaRKoreanPlugin danaRKoreanPlugin = MainApp.getSpecificPlugin(DanaRKoreanPlugin.class);
|
addPreferencesFromResourceIfEnabled(DanaRKoreanPlugin.getPlugin(), PluginBase.PUMP);
|
||||||
DanaRv2Plugin danaRv2Plugin = MainApp.getSpecificPlugin(DanaRv2Plugin.class);
|
addPreferencesFromResourceIfEnabled(DanaRv2Plugin.getPlugin(), PluginBase.PUMP);
|
||||||
DanaRSPlugin danaRSPlugin = MainApp.getSpecificPlugin(DanaRSPlugin.class);
|
addPreferencesFromResourceIfEnabled(DanaRSPlugin.getPlugin(), PluginBase.PUMP);
|
||||||
if (danaRPlugin.isEnabled(PluginBase.PUMP)) {
|
|
||||||
addPreferencesFromResource(R.xml.pref_danar);
|
if (DanaRPlugin.getPlugin().isEnabled(PluginBase.PROFILE)
|
||||||
}
|
|| DanaRKoreanPlugin.getPlugin().isEnabled(PluginBase.PROFILE)
|
||||||
if (danaRKoreanPlugin.isEnabled(PluginBase.PUMP)) {
|
|| DanaRv2Plugin.getPlugin().isEnabled(PluginBase.PROFILE)
|
||||||
addPreferencesFromResource(R.xml.pref_danarkorean);
|
|| DanaRSPlugin.getPlugin().isEnabled(PluginBase.PROFILE)) {
|
||||||
}
|
|
||||||
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);
|
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);
|
addPreferencesFromResourceIfEnabled(VirtualPumpPlugin.getPlugin(), PluginBase.PUMP);
|
||||||
if (nsClientInternalPlugin != null && nsClientInternalPlugin.isEnabled(PluginBase.GENERAL)) {
|
|
||||||
addPreferencesFromResource(R.xml.pref_nsclientinternal);
|
addPreferencesFromResourceIfEnabled(InsulinOrefFreePeakPlugin.getPlugin(), PluginBase.INSULIN);
|
||||||
}
|
|
||||||
if (Config.SMSCOMMUNICATORENABLED)
|
addPreferencesFromResourceIfEnabled(NSClientInternalPlugin.getPlugin(), PluginBase.GENERAL);
|
||||||
addPreferencesFromResource(R.xml.pref_smscommunicator);
|
addPreferencesFromResourceIfEnabled(SmsCommunicatorPlugin.getPlugin(), PluginBase.GENERAL);
|
||||||
if (Config.ALLPREFERENCES) {
|
|
||||||
|
if (!Config.NSCLIENT) {
|
||||||
addPreferencesFromResource(R.xml.pref_others);
|
addPreferencesFromResource(R.xml.pref_others);
|
||||||
}
|
}
|
||||||
addPreferencesFromResource(R.xml.pref_advanced);
|
addPreferencesFromResource(R.xml.pref_advanced);
|
||||||
|
|
||||||
WearPlugin wearPlugin = MainApp.getSpecificPlugin(WearPlugin.class);
|
addPreferencesFromResourceIfEnabled(WearPlugin.getPlugin(), PluginBase.GENERAL);
|
||||||
if (wearPlugin != null && wearPlugin.isEnabled(PluginBase.GENERAL)) {
|
addPreferencesFromResourceIfEnabled(StatuslinePlugin.getPlugin(), PluginBase.GENERAL);
|
||||||
addPreferencesFromResource(R.xml.pref_wear);
|
|
||||||
}
|
|
||||||
|
|
||||||
StatuslinePlugin statuslinePlugin = MainApp.getSpecificPlugin(StatuslinePlugin.class);
|
|
||||||
if (statuslinePlugin != null && statuslinePlugin.isEnabled(PluginBase.GENERAL)) {
|
|
||||||
addPreferencesFromResource(R.xml.pref_xdripstatus);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
initSummary(getPreferenceScreen());
|
initSummary(getPreferenceScreen());
|
||||||
|
|
|
@ -30,4 +30,5 @@ public interface PluginBase {
|
||||||
boolean showInList(int type);
|
boolean showInList(int type);
|
||||||
void setFragmentEnabled(int type, boolean fragmentEnabled);
|
void setFragmentEnabled(int type, boolean fragmentEnabled);
|
||||||
void setFragmentVisible(int type, boolean fragmentVisible);
|
void setFragmentVisible(int type, boolean fragmentVisible);
|
||||||
|
int getPreferencesId();
|
||||||
}
|
}
|
|
@ -74,4 +74,9 @@ public class ActionsPlugin implements PluginBase {
|
||||||
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,6 @@ import info.nightscout.androidaps.plugins.Overview.OverviewFragment;
|
||||||
|
|
||||||
public class CareportalFragment extends SubscriberFragment implements View.OnClickListener {
|
public class CareportalFragment extends SubscriberFragment implements View.OnClickListener {
|
||||||
|
|
||||||
static CareportalPlugin careportalPlugin;
|
|
||||||
|
|
||||||
TextView iage;
|
TextView iage;
|
||||||
TextView cage;
|
TextView cage;
|
||||||
TextView sage;
|
TextView sage;
|
||||||
|
@ -37,13 +35,6 @@ public class CareportalFragment extends SubscriberFragment implements View.OnCli
|
||||||
LinearLayout butonsLayout;
|
LinearLayout butonsLayout;
|
||||||
View noProfileView;
|
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
|
// 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 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();
|
public static final OptionsToShow SNACKBOLUS = new OptionsToShow(R.id.careportal_snackbolus, R.string.careportal_snackbolus).date().bg().insulin().carbs().prebolus();
|
||||||
|
|
|
@ -10,6 +10,15 @@ public class CareportalPlugin implements PluginBase {
|
||||||
private boolean fragmentEnabled = true;
|
private boolean fragmentEnabled = true;
|
||||||
private boolean fragmentVisible = true;
|
private boolean fragmentVisible = true;
|
||||||
|
|
||||||
|
static CareportalPlugin careportalPlugin;
|
||||||
|
|
||||||
|
static public CareportalPlugin getPlugin() {
|
||||||
|
if (careportalPlugin == null) {
|
||||||
|
careportalPlugin = new CareportalPlugin();
|
||||||
|
}
|
||||||
|
return careportalPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return PluginBase.GENERAL;
|
return PluginBase.GENERAL;
|
||||||
|
@ -71,4 +80,9 @@ public class CareportalPlugin implements PluginBase {
|
||||||
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_careportal;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package info.nightscout.androidaps.plugins.ConfigBuilder;
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
|
@ -10,6 +11,7 @@ import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.ListAdapter;
|
import android.widget.ListAdapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
@ -22,6 +24,7 @@ import com.crashlytics.android.answers.CustomEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
|
import info.nightscout.androidaps.PreferencesActivity;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.androidaps.events.EventConfigBuilderChange;
|
import info.nightscout.androidaps.events.EventConfigBuilderChange;
|
||||||
import info.nightscout.androidaps.events.EventRefreshGui;
|
import info.nightscout.androidaps.events.EventRefreshGui;
|
||||||
|
@ -194,7 +197,7 @@ public class ConfigBuilderFragment extends Fragment {
|
||||||
public PluginCustomAdapter(Context context, int textViewResourceId,
|
public PluginCustomAdapter(Context context, int textViewResourceId,
|
||||||
ArrayList<PluginBase> pluginList, int type) {
|
ArrayList<PluginBase> pluginList, int type) {
|
||||||
super(context, textViewResourceId, pluginList);
|
super(context, textViewResourceId, pluginList);
|
||||||
this.pluginList = new ArrayList<PluginBase>();
|
this.pluginList = new ArrayList<>();
|
||||||
this.pluginList.addAll(pluginList);
|
this.pluginList.addAll(pluginList);
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
@ -203,12 +206,14 @@ public class ConfigBuilderFragment extends Fragment {
|
||||||
TextView name;
|
TextView name;
|
||||||
CheckBox checkboxEnabled;
|
CheckBox checkboxEnabled;
|
||||||
CheckBox checkboxVisible;
|
CheckBox checkboxVisible;
|
||||||
|
ImageView settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View view, ViewGroup parent) {
|
public View getView(int position, View view, ViewGroup parent) {
|
||||||
|
|
||||||
PluginViewHolder holder = null;
|
PluginViewHolder holder = null;
|
||||||
|
PluginBase plugin = pluginList.get(position);
|
||||||
|
|
||||||
if (view == null) {
|
if (view == null) {
|
||||||
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.configbuilder_simpleitem, 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.name = (TextView) view.findViewById(R.id.configbuilder_simpleitem_name);
|
||||||
holder.checkboxEnabled = (CheckBox) view.findViewById(R.id.configbuilder_simpleitem_checkboxenabled);
|
holder.checkboxEnabled = (CheckBox) view.findViewById(R.id.configbuilder_simpleitem_checkboxenabled);
|
||||||
holder.checkboxVisible = (CheckBox) view.findViewById(R.id.configbuilder_simpleitem_checkboxvisible);
|
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);
|
view.setTag(holder);
|
||||||
|
|
||||||
holder.checkboxEnabled.setOnClickListener(new View.OnClickListener() {
|
holder.checkboxEnabled.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -244,17 +256,31 @@ public class ConfigBuilderFragment extends Fragment {
|
||||||
getPlugin().logPluginStatus();
|
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 {
|
} else {
|
||||||
holder = (PluginViewHolder) view.getTag();
|
holder = (PluginViewHolder) view.getTag();
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginBase plugin = pluginList.get(position);
|
|
||||||
holder.name.setText(plugin.getName());
|
holder.name.setText(plugin.getName());
|
||||||
holder.checkboxEnabled.setChecked(plugin.isEnabled(type));
|
holder.checkboxEnabled.setChecked(plugin.isEnabled(type));
|
||||||
holder.checkboxVisible.setChecked(plugin.isVisibleInTabs(type));
|
holder.checkboxVisible.setChecked(plugin.isVisibleInTabs(type));
|
||||||
holder.name.setTag(plugin);
|
holder.name.setTag(plugin);
|
||||||
holder.checkboxEnabled.setTag(plugin);
|
holder.checkboxEnabled.setTag(plugin);
|
||||||
holder.checkboxVisible.setTag(plugin);
|
holder.checkboxVisible.setTag(plugin);
|
||||||
|
holder.settings.setTag(plugin);
|
||||||
|
|
||||||
if (!plugin.canBeHidden(type)) {
|
if (!plugin.canBeHidden(type)) {
|
||||||
holder.checkboxEnabled.setEnabled(false);
|
holder.checkboxEnabled.setEnabled(false);
|
||||||
|
|
|
@ -146,6 +146,11 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
// Always visible
|
// Always visible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
pluginList = MainApp.getPluginsList();
|
pluginList = MainApp.getPluginsList();
|
||||||
loadSettings();
|
loadSettings();
|
||||||
|
@ -301,7 +306,7 @@ public class ConfigBuilderPlugin implements PluginBase, PumpInterface, Constrain
|
||||||
pluginsInCategory = MainApp.getSpecificPluginsList(PluginBase.PUMP);
|
pluginsInCategory = MainApp.getSpecificPluginsList(PluginBase.PUMP);
|
||||||
activePump = (PumpInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.PUMP);
|
activePump = (PumpInterface) getTheOneEnabledInArray(pluginsInCategory, PluginBase.PUMP);
|
||||||
if (activePump == null)
|
if (activePump == null)
|
||||||
activePump = VirtualPumpPlugin.getInstance(); // for NSClient build
|
activePump = VirtualPumpPlugin.getPlugin(); // for NSClient build
|
||||||
if (Config.logConfigBuilder)
|
if (Config.logConfigBuilder)
|
||||||
log.debug("Selected pump interface: " + ((PluginBase) activePump).getName());
|
log.debug("Selected pump interface: " + ((PluginBase) activePump).getName());
|
||||||
for (PluginBase p : pluginsInCategory) {
|
for (PluginBase p : pluginsInCategory) {
|
||||||
|
|
|
@ -104,6 +104,11 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface {
|
||||||
if (type == CONSTRAINTS) this.fragmentVisible = fragmentVisible;
|
if (type == CONSTRAINTS) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
class Objective {
|
class Objective {
|
||||||
Integer num;
|
Integer num;
|
||||||
String objective;
|
String objective;
|
||||||
|
|
|
@ -86,6 +86,11 @@ public class SafetyPlugin implements PluginBase, ConstraintsInterface {
|
||||||
public void setFragmentVisible(int type, boolean fragmentVisible) {
|
public void setFragmentVisible(int type, boolean fragmentVisible) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_safety;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isLoopEnabled() {
|
public boolean isLoopEnabled() {
|
||||||
return MainApp.getConfigBuilder().getPumpDescription().isTempBasalCapable;
|
return MainApp.getConfigBuilder().getPumpDescription().isTempBasalCapable;
|
||||||
|
|
|
@ -80,6 +80,11 @@ public class InsulinFastactingPlugin implements PluginBase, InsulinInterface {
|
||||||
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Insulin interface
|
// Insulin interface
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
|
|
@ -80,6 +80,11 @@ public class InsulinFastactingProlongedPlugin implements PluginBase, InsulinInte
|
||||||
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
// Insulin interface
|
// Insulin interface
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
|
|
@ -68,6 +68,11 @@ public class InsulinOrefFreePeakPlugin extends InsulinOrefBasePlugin {
|
||||||
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_insulinoreffreepeak;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
int getPeak() {
|
int getPeak() {
|
||||||
return SP.getInt(R.string.key_insulin_oref_peak, DEFAULT_PEAK);
|
return SP.getInt(R.string.key_insulin_oref_peak, DEFAULT_PEAK);
|
||||||
|
|
|
@ -67,6 +67,11 @@ public class InsulinOrefRapidActingPlugin extends InsulinOrefBasePlugin {
|
||||||
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
int getPeak() {
|
int getPeak() {
|
||||||
return PEAK;
|
return PEAK;
|
||||||
|
|
|
@ -67,6 +67,11 @@ public class InsulinOrefUltraRapidActingPlugin extends InsulinOrefBasePlugin {
|
||||||
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
if (type == INSULIN) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
int getPeak() {
|
int getPeak() {
|
||||||
return PEAK;
|
return PEAK;
|
||||||
|
|
|
@ -126,6 +126,11 @@ public class IobCobCalculatorPlugin implements PluginBase {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
IobCobCalculatorPlugin() {
|
IobCobCalculatorPlugin() {
|
||||||
MainApp.bus().register(this);
|
MainApp.bus().register(this);
|
||||||
if (sHandlerThread == null) {
|
if (sHandlerThread == null) {
|
||||||
|
|
|
@ -148,6 +148,11 @@ public class LoopPlugin implements PluginBase {
|
||||||
if (type == LOOP) this.fragmentVisible = fragmentVisible;
|
if (type == LOOP) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_closedmode;
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onStatusEvent(final EventTreatmentChange ev) {
|
public void onStatusEvent(final EventTreatmentChange ev) {
|
||||||
invoke("EventTreatmentChange", true);
|
invoke("EventTreatmentChange", true);
|
||||||
|
|
|
@ -135,6 +135,11 @@ public class NSClientInternalPlugin implements PluginBase {
|
||||||
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_nsclientinternal;
|
||||||
|
}
|
||||||
|
|
||||||
private ServiceConnection mConnection = new ServiceConnection() {
|
private ServiceConnection mConnection = new ServiceConnection() {
|
||||||
|
|
||||||
public void onServiceDisconnected(ComponentName name) {
|
public void onServiceDisconnected(ComponentName name) {
|
||||||
|
|
|
@ -103,6 +103,11 @@ public class OpenAPSAMAPlugin implements PluginBase, APSInterface {
|
||||||
if (type == APS) this.fragmentVisible = fragmentVisible;
|
if (type == APS) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_openapsama;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFragmentEnabled(int type, boolean fragmentEnabled) {
|
public void setFragmentEnabled(int type, boolean fragmentEnabled) {
|
||||||
if (type == APS) this.fragmentEnabled = fragmentEnabled;
|
if (type == APS) this.fragmentEnabled = fragmentEnabled;
|
||||||
|
|
|
@ -101,6 +101,11 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
|
||||||
if (type == APS) this.fragmentVisible = fragmentVisible;
|
if (type == APS) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_openapsma;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFragmentEnabled(int type, boolean fragmentEnabled) {
|
public void setFragmentEnabled(int type, boolean fragmentEnabled) {
|
||||||
if (type == APS) this.fragmentEnabled = fragmentEnabled;
|
if (type == APS) this.fragmentEnabled = fragmentEnabled;
|
||||||
|
|
|
@ -103,6 +103,11 @@ public class OverviewPlugin implements PluginBase {
|
||||||
// Always visible
|
// Always visible
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return PluginBase.GENERAL;
|
return PluginBase.GENERAL;
|
||||||
|
|
|
@ -205,6 +205,11 @@ public class PersistentNotificationPlugin implements PluginBase {
|
||||||
//no visible fragment
|
//no visible fragment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
private String deltastring(double deltaMGDL, double deltaMMOL, String units) {
|
private String deltastring(double deltaMGDL, double deltaMMOL, String units) {
|
||||||
String deltastring = "";
|
String deltastring = "";
|
||||||
if (deltaMGDL >= 0) {
|
if (deltaMGDL >= 0) {
|
||||||
|
|
|
@ -119,6 +119,11 @@ public class CircadianPercentageProfilePlugin implements PluginBase, ProfileInte
|
||||||
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
void storeSettings() {
|
void storeSettings() {
|
||||||
if (Config.logPrefsChange)
|
if (Config.logPrefsChange)
|
||||||
log.debug("Storing settings");
|
log.debug("Storing settings");
|
||||||
|
|
|
@ -108,6 +108,11 @@ public class LocalProfilePlugin implements PluginBase, ProfileInterface {
|
||||||
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
public void storeSettings() {
|
public void storeSettings() {
|
||||||
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
|
||||||
SharedPreferences.Editor editor = settings.edit();
|
SharedPreferences.Editor editor = settings.edit();
|
||||||
|
|
|
@ -104,6 +104,11 @@ public class NSProfilePlugin implements PluginBase, ProfileInterface {
|
||||||
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return PluginBase.PROFILE;
|
return PluginBase.PROFILE;
|
||||||
|
|
|
@ -111,6 +111,11 @@ public class SimpleProfilePlugin implements PluginBase, ProfileInterface {
|
||||||
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
if (type == PROFILE) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
public void storeSettings() {
|
public void storeSettings() {
|
||||||
if (Config.logPrefsChange)
|
if (Config.logPrefsChange)
|
||||||
log.debug("Storing settings");
|
log.debug("Storing settings");
|
||||||
|
|
|
@ -217,6 +217,11 @@ public class DanaRPlugin implements PluginBase, PumpInterface, DanaRInterface, C
|
||||||
fragmentPumpVisible = fragmentVisible;
|
fragmentPumpVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_danar;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFakingTempsByExtendedBoluses() {
|
public boolean isFakingTempsByExtendedBoluses() {
|
||||||
return useExtendedBoluses;
|
return useExtendedBoluses;
|
||||||
|
|
|
@ -219,6 +219,11 @@ public class DanaRKoreanPlugin implements PluginBase, PumpInterface, DanaRInterf
|
||||||
this.fragmentPumpVisible = fragmentVisible;
|
this.fragmentPumpVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_danarkorean;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFakingTempsByExtendedBoluses() {
|
public boolean isFakingTempsByExtendedBoluses() {
|
||||||
return useExtendedBoluses;
|
return useExtendedBoluses;
|
||||||
|
|
|
@ -137,6 +137,11 @@ public class DanaRSPlugin implements PluginBase, PumpInterface, DanaRInterface,
|
||||||
this.fragmentPumpVisible = fragmentVisible;
|
this.fragmentPumpVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_danars;
|
||||||
|
}
|
||||||
|
|
||||||
static boolean fragmentPumpEnabled = false;
|
static boolean fragmentPumpEnabled = false;
|
||||||
static boolean fragmentProfileEnabled = false;
|
static boolean fragmentProfileEnabled = false;
|
||||||
static boolean fragmentPumpVisible = false;
|
static boolean fragmentPumpVisible = false;
|
||||||
|
|
|
@ -204,6 +204,11 @@ public class DanaRv2Plugin implements PluginBase, PumpInterface, DanaRInterface,
|
||||||
this.fragmentPumpVisible = fragmentVisible;
|
this.fragmentPumpVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_danarv2;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isFakingTempsByExtendedBoluses() {
|
public boolean isFakingTempsByExtendedBoluses() {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -99,6 +99,11 @@ public class MDIPlugin implements PluginBase, PumpInterface {
|
||||||
if (type == PUMP) this.fragmentVisible = fragmentVisible;
|
if (type == PUMP) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return PluginBase.PUMP;
|
return PluginBase.PUMP;
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class VirtualPumpFragment extends SubscriberFragment {
|
||||||
activity.runOnUiThread(new Runnable() {
|
activity.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
VirtualPumpPlugin virtualPump = VirtualPumpPlugin.getInstance();
|
VirtualPumpPlugin virtualPump = VirtualPumpPlugin.getPlugin();
|
||||||
basaBasalRateView.setText(virtualPump.getBaseBasalRate() + "U");
|
basaBasalRateView.setText(virtualPump.getBaseBasalRate() + "U");
|
||||||
if (MainApp.getConfigBuilder().isTempBasalInProgress()) {
|
if (MainApp.getConfigBuilder().isTempBasalInProgress()) {
|
||||||
tempBasalView.setText(MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()).toStringFull());
|
tempBasalView.setText(MainApp.getConfigBuilder().getTempBasalFromHistory(System.currentTimeMillis()).toStringFull());
|
||||||
|
|
|
@ -64,12 +64,12 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
||||||
return fromNSAreCommingFakedExtendedBoluses;
|
return fromNSAreCommingFakedExtendedBoluses;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static VirtualPumpPlugin instance = null;
|
private static VirtualPumpPlugin plugin = null;
|
||||||
public static VirtualPumpPlugin getInstance() {
|
public static VirtualPumpPlugin getPlugin() {
|
||||||
loadFakingStatus();
|
loadFakingStatus();
|
||||||
if (instance == null)
|
if (plugin == null)
|
||||||
instance = new VirtualPumpPlugin();
|
plugin = new VirtualPumpPlugin();
|
||||||
return instance;
|
return plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
private VirtualPumpPlugin() {
|
private VirtualPumpPlugin() {
|
||||||
|
@ -154,6 +154,11 @@ public class VirtualPumpPlugin implements PluginBase, PumpInterface {
|
||||||
if (type == PUMP) this.fragmentVisible = fragmentVisible;
|
if (type == PUMP) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_virtualpump;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return PluginBase.PUMP;
|
return PluginBase.PUMP;
|
||||||
|
|
|
@ -96,6 +96,11 @@ public class SensitivityAAPSPlugin implements PluginBase, SensitivityInterface{
|
||||||
if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible;
|
if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_absorption_aaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AutosensResult detectSensitivity(long fromTime, long toTime) {
|
public AutosensResult detectSensitivity(long fromTime, long toTime) {
|
||||||
|
|
|
@ -94,6 +94,11 @@ public class SensitivityOref0Plugin implements PluginBase, SensitivityInterface
|
||||||
if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible;
|
if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_absorption_oref0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AutosensResult detectSensitivity(long fromTime, long toTime) {
|
public AutosensResult detectSensitivity(long fromTime, long toTime) {
|
||||||
|
|
|
@ -93,6 +93,11 @@ public class SensitivityWeightedAveragePlugin implements PluginBase, Sensitivity
|
||||||
if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible;
|
if (type == SENSITIVITY) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_absorption_aaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AutosensResult detectSensitivity(long fromTime, long toTime) {
|
public AutosensResult detectSensitivity(long fromTime, long toTime) {
|
||||||
|
|
|
@ -186,6 +186,11 @@ public class SmsCommunicatorPlugin implements PluginBase {
|
||||||
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_smscommunicator;
|
||||||
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void processSettings(final EventPreferenceChange ev) {
|
public void processSettings(final EventPreferenceChange ev) {
|
||||||
if (ev == null || ev.isChanged(R.string.key_smscommunicator_allowednumbers)) {
|
if (ev == null || ev.isChanged(R.string.key_smscommunicator_allowednumbers)) {
|
||||||
|
|
|
@ -75,5 +75,10 @@ public class SourceGlimpPlugin implements PluginBase, BgSourceInterface {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,5 +75,10 @@ public class SourceMM640gPlugin implements PluginBase, BgSourceInterface {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,5 +77,10 @@ public class SourceNSClientPlugin implements PluginBase, BgSourceInterface {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,5 +75,10 @@ public class SourceXdripPlugin implements PluginBase, BgSourceInterface {
|
||||||
public void setFragmentVisible(int type, boolean fragmentVisible) {
|
public void setFragmentVisible(int type, boolean fragmentVisible) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,11 @@ public class TreatmentsPlugin implements PluginBase, TreatmentsInterface {
|
||||||
if (type == TREATMENT) this.fragmentVisible = fragmentVisible;
|
if (type == TREATMENT) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getType() {
|
public int getType() {
|
||||||
return PluginBase.TREATMENT;
|
return PluginBase.TREATMENT;
|
||||||
|
|
|
@ -324,7 +324,7 @@ public class ActionStringHandler {
|
||||||
|
|
||||||
|
|
||||||
// send result
|
// send result
|
||||||
WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation(rTitle, rMessage, rAction);
|
WearPlugin.getPlugin().requestActionConfirmation(rTitle, rMessage, rAction);
|
||||||
lastSentTimestamp = System.currentTimeMillis();
|
lastSentTimestamp = System.currentTimeMillis();
|
||||||
lastConfirmActionString = rAction;
|
lastConfirmActionString = rAction;
|
||||||
}
|
}
|
||||||
|
@ -596,7 +596,7 @@ public class ActionStringHandler {
|
||||||
msg += MainApp.sResources.getString(R.string.cpp_valuesnotstored);
|
msg += MainApp.sResources.getString(R.string.cpp_valuesnotstored);
|
||||||
String rTitle = "STATUS";
|
String rTitle = "STATUS";
|
||||||
String rAction = "statusmessage";
|
String rAction = "statusmessage";
|
||||||
WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation(rTitle, msg, rAction);
|
WearPlugin.getPlugin().requestActionConfirmation(rTitle, msg, rAction);
|
||||||
lastSentTimestamp = System.currentTimeMillis();
|
lastSentTimestamp = System.currentTimeMillis();
|
||||||
lastConfirmActionString = rAction;
|
lastConfirmActionString = rAction;
|
||||||
return;
|
return;
|
||||||
|
@ -667,14 +667,14 @@ public class ActionStringHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized static void sendError(String errormessage) {
|
private synchronized static void sendError(String errormessage) {
|
||||||
WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation("ERROR", errormessage, "error");
|
WearPlugin.getPlugin().requestActionConfirmation("ERROR", errormessage, "error");
|
||||||
lastSentTimestamp = System.currentTimeMillis();
|
lastSentTimestamp = System.currentTimeMillis();
|
||||||
lastConfirmActionString = null;
|
lastConfirmActionString = null;
|
||||||
lastBolusWizard = null;
|
lastBolusWizard = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized static void sendStatusmessage(String title, String message) {
|
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();
|
lastSentTimestamp = System.currentTimeMillis();
|
||||||
lastConfirmActionString = null;
|
lastConfirmActionString = null;
|
||||||
lastBolusWizard = null;
|
lastBolusWizard = null;
|
||||||
|
@ -682,7 +682,7 @@ public class ActionStringHandler {
|
||||||
|
|
||||||
public synchronized static void expectNotificationAction(String message, int id) {
|
public synchronized static void expectNotificationAction(String message, int id) {
|
||||||
String actionstring = "dismissoverviewnotification " + id;
|
String actionstring = "dismissoverviewnotification " + id;
|
||||||
WearFragment.getPlugin(MainApp.instance()).requestActionConfirmation("DISMISS", message, actionstring);
|
WearPlugin.getPlugin().requestActionConfirmation("DISMISS", message, actionstring);
|
||||||
lastSentTimestamp = System.currentTimeMillis();
|
lastSentTimestamp = System.currentTimeMillis();
|
||||||
lastConfirmActionString = actionstring;
|
lastConfirmActionString = actionstring;
|
||||||
lastBolusWizard = null;
|
lastBolusWizard = null;
|
||||||
|
|
|
@ -15,17 +15,6 @@ import info.nightscout.androidaps.R;
|
||||||
|
|
||||||
public class WearFragment extends Fragment {
|
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
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||||
Bundle savedInstanceState) {
|
Bundle savedInstanceState) {
|
||||||
|
@ -34,14 +23,14 @@ public class WearFragment extends Fragment {
|
||||||
view.findViewById(R.id.wear_resend).setOnClickListener(new View.OnClickListener() {
|
view.findViewById(R.id.wear_resend).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
getPlugin(getContext()).resendDataToWatch();
|
WearPlugin.getPlugin().resendDataToWatch();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
view.findViewById(R.id.wear_opensettings).setOnClickListener(new View.OnClickListener() {
|
view.findViewById(R.id.wear_opensettings).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
getPlugin(getContext()).openSettings();
|
WearPlugin.getPlugin().openSettings();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,20 @@ public class WearPlugin implements PluginBase {
|
||||||
private static WatchUpdaterService watchUS;
|
private static WatchUpdaterService watchUS;
|
||||||
private final Context ctx;
|
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) {
|
WearPlugin(Context ctx) {
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
MainApp.bus().register(this);
|
MainApp.bus().register(this);
|
||||||
|
@ -105,6 +119,11 @@ public class WearPlugin implements PluginBase {
|
||||||
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
if (type == GENERAL) this.fragmentVisible = fragmentVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_wear;
|
||||||
|
}
|
||||||
|
|
||||||
private void sendDataToWatch(boolean status, boolean basals, boolean bgValue) {
|
private void sendDataToWatch(boolean status, boolean basals, boolean bgValue) {
|
||||||
if (isEnabled(getType())) { //only start service when this plugin is enabled
|
if (isEnabled(getType())) { //only start service when this plugin is enabled
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,11 @@ public class StatuslinePlugin implements PluginBase {
|
||||||
|
|
||||||
private static StatuslinePlugin statuslinePlugin;
|
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) {
|
if (statuslinePlugin == null) {
|
||||||
statuslinePlugin = new StatuslinePlugin(ctx);
|
statuslinePlugin = new StatuslinePlugin(ctx);
|
||||||
|
@ -138,6 +142,11 @@ public class StatuslinePlugin implements PluginBase {
|
||||||
// do nothing, no gui
|
// do nothing, no gui
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getPreferencesId() {
|
||||||
|
return R.xml.pref_xdripstatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void sendStatus() {
|
private void sendStatus() {
|
||||||
|
|
||||||
|
|
BIN
app/src/main/res/drawable-hdpi-v11/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-hdpi-v11/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 526 B |
BIN
app/src/main/res/drawable-hdpi-v9/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-hdpi-v9/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 580 B |
BIN
app/src/main/res/drawable-hdpi/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-hdpi/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 980 B |
BIN
app/src/main/res/drawable-mdpi-v11/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-mdpi-v11/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 357 B |
BIN
app/src/main/res/drawable-mdpi-v9/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-mdpi-v9/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 395 B |
BIN
app/src/main/res/drawable-mdpi/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-mdpi/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 669 B |
BIN
app/src/main/res/drawable-xhdpi-v11/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-xhdpi-v11/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 688 B |
BIN
app/src/main/res/drawable-xhdpi-v9/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-xhdpi-v9/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 756 B |
BIN
app/src/main/res/drawable-xhdpi/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi-v11/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi-v11/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1 KiB |
BIN
app/src/main/res/drawable-xxhdpi-v9/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi-v9/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ic_settings.png
Normal file
BIN
app/src/main/res/drawable-xxhdpi/ic_settings.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 862 B |
|
@ -1,6 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
@ -20,6 +21,16 @@
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="ConfigBuilder plugin text" />
|
android:text="ConfigBuilder plugin text" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/configbuilder_simpleitem_settings"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:focusable="false"
|
||||||
|
android:focusableInTouchMode="false"
|
||||||
|
app:srcCompat="@drawable/ic_settings" />
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/configbuilder_simpleitem_checkboxvisible"
|
android:id="@+id/configbuilder_simpleitem_checkboxvisible"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -5,6 +5,18 @@
|
||||||
android:key="openapsama"
|
android:key="openapsama"
|
||||||
android:title="@string/openapsama">
|
android:title="@string/openapsama">
|
||||||
|
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue="1"
|
||||||
|
android:key="openapsma_max_basal"
|
||||||
|
android:numeric="decimal"
|
||||||
|
android:dialogMessage="@string/openapsma_maxbasal_summary"
|
||||||
|
android:title="@string/openapsma_maxbasal_title" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue="1.5"
|
||||||
|
android:key="openapsma_max_iob"
|
||||||
|
android:numeric="decimal"
|
||||||
|
android:dialogMessage="@string/openapsma_maxiob_summary"
|
||||||
|
android:title="@string/openapsma_maxiob_title" />
|
||||||
<SwitchPreference
|
<SwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="openapsama_useautosens"
|
android:key="openapsama_useautosens"
|
||||||
|
|
Loading…
Add table
Reference in a new issue