remove butterknife at all, remove unused code, overview graph optimalization

This commit is contained in:
Milos Kozak 2017-04-23 13:45:49 +02:00
parent 66c05d8a08
commit b8a8bed6c5
36 changed files with 244 additions and 337 deletions

View file

@ -180,8 +180,4 @@ dependencies {
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.guava:guava:20.0'
compile ('com.jakewharton:butterknife:8.5.1') {
exclude module: 'support-compat'
}
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
}

View file

@ -50,7 +50,7 @@ import info.nightscout.androidaps.plugins.TempTargetRange.TempTargetRangeFragmen
import info.nightscout.androidaps.plugins.Treatments.TreatmentsFragment;
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpFragment;
import info.nightscout.androidaps.plugins.Wear.WearFragment;
import info.nightscout.androidaps.plugins.persistentnotification.PersistentNotificationPlugin;
import info.nightscout.androidaps.plugins.Persistentnotification.PersistentNotificationPlugin;
import info.nightscout.androidaps.receivers.KeepAliveReceiver;
import io.fabric.sdk.android.Fabric;

View file

@ -1,7 +0,0 @@
package info.nightscout.androidaps.interfaces;
/**
* Created by mike on 05.08.2016.
*/
public interface FragmentBase {
}

View file

@ -17,17 +17,16 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventRefreshGui;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.Actions.dialogs.FillDialog;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.androidaps.plugins.Actions.dialogs.NewExtendedBolusDialog;
import info.nightscout.androidaps.plugins.Actions.dialogs.NewTempBasalDialog;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
/**
* A simple {@link Fragment} subclass.
*/
public class ActionsFragment extends Fragment implements FragmentBase, View.OnClickListener {
public class ActionsFragment extends Fragment implements View.OnClickListener {
static ActionsPlugin actionsPlugin = new ActionsPlugin();

View file

@ -9,10 +9,9 @@ import android.view.View;
import android.view.ViewGroup;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
public class CareportalFragment extends Fragment implements FragmentBase, View.OnClickListener {
public class CareportalFragment extends Fragment implements View.OnClickListener {
static CareportalPlugin careportalPlugin;

View file

@ -21,9 +21,6 @@ import com.crashlytics.android.answers.CustomEvent;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventConfigBuilderChange;
@ -31,7 +28,6 @@ import info.nightscout.androidaps.events.EventRefreshGui;
import info.nightscout.androidaps.interfaces.APSInterface;
import info.nightscout.androidaps.interfaces.BgSourceInterface;
import info.nightscout.androidaps.interfaces.ConstraintsInterface;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.InsulinInterface;
import info.nightscout.androidaps.interfaces.PluginBase;
import info.nightscout.androidaps.interfaces.ProfileInterface;
@ -42,7 +38,7 @@ import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin;
import info.nightscout.utils.PasswordProtection;
public class ConfigBuilderFragment extends Fragment implements FragmentBase {
public class ConfigBuilderFragment extends Fragment {
static ConfigBuilderPlugin configBuilderPlugin = new ConfigBuilderPlugin();
@ -50,42 +46,26 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase {
return configBuilderPlugin;
}
@BindView(R.id.configbuilder_insulinlistview)
ListView insulinListView;
@BindView(R.id.configbuilder_bgsourcelistview)
ListView bgsourceListView;
@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_tempslistview)
ListView tempsListView;
@BindView(R.id.configbuilder_tempslabel)
TextView tempsLabel;
@BindView(R.id.configbuilder_profilelistview)
ListView profileListView;
@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;
@BindView(R.id.configbuilder_nsclientversion)
TextView nsclientVerView;
@BindView(R.id.configbuilder_nightscoutversion)
TextView nightscoutVerView;
private Unbinder unbinder;
LinearLayout mainLayout;
Button unlock;
PluginCustomAdapter insulinDataAdapter = null;
PluginCustomAdapter bgsourceDataAdapter = null;
@ -98,11 +78,6 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase {
PluginCustomAdapter constraintsDataAdapter = null;
PluginCustomAdapter generalDataAdapter = null;
@BindView(R.id.configbuilder_mainlayout)
LinearLayout mainLayout;
@BindView(R.id.configbuilder_unlock)
Button unlock;
// TODO: sorting
@Override
@ -110,7 +85,26 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase {
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.configbuilder_fragment, container, false);
unbinder = ButterKnife.bind(this, view);
insulinListView = (ListView) view.findViewById(R.id.configbuilder_insulinlistview);
bgsourceListView = (ListView) view.findViewById(R.id.configbuilder_bgsourcelistview);
pumpListView = (ListView) view.findViewById(R.id.configbuilder_pumplistview);
pumpLabel = (TextView) view.findViewById(R.id.configbuilder_pumplabel);
loopListView = (ListView) view.findViewById(R.id.configbuilder_looplistview);
loopLabel = (TextView) view.findViewById(R.id.configbuilder_looplabel);
treatmentsListView = (ListView) view.findViewById(R.id.configbuilder_treatmentslistview);
tempsListView = (ListView) view.findViewById(R.id.configbuilder_tempslistview);
tempsLabel = (TextView) view.findViewById(R.id.configbuilder_tempslabel);
profileListView = (ListView) view.findViewById(R.id.configbuilder_profilelistview);
apsListView = (ListView) view.findViewById(R.id.configbuilder_apslistview);
apsLabel = (TextView) view.findViewById(R.id.configbuilder_apslabel);
constraintsListView = (ListView) view.findViewById(R.id.configbuilder_constraintslistview);
constraintsLabel = (TextView) view.findViewById(R.id.configbuilder_constraintslabel);
generalListView = (ListView) view.findViewById(R.id.configbuilder_generallistview);
nsclientVerView = (TextView) view.findViewById(R.id.configbuilder_nsclientversion);
nightscoutVerView = (TextView) view.findViewById(R.id.configbuilder_nightscoutversion);
mainLayout = (LinearLayout) view.findViewById(R.id.configbuilder_mainlayout);
unlock = (Button) view.findViewById(R.id.configbuilder_unlock);
nsclientVerView.setText(ConfigBuilderPlugin.nsClientVersionName);
nightscoutVerView.setText(ConfigBuilderPlugin.nightscoutVersionName);
@ -139,12 +133,6 @@ public class ConfigBuilderFragment extends Fragment implements FragmentBase {
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
void setViews() {
insulinDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainApp.getSpecificPluginsListByInterface(InsulinInterface.class), PluginBase.INSULIN);
insulinListView.setAdapter(insulinDataAdapter);

View file

@ -23,9 +23,8 @@ import java.util.List;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
public class ObjectivesFragment extends Fragment implements View.OnClickListener, FragmentBase {
public class ObjectivesFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(ObjectivesFragment.class);
private static ObjectivesPlugin objectivesPlugin;
@ -43,15 +42,6 @@ public class ObjectivesFragment extends Fragment implements View.OnClickListener
LinearLayout fake_layout;
TextView reset;
@Override
public void onClick(View v) {
int id = v.getId();
switch (id) {
default:
break;
}
}
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ObjectiveViewHolder> {
List<ObjectivesPlugin.Objective> objectives;
@ -236,16 +226,4 @@ public class ObjectivesFragment extends Fragment implements View.OnClickListener
});
}
@Override
public void onPause() {
super.onPause();
MainApp.bus().unregister(this);
}
@Override
public void onResume() {
super.onResume();
MainApp.bus().register(this);
}
}

View file

@ -6,9 +6,7 @@ import android.support.v4.app.Fragment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.interfaces.FragmentBase;
public class SafetyFragment extends Fragment implements FragmentBase{
public class SafetyFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(SafetyFragment.class);
private static SafetyPlugin safetyPlugin = new SafetyPlugin();

View file

@ -5,42 +5,35 @@ import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
/**
* Created by mike on 17.04.2017.
*/
public class InsulinFastactingFragment extends Fragment implements FragmentBase {
public class InsulinFastactingFragment extends Fragment {
static InsulinFastactingPlugin insulinFastactingPlugin = new InsulinFastactingPlugin();
static public InsulinFastactingPlugin getPlugin() {
return insulinFastactingPlugin;
}
private Unbinder unbinder;
@BindView(R.id.insulin_name)
TextView insulinName;
@BindView(R.id.insulin_comment)
TextView insulinComment;
@BindView(R.id.insulin_dia)
TextView insulinDia;
@BindView(R.id.insuling_graph)
ActivityGraph insulinGraph;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.insulin_fragment, container, false);
unbinder = ButterKnife.bind(this, view);
insulinName = (TextView) view.findViewById(R.id.insulin_name);
insulinComment = (TextView) view.findViewById(R.id.insulin_comment);
insulinDia = (TextView) view.findViewById(R.id.insulin_dia);
insulinGraph = (ActivityGraph) view.findViewById(R.id.insuling_graph);
insulinName.setText(insulinFastactingPlugin.getFriendlyName());
insulinComment.setText(insulinFastactingPlugin.getComment());
@ -50,11 +43,4 @@ public class InsulinFastactingFragment extends Fragment implements FragmentBase
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}

View file

@ -5,43 +5,36 @@ import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.InsulinFastacting.ActivityGraph;
/**
* Created by mike on 17.04.2017.
*/
public class InsulinFastactingProlongedFragment extends Fragment implements FragmentBase {
public class InsulinFastactingProlongedFragment extends Fragment {
static InsulinFastactingProlongedPlugin insulinFastactingProlongedPlugin = new InsulinFastactingProlongedPlugin();
static public InsulinFastactingProlongedPlugin getPlugin() {
return insulinFastactingProlongedPlugin;
}
private Unbinder unbinder;
@BindView(R.id.insulin_name)
TextView insulinName;
@BindView(R.id.insulin_comment)
TextView insulinComment;
@BindView(R.id.insulin_dia)
TextView insulinDia;
@BindView(R.id.insuling_graph)
ActivityGraph insulinGraph;
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.insulin_fragment, container, false);
unbinder = ButterKnife.bind(this, view);
insulinName = (TextView) view.findViewById(R.id.insulin_name);
insulinComment = (TextView) view.findViewById(R.id.insulin_comment);
insulinDia = (TextView) view.findViewById(R.id.insulin_dia);
insulinGraph = (ActivityGraph) view.findViewById(R.id.insuling_graph);
insulinName.setText(insulinFastactingProlongedPlugin.getFriendlyName());
insulinComment.setText(insulinFastactingProlongedPlugin.getComment());
@ -51,11 +44,4 @@ public class InsulinFastactingProlongedFragment extends Fragment implements Frag
return view;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
}

View file

@ -19,11 +19,10 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.Loop.events.EventLoopSetLastRunGui;
import info.nightscout.androidaps.plugins.Loop.events.EventLoopUpdateGui;
public class LoopFragment extends Fragment implements View.OnClickListener, FragmentBase {
public class LoopFragment extends Fragment implements View.OnClickListener {
private static Logger log = LoggerFactory.getLogger(LoopFragment.class);
private static LoopPlugin loopPlugin;

View file

@ -28,13 +28,12 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventPreferenceChange;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientNewLog;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientRestart;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientUpdateGUI;
import info.nightscout.utils.SP;
public class NSClientInternalFragment extends Fragment implements FragmentBase, View.OnClickListener, CompoundButton.OnCheckedChangeListener {
public class NSClientInternalFragment extends Fragment implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {
private static Logger log = LoggerFactory.getLogger(NSClientInternalFragment.class);
static NSClientInternalPlugin nsClientInternalPlugin;
@ -189,5 +188,4 @@ public class NSClientInternalFragment extends Fragment implements FragmentBase,
});
}
}

View file

@ -20,12 +20,11 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateResultGui;
import info.nightscout.utils.JSONFormatter;
public class OpenAPSAMAFragment extends Fragment implements View.OnClickListener, FragmentBase {
public class OpenAPSAMAFragment extends Fragment implements View.OnClickListener {
private static Logger log = LoggerFactory.getLogger(OpenAPSAMAFragment.class);
private static OpenAPSAMAPlugin openAPSAMAPlugin;

View file

@ -18,18 +18,17 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateResultGui;
import info.nightscout.utils.JSONFormatter;
public class OpenAPSMAFragment extends Fragment implements View.OnClickListener, FragmentBase {
public class OpenAPSMAFragment extends Fragment implements View.OnClickListener {
private static Logger log = LoggerFactory.getLogger(OpenAPSMAFragment.class);
private static OpenAPSMAPlugin openAPSMAPlugin;
public static OpenAPSMAPlugin getPlugin() {
if(openAPSMAPlugin==null){
if (openAPSMAPlugin == null) {
openAPSMAPlugin = new OpenAPSMAPlugin();
}
return openAPSMAPlugin;

View file

@ -40,13 +40,6 @@ import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnCheckedChanged;
import butterknife.OnClick;
import butterknife.OnItemSelected;
import butterknife.OnTextChanged;
import butterknife.Unbinder;
import info.nightscout.androidaps.Constants;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
@ -73,68 +66,37 @@ import info.nightscout.utils.SP;
import info.nightscout.utils.SafeParse;
import info.nightscout.utils.ToastUtils;
import static butterknife.OnItemSelected.Callback.NOTHING_SELECTED;
public class WizardDialog extends DialogFragment {
public class WizardDialog extends DialogFragment implements OnClickListener, CompoundButton.OnCheckedChangeListener, Spinner.OnItemSelectedListener {
private static Logger log = LoggerFactory.getLogger(WizardDialog.class);
@BindView(R.id.treatments_wizard_deliverButton)
Button wizardDialogDeliverButton;
@BindView(R.id.treatments_wizard_correctioninput)
TextView correctionInput;
@BindView(R.id.treatments_wizard_carbsinput)
TextView carbsInput;
@BindView(R.id.treatments_wizard_bginput)
TextView bgInput;
@BindView(R.id.treatments_wizard_bg)
TextView bg;
@BindView(R.id.treatments_wizard_bginsulin)
TextView bgInsulin;
@BindView(R.id.treatments_wizard_bgunits)
TextView bgUnits;
@BindView(R.id.treatments_wizard_bgcheckbox)
CheckBox bgCheckbox;
@BindView(R.id.treatments_wizard_carbs)
TextView carbs;
@BindView(R.id.treatments_wizard_carbsinsulin)
TextView carbsInsulin;
@BindView(R.id.treatments_wizard_bolusiobinsulin)
TextView bolusIobInsulin;
@BindView(R.id.treatments_wizard_basaliobinsulin)
TextView basalIobInsulin;
@BindView(R.id.treatments_wizard_bolusiobcheckbox)
CheckBox bolusIobCheckbox;
@BindView(R.id.treatments_wizard_basaliobcheckbox)
CheckBox basalIobCheckbox;
@BindView(R.id.treatments_wizard_correctioninsulin)
TextView correctionInsulin;
@BindView(R.id.treatments_wizard_total)
TextView total;
@BindView(R.id.treatments_wizard_totalinsulin)
TextView totalInsulin;
@BindView(R.id.treatments_wizard_carbtimeinput)
EditText carbTimeEdit;
@BindView(R.id.treatments_wizard_profile)
Spinner profileSpinner;
@BindView(R.id.treatments_wizard_sbcheckbox)
CheckBox superbolusCheckbox;
@BindView(R.id.treatments_wizard_sb)
TextView superbolus;
@BindView(R.id.treatments_wizard_sbinsulin)
TextView superbolusInsulin;
@BindView(R.id.treatments_wizard_bgtrendcheckbox)
CheckBox bgtrendCheckbox;
@BindView(R.id.treatments_wizard_bgtrend)
TextView bgTrend;
@BindView(R.id.treatments_wizard_bgtrendinsulin)
TextView bgTrendInsulin;
@BindView(R.id.treatments_wizard_cob_layout)
LinearLayout cobLayout;
@BindView(R.id.treatments_wizard_cobcheckbox)
CheckBox cobCheckbox;
@BindView(R.id.treatments_wizard_cob)
TextView cob;
@BindView(R.id.treatments_wizard_cobinsulin)
TextView cobInsulin;
PlusMinusEditText editBg;
@ -142,8 +104,6 @@ public class WizardDialog extends DialogFragment {
PlusMinusEditText editCorr;
PlusMinusEditText editCarbTime;
private Unbinder unbinder;
Integer calculatedCarbs = 0;
Double calculatedTotalInsulin = 0d;
JSONObject boluscalcJSON;
@ -167,13 +127,7 @@ public class WizardDialog extends DialogFragment {
this.context = context;
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
@Override
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
@ -241,8 +195,48 @@ public class WizardDialog extends DialogFragment {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
unbinder = ButterKnife.bind(this, view);
wizardDialogDeliverButton = (Button) view.findViewById(R.id.treatments_wizard_deliverButton);
wizardDialogDeliverButton.setOnClickListener(this);
bg = (TextView) view.findViewById(R.id.treatments_wizard_bg);
bgInsulin = (TextView) view.findViewById(R.id.treatments_wizard_bginsulin);
bgUnits = (TextView) view.findViewById(R.id.treatments_wizard_bgunits);
carbs = (TextView) view.findViewById(R.id.treatments_wizard_carbs);
carbsInsulin = (TextView) view.findViewById(R.id.treatments_wizard_carbsinsulin);
bolusIobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_bolusiobinsulin);
basalIobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_basaliobinsulin);
correctionInsulin = (TextView) view.findViewById(R.id.treatments_wizard_correctioninsulin);
total = (TextView) view.findViewById(R.id.treatments_wizard_total);
totalInsulin = (TextView) view.findViewById(R.id.treatments_wizard_totalinsulin);
carbTimeEdit = (EditText) view.findViewById(R.id.treatments_wizard_carbtimeinput);
superbolus = (TextView) view.findViewById(R.id.treatments_wizard_sb);
superbolusInsulin = (TextView) view.findViewById(R.id.treatments_wizard_sbinsulin);
bgTrend = (TextView) view.findViewById(R.id.treatments_wizard_bgtrend);
bgTrendInsulin = (TextView) view.findViewById(R.id.treatments_wizard_bgtrendinsulin);
cobLayout = (LinearLayout) view.findViewById(R.id.treatments_wizard_cob_layout);
cob = (TextView) view.findViewById(R.id.treatments_wizard_cob);;
cobInsulin = (TextView) view.findViewById(R.id.treatments_wizard_cobinsulin);;
bgCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgcheckbox);
bolusIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bolusiobcheckbox);
basalIobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_basaliobcheckbox);
superbolusCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_sbcheckbox);
bgtrendCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_bgtrendcheckbox);
cobCheckbox = (CheckBox) view.findViewById(R.id.treatments_wizard_cobcheckbox);
bgCheckbox.setOnCheckedChangeListener(this);
basalIobCheckbox.setOnCheckedChangeListener(this);
bolusIobCheckbox.setOnCheckedChangeListener(this);
superbolusCheckbox.setOnCheckedChangeListener(this);
bgtrendCheckbox.setOnCheckedChangeListener(this);
cobCheckbox.setOnCheckedChangeListener(this);
profileSpinner = (Spinner) view.findViewById(R.id.treatments_wizard_profile);
profileSpinner.setOnItemSelectedListener(this);
correctionInput = (TextView) view.findViewById(R.id.treatments_wizard_correctioninput);
carbsInput = (TextView) view.findViewById(R.id.treatments_wizard_carbsinput);
bgInput = (TextView) view.findViewById(R.id.treatments_wizard_bginput);
correctionInput.addTextChangedListener(textWatcher);
carbsInput.addTextChangedListener(textWatcher);
bgInput.addTextChangedListener(textWatcher);
@ -261,102 +255,105 @@ public class WizardDialog extends DialogFragment {
return view;
}
@OnCheckedChanged({R.id.treatments_wizard_bgcheckbox, R.id.treatments_wizard_bolusiobcheckbox, R.id.treatments_wizard_basaliobcheckbox, R.id.treatments_wizard_sbcheckbox, R.id.treatments_wizard_cobcheckbox, R.id.treatments_wizard_bgtrendcheckbox})
public void checkboxToggled(boolean isChecked) {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
calculateInsulin();
}
@OnItemSelected(R.id.treatments_wizard_profile)
public void profileSelected(int position) {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
calculateInsulin();
wizardDialogDeliverButton.setVisibility(View.VISIBLE);
}
@OnItemSelected(value = R.id.treatments_wizard_profile,
callback = NOTHING_SELECTED)
public void profileNotSelected() {
@Override
public void onNothingSelected(AdapterView<?> parent) {
ToastUtils.showToastInUiThread(context, MainApp.sResources.getString(R.string.noprofileselected));
wizardDialogDeliverButton.setVisibility(View.GONE);
}
@OnClick(R.id.treatments_wizard_deliverButton)
@Override
public void onClick(View view) {
if (calculatedTotalInsulin > 0d || calculatedCarbs > 0d) {
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
String confirmMessage = getString(R.string.entertreatmentquestion);
switch (view.getId()) {
case R.id.treatments_wizard_deliverButton:
if (calculatedTotalInsulin > 0d || calculatedCarbs > 0d) {
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
String confirmMessage = getString(R.string.entertreatmentquestion);
Double insulinAfterConstraints = MainApp.getConfigBuilder().applyBolusConstraints(calculatedTotalInsulin);
Integer carbsAfterConstraints = MainApp.getConfigBuilder().applyCarbsConstraints(calculatedCarbs);
Double insulinAfterConstraints = MainApp.getConfigBuilder().applyBolusConstraints(calculatedTotalInsulin);
Integer carbsAfterConstraints = MainApp.getConfigBuilder().applyCarbsConstraints(calculatedCarbs);
confirmMessage += "\n" + getString(R.string.bolus) + ": " + formatNumber2decimalplaces.format(insulinAfterConstraints) + "U";
confirmMessage += "\n" + getString(R.string.carbs) + ": " + carbsAfterConstraints + "g";
confirmMessage += "\n" + getString(R.string.bolus) + ": " + formatNumber2decimalplaces.format(insulinAfterConstraints) + "U";
confirmMessage += "\n" + getString(R.string.carbs) + ": " + carbsAfterConstraints + "g";
if (insulinAfterConstraints - calculatedTotalInsulin != 0 || !carbsAfterConstraints.equals(calculatedCarbs)) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(getString(R.string.constraints_violation) + "\n" + getString(R.string.changeyourinput));
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
return;
}
final Double finalInsulinAfterConstraints = insulinAfterConstraints;
final Integer finalCarbsAfterConstraints = carbsAfterConstraints;
final Double bg = SafeParse.stringToDouble(bgInput.getText().toString());
final int carbTime = SafeParse.stringToInt(carbTimeEdit.getText().toString());
final boolean useSuperBolus = superbolusCheckbox.isChecked();
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
builder.setMessage(confirmMessage);
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (finalInsulinAfterConstraints > 0 || finalCarbsAfterConstraints > 0) {
final ConfigBuilderPlugin pump = MainApp.getConfigBuilder();
mHandler.post(new Runnable() {
@Override
public void run() {
PumpEnactResult result = pump.deliverTreatmentFromBolusWizard(
MainApp.getConfigBuilder().getActiveInsulin(),
context,
finalInsulinAfterConstraints,
finalCarbsAfterConstraints,
bg,
"Manual",
carbTime,
boluscalcJSON
);
if (!result.success) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
}
if (useSuperBolus) {
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
result = pump.setTempBasalAbsolute(0d, 120);
if (!result.success) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.tempbasaldeliveryerror));
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
}
if (activeloop != null) {
activeloop.superBolusTo(new Date().getTime() + 2 * 60L * 60 * 1000);
MainApp.bus().post(new EventRefreshGui(false));
}
}
}
});
Answers.getInstance().logCustom(new CustomEvent("Wizard"));
if (insulinAfterConstraints - calculatedTotalInsulin != 0 || !carbsAfterConstraints.equals(calculatedCarbs)) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(getString(R.string.constraints_violation) + "\n" + getString(R.string.changeyourinput));
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
return;
}
final Double finalInsulinAfterConstraints = insulinAfterConstraints;
final Integer finalCarbsAfterConstraints = carbsAfterConstraints;
final Double bg = SafeParse.stringToDouble(bgInput.getText().toString());
final int carbTime = SafeParse.stringToInt(carbTimeEdit.getText().toString());
final boolean useSuperBolus = superbolusCheckbox.isChecked();
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
builder.setMessage(confirmMessage);
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (finalInsulinAfterConstraints > 0 || finalCarbsAfterConstraints > 0) {
final ConfigBuilderPlugin pump = MainApp.getConfigBuilder();
mHandler.post(new Runnable() {
@Override
public void run() {
PumpEnactResult result = pump.deliverTreatmentFromBolusWizard(
MainApp.getConfigBuilder().getActiveInsulin(),
context,
finalInsulinAfterConstraints,
finalCarbsAfterConstraints,
bg,
"Manual",
carbTime,
boluscalcJSON
);
if (!result.success) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
}
if (useSuperBolus) {
final LoopPlugin activeloop = MainApp.getConfigBuilder().getActiveLoop();
result = pump.setTempBasalAbsolute(0d, 120);
if (!result.success) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle(MainApp.sResources.getString(R.string.tempbasaldeliveryerror));
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
}
if (activeloop != null) {
activeloop.superBolusTo(new Date().getTime() + 2 * 60L * 60 * 1000);
MainApp.bus().post(new EventRefreshGui(false));
}
}
}
});
Answers.getInstance().logCustom(new CustomEvent("Wizard"));
}
}
});
builder.setNegativeButton(getString(R.string.cancel), null);
builder.show();
dismiss();
}
});
builder.setNegativeButton(getString(R.string.cancel), null);
builder.show();
dismiss();
break;
}
}
@ -575,4 +572,5 @@ public class WizardDialog extends DialogFragment {
e.printStackTrace();
}
}
}

View file

@ -31,6 +31,8 @@ import android.widget.TextView;
import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.answers.CustomEvent;
import com.jjoe64.graphview.GraphView;
import com.jjoe64.graphview.LabelFormatter;
import com.jjoe64.graphview.Viewport;
import com.jjoe64.graphview.series.DataPoint;
import com.jjoe64.graphview.series.LineGraphSeries;
import com.jjoe64.graphview.series.PointsGraphSeries;
@ -1133,10 +1135,18 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
bgGraph.getSecondScale().addSeries(basalsLineSeries);
bgGraph.getSecondScale().setMinY(0);
bgGraph.getSecondScale().setMaxY(maxBgValue / lowLine * maxBasalValueFound * 1.2d);
bgGraph.getGridLabelRenderer().setVerticalLabelsSecondScaleColor(ContextCompat.getColor(MainApp.instance(), R.color.background_material_dark)); // same color as backround = hide
}
bgGraph.getSecondScale().setLabelFormatter(new LabelFormatter() {
@Override
public String formatLabel(double value, boolean isValueX) {
return "";
}
//updatePumpStatus(null);
@Override
public void setViewport(Viewport viewport) {
}
});
}
//Notifications

View file

@ -0,0 +1,12 @@
package info.nightscout.androidaps.plugins.Persistentnotification;
import android.support.v4.app.Fragment;
/**
* Created by adrian on 23/12/16.
*/
public class PersistentNotificationFragment extends Fragment {
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.persistentnotification;
package info.nightscout.androidaps.plugins.Persistentnotification;
import android.app.NotificationManager;
import android.app.PendingIntent;

View file

@ -33,14 +33,13 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SafeParse;
public class CircadianPercentageProfileFragment extends Fragment implements FragmentBase {
public class CircadianPercentageProfileFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(CircadianPercentageProfileFragment.class);
private static CircadianPercentageProfilePlugin circadianPercentageProfilePlugin = new CircadianPercentageProfilePlugin();

View file

@ -23,14 +23,13 @@ import java.text.DecimalFormat;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.utils.SafeParse;
import info.nightscout.utils.TimeListEdit;
public class LocalProfileFragment extends Fragment implements FragmentBase {
public class LocalProfileFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(LocalProfileFragment.class);
private static LocalProfilePlugin localProfilePlugin = new LocalProfilePlugin();

View file

@ -12,11 +12,10 @@ import com.squareup.otto.Subscribe;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.ProfileNS.events.EventNSProfileUpdateGUI;
import info.nightscout.utils.DecimalFormatter;
public class NSProfileFragment extends Fragment implements FragmentBase {
public class NSProfileFragment extends Fragment {
private static NSProfilePlugin nsProfilePlugin = new NSProfilePlugin();
public static NSProfilePlugin getPlugin() {

View file

@ -21,13 +21,12 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.utils.SafeParse;
public class SimpleProfileFragment extends Fragment implements FragmentBase {
public class SimpleProfileFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(SimpleProfileFragment.class);
private static SimpleProfilePlugin simpleProfilePlugin = new SimpleProfilePlugin();

View file

@ -26,7 +26,6 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.PumpDanaR.Dialogs.ProfileViewDialog;
import info.nightscout.androidaps.plugins.PumpDanaR.History.DanaRHistoryActivity;
import info.nightscout.androidaps.plugins.PumpDanaR.History.DanaRStatsActivity;
@ -35,13 +34,13 @@ import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SetWarnColor;
public class DanaRFragment extends Fragment implements FragmentBase {
public class DanaRFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(DanaRFragment.class);
private static DanaRPlugin danaRPlugin;
public static DanaRPlugin getPlugin() {
if(danaRPlugin==null){
if (danaRPlugin == null) {
danaRPlugin = new DanaRPlugin();
}
return danaRPlugin;
@ -211,7 +210,7 @@ public class DanaRFragment extends Fragment implements FragmentBase {
}
if (pump.lastBolusTime.getTime() != 0) {
Long agoMsec = new Date().getTime() - pump.lastBolusTime.getTime();
double agoHours = agoMsec / 60d / 60d / 1000d;
double agoHours = agoMsec / 60d / 60d / 1000d;
if (agoHours < 6) // max 6h back
lastBolusView.setText(DateUtil.timeString(pump.lastBolusTime) + " (" + DecimalFormatter.to1Decimal(agoHours) + " " + MainApp.sResources.getString(R.string.hoursago) + ") " + DecimalFormatter.to2Decimal(getPlugin().getDanaRPump().lastBolusAmount) + " U");
else lastBolusView.setText("");

View file

@ -26,7 +26,6 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.PumpDanaR.Dialogs.ProfileViewDialog;
import info.nightscout.androidaps.plugins.PumpDanaR.events.EventDanaRNewStatus;
import info.nightscout.androidaps.plugins.PumpDanaRKorean.History.DanaRHistoryActivity;
@ -35,7 +34,7 @@ import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SetWarnColor;
public class DanaRKoreanFragment extends Fragment implements FragmentBase {
public class DanaRKoreanFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(DanaRKoreanFragment.class);
private static DanaRKoreanPlugin danaRKoreanPlugin = new DanaRKoreanPlugin();

View file

@ -3,14 +3,7 @@ package info.nightscout.androidaps.plugins.PumpMDI;
import android.support.v4.app.Fragment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.interfaces.FragmentBase;
public class MDIFragment extends Fragment implements FragmentBase {
private static Logger log = LoggerFactory.getLogger(MDIFragment.class);
public class MDIFragment extends Fragment {
private static MDIPlugin mdiPlugin = new MDIPlugin();
public static MDIPlugin getPlugin() {

View file

@ -18,10 +18,9 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.PumpVirtual.events.EventVirtualPumpUpdateGui;
public class VirtualPumpFragment extends Fragment implements FragmentBase {
public class VirtualPumpFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(VirtualPumpFragment.class);
private static VirtualPumpPlugin virtualPumpPlugin = new VirtualPumpPlugin();

View file

@ -3,9 +3,7 @@ package info.nightscout.androidaps.plugins.SourceGlimp;
import android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase;
public class SourceGlimpFragment extends Fragment implements FragmentBase {
public class SourceGlimpFragment extends Fragment {
private static SourceGlimpPlugin sourceGlimpPlugin = new SourceGlimpPlugin();

View file

@ -3,9 +3,7 @@ package info.nightscout.androidaps.plugins.SourceMM640g;
import android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase;
public class SourceMM640gFragment extends Fragment implements FragmentBase {
public class SourceMM640gFragment extends Fragment {
private static SourceMM640gPlugin sourceMM640gPlugin = new SourceMM640gPlugin();

View file

@ -3,9 +3,7 @@ package info.nightscout.androidaps.plugins.SourceNSClient;
import android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase;
public class SourceNSClientFragment extends Fragment implements FragmentBase {
public class SourceNSClientFragment extends Fragment {
private static SourceNSClientPlugin sourceNSClientPlugin = new SourceNSClientPlugin();

View file

@ -3,9 +3,7 @@ package info.nightscout.androidaps.plugins.SourceXdrip;
import android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase;
public class SourceXdripFragment extends Fragment implements FragmentBase {
public class SourceXdripFragment extends Fragment {
private static SourceXdripPlugin sourceXdripPlugin = new SourceXdripPlugin();

View file

@ -26,12 +26,11 @@ import info.nightscout.androidaps.R;
import info.nightscout.androidaps.data.IobTotal;
import info.nightscout.androidaps.db.TempBasal;
import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter;
public class TempBasalsFragment extends Fragment implements FragmentBase {
public class TempBasalsFragment extends Fragment {
private static Logger log = LoggerFactory.getLogger(TempBasalsFragment.class);
private static TempBasalsPlugin tempBasalsPlugin = new TempBasalsPlugin();

View file

@ -31,10 +31,9 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.Services.Intents;
import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.TempTargetRange.events.EventTempTargetRangeChange;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.androidaps.plugins.TempTargetRange.events.EventTempTargetRangeChange;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.ToastUtils;
@ -43,7 +42,7 @@ import info.nightscout.utils.ToastUtils;
* Created by mike on 13/01/17.
*/
public class TempTargetRangeFragment extends Fragment implements View.OnClickListener, FragmentBase {
public class TempTargetRangeFragment extends Fragment implements View.OnClickListener {
private static TempTargetRangePlugin tempTargetRangePlugin = new TempTargetRangePlugin();

View file

@ -37,14 +37,13 @@ import info.nightscout.androidaps.Services.Intents;
import info.nightscout.androidaps.data.Iob;
import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventTreatmentChange;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.InsulinInterface;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.ToastUtils;
public class TreatmentsFragment extends Fragment implements View.OnClickListener, FragmentBase {
public class TreatmentsFragment extends Fragment implements View.OnClickListener {
private static Logger log = LoggerFactory.getLogger(TreatmentsFragment.class);
private static TreatmentsPlugin treatmentsPlugin = new TreatmentsPlugin();

View file

@ -8,19 +8,18 @@ import android.view.View;
import android.view.ViewGroup;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
/**
* Created by adrian on 17/11/16.
*/
public class WearFragment extends Fragment implements FragmentBase {
public class WearFragment extends Fragment {
private static WearPlugin wearPlugin;
public static WearPlugin getPlugin(Context ctx) {
if (wearPlugin == null){
if (wearPlugin == null) {
wearPlugin = new WearPlugin(ctx);
}

View file

@ -1,14 +0,0 @@
package info.nightscout.androidaps.plugins.persistentnotification;
import android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase;
/**
* Created by adrian on 23/12/16.
*/
public class PersistentNotificationFragment extends Fragment implements FragmentBase {
}

View file

@ -192,32 +192,41 @@
android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" />
<RelativeLayout
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph"
android:layout_width="match_parent"
android:layout_height="160dip" />
<CheckBox
android:id="@+id/overview_showprediction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:buttonTint="@color/magenta"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />
android:layout_height="160dip"
android:layout_weight="1" />
<CheckBox
android:id="@+id/overview_showbasals"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignWithParentIfMissing="false"
android:layout_below="@+id/overview_showprediction"
app:buttonTint="@color/cyan" />
</RelativeLayout>
android:layout_height="match_parent"
android:orientation="vertical">
<CheckBox
android:id="@+id/overview_showprediction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:buttonTint="@color/magenta"
android:layout_alignParentTop="true"
android:layout_alignParentEnd="true" />
<CheckBox
android:id="@+id/overview_showbasals"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignWithParentIfMissing="false"
android:layout_below="@+id/overview_showprediction"
app:buttonTint="@color/cyan" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/overview_accepttemplayout"