Ohoy. As Im upgrading my app to L, I replaced ActionBars with Toolbars and whenever I start an ActionMode now it pushes down all the content. (I suppose this is because the ActionBar is once again shown in order to display the ActionMode.) Is it possible to display the ActionMode as an overlay, or have it reside within the Toolbar?
Also no styling options seem to apply to it, which makes me wonder whether theres a new way to style it. Any ideas?
Im using AppCompat V7 21 and so far Ive tried windowActionModeOverlay=true and toolbar.startActionMode(..)
Use <item name="windowActionModeOverlay">true</item> in your app theme (without android:).
Related
Actually I am using
#android:style/Theme.Holo.Wallpaper.NoTitleBar
in my android launcher app. But the problem is when I am changing
navigation bar color
for lollipop and above devices, it's not changing. I tried pro-grammatically as well as from styles.xml.
If I am using appcompat theme, then it's working. But I don't wanna use appcompat theme for my launcher app. So what is the reason behind it and give me solution as well.
I want to make my app in Material Design, but one thing I noticed was that the ContextMenus are themed in Holo, as seen here: .
Is there a way to make the context menu Material Themed?
Maybe this post helps:
Styling the popup menu in Android 5.0
They try to do exactly the opposite there. Note that using the ActionBar and using the right application/activity theme should do the trick.
This however is for the ActionBar context menu. I think the longpress ListView context menu is being phased out. It might be possible to make a custom theme for it though:
Android: Theme ContextMenu item selection
Maybe this is not quite an ActionBar problem but the problem is as follows;
I have an EditText and when you long click on the EditText, text selection options appear on ActionBar's position by default. My problem is that, both the texts and background are white, so they cannot be read. Here is the screenshot:
I tried some possible causes of the problem but nothing helped. For example, I tried to change the theme
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
However, any theme with the AppCompat results totally white.
Also I changed the project theme in Android Studio's interface as follows:
However it's still white.
The copy-paste options are there and you can click on them, but how can I make them appear? Another solution on SA suggested manually replacing gray icons. But I believe this is not the usual case in Android and there should be another way. Any ideas?
I am designing an app with Material Design, but I am having trouble styling the ActionBar.
First of all, I can not get the ActionBar to render a shadow. I have tried setting the elevation in multiple ways:
In the styles.xml (v21):
<item name="android:elevation">4dp</item>
<item name="elevation">4dp</item>
In the onCreate() method
getActionBar().setElevation(4);
However, none of these result in the ActionBar rendering a shadow. Not sure if this is important, but I am running Android 5.0.1 Lollipop. What am I missing in trying to render a shadow? I don't really want to make a drawable shadow and set it as the window background.
Secondly, my ActionBar buttons are square, and when I click on them, the ripple is cut off in a square, while in other apps I have used the mask for the ripples has been circular, and my app had been using round buttons, but recently it changed and I don't know why. Could I have accidentaly changed something making them square?
Thank you
The issue is that u use ActionBar while the other apps use ToolBar. Read about and change your code, everything should work after that.
the navigation bar is overlaying my activity view on the bottom. Same issue like here: Android Navigation Bar overlaying my view
The issue seems to happen only on Android Lollipop. On my Moto G with KitKat 4.4.4. i don't have this issue. I don't know why this problem is only related to Lollipop.
My problem is, with the solution #ps-glass postet is not working for me somehow setting fitsSystemWindow = true. I tried it with the theme or with the layout file directly, nothing worked for me so far.
Here is an image: https://drive.google.com/file/d/0B5g_MttTC7ZIQzNfS3Y2dVFKSFk/view?usp=sharing
You can only see a bit of the text, the rest is overlaid by the navigation bar.
I found out that this problem is related to a library we are using:
https://github.com/jfeinstein10/SlidingMenu
and other people have this problem too after they updated their AppCompat to v21.
Some solutions were posted here https://github.com/jfeinstein10/SlidingMenu/issues/680 and another one here The getDecorView method return view include navigation bar view on lollipop?
The Solution from https://stackoverflow.com/users/715451/saulobrito is working for me now and it is the easiest way i think.
<style name="Theme" parent="FrameworkRoot.Theme">
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
</style>
I put this code snippet to a my theme in the res/values-v21 folder.