SW add more texts
This commit is contained in:
parent
c723deaf02
commit
4fa24fb009
3 changed files with 50 additions and 12 deletions
|
@ -62,13 +62,15 @@ public class BLEScanActivity extends AppCompatActivity {
|
|||
super.onResume();
|
||||
|
||||
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();
|
||||
|
||||
if (mBluetoothLeScanner == null) {
|
||||
mBluetoothAdapter.enable();
|
||||
if (mBluetoothAdapter != null) {
|
||||
mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();
|
||||
|
||||
if (mBluetoothLeScanner == null) {
|
||||
mBluetoothAdapter.enable();
|
||||
mBluetoothLeScanner = mBluetoothAdapter.getBluetoothLeScanner();
|
||||
}
|
||||
startScan();
|
||||
}
|
||||
startScan();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,11 +81,13 @@ public class BLEScanActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private void startScan() {
|
||||
mBluetoothLeScanner.startScan(mBleScanCallback);
|
||||
if (mBluetoothLeScanner != null)
|
||||
mBluetoothLeScanner.startScan(mBleScanCallback);
|
||||
}
|
||||
|
||||
private void stopScan() {
|
||||
mBluetoothLeScanner.stopScan(mBleScanCallback);
|
||||
if (mBluetoothLeScanner != null)
|
||||
mBluetoothLeScanner.stopScan(mBleScanCallback);
|
||||
}
|
||||
|
||||
private void addBleDevice(BluetoothDevice device) {
|
||||
|
|
|
@ -154,11 +154,15 @@ public class SWDefinition {
|
|||
.add(new SWScreen(R.string.configbuilder_insulin)
|
||||
.skippable(false)
|
||||
.add(new SWInfotext()
|
||||
.label(MainApp.gs(R.string.fastactinginsulincomment)+" = "+MainApp.gs(R.string.rapid_acting_oref)))
|
||||
.label(MainApp.gs(R.string.fastactinginsulincomment) + " = " + MainApp.gs(R.string.rapid_acting_oref)))
|
||||
.add(new SWInfotext()
|
||||
.label(MainApp.gs(R.string.ultrafastactinginsulincomment)+" = "+MainApp.gs(R.string.ultrarapid_oref)))
|
||||
.label(MainApp.gs(R.string.ultrafastactinginsulincomment) + " = " + MainApp.gs(R.string.ultrarapid_oref)))
|
||||
.add(new SWInfotext()
|
||||
.label(MainApp.gs(R.string.free_peak_oref_description)+" = "+MainApp.gs(R.string.free_peak_oref)))
|
||||
.label(MainApp.gs(R.string.free_peak_oref_description) + " = " + MainApp.gs(R.string.free_peak_oref)))
|
||||
.add(new SWBreak())
|
||||
.add(new SWInfotext()
|
||||
.label(R.string.diawarning))
|
||||
.add(new SWBreak())
|
||||
.add(new SWPlugin()
|
||||
.option(PluginType.INSULIN)
|
||||
.label(R.string.configbuilder_insulin))
|
||||
|
@ -171,10 +175,25 @@ public class SWDefinition {
|
|||
.add(new SWPlugin()
|
||||
.option(PluginType.BGSOURCE)
|
||||
.label(R.string.configbuilder_bgsource))
|
||||
.add(new SWBreak())
|
||||
.add(new SWButton()
|
||||
.text(R.string.bgsourcesetup)
|
||||
.action(() -> {
|
||||
final PluginBase plugin = (PluginBase) MainApp.getConfigBuilder().getActiveBgSource();
|
||||
PasswordProtection.QueryPassword(activity, R.string.settings_password, "settings_password", () -> {
|
||||
Intent i = new Intent(activity, PreferencesActivity.class);
|
||||
i.putExtra("id", plugin.getPreferencesId());
|
||||
activity.startActivity(i);
|
||||
}, null);
|
||||
})
|
||||
.visibility(() -> MainApp.getConfigBuilder().getActiveBgSource()!= null && ((PluginBase) MainApp.getConfigBuilder().getActiveBgSource()).getPreferencesId() > 0))
|
||||
.validator(() -> MainApp.getConfigBuilder().getActiveBgSource() != null)
|
||||
)
|
||||
.add(new SWScreen(R.string.configbuilder_profile)
|
||||
.skippable(false)
|
||||
.add(new SWInfotext()
|
||||
.label(R.string.setupwizard_profile_description))
|
||||
.add(new SWBreak())
|
||||
.add(new SWPlugin()
|
||||
.option(PluginType.PROFILE)
|
||||
.label(R.string.configbuilder_profile))
|
||||
|
@ -251,6 +270,12 @@ public class SWDefinition {
|
|||
)
|
||||
.add(new SWScreen(R.string.configbuilder_aps)
|
||||
.skippable(false)
|
||||
.add(new SWInfotext()
|
||||
.label(R.string.setupwizard_aps_description))
|
||||
.add(new SWBreak())
|
||||
.add(new SWHtmlLink()
|
||||
.label("https://openaps.readthedocs.io/en/latest/"))
|
||||
.add(new SWBreak())
|
||||
.add(new SWPlugin()
|
||||
.option(PluginType.APS)
|
||||
.label(R.string.configbuilder_aps))
|
||||
|
@ -323,12 +348,16 @@ public class SWDefinition {
|
|||
ConfigBuilderPlugin.getPlugin().storeSettings("SetupWizard");
|
||||
MainApp.bus().post(new EventConfigBuilderChange());
|
||||
MainApp.bus().post(new EventSWUpdate(true));
|
||||
}))
|
||||
})
|
||||
.visibility(() -> !ObjectivesPlugin.getPlugin().isFragmentVisible()))
|
||||
.validator(() -> ObjectivesPlugin.getPlugin().isEnabled(PluginType.CONSTRAINTS))
|
||||
.visibility(() -> !ObjectivesPlugin.getPlugin().isFragmentVisible())
|
||||
)
|
||||
.add(new SWScreen(R.string.objectives)
|
||||
.skippable(false)
|
||||
.add(new SWInfotext()
|
||||
.label(R.string.startobjective))
|
||||
.add(new SWBreak())
|
||||
.add(new SWFragment(this)
|
||||
.add(new ObjectivesFragment()))
|
||||
.validator(() -> ObjectivesPlugin.getPlugin().objectives.get(0).isStarted())
|
||||
|
|
|
@ -1074,5 +1074,10 @@
|
|||
<string name="sensitivitysetup">Configure Sensitivity plugin</string>
|
||||
<string name="setupwizard_sensitivity_description">Sensitivity plugin is used for sensitivity detection and COB calculation. For more info visit:</string>
|
||||
<string name="setupwizard_sensitivity_url">https://github.com/MilosKozak/AndroidAPS/wiki/Sensitivity-detection-and-COB</string>
|
||||
<string name="nsclientinfotext">NSClient handles connection to Nightscout. You can skip this part now but you will not be able to pass objectives.</string>
|
||||
<string name="nsclientinfotext">NSClient handles connection to Nightscout. You can skip this part now but you will not be able to pass objectives until you setup it.</string>
|
||||
<string name="diawarning">Please remember: new insulin profiles require DIA at least 5h. DIA 5-6h on new profile is equal to DIA 3h on old insulin profiles.</string>
|
||||
<string name="bgsourcesetup">Configure BG source</string>
|
||||
<string name="setupwizard_profile_description">Please select source of profile. If patient is a child you should use NS profile. If there is nobody following you on Nightscout you will probably prefer Local profile. Please remember that you are only selecting the profile source. To use it you must activate it by executing \"Profile switch\"</string>
|
||||
<string name="setupwizard_aps_description">Select one from availables algorithms. They are sorted from oldest to newest. Newer algorithm is usualy more powerfull and more aggresive. Thus if you are new looper you may probably start with AMA and not with latest one. Do not forget to read the OpenAPS documentation and configure it before use.</string>
|
||||
<string name="startobjective">Start your first objective</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue