Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/stefan-niedermann/nextcloud-notes.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/it/niedermann/owncloud/notes/main/MultiSelectedActionModeCallback.java')
-rw-r--r--app/src/main/java/it/niedermann/owncloud/notes/main/MultiSelectedActionModeCallback.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/main/MultiSelectedActionModeCallback.java b/app/src/main/java/it/niedermann/owncloud/notes/main/MultiSelectedActionModeCallback.java
index a76b2068..194dcbc8 100644
--- a/app/src/main/java/it/niedermann/owncloud/notes/main/MultiSelectedActionModeCallback.java
+++ b/app/src/main/java/it/niedermann/owncloud/notes/main/MultiSelectedActionModeCallback.java
@@ -42,6 +42,8 @@ public class MultiSelectedActionModeCallback implements Callback {
@NonNull
private final View view;
@NonNull
+ private final View anchorView;
+ @NonNull
private final MainViewModel mainViewModel;
@NonNull
private final LifecycleOwner lifecycleOwner;
@@ -52,9 +54,17 @@ public class MultiSelectedActionModeCallback implements Callback {
private final FragmentManager fragmentManager;
public MultiSelectedActionModeCallback(
- @NonNull Context context, @NonNull View view, @NonNull MainViewModel mainViewModel, @NonNull LifecycleOwner lifecycleOwner, boolean canMoveNoteToAnotherAccounts, @NonNull SelectionTracker<Long> tracker, @NonNull FragmentManager fragmentManager) {
+ @NonNull Context context,
+ @NonNull View view,
+ @NonNull View anchorView,
+ @NonNull MainViewModel mainViewModel,
+ @NonNull LifecycleOwner lifecycleOwner,
+ boolean canMoveNoteToAnotherAccounts,
+ @NonNull SelectionTracker<Long> tracker,
+ @NonNull FragmentManager fragmentManager) {
this.context = context;
this.view = view;
+ this.anchorView = anchorView;
this.mainViewModel = mainViewModel;
this.lifecycleOwner = lifecycleOwner;
this.canMoveNoteToAnotherAccounts = canMoveNoteToAnotherAccounts;
@@ -110,6 +120,7 @@ public class MultiSelectedActionModeCallback implements Callback {
? context.getString(R.string.action_note_deleted, fullNotes.get(0).getTitle())
: context.getResources().getQuantityString(R.plurals.bulk_notes_deleted, fullNotes.size(), fullNotes.size());
BrandedSnackbar.make(view, deletedSnackbarTitle, Snackbar.LENGTH_LONG)
+ .setAnchorView(anchorView)
.setAction(R.string.action_undo, (View v) -> {
for (final var deletedNote : fullNotes) {
final var undoLiveData = mainViewModel.addNoteAndSync(deletedNote);
@@ -119,6 +130,7 @@ public class MultiSelectedActionModeCallback implements Callback {
? context.getString(R.string.action_note_restored, fullNotes.get(0).getTitle())
: context.getResources().getQuantityString(R.plurals.bulk_notes_restored, fullNotes.size(), fullNotes.size());
BrandedSnackbar.make(view, restoreSnackbarTitle, Snackbar.LENGTH_SHORT)
+ .setAnchorView(anchorView)
.show();
})
.show();