Fix dialogs and remove extra CONFIRM. Fixes #1078
This commit is contained in:
parent
35ded822c9
commit
7ef8c35c33
4 changed files with 8 additions and 29 deletions
|
@ -522,7 +522,7 @@ public class ListenerService extends WearableListenerService implements GoogleAp
|
||||||
intent.putExtras(params);
|
intent.putExtras(params);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
showConfirmationDialog(title, message, actionstring);
|
showConfirmationDialog(message, actionstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (path.equals(NEW_STATUS_PATH)) {
|
} else if (path.equals(NEW_STATUS_PATH)) {
|
||||||
|
@ -680,12 +680,10 @@ public class ListenerService extends WearableListenerService implements GoogleAp
|
||||||
notificationManager.createNotificationChannel(channel);
|
notificationManager.createNotificationChannel(channel);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showConfirmationDialog(String title, String message, String actionstring) {
|
private void showConfirmationDialog(String message, String actionstring) {
|
||||||
|
|
||||||
Intent intent = new Intent(this, AcceptActivity.class);
|
Intent intent = new Intent(this, AcceptActivity.class);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
Bundle params = new Bundle();
|
Bundle params = new Bundle();
|
||||||
params.putString("title", title);
|
|
||||||
params.putString("message", message);
|
params.putString("message", message);
|
||||||
params.putString("actionstring", actionstring);
|
params.putString("actionstring", actionstring);
|
||||||
intent.putExtras(params);
|
intent.putExtras(params);
|
||||||
|
|
|
@ -21,7 +21,6 @@ import info.nightscout.androidaps.data.ListenerService;
|
||||||
|
|
||||||
public class AcceptActivity extends ViewSelectorActivity {
|
public class AcceptActivity extends ViewSelectorActivity {
|
||||||
|
|
||||||
String title = "";
|
|
||||||
String message = "";
|
String message = "";
|
||||||
String actionstring = "";
|
String actionstring = "";
|
||||||
private DismissThread dismissThread;
|
private DismissThread dismissThread;
|
||||||
|
@ -34,7 +33,6 @@ public class AcceptActivity extends ViewSelectorActivity {
|
||||||
dismissThread.start();
|
dismissThread.start();
|
||||||
|
|
||||||
Bundle extras = getIntent().getExtras();
|
Bundle extras = getIntent().getExtras();
|
||||||
title = extras.getString("title", "");
|
|
||||||
message = extras.getString("message", "");
|
message = extras.getString("message", "");
|
||||||
actionstring = extras.getString("actionstring", "");
|
actionstring = extras.getString("actionstring", "");
|
||||||
|
|
||||||
|
@ -43,7 +41,6 @@ public class AcceptActivity extends ViewSelectorActivity {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setContentView(R.layout.grid_layout);
|
|
||||||
setAdapter(new MyGridViewPagerAdapter());
|
setAdapter(new MyGridViewPagerAdapter());
|
||||||
|
|
||||||
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
@ -73,8 +70,6 @@ public class AcceptActivity extends ViewSelectorActivity {
|
||||||
|
|
||||||
if (col == 0) {
|
if (col == 0) {
|
||||||
final View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.action_confirm_text, container, false);
|
final View view = LayoutInflater.from(getApplicationContext()).inflate(R.layout.action_confirm_text, container, false);
|
||||||
final TextView headingView = view.findViewById(R.id.title);
|
|
||||||
headingView.setText(title);
|
|
||||||
final TextView textView = view.findViewById(R.id.message);
|
final TextView textView = view.findViewById(R.id.message);
|
||||||
textView.setText(message);
|
textView.setText(message);
|
||||||
container.addView(view);
|
container.addView(view);
|
||||||
|
|
|
@ -86,7 +86,7 @@ public class WizardActivity extends ViewSelectorActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
//check if it can happen that the fagment is never created that hold data?
|
// check if it can happen that the fragment is never created that hold data?
|
||||||
// (you have to swipe past them anyways - but still)
|
// (you have to swipe past them anyways - but still)
|
||||||
|
|
||||||
int percentage = 100;
|
int percentage = 100;
|
||||||
|
|
|
@ -13,27 +13,13 @@
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
<TextView
|
||||||
<LinearLayout
|
android:id="@+id/message"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:text="message"
|
||||||
<TextView
|
android:textAppearance="@style/TextAppearance.Wearable.Small"
|
||||||
android:id="@+id/title"
|
android:textColor="@color/white" />
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="title"
|
|
||||||
android:textAppearance="@style/TextAppearance.Wearable.Medium"
|
|
||||||
android:textColor="@color/white" />
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/message"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="message"
|
|
||||||
android:textAppearance="@style/TextAppearance.Wearable.Small"
|
|
||||||
android:textColor="@color/white" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
Loading…
Reference in a new issue