From c394c045c92155457f8499a4585968dcb8ba60a1 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Thu, 3 May 2018 16:31:55 +0200 Subject: [PATCH] wearwizard reduced watch settings --- .../plugins/Wear/ActionStringHandler.java | 8 +- .../interaction/actions/WizardActivity.java | 82 +------------------ 2 files changed, 6 insertions(+), 84 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java index 8935a28f87..9f46e9e25c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Wear/ActionStringHandler.java @@ -192,12 +192,12 @@ public class ActionStringHandler { return; } - boolean useBG = Boolean.parseBoolean(act[2]); - boolean useBolusIOB = Boolean.parseBoolean(act[3]); - boolean useBasalIOB = Boolean.parseBoolean(act[4]); + boolean useBG = true; + boolean useBolusIOB = true; + boolean useBasalIOB = true; boolean useCOB = true; boolean useTrend = true; - int percentage = Integer.parseInt(act[5]); + int percentage = Integer.parseInt(act[2]); Profile profile = MainApp.getConfigBuilder().getProfile(); if (profile == null) { diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java index 682a669cd8..5c16063bb2 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java @@ -32,9 +32,6 @@ public class WizardActivity extends ViewSelectorActivity { PlusMinusEditText editCarbs; PlusMinusEditText editPercentage; - boolean useBG; - boolean includeBolusIOB; - boolean includeBasalIOB; boolean hasPercentage; @@ -63,7 +60,7 @@ public class WizardActivity extends ViewSelectorActivity { private class MyGridViewPagerAdapter extends GridPagerAdapter { @Override public int getColumnCount(int arg0) { - return hasPercentage?6:5; + return hasPercentage?3:2; } @Override @@ -86,79 +83,7 @@ public class WizardActivity extends ViewSelectorActivity { setLabelToPlusMinusView(view, "carbs"); container.addView(view); return view; - } else if(col == 1){ - final View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.action_toggle_item, container, false); - final TextView textView = (TextView) view.findViewById(R.id.label); - textView.setText("include BG?"); - - final ImageView togglebutton = (ImageView) view.findViewById(R.id.togglebutton); - if(useBG){ - togglebutton.setImageResource(R.drawable.ic_toggle_on); - } else { - togglebutton.setImageResource(R.drawable.ic_toggle_off); - } - togglebutton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - useBG = !useBG; - if(useBG){ - togglebutton.setImageResource(R.drawable.ic_toggle_on); - } else { - togglebutton.setImageResource(R.drawable.ic_toggle_off); - } - } - }); - container.addView(view); - return view; - } else if(col == 2){ - final View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.action_toggle_item, container, false); - final TextView textView = (TextView) view.findViewById(R.id.label); - textView.setText("Bolus IOB?"); - - final ImageView togglebutton = (ImageView) view.findViewById(R.id.togglebutton); - if(includeBolusIOB){ - togglebutton.setImageResource(R.drawable.ic_toggle_on); - } else { - togglebutton.setImageResource(R.drawable.ic_toggle_off); - } - togglebutton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - includeBolusIOB = !includeBolusIOB; - if(includeBolusIOB){ - togglebutton.setImageResource(R.drawable.ic_toggle_on); - } else { - togglebutton.setImageResource(R.drawable.ic_toggle_off); - } - } - }); - container.addView(view); - return view; - } else if(col == 3){ - final View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.action_toggle_item, container, false); - final TextView textView = (TextView) view.findViewById(R.id.label); - textView.setText("Basal IOB?"); - - final ImageView togglebutton = (ImageView) view.findViewById(R.id.togglebutton); - if(includeBasalIOB){ - togglebutton.setImageResource(R.drawable.ic_toggle_on); - } else { - togglebutton.setImageResource(R.drawable.ic_toggle_off); - } - togglebutton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - includeBasalIOB = !includeBasalIOB; - if(includeBasalIOB){ - togglebutton.setImageResource(R.drawable.ic_toggle_on); - } else { - togglebutton.setImageResource(R.drawable.ic_toggle_off); - } - } - }); - container.addView(view); - return view; - } else if(col == 4 && hasPercentage){ + } else if(col == 1 && hasPercentage){ final View view = getInflatedPlusMinusView(container); if (editPercentage == null) { editPercentage = new PlusMinusEditText(view, R.id.amountfield, R.id.plusbutton, R.id.minusbutton, 100d, 50d, 150d, 1d, new DecimalFormat("0"), false); @@ -185,9 +110,6 @@ public class WizardActivity extends ViewSelectorActivity { if (editPercentage != null) percentage = SafeParse.stringToInt(editPercentage.editText.getText().toString()); String actionstring = "wizard2 " + SafeParse.stringToInt(editCarbs.editText.getText().toString()) - + " " + useBG - + " " + includeBolusIOB - + " " + includeBasalIOB + " " + percentage; ListenerService.initiateAction(WizardActivity.this, actionstring); finish();