Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make contextual actionmode bar overlay my layout instead of "pushing" it down

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?

like image 731
ChD Computers Avatar asked Jul 04 '13 14:07

ChD Computers


2 Answers

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

like image 104
marijnvdwerf Avatar answered Sep 19 '22 22:09

marijnvdwerf


To use windowActionModeOverlay with appcompat toolbar,use

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

to your style.

like image 36
Giru Bhai Avatar answered Sep 19 '22 22:09

Giru Bhai