Wear improve menu navigation

This commit is contained in:
Andries Smit 2021-12-01 15:28:25 +01:00
parent e8e0aa75e2
commit d7caa39ff3
8 changed files with 8 additions and 15 deletions

View file

@ -99,7 +99,7 @@ public class AcceptActivity extends ViewSelectorActivity {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
ListenerService.confirmAction(AcceptActivity.this, actionstring); ListenerService.confirmAction(AcceptActivity.this, actionstring);
finish(); finishAffinity();
} }
}); });
container.addView(view); container.addView(view);

View file

@ -113,7 +113,7 @@ public class BolusActivity extends ViewSelectorActivity {
String actionstring = "bolus " + SafeParse.stringToDouble(editInsulin.editText.getText().toString()) String actionstring = "bolus " + SafeParse.stringToDouble(editInsulin.editText.getText().toString())
+ " " + SafeParse.stringToInt(editCarbs.editText.getText().toString()); + " " + SafeParse.stringToInt(editCarbs.editText.getText().toString());
ListenerService.initiateAction(BolusActivity.this, actionstring); ListenerService.initiateAction(BolusActivity.this, actionstring);
finish(); finishAffinity();
} }
}); });
container.addView(view); container.addView(view);

View file

@ -129,7 +129,7 @@ public class CPPActivity extends ViewSelectorActivity {
String actionstring = "cppset " + SafeParse.stringToInt(editTimeshift.editText.getText().toString()) String actionstring = "cppset " + SafeParse.stringToInt(editTimeshift.editText.getText().toString())
+ " " + SafeParse.stringToInt(editPercentage.editText.getText().toString()); + " " + SafeParse.stringToInt(editPercentage.editText.getText().toString());
ListenerService.initiateAction(CPPActivity.this, actionstring); ListenerService.initiateAction(CPPActivity.this, actionstring);
finish(); finishAffinity();
} }
}); });
container.addView(view); container.addView(view);

View file

@ -127,7 +127,7 @@ public class ECarbActivity extends ViewSelectorActivity {
+ " " + SafeParse.stringToInt(editStartTime.editText.getText().toString()) + " " + SafeParse.stringToInt(editStartTime.editText.getText().toString())
+ " " + SafeParse.stringToInt(editDuration.editText.getText().toString()); + " " + SafeParse.stringToInt(editDuration.editText.getText().toString());
ListenerService.initiateAction(ECarbActivity.this, actionstring); ListenerService.initiateAction(ECarbActivity.this, actionstring);
finish(); finishAffinity();
} }
}); });
container.addView(view); container.addView(view);

View file

@ -85,7 +85,7 @@ public class FillActivity extends ViewSelectorActivity {
String actionstring = "fill " + SafeParse.stringToDouble(editInsulin.editText.getText().toString()); String actionstring = "fill " + SafeParse.stringToDouble(editInsulin.editText.getText().toString());
ListenerService.initiateAction(FillActivity.this, actionstring); ListenerService.initiateAction(FillActivity.this, actionstring);
finish(); finishAffinity();
} }
}); });
container.addView(view); container.addView(view);

View file

@ -162,7 +162,7 @@ public class TempTargetActivity extends ViewSelectorActivity {
+ " " + (isSingleTarget ? SafeParse.stringToDouble(lowRange.editText.getText().toString()) : SafeParse.stringToDouble(highRange.editText.getText().toString())); + " " + (isSingleTarget ? SafeParse.stringToDouble(lowRange.editText.getText().toString()) : SafeParse.stringToDouble(highRange.editText.getText().toString()));
ListenerService.initiateAction(TempTargetActivity.this, actionstring); ListenerService.initiateAction(TempTargetActivity.this, actionstring);
finish(); finishAffinity();
} }
}); });
container.addView(view); container.addView(view);

View file

@ -129,7 +129,7 @@ public class WizardActivity extends ViewSelectorActivity {
String actionstring = "wizard2 " + SafeParse.stringToInt(editCarbs.editText.getText().toString()) String actionstring = "wizard2 " + SafeParse.stringToInt(editCarbs.editText.getText().toString())
+ " " + percentage; + " " + percentage;
ListenerService.initiateAction(WizardActivity.this, actionstring); ListenerService.initiateAction(WizardActivity.this, actionstring);
finish(); finishAffinity();
} }
}); });
container.addView(view); container.addView(view);

View file

@ -28,12 +28,6 @@ public abstract class MenuListActivity extends Activity
protected abstract void doAction(String position); protected abstract void doAction(String position);
@Override
protected void onPause(){
super.onPause();
finish();
}
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -56,8 +50,7 @@ public abstract class MenuListActivity extends Activity
public void onClick(WearableListView.ViewHolder v) { public void onClick(WearableListView.ViewHolder v) {
String tag = (String) v.itemView.getTag(); String tag = (String) v.itemView.getTag();
doAction(tag); doAction(tag);
//ActionsDefinitions.doAction(v.getAdapterPosition(), this);
finish();
} }
@Override @Override