mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
Fix re-enabling tab switching in MediaOverview.
We were being inconsistent in how we were handling exiting multiselect, and it wasn't behaving properly when you left by clicking the 'x'. Now it's all handled centrally. Fixes #8234
This commit is contained in:
parent
bc6941589c
commit
2c5fa155ae
@ -286,7 +286,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
|
||||
adapter.toggleSelection(mediaRecord);
|
||||
if (adapter.getSelectedMediaCount() == 0) {
|
||||
exitMultiSelect();
|
||||
actionMode.finish();
|
||||
} else {
|
||||
actionMode.setTitle(String.valueOf(adapter.getSelectedMediaCount()));
|
||||
}
|
||||
@ -360,7 +360,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
attachments.size());
|
||||
saveTask.executeOnExecutor(THREAD_POOL_EXECUTOR,
|
||||
attachments.toArray(new SaveAttachmentTask.Attachment[attachments.size()]));
|
||||
exitMultiSelect();
|
||||
actionMode.finish();
|
||||
}
|
||||
}.execute();
|
||||
})
|
||||
@ -422,12 +422,6 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
((MediaOverviewActivity) getActivity()).onEnterMultiSelect();
|
||||
}
|
||||
|
||||
private void exitMultiSelect() {
|
||||
actionMode.finish();
|
||||
actionMode = null;
|
||||
((MediaOverviewActivity) getActivity()).onExitMultiSelect();
|
||||
}
|
||||
|
||||
private class ActionModeCallback implements ActionMode.Callback {
|
||||
|
||||
private int originalStatusBarColor;
|
||||
@ -458,7 +452,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
return true;
|
||||
case R.id.delete:
|
||||
handleDeleteMedia(getListAdapter().getSelectedMedia());
|
||||
exitMultiSelect();
|
||||
actionMode.finish();
|
||||
return true;
|
||||
case R.id.select_all:
|
||||
handleSelectAllMedia();
|
||||
@ -471,6 +465,7 @@ public class MediaOverviewActivity extends PassphraseRequiredActionBarActivity {
|
||||
public void onDestroyActionMode(ActionMode mode) {
|
||||
actionMode = null;
|
||||
getListAdapter().clearSelection();
|
||||
((MediaOverviewActivity) getActivity()).onExitMultiSelect();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
getActivity().getWindow().setStatusBarColor(originalStatusBarColor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user