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.code.gson:gson:2.7'
compile 'com.google.guava:guava:20.0' 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.Treatments.TreatmentsFragment;
import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpFragment; import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpFragment;
import info.nightscout.androidaps.plugins.Wear.WearFragment; 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 info.nightscout.androidaps.receivers.KeepAliveReceiver;
import io.fabric.sdk.android.Fabric; 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.R;
import info.nightscout.androidaps.events.EventInitializationChanged; import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.events.EventRefreshGui; 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.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.NewExtendedBolusDialog;
import info.nightscout.androidaps.plugins.Actions.dialogs.NewTempBasalDialog; 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. * 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(); static ActionsPlugin actionsPlugin = new ActionsPlugin();

View file

@ -9,10 +9,9 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog; 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; static CareportalPlugin careportalPlugin;

View file

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

View file

@ -23,9 +23,8 @@ import java.util.List;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; 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 Logger log = LoggerFactory.getLogger(ObjectivesFragment.class);
private static ObjectivesPlugin objectivesPlugin; private static ObjectivesPlugin objectivesPlugin;
@ -43,15 +42,6 @@ public class ObjectivesFragment extends Fragment implements View.OnClickListener
LinearLayout fake_layout; LinearLayout fake_layout;
TextView reset; TextView reset;
@Override
public void onClick(View v) {
int id = v.getId();
switch (id) {
default:
break;
}
}
public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ObjectiveViewHolder> { public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ObjectiveViewHolder> {
List<ObjectivesPlugin.Objective> objectives; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.interfaces.FragmentBase; public class SafetyFragment extends Fragment {
public class SafetyFragment extends Fragment implements FragmentBase{
private static Logger log = LoggerFactory.getLogger(SafetyFragment.class); private static Logger log = LoggerFactory.getLogger(SafetyFragment.class);
private static SafetyPlugin safetyPlugin = new SafetyPlugin(); 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.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
/** /**
* Created by mike on 17.04.2017. * 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 InsulinFastactingPlugin insulinFastactingPlugin = new InsulinFastactingPlugin();
static public InsulinFastactingPlugin getPlugin() { static public InsulinFastactingPlugin getPlugin() {
return insulinFastactingPlugin; return insulinFastactingPlugin;
} }
private Unbinder unbinder;
@BindView(R.id.insulin_name)
TextView insulinName; TextView insulinName;
@BindView(R.id.insulin_comment)
TextView insulinComment; TextView insulinComment;
@BindView(R.id.insulin_dia)
TextView insulinDia; TextView insulinDia;
@BindView(R.id.insuling_graph)
ActivityGraph insulinGraph; ActivityGraph insulinGraph;
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.insulin_fragment, container, false); 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()); insulinName.setText(insulinFastactingPlugin.getFriendlyName());
insulinComment.setText(insulinFastactingPlugin.getComment()); insulinComment.setText(insulinFastactingPlugin.getComment());
@ -50,11 +43,4 @@ public class InsulinFastactingFragment extends Fragment implements FragmentBase
return view; 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.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.InsulinFastacting.ActivityGraph; import info.nightscout.androidaps.plugins.InsulinFastacting.ActivityGraph;
/** /**
* Created by mike on 17.04.2017. * 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 InsulinFastactingProlongedPlugin insulinFastactingProlongedPlugin = new InsulinFastactingProlongedPlugin();
static public InsulinFastactingProlongedPlugin getPlugin() { static public InsulinFastactingProlongedPlugin getPlugin() {
return insulinFastactingProlongedPlugin; return insulinFastactingProlongedPlugin;
} }
private Unbinder unbinder;
@BindView(R.id.insulin_name)
TextView insulinName; TextView insulinName;
@BindView(R.id.insulin_comment)
TextView insulinComment; TextView insulinComment;
@BindView(R.id.insulin_dia)
TextView insulinDia; TextView insulinDia;
@BindView(R.id.insuling_graph)
ActivityGraph insulinGraph; ActivityGraph insulinGraph;
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.insulin_fragment, container, false); 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()); insulinName.setText(insulinFastactingProlongedPlugin.getFriendlyName());
insulinComment.setText(insulinFastactingProlongedPlugin.getComment()); insulinComment.setText(insulinFastactingProlongedPlugin.getComment());
@ -51,11 +44,4 @@ public class InsulinFastactingProlongedFragment extends Fragment implements Frag
return view; 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.MainApp;
import info.nightscout.androidaps.R; 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.EventLoopSetLastRunGui;
import info.nightscout.androidaps.plugins.Loop.events.EventLoopUpdateGui; 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 Logger log = LoggerFactory.getLogger(LoopFragment.class);
private static LoopPlugin loopPlugin; private static LoopPlugin loopPlugin;

View file

@ -28,13 +28,12 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventPreferenceChange; 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.EventNSClientNewLog;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientRestart; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientRestart;
import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientUpdateGUI; import info.nightscout.androidaps.plugins.NSClientInternal.events.EventNSClientUpdateGUI;
import info.nightscout.utils.SP; 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); private static Logger log = LoggerFactory.getLogger(NSClientInternalFragment.class);
static NSClientInternalPlugin nsClientInternalPlugin; 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.MainApp;
import info.nightscout.androidaps.R; 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.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateResultGui; import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateResultGui;
import info.nightscout.utils.JSONFormatter; 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 Logger log = LoggerFactory.getLogger(OpenAPSAMAFragment.class);
private static OpenAPSAMAPlugin openAPSAMAPlugin; private static OpenAPSAMAPlugin openAPSAMAPlugin;

View file

@ -18,18 +18,17 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; 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.EventOpenAPSUpdateGui;
import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateResultGui; import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateResultGui;
import info.nightscout.utils.JSONFormatter; 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 Logger log = LoggerFactory.getLogger(OpenAPSMAFragment.class);
private static OpenAPSMAPlugin openAPSMAPlugin; private static OpenAPSMAPlugin openAPSMAPlugin;
public static OpenAPSMAPlugin getPlugin() { public static OpenAPSMAPlugin getPlugin() {
if(openAPSMAPlugin==null){ if (openAPSMAPlugin == null) {
openAPSMAPlugin = new OpenAPSMAPlugin(); openAPSMAPlugin = new OpenAPSMAPlugin();
} }
return openAPSMAPlugin; return openAPSMAPlugin;

View file

@ -40,13 +40,6 @@ import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; 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.Constants;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
@ -73,68 +66,37 @@ import info.nightscout.utils.SP;
import info.nightscout.utils.SafeParse; import info.nightscout.utils.SafeParse;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
import static butterknife.OnItemSelected.Callback.NOTHING_SELECTED; public class WizardDialog extends DialogFragment implements OnClickListener, CompoundButton.OnCheckedChangeListener, Spinner.OnItemSelectedListener {
public class WizardDialog extends DialogFragment {
private static Logger log = LoggerFactory.getLogger(WizardDialog.class); private static Logger log = LoggerFactory.getLogger(WizardDialog.class);
@BindView(R.id.treatments_wizard_deliverButton)
Button wizardDialogDeliverButton; Button wizardDialogDeliverButton;
@BindView(R.id.treatments_wizard_correctioninput)
TextView correctionInput; TextView correctionInput;
@BindView(R.id.treatments_wizard_carbsinput)
TextView carbsInput; TextView carbsInput;
@BindView(R.id.treatments_wizard_bginput)
TextView bgInput; TextView bgInput;
@BindView(R.id.treatments_wizard_bg)
TextView bg; TextView bg;
@BindView(R.id.treatments_wizard_bginsulin)
TextView bgInsulin; TextView bgInsulin;
@BindView(R.id.treatments_wizard_bgunits)
TextView bgUnits; TextView bgUnits;
@BindView(R.id.treatments_wizard_bgcheckbox)
CheckBox bgCheckbox; CheckBox bgCheckbox;
@BindView(R.id.treatments_wizard_carbs)
TextView carbs; TextView carbs;
@BindView(R.id.treatments_wizard_carbsinsulin)
TextView carbsInsulin; TextView carbsInsulin;
@BindView(R.id.treatments_wizard_bolusiobinsulin)
TextView bolusIobInsulin; TextView bolusIobInsulin;
@BindView(R.id.treatments_wizard_basaliobinsulin)
TextView basalIobInsulin; TextView basalIobInsulin;
@BindView(R.id.treatments_wizard_bolusiobcheckbox)
CheckBox bolusIobCheckbox; CheckBox bolusIobCheckbox;
@BindView(R.id.treatments_wizard_basaliobcheckbox)
CheckBox basalIobCheckbox; CheckBox basalIobCheckbox;
@BindView(R.id.treatments_wizard_correctioninsulin)
TextView correctionInsulin; TextView correctionInsulin;
@BindView(R.id.treatments_wizard_total)
TextView total; TextView total;
@BindView(R.id.treatments_wizard_totalinsulin)
TextView totalInsulin; TextView totalInsulin;
@BindView(R.id.treatments_wizard_carbtimeinput)
EditText carbTimeEdit; EditText carbTimeEdit;
@BindView(R.id.treatments_wizard_profile)
Spinner profileSpinner; Spinner profileSpinner;
@BindView(R.id.treatments_wizard_sbcheckbox)
CheckBox superbolusCheckbox; CheckBox superbolusCheckbox;
@BindView(R.id.treatments_wizard_sb)
TextView superbolus; TextView superbolus;
@BindView(R.id.treatments_wizard_sbinsulin)
TextView superbolusInsulin; TextView superbolusInsulin;
@BindView(R.id.treatments_wizard_bgtrendcheckbox)
CheckBox bgtrendCheckbox; CheckBox bgtrendCheckbox;
@BindView(R.id.treatments_wizard_bgtrend)
TextView bgTrend; TextView bgTrend;
@BindView(R.id.treatments_wizard_bgtrendinsulin)
TextView bgTrendInsulin; TextView bgTrendInsulin;
@BindView(R.id.treatments_wizard_cob_layout)
LinearLayout cobLayout; LinearLayout cobLayout;
@BindView(R.id.treatments_wizard_cobcheckbox)
CheckBox cobCheckbox; CheckBox cobCheckbox;
@BindView(R.id.treatments_wizard_cob)
TextView cob; TextView cob;
@BindView(R.id.treatments_wizard_cobinsulin)
TextView cobInsulin; TextView cobInsulin;
PlusMinusEditText editBg; PlusMinusEditText editBg;
@ -142,8 +104,6 @@ public class WizardDialog extends DialogFragment {
PlusMinusEditText editCorr; PlusMinusEditText editCorr;
PlusMinusEditText editCarbTime; PlusMinusEditText editCarbTime;
private Unbinder unbinder;
Integer calculatedCarbs = 0; Integer calculatedCarbs = 0;
Double calculatedTotalInsulin = 0d; Double calculatedTotalInsulin = 0d;
JSONObject boluscalcJSON; JSONObject boluscalcJSON;
@ -167,12 +127,6 @@ public class WizardDialog extends DialogFragment {
this.context = context; this.context = context;
} }
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
@ -241,8 +195,48 @@ public class WizardDialog extends DialogFragment {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE); getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); 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); correctionInput.addTextChangedListener(textWatcher);
carbsInput.addTextChangedListener(textWatcher); carbsInput.addTextChangedListener(textWatcher);
bgInput.addTextChangedListener(textWatcher); bgInput.addTextChangedListener(textWatcher);
@ -261,26 +255,27 @@ public class WizardDialog extends DialogFragment {
return view; 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}) @Override
public void checkboxToggled(boolean isChecked) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
calculateInsulin(); calculateInsulin();
} }
@OnItemSelected(R.id.treatments_wizard_profile) @Override
public void profileSelected(int position) { public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
calculateInsulin(); calculateInsulin();
wizardDialogDeliverButton.setVisibility(View.VISIBLE); wizardDialogDeliverButton.setVisibility(View.VISIBLE);
} }
@OnItemSelected(value = R.id.treatments_wizard_profile, @Override
callback = NOTHING_SELECTED) public void onNothingSelected(AdapterView<?> parent) {
public void profileNotSelected() {
ToastUtils.showToastInUiThread(context, MainApp.sResources.getString(R.string.noprofileselected)); ToastUtils.showToastInUiThread(context, MainApp.sResources.getString(R.string.noprofileselected));
wizardDialogDeliverButton.setVisibility(View.GONE); wizardDialogDeliverButton.setVisibility(View.GONE);
} }
@OnClick(R.id.treatments_wizard_deliverButton) @Override
public void onClick(View view) { public void onClick(View view) {
switch (view.getId()) {
case R.id.treatments_wizard_deliverButton:
if (calculatedTotalInsulin > 0d || calculatedCarbs > 0d) { if (calculatedTotalInsulin > 0d || calculatedCarbs > 0d) {
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00"); DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
String confirmMessage = getString(R.string.entertreatmentquestion); String confirmMessage = getString(R.string.entertreatmentquestion);
@ -358,6 +353,8 @@ public class WizardDialog extends DialogFragment {
builder.show(); builder.show();
dismiss(); dismiss();
} }
break;
}
} }
private void initDialog() { private void initDialog() {
@ -575,4 +572,5 @@ public class WizardDialog extends DialogFragment {
e.printStackTrace(); e.printStackTrace();
} }
} }
} }

View file

@ -31,6 +31,8 @@ import android.widget.TextView;
import com.crashlytics.android.answers.Answers; import com.crashlytics.android.answers.Answers;
import com.crashlytics.android.answers.CustomEvent; import com.crashlytics.android.answers.CustomEvent;
import com.jjoe64.graphview.GraphView; 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.DataPoint;
import com.jjoe64.graphview.series.LineGraphSeries; import com.jjoe64.graphview.series.LineGraphSeries;
import com.jjoe64.graphview.series.PointsGraphSeries; import com.jjoe64.graphview.series.PointsGraphSeries;
@ -1133,10 +1135,18 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
bgGraph.getSecondScale().addSeries(basalsLineSeries); bgGraph.getSecondScale().addSeries(basalsLineSeries);
bgGraph.getSecondScale().setMinY(0); bgGraph.getSecondScale().setMinY(0);
bgGraph.getSecondScale().setMaxY(maxBgValue / lowLine * maxBasalValueFound * 1.2d); 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 //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.NotificationManager;
import android.app.PendingIntent; import android.app.PendingIntent;

View file

@ -33,14 +33,13 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventInitializationChanged; import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog; import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow; import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.SafeParse; 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 Logger log = LoggerFactory.getLogger(CircadianPercentageProfileFragment.class);
private static CircadianPercentageProfilePlugin circadianPercentageProfilePlugin = new CircadianPercentageProfilePlugin(); 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.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventInitializationChanged; import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog; import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow; import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.utils.SafeParse; import info.nightscout.utils.SafeParse;
import info.nightscout.utils.TimeListEdit; 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 Logger log = LoggerFactory.getLogger(LocalProfileFragment.class);
private static LocalProfilePlugin localProfilePlugin = new LocalProfilePlugin(); 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.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.ProfileNS.events.EventNSProfileUpdateGUI; import info.nightscout.androidaps.plugins.ProfileNS.events.EventNSProfileUpdateGUI;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
public class NSProfileFragment extends Fragment implements FragmentBase { public class NSProfileFragment extends Fragment {
private static NSProfilePlugin nsProfilePlugin = new NSProfilePlugin(); private static NSProfilePlugin nsProfilePlugin = new NSProfilePlugin();
public static NSProfilePlugin getPlugin() { public static NSProfilePlugin getPlugin() {

View file

@ -21,13 +21,12 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventInitializationChanged; import info.nightscout.androidaps.events.EventInitializationChanged;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog; import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog;
import info.nightscout.androidaps.plugins.Careportal.OptionsToShow; import info.nightscout.androidaps.plugins.Careportal.OptionsToShow;
import info.nightscout.utils.SafeParse; 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 Logger log = LoggerFactory.getLogger(SimpleProfileFragment.class);
private static SimpleProfilePlugin simpleProfilePlugin = new SimpleProfilePlugin(); 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.R;
import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.events.EventTempBasalChange; 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.Dialogs.ProfileViewDialog;
import info.nightscout.androidaps.plugins.PumpDanaR.History.DanaRHistoryActivity; import info.nightscout.androidaps.plugins.PumpDanaR.History.DanaRHistoryActivity;
import info.nightscout.androidaps.plugins.PumpDanaR.History.DanaRStatsActivity; 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.DecimalFormatter;
import info.nightscout.utils.SetWarnColor; 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 Logger log = LoggerFactory.getLogger(DanaRFragment.class);
private static DanaRPlugin danaRPlugin; private static DanaRPlugin danaRPlugin;
public static DanaRPlugin getPlugin() { public static DanaRPlugin getPlugin() {
if(danaRPlugin==null){ if (danaRPlugin == null) {
danaRPlugin = new DanaRPlugin(); danaRPlugin = new DanaRPlugin();
} }
return danaRPlugin; return danaRPlugin;

View file

@ -26,7 +26,6 @@ import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.events.EventPumpStatusChanged;
import info.nightscout.androidaps.events.EventTempBasalChange; 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.Dialogs.ProfileViewDialog;
import info.nightscout.androidaps.plugins.PumpDanaR.events.EventDanaRNewStatus; import info.nightscout.androidaps.plugins.PumpDanaR.events.EventDanaRNewStatus;
import info.nightscout.androidaps.plugins.PumpDanaRKorean.History.DanaRHistoryActivity; 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.DecimalFormatter;
import info.nightscout.utils.SetWarnColor; 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 Logger log = LoggerFactory.getLogger(DanaRKoreanFragment.class);
private static DanaRKoreanPlugin danaRKoreanPlugin = new DanaRKoreanPlugin(); 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 android.support.v4.app.Fragment;
import org.slf4j.Logger; public class MDIFragment extends Fragment {
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);
private static MDIPlugin mdiPlugin = new MDIPlugin(); private static MDIPlugin mdiPlugin = new MDIPlugin();
public static MDIPlugin getPlugin() { public static MDIPlugin getPlugin() {

View file

@ -18,10 +18,9 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.PumpVirtual.events.EventVirtualPumpUpdateGui; 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 Logger log = LoggerFactory.getLogger(VirtualPumpFragment.class);
private static VirtualPumpPlugin virtualPumpPlugin = new VirtualPumpPlugin(); 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 android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase; public class SourceGlimpFragment extends Fragment {
public class SourceGlimpFragment extends Fragment implements FragmentBase {
private static SourceGlimpPlugin sourceGlimpPlugin = new SourceGlimpPlugin(); 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 android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase; public class SourceMM640gFragment extends Fragment {
public class SourceMM640gFragment extends Fragment implements FragmentBase {
private static SourceMM640gPlugin sourceMM640gPlugin = new SourceMM640gPlugin(); 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 android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase; public class SourceNSClientFragment extends Fragment {
public class SourceNSClientFragment extends Fragment implements FragmentBase {
private static SourceNSClientPlugin sourceNSClientPlugin = new SourceNSClientPlugin(); 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 android.support.v4.app.Fragment;
import info.nightscout.androidaps.interfaces.FragmentBase; public class SourceXdripFragment extends Fragment {
public class SourceXdripFragment extends Fragment implements FragmentBase {
private static SourceXdripPlugin sourceXdripPlugin = new SourceXdripPlugin(); 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.data.IobTotal;
import info.nightscout.androidaps.db.TempBasal; import info.nightscout.androidaps.db.TempBasal;
import info.nightscout.androidaps.events.EventTempBasalChange; import info.nightscout.androidaps.events.EventTempBasalChange;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.utils.DateUtil; import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter; 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 Logger log = LoggerFactory.getLogger(TempBasalsFragment.class);
private static TempBasalsPlugin tempBasalsPlugin = new TempBasalsPlugin(); 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.R;
import info.nightscout.androidaps.Services.Intents; import info.nightscout.androidaps.Services.Intents;
import info.nightscout.androidaps.db.TempTarget; import info.nightscout.androidaps.db.TempTarget;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; 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.NSClientInternal.data.NSProfile;
import info.nightscout.androidaps.plugins.TempTargetRange.events.EventTempTargetRangeChange;
import info.nightscout.utils.DateUtil; import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.ToastUtils; import info.nightscout.utils.ToastUtils;
@ -43,7 +42,7 @@ import info.nightscout.utils.ToastUtils;
* Created by mike on 13/01/17. * 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(); 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.data.Iob;
import info.nightscout.androidaps.db.Treatment; import info.nightscout.androidaps.db.Treatment;
import info.nightscout.androidaps.events.EventTreatmentChange; import info.nightscout.androidaps.events.EventTreatmentChange;
import info.nightscout.androidaps.interfaces.FragmentBase;
import info.nightscout.androidaps.interfaces.InsulinInterface; import info.nightscout.androidaps.interfaces.InsulinInterface;
import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile;
import info.nightscout.utils.DateUtil; import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.ToastUtils; 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 Logger log = LoggerFactory.getLogger(TreatmentsFragment.class);
private static TreatmentsPlugin treatmentsPlugin = new TreatmentsPlugin(); private static TreatmentsPlugin treatmentsPlugin = new TreatmentsPlugin();

View file

@ -8,19 +8,18 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.FragmentBase;
/** /**
* Created by adrian on 17/11/16. * Created by adrian on 17/11/16.
*/ */
public class WearFragment extends Fragment implements FragmentBase { public class WearFragment extends Fragment {
private static WearPlugin wearPlugin; private static WearPlugin wearPlugin;
public static WearPlugin getPlugin(Context ctx) { public static WearPlugin getPlugin(Context ctx) {
if (wearPlugin == null){ if (wearPlugin == null) {
wearPlugin = new WearPlugin(ctx); 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,14 +192,21 @@
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:textAppearance="?android:attr/textAppearanceSmall" /> android:textAppearance="?android:attr/textAppearanceSmall" />
<RelativeLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:orientation="horizontal">
<com.jjoe64.graphview.GraphView <com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph" android:id="@+id/overview_bggraph"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="160dip" /> android:layout_height="160dip"
android:layout_weight="1" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
<CheckBox <CheckBox
android:id="@+id/overview_showprediction" android:id="@+id/overview_showprediction"
@ -217,7 +224,9 @@
android:layout_alignWithParentIfMissing="false" android:layout_alignWithParentIfMissing="false"
android:layout_below="@+id/overview_showprediction" android:layout_below="@+id/overview_showprediction"
app:buttonTint="@color/cyan" /> app:buttonTint="@color/cyan" />
</RelativeLayout> </LinearLayout>
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/overview_accepttemplayout" android:id="@+id/overview_accepttemplayout"