Merge pull request #1084 from TebbeUbben/dev

Config builder styling
This commit is contained in:
Milos Kozak 2018-06-09 11:39:16 +02:00 committed by GitHub
commit 6344e88550
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 744 additions and 561 deletions

View file

@ -57,6 +57,11 @@ public abstract class PluginBase {
return getName();
}
public String getDescription() {
if (pluginDescription.description == -1) return null;
else return MainApp.gs(pluginDescription.description);
}
public PluginType getType() {
return pluginDescription.mainType;
}

View file

@ -9,6 +9,7 @@ public class PluginDescription {
boolean showInList = true;
int pluginName = -1;
int shortName = -1;
int description = -1;
int preferencesId = -1;
int advancedPreferencesId = -1;
public boolean enableByDefault = false;
@ -74,6 +75,11 @@ public class PluginDescription {
return this;
}
public PluginDescription description(int description) {
this.description = description;
return this;
}
public String getFragmentClass() {
return fragmentClass;
}

View file

@ -17,6 +17,7 @@ public class ActionsPlugin extends PluginBase {
.fragmentClass(ActionsFragment.class.getName())
.pluginName(R.string.actions)
.shortName(R.string.actions_shortname)
.description(R.string.description_actions)
);
}
}

View file

@ -25,6 +25,7 @@ public class CareportalPlugin extends PluginBase {
.shortName(R.string.careportal_shortname)
.visibleByDefault(true)
.enableByDefault(true)
.description(R.string.description_careportal)
);
}

View file

@ -21,7 +21,7 @@ abstract public class SubscriberFragment extends Fragment {
updateGUI();
}
@Override public void onDestroyView() {
@Override public synchronized void onDestroyView() {
super.onDestroyView();
if (unbinder != null)
unbinder.unbind();

View file

@ -1,30 +1,31 @@
package info.nightscout.androidaps.plugins.ConfigBuilder;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.ImageView;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.ScrollView;
import android.widget.TextView;
import com.crashlytics.android.answers.CustomEvent;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnCheckedChanged;
import butterknife.OnClick;
import info.nightscout.androidaps.Config;
import butterknife.Optional;
import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.PreferencesActivity;
import info.nightscout.androidaps.R;
@ -50,69 +51,47 @@ import info.nightscout.utils.PasswordProtection;
public class ConfigBuilderFragment extends SubscriberFragment {
@BindView(R.id.configbuilder_insulinlistview)
ListView insulinListView;
@BindView(R.id.configbuilder_sensitivitylistview)
ListView sensitivityListView;
@BindView(R.id.configbuilder_bgsourcelistview)
ListView bgsourceListView;
@BindView(R.id.configbuilder_bgsourcelabel)
TextView bgsourceLabel;
@BindView(R.id.configbuilder_pumplistview)
ListView pumpListView;
@BindView(R.id.configbuilder_pumplabel)
TextView pumpLabel;
@BindView(R.id.configbuilder_looplistview)
ListView loopListView;
@BindView(R.id.configbuilder_looplabel)
TextView loopLabel;
@BindView(R.id.configbuilder_treatmentslistview)
ListView treatmentsListView;
@BindView(R.id.configbuilder_treatmentslabel)
TextView treatmentsLabel;
@BindView(R.id.configbuilder_profilelistview)
ListView profileListView;
@BindView(R.id.configbuilder_profilelabel)
TextView profileLabel;
@BindView(R.id.configbuilder_apslistview)
ListView apsListView;
@BindView(R.id.configbuilder_apslabel)
TextView apsLabel;
@BindView(R.id.configbuilder_constraintslistview)
ListView constraintsListView;
@BindView(R.id.configbuilder_constraintslabel)
TextView constraintsLabel;
@BindView(R.id.configbuilder_generallistview)
ListView generalListView;
private List<PluginView> pluginViews = new ArrayList<>();
@BindView(R.id.configbuilder_mainlayout)
LinearLayout mainLayout;
@BindView(R.id.configbuilder_unlock)
@BindView(R.id.profile_plugins)
LinearLayout profilePlugins;
@BindView(R.id.insulin_plugins)
LinearLayout insulinPlugins;
@BindView(R.id.bgsource_plugins)
LinearLayout bgSourcePlugins;
@BindView(R.id.pump_plugins)
LinearLayout pumpPlugins;
@BindView(R.id.sensitivity_plugins)
LinearLayout sensitivityPlugins;
@BindView(R.id.aps_plugins)
LinearLayout apsPlugins;
@BindView(R.id.loop_plugins)
LinearLayout loopPlugins;
@BindView(R.id.constraints_plugins)
LinearLayout constraintsPlugins;
@BindView(R.id.treatments_plugins)
LinearLayout treatmentsPlugins;
@BindView(R.id.general_plugins)
LinearLayout generalPlugins;
@BindView(R.id.main_layout)
ScrollView mainLayout;
@BindView(R.id.unlock)
Button unlock;
PluginCustomAdapter insulinDataAdapter = null;
PluginCustomAdapter sensivityDataAdapter = null;
PluginCustomAdapter bgsourceDataAdapter = null;
PluginCustomAdapter pumpDataAdapter = null;
PluginCustomAdapter loopDataAdapter = null;
PluginCustomAdapter treatmentDataAdapter = null;
PluginCustomAdapter profileDataAdapter = null;
PluginCustomAdapter apsDataAdapter = null;
PluginCustomAdapter constraintsDataAdapter = null;
PluginCustomAdapter generalDataAdapter = null;
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
try {
View view = inflater.inflate(R.layout.configbuilder_fragment, container, false);
unbinder = ButterKnife.bind(this, view);
if (PasswordProtection.isLocked("settings_password"))
mainLayout.setVisibility(View.GONE);
else
unlock.setVisibility(View.GONE);
else unlock.setVisibility(View.GONE);
createViews();
return view;
} catch (Exception e) {
FabricPrivacy.logException(e);
@ -121,222 +100,49 @@ public class ConfigBuilderFragment extends SubscriberFragment {
return null;
}
@OnClick(R.id.configbuilder_unlock)
public void onClickUnlock() {
@OnClick(R.id.unlock)
void onClickUnlock() {
PasswordProtection.QueryPassword(getContext(), R.string.settings_password, "settings_password", () -> {
mainLayout.setVisibility(View.VISIBLE);
unlock.setVisibility(View.GONE);
}, null);
}
@Override
public void onDestroyView() {
super.onDestroyView();
for (PluginView pluginView : pluginViews) pluginView.unbind();
pluginViews.clear();
}
@Override
protected void updateGUI() {
insulinDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(InsulinInterface.class, PluginType.INSULIN), PluginType.INSULIN);
insulinListView.setAdapter(insulinDataAdapter);
setListViewHeightBasedOnChildren(insulinListView);
bgsourceDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(BgSourceInterface.class, PluginType.BGSOURCE), PluginType.BGSOURCE);
bgsourceListView.setAdapter(bgsourceDataAdapter);
if (MainApp.getSpecificPluginsVisibleInList(PluginType.BGSOURCE).size() == 0)
bgsourceLabel.setVisibility(View.GONE);
setListViewHeightBasedOnChildren(bgsourceListView);
pumpDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginType.PUMP), PluginType.PUMP);
pumpListView.setAdapter(pumpDataAdapter);
if (MainApp.getSpecificPluginsVisibleInList(PluginType.PUMP).size() == 0 || Config.NSCLIENT || Config.G5UPLOADER) {
pumpLabel.setVisibility(View.GONE);
pumpListView.setVisibility(View.GONE);
}
setListViewHeightBasedOnChildren(pumpListView);
loopDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginType.LOOP), PluginType.LOOP);
loopListView.setAdapter(loopDataAdapter);
setListViewHeightBasedOnChildren(loopListView);
if (MainApp.getSpecificPluginsVisibleInList(PluginType.LOOP).size() == 0)
loopLabel.setVisibility(View.GONE);
treatmentDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginType.TREATMENT), PluginType.TREATMENT);
treatmentsListView.setAdapter(treatmentDataAdapter);
setListViewHeightBasedOnChildren(treatmentsListView);
if (MainApp.getSpecificPluginsVisibleInList(PluginType.TREATMENT).size() == 0)
treatmentsLabel.setVisibility(View.GONE);
profileDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(ProfileInterface.class, PluginType.PROFILE), PluginType.PROFILE);
profileListView.setAdapter(profileDataAdapter);
if (MainApp.getSpecificPluginsVisibleInList(PluginType.PROFILE).size() == 0)
profileLabel.setVisibility(View.GONE);
setListViewHeightBasedOnChildren(profileListView);
apsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginType.APS), PluginType.APS);
apsListView.setAdapter(apsDataAdapter);
setListViewHeightBasedOnChildren(apsListView);
if (MainApp.getSpecificPluginsVisibleInList(PluginType.APS).size() == 0)
apsLabel.setVisibility(View.GONE);
sensivityDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(SensitivityInterface.class, PluginType.SENSITIVITY), PluginType.SENSITIVITY);
sensitivityListView.setAdapter(sensivityDataAdapter);
setListViewHeightBasedOnChildren(sensitivityListView);
constraintsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInListByInterface(ConstraintsInterface.class, PluginType.CONSTRAINTS), PluginType.CONSTRAINTS);
constraintsListView.setAdapter(constraintsDataAdapter);
setListViewHeightBasedOnChildren(constraintsListView);
if (MainApp.getSpecificPluginsVisibleInList(PluginType.CONSTRAINTS).size() == 0)
constraintsLabel.setVisibility(View.GONE);
generalDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsVisibleInList(PluginType.GENERAL), PluginType.GENERAL);
generalListView.setAdapter(generalDataAdapter);
setListViewHeightBasedOnChildren(generalListView);
for (PluginView pluginView : pluginViews) pluginView.update();
}
/*
* ConfigBuilderFragment code
*/
private class PluginCustomAdapter extends ArrayAdapter<PluginBase> {
private ArrayList<PluginBase> pluginList;
final private PluginType type;
PluginCustomAdapter(Context context, int textViewResourceId,
ArrayList<PluginBase> pluginList, PluginType type) {
super(context, textViewResourceId, pluginList);
this.pluginList = new ArrayList<>();
this.pluginList.addAll(pluginList);
this.type = type;
private void createViews() {
createViewsForPlugins(profilePlugins, MainApp.getSpecificPluginsVisibleInListByInterface(ProfileInterface.class, PluginType.PROFILE));
createViewsForPlugins(insulinPlugins, MainApp.getSpecificPluginsVisibleInListByInterface(InsulinInterface.class, PluginType.INSULIN));
createViewsForPlugins(bgSourcePlugins, MainApp.getSpecificPluginsVisibleInListByInterface(BgSourceInterface.class, PluginType.BGSOURCE));
createViewsForPlugins(pumpPlugins, MainApp.getSpecificPluginsVisibleInList(PluginType.PUMP));
createViewsForPlugins(sensitivityPlugins, MainApp.getSpecificPluginsVisibleInListByInterface(SensitivityInterface.class, PluginType.SENSITIVITY));
createViewsForPlugins(apsPlugins, MainApp.getSpecificPluginsVisibleInList(PluginType.APS));
createViewsForPlugins(loopPlugins, MainApp.getSpecificPluginsVisibleInList(PluginType.LOOP));
createViewsForPlugins(constraintsPlugins, MainApp.getSpecificPluginsVisibleInListByInterface(ConstraintsInterface.class, PluginType.CONSTRAINTS));
createViewsForPlugins(treatmentsPlugins, MainApp.getSpecificPluginsVisibleInList(PluginType.TREATMENT));
createViewsForPlugins(generalPlugins, MainApp.getSpecificPluginsVisibleInList(PluginType.GENERAL));
}
private class PluginViewHolder {
TextView name;
CheckBox checkboxEnabled;
CheckBox checkboxVisible;
ImageView settings;
}
@NonNull
@Override
public View getView(int position, View view, @NonNull ViewGroup parent) {
PluginViewHolder holder;
PluginBase plugin = pluginList.get(position);
if (view == null) {
view = LayoutInflater.from(parent.getContext()).inflate(R.layout.configbuilder_simpleitem, null);
holder = new PluginViewHolder();
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(v -> {
CheckBox cb = (CheckBox) v;
PluginBase plugin1 = (PluginBase) cb.getTag();
plugin1.setPluginEnabled(type, cb.isChecked());
plugin1.setFragmentVisible(type, cb.isChecked());
onEnabledCategoryChanged(plugin1, type);
ConfigBuilderPlugin.getPlugin().storeSettings("CheckedCheckboxEnabled");
MainApp.bus().post(new EventRefreshGui());
MainApp.bus().post(new EventConfigBuilderChange());
ConfigBuilderPlugin.getPlugin().logPluginStatus();
FabricPrivacy.getInstance().logCustom(new CustomEvent("ConfigurationChange"));
});
holder.checkboxVisible.setOnClickListener(v -> {
CheckBox cb = (CheckBox) v;
PluginBase plugin12 = (PluginBase) cb.getTag();
plugin12.setFragmentVisible(type, cb.isChecked());
ConfigBuilderPlugin.getPlugin().storeSettings("CheckedCheckboxVisible");
MainApp.bus().post(new EventRefreshGui());
ConfigBuilderPlugin.getPlugin().logPluginStatus();
});
holder.settings.setOnClickListener(v -> {
final PluginBase plugin13 = (PluginBase) v.getTag();
PasswordProtection.QueryPassword(getContext(), R.string.settings_password, "settings_password", () -> {
Intent i = new Intent(getContext(), PreferencesActivity.class);
i.putExtra("id", plugin13.getPreferencesId());
startActivity(i);
}, null);
});
holder.name.setOnLongClickListener(v -> {
final PluginBase plugin14 = (PluginBase) v.getTag();
PasswordProtection.QueryPassword(getContext(), R.string.settings_password, "settings_password", () -> {
Intent i = new Intent(getContext(), PreferencesActivity.class);
i.putExtra("id", plugin14.getPreferencesId());
startActivity(i);
}, null);
return false;
});
} else {
holder = (PluginViewHolder) view.getTag();
}
holder.name.setText(plugin.getName());
holder.checkboxEnabled.setChecked(plugin.isEnabled(type));
holder.checkboxVisible.setChecked(plugin.isFragmentVisible());
holder.name.setTag(plugin);
holder.checkboxEnabled.setTag(plugin);
holder.checkboxVisible.setTag(plugin);
holder.settings.setTag(plugin);
if (plugin.pluginDescription.alwaysEnabled) {
holder.checkboxEnabled.setEnabled(false);
}
if (plugin.pluginDescription.alwayVisible) {
holder.checkboxEnabled.setEnabled(false);
}
if (!plugin.isEnabled(type)) {
holder.checkboxVisible.setEnabled(false);
}
if (!plugin.hasFragment()) {
holder.checkboxVisible.setVisibility(View.INVISIBLE);
}
// Hide enabled control and force enabled plugin if there is only one plugin available
if (type == PluginType.INSULIN || type == PluginType.PUMP || type == PluginType.SENSITIVITY)
if (pluginList.size() < 2) {
holder.checkboxEnabled.setEnabled(false);
plugin.setPluginEnabled(type, true);
ConfigBuilderPlugin.getPlugin().storeSettings("ForceEnable");
}
// Constraints cannot be disabled
if (type == PluginType.CONSTRAINTS)
holder.checkboxEnabled.setEnabled(false);
// Hide disabled profiles by default
if (type == PluginType.PROFILE) {
if (!plugin.isEnabled(type)) {
holder.checkboxVisible.setEnabled(false);
holder.checkboxVisible.setChecked(false);
} else {
holder.checkboxVisible.setEnabled(true);
private void createViewsForPlugins(LinearLayout parent, List<PluginBase> plugins) {
for (PluginBase plugin: plugins) {
PluginView pluginView = new PluginView(plugin);
parent.addView(pluginView.getBaseView());
pluginViews.add(pluginView);
}
}
// Disable profile control for pump profiles if pump is not enabled
if (type == PluginType.PROFILE) {
if (PumpInterface.class.isAssignableFrom(plugin.getClass())) {
if (!plugin.isEnabled(PluginType.PUMP)) {
holder.checkboxEnabled.setEnabled(false);
holder.checkboxEnabled.setChecked(false);
}
}
}
if (plugin.isEnabled(type)) {
view.setBackgroundColor(MainApp.gc(R.color.configBuilderSelectedBackground));
}
return view;
}
private boolean areMultipleSelectionsAllowed(PluginType type) {
return type == PluginType.GENERAL || type == PluginType.CONSTRAINTS ||type == PluginType.LOOP;
}
public static void processOnEnabledCategoryChanged(PluginBase changedPlugin, PluginType type) {
@ -394,35 +200,90 @@ public class ConfigBuilderFragment extends SubscriberFragment {
}
}
void onEnabledCategoryChanged(PluginBase changedPlugin, PluginType type) {
processOnEnabledCategoryChanged(changedPlugin, type);
class PluginView {
private Unbinder unbinder;
private PluginBase plugin;
LinearLayout baseView;
@BindView(R.id.plugin_enabled_exclusive)
RadioButton enabledExclusive;
@BindView(R.id.plugin_enabled_inclusive)
CheckBox enabledInclusive;
@BindView(R.id.plugin_name)
TextView pluginName;
@BindView(R.id.plugin_description)
TextView pluginDescription;
@BindView(R.id.plugin_preferences)
ImageButton pluginPreferences;
@BindView(R.id.plugin_visibility)
CheckBox pluginVisibility;
public PluginView(PluginBase plugin) {
this.plugin = plugin;
baseView = (LinearLayout) getLayoutInflater().inflate(R.layout.configbuilder_single_plugin, null);
unbinder = ButterKnife.bind(this, baseView);
update();
}
public LinearLayout getBaseView() {
return baseView;
}
public void update() {
enabledExclusive.setVisibility(areMultipleSelectionsAllowed(plugin.getType()) ? View.GONE : View.VISIBLE);
enabledInclusive.setVisibility(areMultipleSelectionsAllowed(plugin.getType()) ? View.VISIBLE : View.GONE);
enabledExclusive.setChecked(plugin.isEnabled(plugin.getType()));
enabledInclusive.setChecked(plugin.isEnabled(plugin.getType()));
enabledInclusive.setEnabled(!plugin.pluginDescription.alwaysEnabled);
enabledExclusive.setEnabled(!plugin.pluginDescription.alwaysEnabled);
pluginName.setText(plugin.getName());
if (plugin.getDescription() == null) pluginDescription.setVisibility(View.GONE);
else {
pluginDescription.setVisibility(View.VISIBLE);
pluginDescription.setText(plugin.getDescription());
}
pluginPreferences.setVisibility(plugin.getPreferencesId() == -1 || !plugin.isEnabled(plugin.getType()) ? View.INVISIBLE : View.VISIBLE);
pluginVisibility.setVisibility(plugin.hasFragment() ? View.VISIBLE : View.INVISIBLE);
pluginVisibility.setEnabled(!(plugin.pluginDescription.neverVisible || plugin.pluginDescription.alwayVisible) && plugin.isEnabled(plugin.getType()));
pluginVisibility.setChecked(plugin.isFragmentVisible());
}
@OnClick(R.id.plugin_visibility)
void onVisibilityChanged() {
plugin.setFragmentVisible(plugin.getType(), pluginVisibility.isChecked());
ConfigBuilderPlugin.getPlugin().storeSettings("CheckedCheckboxVisible");
MainApp.bus().post(new EventRefreshGui());
ConfigBuilderPlugin.getPlugin().logPluginStatus();
}
@OnClick({R.id.plugin_enabled_exclusive, R.id.plugin_enabled_inclusive})
void onEnabledChanged() {
boolean enabled = enabledExclusive.getVisibility() == View.VISIBLE ? enabledExclusive.isChecked() : enabledInclusive.isChecked();
plugin.setPluginEnabled(plugin.getType(), enabled);
plugin.setFragmentVisible(plugin.getType(), enabled);
processOnEnabledCategoryChanged(plugin, plugin.getType());
updateGUI();
ConfigBuilderPlugin.getPlugin().storeSettings("CheckedCheckboxEnabled");
MainApp.bus().post(new EventRefreshGui());
MainApp.bus().post(new EventConfigBuilderChange());
ConfigBuilderPlugin.getPlugin().logPluginStatus();
FabricPrivacy.getInstance().logCustom(new CustomEvent("ConfigurationChange"));
}
/****
* Method for Setting the Height of the ListView dynamically.
* *** Hack to fix the issue of not showing all the items of the ListView
* *** when placed inside a ScrollView
****/
public static void setListViewHeightBasedOnChildren(ListView listView) {
ListAdapter listAdapter = listView.getAdapter();
if (listAdapter == null)
return;
int desiredWidth = View.MeasureSpec.makeMeasureSpec(listView.getWidth(), View.MeasureSpec.UNSPECIFIED);
int totalHeight = 0;
View view = null;
for (int i = 0; i < listAdapter.getCount(); i++) {
view = listAdapter.getView(i, view, listView);
if (i == 0)
view.setLayoutParams(new ViewGroup.LayoutParams(desiredWidth, ViewGroup.LayoutParams.WRAP_CONTENT));
view.measure(desiredWidth, View.MeasureSpec.UNSPECIFIED);
totalHeight += view.getMeasuredHeight();
@OnClick(R.id.plugin_preferences)
void onPluginPreferencesClicked() {
PasswordProtection.QueryPassword(getContext(), R.string.settings_password, "settings_password", () -> {
Intent i = new Intent(getContext(), PreferencesActivity.class);
i.putExtra("id", plugin.getPreferencesId());
startActivity(i);
}, null);
}
ViewGroup.LayoutParams params = listView.getLayoutParams();
params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
listView.setLayoutParams(params);
public void unbind() {
unbinder.unbind();
}
}
}

View file

@ -92,6 +92,7 @@ public class ConfigBuilderPlugin extends PluginBase {
.alwayVisible(false)
.pluginName(R.string.configbuilder)
.shortName(R.string.configbuilder_shortname)
.description(R.string.description_config_builder)
);
}

View file

@ -56,6 +56,7 @@ public class ObjectivesPlugin extends PluginBase implements ConstraintsInterface
.showInList(!Config.NSCLIENT && !Config.G5UPLOADER)
.pluginName(R.string.objectives)
.shortName(R.string.objectives_shortname)
.description(R.string.description_objectives)
);
initializeData();
loadProgress();

View file

@ -26,6 +26,7 @@ public class FoodPlugin extends PluginBase {
.fragmentClass(FoodFragment.class.getName())
.pluginName(R.string.food)
.shortName(R.string.food_short)
.description(R.string.description_food)
);
this.service = new FoodService();
}

View file

@ -24,7 +24,8 @@ public class InsulinOrefFreePeakPlugin extends InsulinOrefBasePlugin {
super();
pluginDescription
.pluginName(R.string.free_peak_oref)
.preferencesId(R.xml.pref_insulinoreffreepeak);
.preferencesId(R.xml.pref_insulinoreffreepeak)
.description(R.string.description_insulin_free_peak);
}
@Override

View file

@ -22,7 +22,8 @@ public class InsulinOrefRapidActingPlugin extends InsulinOrefBasePlugin {
private InsulinOrefRapidActingPlugin() {
super();
pluginDescription
.pluginName(R.string.rapid_acting_oref);
.pluginName(R.string.rapid_acting_oref)
.description(R.string.description_insulin_rapid);
}
@Override

View file

@ -22,7 +22,8 @@ public class InsulinOrefUltraRapidActingPlugin extends InsulinOrefBasePlugin {
private InsulinOrefUltraRapidActingPlugin() {
super();
pluginDescription
.pluginName(R.string.ultrarapid_oref);
.pluginName(R.string.ultrarapid_oref)
.description(R.string.description_insulin_ultra_rapid);
}
@Override

View file

@ -94,6 +94,7 @@ public class LoopPlugin extends PluginBase {
.pluginName(R.string.loop)
.shortName(R.string.loop_shortname)
.preferencesId(R.xml.pref_closedmode)
.description(R.string.description_loop)
);
loopSuspendedTill = SP.getLong("loopSuspendedTill", 0L);
isSuperBolus = SP.getBoolean("isSuperBolus", false);

View file

@ -69,6 +69,7 @@ public class NSClientPlugin extends PluginBase {
.pluginName(R.string.nsclientinternal)
.shortName(R.string.nsclientinternal_shortname)
.preferencesId(R.xml.pref_nsclientinternal)
.description(R.string.description_ns_client)
);
if (Config.NSCLIENT || Config.G5UPLOADER) {

View file

@ -62,6 +62,7 @@ public class OpenAPSAMAPlugin extends PluginBase implements APSInterface {
.pluginName(R.string.openapsama)
.shortName(R.string.oaps_shortname)
.preferencesId(R.xml.pref_openapsama)
.description(R.string.description_ama)
);
}

View file

@ -62,6 +62,7 @@ public class OpenAPSMAPlugin extends PluginBase implements APSInterface {
.pluginName(R.string.openapsma)
.shortName(R.string.oaps_shortname)
.preferencesId(R.xml.pref_openapsma)
.description(R.string.description_ma)
);
}

View file

@ -65,6 +65,7 @@ public class OpenAPSSMBPlugin extends PluginBase implements APSInterface {
.pluginName(R.string.openapssmb)
.shortName(R.string.smb_shortname)
.preferencesId(R.xml.pref_openapssmb)
.description(R.string.description_smb)
);
}

View file

@ -50,6 +50,7 @@ public class OverviewPlugin extends PluginBase {
.pluginName(R.string.overview)
.shortName(R.string.overview_shortname)
.preferencesId(R.xml.pref_overview)
.description(R.string.description_overview)
);
String storedData = SP.getString("QuickWizard", "[]");
try {

View file

@ -57,6 +57,7 @@ public class PersistentNotificationPlugin extends PluginBase {
.neverVisible(true)
.pluginName(R.string.ongoingnotificaction)
.enableByDefault(true)
.description(R.string.description_persistent_notification)
);
this.ctx = ctx;
}

View file

@ -64,6 +64,7 @@ public class LocalProfilePlugin extends PluginBase implements ProfileInterface {
.fragmentClass(LocalProfileFragment.class.getName())
.pluginName(R.string.localprofile)
.shortName(R.string.localprofile_shortname)
.description(R.string.description_profile_local)
);
loadSettings();
}

View file

@ -49,6 +49,7 @@ public class NSProfilePlugin extends PluginBase implements ProfileInterface {
.alwaysEnabled(Config.NSCLIENT)
.alwayVisible(Config.NSCLIENT)
.showInList(!Config.NSCLIENT)
.description(R.string.description_profile_nightscout)
);
loadNSProfile();
}

View file

@ -52,6 +52,7 @@ public class SimpleProfilePlugin extends PluginBase implements ProfileInterface
.fragmentClass(SimpleProfileFragment.class.getName())
.pluginName(R.string.simpleprofile)
.shortName(R.string.simpleprofile_shortname)
.description(R.string.description_profile_simple)
);
loadSettings();
}

View file

@ -167,6 +167,7 @@ public class ComboPlugin extends PluginBase implements PumpInterface, Constraint
.fragmentClass(ComboFragment.class.getName())
.pluginName(R.string.combopump)
.shortName(R.string.combopump_shortname)
.description(R.string.description_pump_combo)
);
ruffyScripter = new RuffyScripter(MainApp.instance().getApplicationContext());
}

View file

@ -59,6 +59,7 @@ public abstract class AbstractDanaRPlugin extends PluginBase implements PumpInte
.pluginName(R.string.danarspump)
.shortName(R.string.danarpump_shortname)
.preferencesId(R.xml.pref_danars)
.description(R.string.description_pump_dana_r)
);
}

View file

@ -154,6 +154,10 @@ public class DanaRFragment extends SubscriberFragment {
new Runnable() {
@Override
public void run() {
synchronized(DanaRFragment.this){
if(btConnectionView == null || pumpStatusView == null || pumpStatusLayout == null ) return;
if (c.sStatus == EventPumpStatusChanged.CONNECTING)
btConnectionView.setText("{fa-bluetooth-b spin} " + c.sSecondsElapsed + "s");
else if (c.sStatus == EventPumpStatusChanged.CONNECTED)
@ -169,6 +173,7 @@ public class DanaRFragment extends SubscriberFragment {
}
}
}
}
);
}
}

View file

@ -83,6 +83,7 @@ public class DanaRSPlugin extends PluginBase implements PumpInterface, DanaRInte
.pluginName(R.string.danarspump)
.shortName(R.string.danarspump_shortname)
.preferencesId(R.xml.pref_danars)
.description(R.string.description_pump_dana_rs)
);
pumpDescription.isBolusCapable = true;

View file

@ -112,6 +112,7 @@ public class InsightPlugin extends PluginBase implements PumpInterface, Constrai
.pluginName(R.string.insightpump)
.shortName(R.string.insightpump_shortname)
.preferencesId(R.xml.pref_insightpump)
.description(R.string.description_pump_insight)
);
log("InsightPlugin instantiated");
pumpDescription.isBolusCapable = true;

View file

@ -42,6 +42,7 @@ public class MDIPlugin extends PluginBase implements PumpInterface {
super(new PluginDescription()
.mainType(PluginType.PUMP)
.pluginName(R.string.mdi)
.description(R.string.description_pump_mdi)
);
pumpDescription.isBolusCapable = true;
pumpDescription.bolusStep = 0.5d;

View file

@ -78,6 +78,7 @@ public class VirtualPumpPlugin extends PluginBase implements PumpInterface {
.shortName(R.string.virtualpump_shortname)
.preferencesId(R.xml.pref_virtualpump)
.neverVisible(BuildConfig.NSCLIENTOLNY || BuildConfig.G5UPLOADER)
.description(R.string.description_pump_virtual)
);
pumpDescription.isBolusCapable = true;
pumpDescription.bolusStep = 0.1d;

View file

@ -47,6 +47,7 @@ public class SensitivityAAPSPlugin extends PluginBase implements SensitivityInte
.pluginName(R.string.sensitivityaaps)
.shortName(R.string.sensitivity_shortname)
.preferencesId(R.xml.pref_absorption_aaps)
.description(R.string.description_sensitivity_aaps)
);
}

View file

@ -46,6 +46,7 @@ public class SensitivityOref0Plugin extends PluginBase implements SensitivityInt
.pluginName(R.string.sensitivityoref0)
.shortName(R.string.sensitivity_shortname)
.preferencesId(R.xml.pref_absorption_oref0)
.description(R.string.description_sensitivity_oref0)
);
}

View file

@ -43,6 +43,7 @@ public class SensitivityWeightedAveragePlugin extends PluginBase implements Sens
.pluginName(R.string.sensitivityweightedaverage)
.shortName(R.string.sensitivity_shortname)
.preferencesId(R.xml.pref_absorption_aaps)
.description(R.string.description_sensitivity_weighted_average)
);
}

View file

@ -124,6 +124,7 @@ public class SmsCommunicatorPlugin extends PluginBase {
.pluginName(R.string.smscommunicator)
.shortName(R.string.smscommunicator_shortname)
.preferencesId(R.xml.pref_smscommunicator)
.description(R.string.description_sms_communicator)
);
processSettings(null);
}

View file

@ -29,6 +29,7 @@ public class SourceDexcomG5Plugin extends PluginBase implements BgSourceInterfac
.shortName(R.string.dexcomG5_shortname)
.showInList(!Config.NSCLIENT)
.preferencesId(R.xml.pref_dexcomg5)
.description(R.string.description_source_dexcom_g5)
);
}

View file

@ -24,6 +24,7 @@ public class SourceGlimpPlugin extends PluginBase implements BgSourceInterface {
.mainType(PluginType.BGSOURCE)
.fragmentClass(BGSourceFragment.class.getName())
.pluginName(R.string.Glimp)
.description(R.string.description_source_glimp)
);
}

View file

@ -23,6 +23,7 @@ public class SourceMM640gPlugin extends PluginBase implements BgSourceInterface
.mainType(PluginType.BGSOURCE)
.fragmentClass(BGSourceFragment.class.getName())
.pluginName(R.string.MM640g)
.description(R.string.description_source_mm640g)
);
}

View file

@ -27,6 +27,7 @@ public class SourceNSClientPlugin extends PluginBase implements BgSourceInterfac
.pluginName(R.string.nsclientbg)
.showInList(!Config.NSCLIENT)
.alwaysEnabled(Config.NSCLIENT)
.description(R.string.description_source_ns_client)
);
}

View file

@ -26,6 +26,7 @@ public class SourceXdripPlugin extends PluginBase implements BgSourceInterface {
.mainType(PluginType.BGSOURCE)
.fragmentClass(BGSourceFragment.class.getName())
.pluginName(R.string.xdrip)
.description(R.string.description_source_xdrip)
);
}

View file

@ -80,6 +80,7 @@ public class TreatmentsPlugin extends PluginBase implements TreatmentsInterface
.shortName(R.string.treatments_shortname)
.preferencesId(R.xml.pref_absorption_oref0)
.alwaysEnabled(true)
.description(R.string.description_treatments)
);
this.service = new TreatmentService();
}

View file

@ -56,6 +56,7 @@ public class WearPlugin extends PluginBase {
.pluginName(R.string.wear)
.shortName(R.string.wear_shortname)
.preferencesId(R.xml.pref_wear)
.description(R.string.description_wear)
);
this.ctx = ctx;
}

View file

@ -70,6 +70,7 @@ public class StatuslinePlugin extends PluginBase {
.shortName(R.string.xdripstatus_shortname)
.neverVisible(true)
.preferencesId(R.xml.pref_xdripstatus)
.description(R.string.description_xdrip_status_line)
);
this.ctx = ctx;
this.mPrefs = PreferenceManager.getDefaultSharedPreferences(ctx);

View file

@ -3,9 +3,11 @@ package info.nightscout.androidaps.tabs;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.view.ViewGroup;
@ -19,7 +21,7 @@ import info.nightscout.androidaps.interfaces.PluginBase;
/**
* Created by mike on 30.05.2016.
*/
public class TabPageAdapter extends FragmentStatePagerAdapter {
public class TabPageAdapter extends FragmentPagerAdapter {
ArrayList<PluginBase> visibleFragmentList = new ArrayList<>();
@ -76,5 +78,8 @@ public class TabPageAdapter extends FragmentStatePagerAdapter {
}
}
@Override
public long getItemId(int position) {
return System.identityHashCode(visibleFragmentList.get(position));
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

View file

@ -1,240 +1,437 @@
<FrameLayout 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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderFragment">
android:gravity="center"
android:orientation="vertical">
<Button
android:id="@+id/unlock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:text="@string/unlock_settings" />
<ScrollView
android:id="@+id/main_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/configbuilder_unlock"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/unlock_settings" />
android:orientation="vertical"
android:padding="16dp">
<LinearLayout
android:id="@+id/configbuilder_mainlayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/configbuilder_profilelabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_profile"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="false"
android:layout_alignParentRight="true"
android:layout_weight="1"
android:paddingRight="10dp"
app:srcCompat="@drawable/visibility_black_16x16" />
</RelativeLayout>
<ListView
android:id="@+id/configbuilder_profilelistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
android:text="@string/configbuilder_profile"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:id="@+id/configbuilder_insulinlabel"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_insulin"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_insulinlistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_bgsourcelabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_bgsource"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_bgsourcelistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_pumplabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_pump"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_pumplistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_sensitivitylabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_sensitivity"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_sensitivitylistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_apslabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_aps"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_apslistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_looplabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_loop"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_looplistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_constraintslabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/constraints"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_constraintslistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_treatmentslabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_treatments"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_treatmentslistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
<TextView
android:id="@+id/configbuilder_generallabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="@color/mdtp_circle_color"
android:paddingLeft="5dp"
android:text="@string/configbuilder_general"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@android:color/black"
android:textStyle="bold" />
<ListView
android:id="@+id/configbuilder_generallistview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cardColorBackground" />
android:text="@string/configbuilder_profile_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/profile_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_insulin"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_insulin_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/insulin_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_bgsource"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_bgsource_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/bgsource_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_pump"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_pump_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/pump_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_sensitivity"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_sensitivity_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/sensitivity_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_aps"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_aps_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/aps_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_loop"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_loop_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/loop_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/constraints"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_constraints_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/constraints_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_treatments"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_treatments_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/treatments_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<LinearLayout
android:layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_general"
android:textColor="@color/colorAccent"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/configbuilder_general_description"
android:textColor="@color/colorAccent"
android:textSize="12sp" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="4dp"
app:srcCompat="@drawable/ic_visibility" />
</LinearLayout>
<LinearLayout
android:id="@+id/general_plugins"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
</ScrollView>
</FrameLayout>
</LinearLayout>

View file

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<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_height="wrap_content"
android:orientation="horizontal">
<CheckBox
android:id="@+id/configbuilder_simpleitem_checkboxenabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="false"
android:focusableInTouchMode="false"
android:gravity="center_vertical" />
<TextView
android:id="@+id/configbuilder_simpleitem_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
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
android:id="@+id/configbuilder_simpleitem_checkboxvisible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:focusable="false"
android:focusableInTouchMode="false" />
</LinearLayout>

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal">
<RadioButton
android:id="@+id/plugin_enabled_exclusive"
android:saveEnabled="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp" />
<CheckBox
android:id="@+id/plugin_enabled_inclusive"
android:saveEnabled="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginTop="12dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/plugin_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="16sp"
tools:text="Plugin name" />
<TextView
android:id="@+id/plugin_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:textSize="12sp"
tools:text="A super exquisite plugin description" />
</LinearLayout>
<ImageButton
android:id="@+id/plugin_preferences"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="?android:selectableItemBackgroundBorderless"
app:srcCompat="@drawable/ic_settings" />
<CheckBox
android:id="@+id/plugin_visibility"
android:saveEnabled="false"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>

View file

@ -13,6 +13,43 @@
<string name="ns_sync_use_absolute_title">Always use basal absolute values</string>
<string name="alert_dialog_storage_permission_text">Please reboot your phone or restart AndroidAPS from the System Settings \notherwise Android APS will not have logging (important to track and verify that the algorithms are working correctly)!</string>
<string name="description_actions">Some buttons to quickly access common features</string>
<string name="description_careportal">Enter advanced log book entries.</string>
<string name="description_config_builder">Used for configuring the active plugins</string>
<string name="description_objectives">Helps you to get started with AndroidAPS</string>
<string name="description_food">Displays the food presets defined in Nightscout</string>
<string name="description_insulin_rapid">Insulin preset for Humalog and NovoRapid / NovoLog</string>
<string name="description_insulin_ultra_rapid">Insulin preset for Fiasp</string>
<string name="description_insulin_free_peak">Allows you to define the peak of the insulin activity and should only be used by advanced users</string>
<string name="description_loop">Activate or deactivate the implementation triggering the loop.</string>
<string name="description_ns_client">Synchronizes your data with Nightscout</string>
<string name="description_ma">State of the algorithm in 2016</string>
<string name="description_ama">State of the algorithm in 2017</string>
<string name="description_smb">Most recent and most stable</string>
<string name="description_overview">Displays the current state of your loop and buttons for most common actions</string>
<string name="description_persistent_notification">Shows an ongoing notification with a short overview of what your loop is doing</string>
<string name="description_profile_local">Define a profile which is offline available.</string>
<string name="description_profile_nightscout">Provides the profile you have defined in Nightscout</string>
<string name="description_profile_simple">Define a profile with only one time block.</string>
<string name="description_pump_combo">Pump integration for Accu-Chek Combo pumps, requires having ruffy installed</string>
<string name="description_pump_dana_r">Pump integration for DANA Diabecare R pumps</string>
<string name="description_pump_dana_rs">Pump integration for DANA Diabecare RS pumps</string>
<string name="description_pump_insight">Pump integration for Accu-Chek Insight pumps, requires having SightRemote installed</string>
<string name="description_pump_mdi">Pump integration for people who do multiple daily injections for their diabetes therapy</string>
<string name="description_pump_virtual">Pump integration for pumps which don\'t have any driver yet (Open Loop)</string>
<string name="description_sensitivity_aaps">Sensitivity is calculated the same way like Oref0, but you can specify timeframe to the past. Minimal carb absorption is calculated from max carb absorption time from preferences.</string>
<string name="description_sensitivity_oref0">Sensitivity is calculated from 24h data in the past and carbs (if not absorbed) are cut after time specified in preferences.</string>
<string name="description_sensitivity_weighted_average">Sensitivity is calculated as a weighted average from deviations. Newer deviations have higher weight. Minimal carb absorption is calculated from max carb absorption time from preferences. This algorithm is the fastest in following sensitivity changes.</string>
<string name="description_source_dexcom_g5">Receive BG values from the patched Dexcom G5 app.</string>
<string name="description_source_glimp">Receive BG values from Glimp.</string>
<string name="description_source_mm640g">Receive BG values from the 600SeriesAndroidUploader.</string>
<string name="description_source_ns_client">Downloads BG data from Nightscout</string>
<string name="description_source_xdrip">Receive BG values from xDrip.</string>
<string name="description_treatments">Saves all treatments that were made</string>
<string name="description_wear">Monitor and control AndroidAPS using your WearOS watch.</string>
<string name="description_xdrip_status_line">Show information about your loop on your xDrip+ watchface.</string>
<string name="description_sms_communicator">Remote control AndroidAPS using SMS commands.</string>
<string name="objectives_objective_label_string">Objective:</string>
<string name="objectives_gate_label_string">Gate:</string>
<string name="objectives_button_start">Start</string>
@ -83,16 +120,23 @@
<string name="configbuilder_pump">Pump</string>
<string name="configbuilder_pump_description">Which pump would you like to use with AndroidAPS?</string>
<string name="configbuilder_treatments">Treatments</string>
<string name="configbuilder_treatments_description">Which plugin should be used for treatment handling?</string>
<string name="configbuilder_profile">Profile</string>
<string name="configbuilder_profile_description">Which profile should AndroidAPS use?</string>
<string name="configbuilder_aps">APS</string>
<string name="configbuilder_aps_description">Which APS algorithm should make therapy adjustments?</string>
<string name="configbuilder_general">General</string>
<string name="configbuilder_general_description">These are some general plugins you might find useful.</string>
<string name="configbuilder_constraints_description">Which constraints are applied?</string>
<string name="days">days</string>
<string name="objectives_minimalduration">Minimal duration</string>
<string name="constraints">Constraints</string>
<string name="loop">Loop</string>
<string name="configbuilder_loop">Loop</string>
<string name="configbuilder_loop_description">Use this to activate AndroidAPS\' loop integration.</string>
<string name="loop_aps_label">APS</string>
<string name="loop_constraintsprocessed_label">After processed constraints</string>
<string name="loop_tbrsetbypump_label">Temp basal set by pump</string>
@ -121,6 +165,7 @@
<string name="changeyourinput">Change your input!</string>
<string name="setextendedbolusquestion">Set new extended bolus:</string>
<string name="configbuilder_bgsource">BG Source</string>
<string name="configbuilder_bgsource_description">Where should AndroidAPS gain it\'s data from?</string>
<string name="xdrip">xDrip</string>
<string name="apsmode_title">APS Mode</string>
@ -553,6 +598,7 @@
<string name="restartingapp">Exiting application to apply settings.</string>
<string name="danarv2pump">DanaRv2</string>
<string name="configbuilder_insulin">Insulin</string>
<string name="configbuilder_insulin_description">Which type of insulin are you using?</string>
<string name="fastactinginsulin">Fast Acting Insulin</string>
<string name="fastactinginsulincomment">Novorapid, Novolog, Humalog</string>
<string name="ultrafastactinginsulincomment">Fiasp</string>
@ -616,6 +662,7 @@
<string name="openaps">OpenAPS</string>
<string name="uploader">Uploader</string>
<string name="configbuilder_sensitivity">Sensitivity detection</string>
<string name="configbuilder_sensitivity_description">Which sensitivity algorithm should be used?</string>
<string name="sensitivity_shortname">SENS</string>
<string name="sensitivityoref0">Sensitivity Oref0</string>
<string name="sensitivityaaps">Sensitivity AAPS</string>