diff --git a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java index e96115d4c9..6661a16c2e 100644 --- a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java +++ b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java @@ -522,7 +522,7 @@ public class ListenerService extends WearableListenerService implements GoogleAp intent.putExtras(params); startActivity(intent); } else { - showConfirmationDialog(message, actionstring); + showConfirmationDialog(title, message, actionstring); } } else if (path.equals(NEW_STATUS_PATH)) { @@ -680,10 +680,11 @@ public class ListenerService extends WearableListenerService implements GoogleAp notificationManager.createNotificationChannel(channel); } - private void showConfirmationDialog(String message, String actionstring) { + private void showConfirmationDialog(String title, String message, String actionstring) { Intent intent = new Intent(this, AcceptActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); Bundle params = new Bundle(); + params.putString("title", title); params.putString("message", message); params.putString("actionstring", actionstring); intent.putExtras(params); diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ViewSelectorActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ViewSelectorActivity.java index 3f36538819..afb3dda6cc 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ViewSelectorActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ViewSelectorActivity.java @@ -29,7 +29,7 @@ public class ViewSelectorActivity extends Activity { super.onCreate(savedInstanceState); setContentView(R.layout.grid_layout); - setTitleBasedOnScreenShape(String.valueOf(getTitle())); + setTitleBasedOnScreenShape(); pager = findViewById(R.id.pager); DotsPageIndicator dotsPageIndicator = findViewById(R.id.page_indicator); @@ -59,7 +59,12 @@ public class ViewSelectorActivity extends Activity { pager.setAdapter(adapter); } - private void setTitleBasedOnScreenShape(String title) { + private void setTitleBasedOnScreenShape() { + // intents can inject dynamic titles, otherwise we'll use the default + String title = String.valueOf(getTitle()); + if (getIntent().getExtras() != null) + title = getIntent().getExtras().getString("title", title); + CurvedTextView titleViewCurved = findViewById(R.id.title_curved); TextView titleView = findViewById(R.id.title); if (this.getResources().getConfiguration().isScreenRound()) { @@ -91,18 +96,8 @@ public class ViewSelectorActivity extends Activity { } void setLabelToPlusMinusView(View view, String labelText) { - SharedPreferences sharedPrefs = PreferenceManager - .getDefaultSharedPreferences(this); - int design = Integer.parseInt(sharedPrefs.getString("input_design", "1")); - - if (design == 4) { - //@LadyViktoria: Here the label can be set differently, if you like. final TextView textView = view.findViewById(R.id.label); textView.setText(labelText); - } else { - final TextView textView = view.findViewById(R.id.label); - textView.setText(labelText); - } } }