wearwizard reduced watch settings

This commit is contained in:
AdrianLxM 2018-05-03 16:31:55 +02:00
parent bdfce784c0
commit c394c045c9
2 changed files with 6 additions and 84 deletions

View file

@ -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) {

View file

@ -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();