mirror of
https://github.com/gabehf/tempus.git
synced 2026-03-17 11:16:28 -07:00
fix: disable sync starred tracks/albums switches in when Cancel is clicked in warning dialog
This commit is contained in:
parent
cc61d1cd48
commit
e24063e460
3 changed files with 22 additions and 3 deletions
|
|
@ -26,6 +26,12 @@ import java.util.stream.Collectors;
|
|||
public class StarredAlbumSyncDialog extends DialogFragment {
|
||||
private StarredAlbumsSyncViewModel starredAlbumsSyncViewModel;
|
||||
|
||||
private Runnable onCancel;
|
||||
|
||||
public StarredAlbumSyncDialog(Runnable onCancel) {
|
||||
this.onCancel = onCancel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
|
|
@ -74,6 +80,7 @@ public class StarredAlbumSyncDialog extends DialogFragment {
|
|||
Button negativeButton = dialog.getButton(Dialog.BUTTON_NEGATIVE);
|
||||
negativeButton.setOnClickListener(v -> {
|
||||
Preferences.setStarredAlbumsSyncEnabled(false);
|
||||
if (onCancel != null) onCancel.run();
|
||||
dialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ import java.util.stream.Collectors;
|
|||
public class StarredSyncDialog extends DialogFragment {
|
||||
private StarredSyncViewModel starredSyncViewModel;
|
||||
|
||||
private Runnable onCancel;
|
||||
|
||||
public StarredSyncDialog(Runnable onCancel) {
|
||||
this.onCancel = onCancel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
|
|
@ -75,6 +81,7 @@ public class StarredSyncDialog extends DialogFragment {
|
|||
Button negativeButton = dialog.getButton(Dialog.BUTTON_NEGATIVE);
|
||||
negativeButton.setOnClickListener(v -> {
|
||||
Preferences.setStarredSyncEnabled(false);
|
||||
if (onCancel != null) onCancel.run();
|
||||
dialog.dismiss();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue