Merge pull request #3839 from k9mail/fix_action_mode

Fix placement of action mode bar
This commit is contained in:
cketti 2018-12-23 21:30:45 +01:00 committed by GitHub
commit f0b12e5bfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View file

@ -31,8 +31,9 @@ import android.support.v4.content.CursorLoader;
import android.support.v4.content.Loader;
import android.support.v4.content.LocalBroadcastManager;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.view.ActionMode;
import android.text.TextUtils;
import android.view.ActionMode;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.LayoutInflater;
@ -2693,8 +2694,12 @@ public class MessageListFragment extends Fragment implements OnItemClickListener
}
private void startAndPrepareActionMode() {
actionMode = getActivity().startActionMode(actionModeCallback);
actionMode.invalidate();
AppCompatActivity activity = (AppCompatActivity) requireActivity();
ActionMode actionMode = activity.startSupportActionMode(actionModeCallback);
this.actionMode = actionMode;
if (actionMode != null) {
actionMode.invalidate();
}
}
/**

View file

@ -10,6 +10,8 @@
<style name="Theme.K9.Dark.Base" parent="Theme.AppCompat.NoActionBar" />
<style name="Theme.K9.Light.Common" parent="Theme.K9.Light.Base">
<item name="windowActionModeOverlay">true</item>
<item name="material_drawer_background">@color/material_drawer_background</item>
<item name="material_drawer_primary_text">@color/material_drawer_primary_text</item>
<item name="material_drawer_primary_icon">@color/material_drawer_primary_icon</item>
@ -116,6 +118,8 @@
</style>
<style name="Theme.K9.Dark.Common" parent="Theme.K9.Dark.Base">
<item name="windowActionModeOverlay">true</item>
<item name="material_drawer_background">@color/material_drawer_dark_background</item>
<item name="material_drawer_primary_text">@color/material_drawer_dark_primary_text</item>
<item name="material_drawer_primary_icon">@color/material_drawer_dark_primary_icon</item>