Question

I have implemented my own viewgroup for my application. Using actionbar is not an option for various reasons so in my viewgroup I have my own "actionbars" one on top and one in the bottom. Image 1 illustrates my current layout.

Image 1

As you can see there are two edittexts in the layout and everything looks ok.

However when the user selects some text in any of the edittexts the contextual actionmode bar is shown. Image 2 illustrates this.

Image 2

When this happens actionmode bar "pushes" down my entire layout in order to get its space. In tablets and other large screen devices this is OK but in smaller devices and especially with the soft keyboard visible the remaining height is too small (in landscape orientation is unusable).

What I want to do is actionmode bar to overlay my layout instead of pushing it down as shown in Image 3.

Image 3

Is that possible?

Was it helpful?

Solution

Just add <item name="android:windowActionModeOverlay">true</item> to your style.

OTHER TIPS

To use windowActionModeOverlay with appcompat toolbar,use

<item name="windowActionModeOverlay">true</item>  

to your style.

This can also be done programmatically using:

 getWindow().requestFeature(Window.FEATURE_ACTION_MODE_OVERLAY);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top