Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overlay or hide Toolbar on copy/cut selection

I've created an activity with the new Appcompat v21 Toolbar. Everything works fine except when I highlight some text out of a TextView. The copy/cut Actionbar shows up, but instead of overlaying my existing toolbar or hiding it it just pushes the toolbar down so I get something like this:

enter image description here

Now my question is, how can I make the copy/cut actionbar overlay my toolbar? Or should I just hide it if text is selected? If so, how do I listen for textselection?

Best regards

like image 468
user2410644 Avatar asked Nov 21 '14 15:11

user2410644


1 Answers

in your theme you need to add this to it

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

so it would look something like this

<style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="colorPrimary">@color/color_primary</item>
    <item name="colorPrimaryDark">@color/color_primary_dark</item>
    <item name="colorAccent">@color/color_primary</item>
    <item name="windowActionModeOverlay">true</item>
</style>
like image 52
tyczj Avatar answered Nov 06 '22 14:11

tyczj