mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 15:27:55 -04:00
Disable swipeLayout after long press
This commit is contained in:
parent
367e0d642b
commit
6bbea63a8e
@ -138,10 +138,16 @@ public class ZimFileSelectFragment extends BaseFragment
|
|||||||
|
|
||||||
if (checked) { // If the item was selected
|
if (checked) { // If the item was selected
|
||||||
selectedViewPosition.add(position);
|
selectedViewPosition.add(position);
|
||||||
|
swipeRefreshLayout.setEnabled(
|
||||||
|
false); //disabled to stop selected items getting deselected (issue #1019)
|
||||||
|
swipeRefreshLayout.setRefreshing(false);
|
||||||
mode.setTitle("" + selectedViewPosition.size()); // Update title of the CAB
|
mode.setTitle("" + selectedViewPosition.size()); // Update title of the CAB
|
||||||
} else { // If the item was deselected
|
} else { // If the item was deselected
|
||||||
selectedViewPosition.remove(Integer.valueOf(position));
|
selectedViewPosition.remove(Integer.valueOf(position));
|
||||||
mode.setTitle("" + selectedViewPosition.size()); // Update title of the CAB
|
mode.setTitle("" + selectedViewPosition.size()); // Update title of the CAB
|
||||||
|
if (selectedViewPosition.isEmpty()) {
|
||||||
|
swipeRefreshLayout.setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,6 +253,7 @@ public class ZimFileSelectFragment extends BaseFragment
|
|||||||
@Override
|
@Override
|
||||||
public void onDestroyActionMode(ActionMode mode) {
|
public void onDestroyActionMode(ActionMode mode) {
|
||||||
// Upon closure of the CAB, empty the array list of selected list item positions
|
// Upon closure of the CAB, empty the array list of selected list item positions
|
||||||
|
swipeRefreshLayout.setEnabled(true);
|
||||||
selectedViewPosition.clear();
|
selectedViewPosition.clear();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user