mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-21 20:35:58 +03:00
Fix #715 Multiselect broken
Signed-off-by: stefan-niedermann <info@niedermann.it>
This commit is contained in:
parent
edfb60f588
commit
4fa0329c91
2 changed files with 7 additions and 19 deletions
|
@ -738,7 +738,8 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
|
|||
|
||||
@Override
|
||||
public void onNoteClick(int position, View v) {
|
||||
if (mActionMode != null) {
|
||||
boolean hasCheckedItems = adapter.getSelected().size() > 0;
|
||||
if (hasCheckedItems) {
|
||||
if (!adapter.select(position)) {
|
||||
v.setSelected(false);
|
||||
adapter.deselect(position);
|
||||
|
@ -746,23 +747,9 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
|
|||
v.setSelected(true);
|
||||
}
|
||||
int size = adapter.getSelected().size();
|
||||
if (size > 0) {
|
||||
mActionMode.setTitle(getResources().getQuantityString(R.plurals.ab_selected, size, size));
|
||||
int checkedItemCount = adapter.getSelected().size();
|
||||
boolean hasCheckedItems = checkedItemCount > 0;
|
||||
|
||||
if (hasCheckedItems && mActionMode == null) {
|
||||
// TODO differ if one or more items are selected
|
||||
// if (checkedItemCount == 1) {
|
||||
// mActionMode = startActionMode(new
|
||||
// SingleSelectedActionModeCallback());
|
||||
// } else {
|
||||
// there are some selected items, start the actionMode
|
||||
mActionMode = startSupportActionMode(new MultiSelectedActionModeCallback(
|
||||
this, this, db, mActionMode, adapter, listView, this::refreshLists, getSupportFragmentManager(), searchView
|
||||
));
|
||||
// }
|
||||
} else if (!hasCheckedItems && mActionMode != null) {
|
||||
// there no selected items, finish the actionMode
|
||||
} else {
|
||||
mActionMode.finish();
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
- 🌓 Make background of dark theme darker (#557)
|
||||
- 🌓 Change the font color for Markdown (#716)
|
||||
- 🐞 Fix jumping cursor when handle code blocks (#558)
|
||||
- 💡 Lots of empty notes are created if the server is full (#679)
|
||||
- 🐞 Fix jumping cursor when handle code blocks (#558)
|
||||
- 🐞 Multiselect broken (#715)
|
||||
|
||||
Requires at least Files app¹ version 3.9.0
|
||||
¹ https://github.com/nextcloud/android
|
Loading…
Reference in a new issue