Merge pull request #1080 from substars/confirm-dialogs-fix

Fix dialogs and remove extra CONFIRM. Fixes #1078
This commit is contained in:
Milos Kozak 2021-12-16 14:55:31 +01:00 committed by GitHub
commit 176d898d0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 29 deletions

View file

@ -522,7 +522,7 @@ public class ListenerService extends WearableListenerService implements GoogleAp
intent.putExtras(params);
startActivity(intent);
} else {
showConfirmationDialog(title, message, actionstring);
showConfirmationDialog(message, actionstring);
}
} else if (path.equals(NEW_STATUS_PATH)) {
@ -680,12 +680,10 @@ public class ListenerService extends WearableListenerService implements GoogleAp
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.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);

View file

@ -21,7 +21,6 @@ import info.nightscout.androidaps.data.ListenerService;
public class AcceptActivity extends ViewSelectorActivity {
String title = "";
String message = "";
String actionstring = "";
private DismissThread dismissThread;
@ -34,7 +33,6 @@ public class AcceptActivity extends ViewSelectorActivity {
dismissThread.start();
Bundle extras = getIntent().getExtras();
title = extras.getString("title", "");
message = extras.getString("message", "");
actionstring = extras.getString("actionstring", "");
@ -43,7 +41,6 @@ public class AcceptActivity extends ViewSelectorActivity {
return;
}
setContentView(R.layout.grid_layout);
setAdapter(new MyGridViewPagerAdapter());
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
@ -73,8 +70,6 @@ public class AcceptActivity extends ViewSelectorActivity {
if (col == 0) {
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);
textView.setText(message);
container.addView(view);

View file

@ -86,7 +86,7 @@ public class WizardActivity extends ViewSelectorActivity {
@Override
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)
int percentage = 100;

View file

@ -13,27 +13,13 @@
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/title"
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>
android:text="message"
android:textAppearance="@style/TextAppearance.Wearable.Small"
android:textColor="@color/white" />
</androidx.core.widget.NestedScrollView>
</FrameLayout>