Merge pull request #766 from AdrianLxM/chart-menu

Chart menu
This commit is contained in:
AdrianLxM 2018-03-17 14:07:20 +01:00 committed by GitHub
commit 42e1c61c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 222 additions and 570 deletions

View file

@ -16,21 +16,27 @@ import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.content.ContextCompat;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.CardView;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.RecyclerView;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.util.DisplayMetrics;
import android.util.TypedValue;
import android.view.ContextMenu;
import android.view.HapticFeedbackConstants;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -120,7 +126,7 @@ import info.nightscout.utils.SP;
import info.nightscout.utils.SingleClickButton;
import info.nightscout.utils.ToastUtils;
public class OverviewFragment extends Fragment implements View.OnClickListener, CompoundButton.OnCheckedChangeListener, View.OnLongClickListener {
public class OverviewFragment extends Fragment implements View.OnClickListener, View.OnLongClickListener {
private static Logger log = LoggerFactory.getLogger(OverviewFragment.class);
TextView timeView;
@ -144,25 +150,13 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
LinearLayout pumpStatusLayout;
GraphView bgGraph;
GraphView iobGraph;
ImageButton chartButton;
TextView iage;
TextView cage;
TextView sage;
TextView pbage;
TextView showPredictionLabel;
CheckBox showPredictionCheckbox;
TextView showBasalsLabel;
CheckBox showBasalsCheckbox;
TextView showIobLabel;
CheckBox showIobCheckbox;
TextView showCobLabel;
CheckBox showCobCheckbox;
TextView showDeviationsLabel;
CheckBox showDeviationsCheckbox;
TextView showRatiosLabel;
CheckBox showRatiosCheckbox;
RecyclerView notificationsView;
LinearLayoutManager llm;
@ -193,6 +187,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
final Object updateSync = new Object();
public enum CHARTTYPE {PRE,BAS, IOB, COB, DEV, SEN};
private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();
private static ScheduledFuture<?> scheduledUpdate = null;
@ -286,38 +281,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
acceptTempLayout = (LinearLayout) view.findViewById(R.id.overview_accepttemplayout);
showPredictionCheckbox = (CheckBox) view.findViewById(R.id.overview_showprediction);
showBasalsCheckbox = (CheckBox) view.findViewById(R.id.overview_showbasals);
showIobCheckbox = (CheckBox) view.findViewById(R.id.overview_showiob);
showCobCheckbox = (CheckBox) view.findViewById(R.id.overview_showcob);
showDeviationsCheckbox = (CheckBox) view.findViewById(R.id.overview_showdeviations);
showRatiosCheckbox = (CheckBox) view.findViewById(R.id.overview_showratios);
showPredictionCheckbox.setChecked(SP.getBoolean("showprediction", false));
showBasalsCheckbox.setChecked(SP.getBoolean("showbasals", true));
showIobCheckbox.setChecked(SP.getBoolean("showiob", false));
showCobCheckbox.setChecked(SP.getBoolean("showcob", false));
showDeviationsCheckbox.setChecked(SP.getBoolean("showdeviations", false));
showRatiosCheckbox.setChecked(SP.getBoolean("showratios", false));
showPredictionCheckbox.setOnCheckedChangeListener(this);
showBasalsCheckbox.setOnCheckedChangeListener(this);
showIobCheckbox.setOnCheckedChangeListener(this);
showCobCheckbox.setOnCheckedChangeListener(this);
showDeviationsCheckbox.setOnCheckedChangeListener(this);
showRatiosCheckbox.setOnCheckedChangeListener(this);
showPredictionLabel = (TextView) view.findViewById(R.id.overview_showprediction_label);
showPredictionLabel.setOnClickListener(this);
showBasalsLabel = (TextView) view.findViewById(R.id.overview_showbasals_label);
showBasalsLabel.setOnClickListener(this);
showIobLabel = (TextView) view.findViewById(R.id.overview_showiob_label);
showIobLabel.setOnClickListener(this);
showCobLabel = (TextView) view.findViewById(R.id.overview_showcob_label);
showCobLabel.setOnClickListener(this);
showDeviationsLabel = (TextView) view.findViewById(R.id.overview_showdeviations_label);
showDeviationsLabel.setOnClickListener(this);
showRatiosLabel = (TextView) view.findViewById(R.id.overview_showratios_label);
showRatiosLabel.setOnClickListener(this);
notificationsView = (RecyclerView) view.findViewById(R.id.overview_notifications);
notificationsView.setHasFixedSize(true);
llm = new LinearLayoutManager(view.getContext());
@ -345,6 +308,8 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
});
setupChartMenu(view);
lockScreen = (CheckBox) view.findViewById(R.id.overview_lockscreen);
if (lockScreen != null) {
lockScreen.setChecked(SP.getBoolean("lockscreen", false));
@ -366,6 +331,106 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
return null;
}
private void setupChartMenu(View view) {
chartButton = (ImageButton) view.findViewById(R.id.overview_chartMenuButton);
chartButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final LoopPlugin.LastRun finalLastRun = LoopPlugin.lastRun;
final boolean predictionsAvailable = finalLastRun != null && finalLastRun.request.hasPredictions;
MenuItem item;
CharSequence title;
SpannableString s;
PopupMenu popup = new PopupMenu(v.getContext(), v);
if(predictionsAvailable) {
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.PRE.ordinal(), Menu.NONE, "Predictions");
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.prediction, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showprediction", true));
}
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.BAS.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_basals));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.basal, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showbasals", true));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.IOB.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_iob));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.iob, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showiob", true));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.COB.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_cob));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.cob, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showcob", true));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.DEV.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_deviations));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.deviations, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showdeviations", false));
item = popup.getMenu().add(Menu.NONE, CHARTTYPE.SEN.ordinal(), Menu.NONE, MainApp.gs(R.string.overview_show_sensitivity));
title = item.getTitle();
s = new SpannableString(title);
s.setSpan(new ForegroundColorSpan(ResourcesCompat.getColor(getResources(), R.color.ratio, null)), 0, s.length(), 0);
item.setTitle(s);
item.setCheckable(true);
item.setChecked(SP.getBoolean("showratios", false));
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == CHARTTYPE.PRE.ordinal()) {
SP.putBoolean("showprediction", !item.isChecked());
} else if (item.getItemId() == CHARTTYPE.BAS.ordinal()) {
SP.putBoolean("showbasals", !item.isChecked());
} else if (item.getItemId() == CHARTTYPE.IOB.ordinal()) {
SP.putBoolean("showiob", !item.isChecked());
} else if (item.getItemId() == CHARTTYPE.COB.ordinal()) {
SP.putBoolean("showcob", !item.isChecked());
} else if (item.getItemId() == CHARTTYPE.DEV.ordinal()) {
SP.putBoolean("showdeviations", !item.isChecked());
} else if (item.getItemId() == CHARTTYPE.SEN.ordinal()) {
SP.putBoolean("showratios", !item.isChecked());
}
scheduleUpdateGUI("onGraphCheckboxesCheckedChanged");
return true;
}
});
chartButton.setImageResource(R.drawable.ic_arrow_drop_up_white_24dp);
popup.setOnDismissListener(new PopupMenu.OnDismissListener() {
@Override
public void onDismiss(PopupMenu menu) {
chartButton.setImageResource(R.drawable.ic_arrow_drop_down_white_24dp);
}
});
popup.show();
}
});
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
@ -403,35 +468,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
}
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
switch (buttonView.getId()) {
case R.id.overview_showprediction:
case R.id.overview_showbasals:
case R.id.overview_showiob:
break;
case R.id.overview_showcob:
showDeviationsCheckbox.setOnCheckedChangeListener(null);
showDeviationsCheckbox.setChecked(false);
showDeviationsCheckbox.setOnCheckedChangeListener(this);
break;
case R.id.overview_showdeviations:
showCobCheckbox.setOnCheckedChangeListener(null);
showCobCheckbox.setChecked(false);
showCobCheckbox.setOnCheckedChangeListener(this);
break;
case R.id.overview_showratios:
break;
}
SP.putBoolean("showiob", showIobCheckbox.isChecked());
SP.putBoolean("showprediction", showPredictionCheckbox.isChecked());
SP.putBoolean("showbasals", showBasalsCheckbox.isChecked());
SP.putBoolean("showcob", showCobCheckbox.isChecked());
SP.putBoolean("showdeviations", showDeviationsCheckbox.isChecked());
SP.putBoolean("showratios", showRatiosCheckbox.isChecked());
scheduleUpdateGUI("onGraphCheckboxesCheckedChanged");
}
@Override
public boolean onContextItemSelected(MenuItem item) {
final LoopPlugin activeloop = ConfigBuilderPlugin.getActiveLoop();
@ -574,24 +610,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
if (ConfigBuilderPlugin.getActivePump().isSuspended() || !ConfigBuilderPlugin.getActivePump().isInitialized())
ConfigBuilderPlugin.getCommandQueue().readStatus("RefreshClicked", null);
break;
case R.id.overview_showprediction_label:
showPredictionCheckbox.toggle();
break;
case R.id.overview_showbasals_label:
showBasalsCheckbox.toggle();
break;
case R.id.overview_showiob_label:
showIobCheckbox.toggle();
break;
case R.id.overview_showcob_label:
showCobCheckbox.toggle();
break;
case R.id.overview_showdeviations_label:
showDeviationsCheckbox.toggle();
break;
case R.id.overview_showratios_label:
showRatiosCheckbox.toggle();
break;
}
}
@ -1270,14 +1288,6 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
}
final boolean predictionsAvailable = finalLastRun != null && finalLastRun.request.hasPredictions;
if (predictionsAvailable) {
showPredictionCheckbox.setVisibility(View.VISIBLE);
showPredictionLabel.setVisibility(View.VISIBLE);
} else {
showPredictionCheckbox.setVisibility(View.GONE);
showPredictionLabel.setVisibility(View.GONE);
}
// pump status from ns
if (pumpDeviceStatusView != null) {
pumpDeviceStatusView.setText(NSDeviceStatus.getInstance().getPumpStatus());
@ -1328,7 +1338,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
final long toTime;
final long fromTime;
final long endTime;
if (predictionsAvailable && showPredictionCheckbox.isChecked()) {
if (predictionsAvailable && SP.getBoolean("showprediction", false)) {
int predHours = (int) (Math.ceil(finalLastRun.constraintsProcessed.getLatestPredictionsTime() - System.currentTimeMillis()) / (60 * 60 * 1000));
predHours = Math.min(2, predHours);
predHours = Math.max(0, predHours);
@ -1355,7 +1365,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
graphData.addInRangeArea(fromTime, endTime, lowLine, highLine);
// **** BG ****
if (predictionsAvailable && showPredictionCheckbox.isChecked())
if (predictionsAvailable && SP.getBoolean("showprediction", false))
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, finalLastRun.constraintsProcessed);
else
graphData.addBgReadings(fromTime, toTime, lowLine, highLine, null);
@ -1367,7 +1377,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
graphData.addTreatments(fromTime, endTime);
// add basal data
if (pump.getPumpDescription().isTempBasalCapable && showBasalsCheckbox.isChecked()) {
if (pump.getPumpDescription().isTempBasalCapable && SP.getBoolean("showbasals", true)) {
graphData.addBasals(fromTime, now, lowLine / graphData.maxY / 1.2d);
}
@ -1388,25 +1398,25 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
boolean useRatioForScale = false;
boolean useDSForScale = false;
if (showIobCheckbox.isChecked()) {
if (SP.getBoolean("showiob", true)) {
useIobForScale = true;
} else if (showCobCheckbox.isChecked()) {
} else if (SP.getBoolean("showcob", true)) {
useCobForScale = true;
} else if (showDeviationsCheckbox.isChecked()) {
} else if (SP.getBoolean("showdeviations", false)) {
useDevForScale = true;
} else if (showRatiosCheckbox.isChecked()) {
} else if (SP.getBoolean("showratios", false)) {
useRatioForScale = true;
} else if (Config.displayDeviationSlope) {
useDSForScale = true;
}
if (showIobCheckbox.isChecked())
if (SP.getBoolean("showiob", true))
secondGraphData.addIob(fromTime, now, useIobForScale, 1d);
if (showCobCheckbox.isChecked())
if (SP.getBoolean("showcob", true))
secondGraphData.addCob(fromTime, now, useCobForScale, useCobForScale ? 1d : 0.5d);
if (showDeviationsCheckbox.isChecked())
if (SP.getBoolean("showdeviations", false))
secondGraphData.addDeviations(fromTime, now, useDevForScale, 1d);
if (showRatiosCheckbox.isChecked())
if (SP.getBoolean("showratios", false))
secondGraphData.addRatio(fromTime, now, useRatioForScale, 1d);
if (Config.displayDeviationSlope)
secondGraphData.addDeviationSlope(fromTime, now, useDSForScale, 1d);
@ -1422,7 +1432,7 @@ public class OverviewFragment extends Fragment implements View.OnClickListener,
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
if (showIobCheckbox.isChecked() || showCobCheckbox.isChecked() || showDeviationsCheckbox.isChecked() || showRatiosCheckbox.isChecked() || Config.displayDeviationSlope) {
if (SP.getBoolean("showiob", true) || SP.getBoolean("showcob", true) || SP.getBoolean("showdeviations", false) || SP.getBoolean("showratios", false) || Config.displayDeviationSlope) {
iobGraph.setVisibility(View.VISIBLE);
} else {
iobGraph.setVisibility(View.GONE);

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M7,10l5,5 5,-5z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M7,14l5,-5 5,5z"/>
</vector>

View file

@ -238,120 +238,27 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp">
<CheckBox
android:id="@+id/overview_showprediction"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:buttonTint="@color/prediction" />
<TextView
android:id="@+id/overview_showprediction_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/predictionshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/prediction"
android:textStyle="bold"/>
<CheckBox
android:id="@+id/overview_showbasals"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:buttonTint="@color/basal" />
<TextView
android:id="@+id/overview_showbasals_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/basalshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/basal"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showiob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:buttonTint="@color/iob" />
<TextView
android:id="@+id/overview_showiob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/iob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/iob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showcob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:buttonTint="@color/cob" />
<TextView
android:id="@+id/overview_showcob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/cob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/cob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showdeviations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
app:buttonTint="@color/deviations" />
<TextView
android:id="@+id/overview_showdeviations_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/dev"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/deviations"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showratios"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:id="@+id/overview_showratios_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/ratio_short"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" />
</LinearLayout>
android:layout_height="0dp"
android:layout_weight="1">
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/overview_chartMenuButton"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:paddingTop="5dp"
app:srcCompat="@drawable/ic_arrow_drop_down_white_24dp" />
</RelativeLayout>
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_iobgraph"

View file

@ -467,125 +467,31 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp">
<CheckBox
android:id="@+id/overview_showprediction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/prediction" />
<TextView
android:id="@+id/overview_showprediction_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/predictionshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/prediction"
android:textStyle="bold"/>
<CheckBox
android:id="@+id/overview_showbasals"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/basal" />
<TextView
android:id="@+id/overview_showbasals_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/basalshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/basal"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showiob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/iob" />
<TextView
android:id="@+id/overview_showiob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/iob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/iob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showcob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/cob" />
<TextView
android:id="@+id/overview_showcob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/cob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/cob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showdeviations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/deviations" />
<TextView
android:id="@+id/overview_showdeviations_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/dev"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/deviations"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showratios"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:id="@+id/overview_showratios_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/ratio_short"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1">
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph"
android:layout_width="wrap_content"
android:layout_height="160dip" />
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/overview_chartMenuButton"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:paddingTop="5dp"
app:srcCompat="@drawable/ic_arrow_drop_down_white_24dp" />
</RelativeLayout>
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_iobgraph"

View file

@ -551,116 +551,6 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp">
<CheckBox
android:id="@+id/overview_showprediction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/prediction" />
<TextView
android:id="@+id/overview_showprediction_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/predictionshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/prediction"
android:textStyle="bold"/>
<CheckBox
android:id="@+id/overview_showbasals"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/basal" />
<TextView
android:id="@+id/overview_showbasals_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/basalshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/basal"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showiob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/iob" />
<TextView
android:id="@+id/overview_showiob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/iob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/iob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showcob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/cob" />
<TextView
android:id="@+id/overview_showcob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/cob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/cob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showdeviations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/deviations" />
<TextView
android:id="@+id/overview_showdeviations_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/dev"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/deviations"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showratios"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:id="@+id/overview_showratios_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/ratio_short"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/overview_graphs_layout"
android:layout_width="wrap_content"
@ -668,11 +558,26 @@
android:layout_weight="1"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1">
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1" />
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/overview_chartMenuButton"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:paddingTop="5dp"
app:srcCompat="@drawable/ic_arrow_drop_down_white_24dp" />
</RelativeLayout>
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_iobgraph"

View file

@ -232,130 +232,35 @@
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:paddingTop="5dp">
<CheckBox
android:id="@+id/overview_showprediction"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/prediction" />
<TextView
android:id="@+id/overview_showprediction_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/predictionshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/prediction"
android:textStyle="bold"/>
<CheckBox
android:id="@+id/overview_showbasals"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/basal" />
<TextView
android:id="@+id/overview_showbasals_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/basalshortlabel"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/basal"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showiob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/iob" />
<TextView
android:id="@+id/overview_showiob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/iob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/iob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showcob"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/cob" />
<TextView
android:id="@+id/overview_showcob_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/cob"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/cob"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showdeviations"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:buttonTint="@color/deviations" />
<TextView
android:id="@+id/overview_showdeviations_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/dev"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/deviations"
android:textStyle="bold" />
<CheckBox
android:id="@+id/overview_showratios"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
<TextView
android:id="@+id/overview_showratios_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/ratio_short"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="200dp">
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_bggraph"
android:layout_width="wrap_content"
android:layout_height="160dip" />
android:layout_height="match_parent" />
<ImageButton
android:id="@+id/overview_chartMenuButton"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:paddingTop="5dp"
app:srcCompat="@drawable/ic_arrow_drop_down_white_24dp" />
</RelativeLayout>
<com.jjoe64.graphview.GraphView
android:id="@+id/overview_iobgraph"
android:layout_width="wrap_content"
android:layout_height="100dp" />
android:layout_height="150dp" />
</LinearLayout>
@ -394,9 +299,7 @@
android:paddingRight="0dp"
android:text="@string/overview_treatment_label"
android:textColor="@color/colorTreatmentButton"
android:textSize="10sp"
android:visibility="gone"/>
android:textSize="10sp" />
<info.nightscout.utils.SingleClickButton
android:id="@+id/overview_insulinbutton"
@ -425,8 +328,7 @@
android:paddingRight="0dp"
android:text="@string/overview_carbs_label"
android:textColor="@color/colorCarbsButton"
android:textSize="10sp"
android:visibility="gone"/>
android:textSize="10sp" />
<info.nightscout.utils.SingleClickButton
android:id="@+id/overview_wizardbutton"
@ -470,8 +372,7 @@
android:paddingRight="0dp"
android:text="@string/overview_cgm"
android:textColor="@color/colorCalibrationButton"
android:textSize="10sp"
android:visibility="gone"/>
android:textSize="10sp"/>
<info.nightscout.utils.SingleClickButton
android:id="@+id/overview_quickwizardbutton"

View file

@ -982,5 +982,10 @@
<string name="ns_autobackfill">Autobackfill missig BGs from NS</string>
<string name="key_ns_autobackfill" translatable="false">ns_autobackfill</string>
<string name="loop_smbsetbypump_label">SMB set by pump</string>
<string name="overview_show_sensitivity">Sensitivity</string>
<string name="overview_show_deviations">Deviations</string>
<string name="overview_show_cob">Carbs On Board</string>
<string name="overview_show_iob">Insulin On Board</string>
<string name="overview_show_basals">Basals</string>
</resources>