mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-25 06:16:15 +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
|
@Override
|
||||||
public void onNoteClick(int position, View v) {
|
public void onNoteClick(int position, View v) {
|
||||||
if (mActionMode != null) {
|
boolean hasCheckedItems = adapter.getSelected().size() > 0;
|
||||||
|
if (hasCheckedItems) {
|
||||||
if (!adapter.select(position)) {
|
if (!adapter.select(position)) {
|
||||||
v.setSelected(false);
|
v.setSelected(false);
|
||||||
adapter.deselect(position);
|
adapter.deselect(position);
|
||||||
|
@ -746,23 +747,9 @@ public class NotesListViewActivity extends AppCompatActivity implements ItemAdap
|
||||||
v.setSelected(true);
|
v.setSelected(true);
|
||||||
}
|
}
|
||||||
int size = adapter.getSelected().size();
|
int size = adapter.getSelected().size();
|
||||||
|
if (size > 0) {
|
||||||
mActionMode.setTitle(getResources().getQuantityString(R.plurals.ab_selected, size, size));
|
mActionMode.setTitle(getResources().getQuantityString(R.plurals.ab_selected, size, size));
|
||||||
int checkedItemCount = adapter.getSelected().size();
|
} else {
|
||||||
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
|
|
||||||
mActionMode.finish();
|
mActionMode.finish();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
- 🌓 Make background of dark theme darker (#557)
|
- 🌓 Make background of dark theme darker (#557)
|
||||||
- 🌓 Change the font color for Markdown (#716)
|
- 🌓 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)
|
- 💡 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
|
Requires at least Files app¹ version 3.9.0
|
||||||
¹ https://github.com/nextcloud/android
|
¹ https://github.com/nextcloud/android
|
Loading…
Reference in a new issue