1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-10 15:18:23 +02:00

Fix widget device choice dialog behaviour

This commit is contained in:
Arjan Schrijver 2023-08-05 21:48:34 +02:00 committed by Arjan Schrijver
parent d46ed71a46
commit ee4f3fabcf
2 changed files with 4 additions and 31 deletions

View File

@ -83,12 +83,6 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity implements G
String[] allDevicesString = list.toArray(new String[0]);
builder.setSingleChoiceItems(allDevicesString, 0, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ListView lw = ((AlertDialog) dialog).getListView();
@ -106,16 +100,8 @@ public class SleepAlarmWidgetConfigurationActivity extends Activity implements G
finish();
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent resultValue;
resultValue = new Intent();
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
setResult(RESULT_CANCELED, resultValue);
finish();
}
});
builder.setCancelable(false);
AlertDialog dialog = builder.create();
dialog.show();
}

View File

@ -77,12 +77,6 @@ public class WidgetConfigurationActivity extends Activity implements GBActivity
String[] allDevicesString = list.toArray(new String[0]);
builder.setSingleChoiceItems(allDevicesString, 0, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
}
});
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ListView lw = ((AlertDialog) dialog).getListView();
@ -100,15 +94,8 @@ public class WidgetConfigurationActivity extends Activity implements GBActivity
finish();
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Intent resultValue; resultValue = new Intent();
resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
setResult(RESULT_CANCELED, resultValue);
finish();
}
});
builder.setCancelable(false);
AlertDialog dialog = builder.create();
dialog.show();
}