I know this question was asked already but the answer does not work. I am trying to put an image behind the status bar. I have tried to accomplish this for some time with many different solutions but I am not getting the solution. Doe's anyone know how to make the layout behind the status bar? I have yet to see a solid example. They didn't even use this in their I/O app otherwise, I wouldn't be asking this question.
Targeting api 21 and greater.
Using NoActionBar
<style name="LogInTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>
It looks like you want a transparent status bar.
Add this line to your style:
<item name="android:windowTranslucentStatus">true</item>
Related
I've searched for a solution, but haven't found one yet.
I'm currently in the process of creating an Android app and my team wants to keep the experience of our app the same across the recent Android versions. We're using the Support v7 library, so most of the Material Design elements can be used in our app, but we're kinda struggling to find a replacement for the tinted status bar. We've got a nice bar on Lollipop, but Kitkat is stuck with the ugly black bar and we'd really like to change that.
We were thinking about a translucent bar for pre-Lollipop devices, but we're not sure on how to approach that. I've tried copying the styles.xml to a new folder, values-v19, and adding
<item name="android:windowTranslucentStatus">true</item>
<item name="android:fitsSystemWindows">true</item>
to the styles, but this is also applied to my phone running Android 5.0.2, strangely enough.
Do you happen to know how to fix this or another method to create a similar effect? I'm new to Android, so detailed explanations will be appreciated.
Try adding
<item name="android:windowTranslucentStatus">false</item>
<item name="android:fitsSystemWindows">false</item>
to either values/styles.xml or values-v21/styles.xml.
When you define a style for a certain API level it will be applied not only to that version, but also to all higher versions, unless explicitly specified otherwise.
I want to change the background and text colors of the pop up menu that appears when the user presses the overflow icon.
If I use Theme.Holo or Theme.Holo.Light it works, but I'm using Theme.Holo.Light.DarkActionBar and it never works. I'm starting to assume that it's an Android bug.
I'm testing on a Nexus 4 with 4.4.2 but it also doesn't work on an emulator with API 19.
After trying a lot of potential solutions that I came across here in StackOverflow, here is what I'm doing:
<style name="Theme.MyApp" parent="android:Theme.Holo.Light.DarkActionBar">
<item name="android:actionBarWidgetTheme">#style/ActionBarWidget</item>
</style>
<style name="AndroidPitActionBarWidget" parent="android:Theme.Holo.Light">
<item name="android:popupMenuStyle">#android:style/Widget.Holo.Light.PopupMenu</item>
<item name="android:dropDownListViewStyle">#android:style/Widget.Holo.Light.ListView.DropDown</item>
</style>
That works but it changes the styling of the SearchView, which is another pain to change.
So I'm not considering this a solution.
What I want is to just change the background/text of the popup to the Light version, which is light background with black text.
I also tried setting those two attributes in the main theme instead of using the actionBarWidgetTheme.
It's really frustrating to waste hours on this kind of problems.
I also tried using Action Bar Style Generator to make the background white, but then the text is white and I can't change it to black.
Thanks very much in advance.
If you set the background color of that panel using the theme you get in the Action Bar Style Generator, you can try adding the android:textColor attribute of the drop down ListView.
If that does not work, you can alternately set the string color in code during your onCreateOptionsMenu method as detailed on this SO thread
So I've basically looked into every resource I saw online on how to change the blue underline in the tabs, but all of the advice has not worked in my case.
I tried actionbarsherlock, appcombat, holo from Action Bar Generator but all the coloring did was color the top action bar, not the tab underline. And yes the files did compile and did not have any errors, but for some reason, it seemed like the underline would never be changed even through the generator.
I am confused on how to change the default blue underline on the tabs, and I would SO EXTREMELY appreciate it if there was a working custom style xml that you would share.
After going to Changing ActionBar tabs underline color programmatically result is still same :/
Screen shot after trying from other page: http://i.stack.imgur.com/EOUbu.png
Anyone able to help me out?
I've been struggling with this for days, but finally found the solution. I'm using AppCompat. You can set colorAccent in your theme and that will change the highlight color on your ActionBar. Like so:
<item name="colorAccent">#color/highlightcolor</item>
Here it is in context:
<style name="LightTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/darkgrey</item>
<item name="colorPrimaryDark">#color/black</item>
<item name="colorAccent">#color/highlightcolor</item>
</style>
You need to define a custom theme for that, and then check the states to change the colour of the line. See if this answer helps you
Not sure if you are still pursuing this, but can you show what you did with Action Bar Generator? What Style entries did you add (in XML) and which drawables did you add?
I just went through the same process and it worked well with Action Bar Generator; just required a few lines added to the styles.xml, a new xml file in drawables folder, and then about 5 new image drawables into each of the resolution size folders (drawable-hdpi, etc).
I'm using ViewPageIndicator to customize the looks of the tabs in my app but I'm really new to android so I don't really know to get exactly where I want to.
Here's a gif that I made to show how I want it to behave: http://i.imgur.com/1FSw5ae.gif
I couldnt find any options to make the make the background semi-transparent like android:background_alpha or something , instead I found this topic How to make a background 20% transparent on Android but it didn't worked either.
As for the tabs switching color depending on the content I have no idea how to get there =/
If anyone could help I'd be really glad.
Here's the code for the styles:
<style name="CustomTabPageIndicator" parent="Widget.TabPageIndicator">
<item name="android:textSize">16sp</item>
<item name="android:textColor">#6abd45</item>
<item name="android:background">#80000000</item>
</style>
Thanks in advance.
I know how to do this via java code, but I'm wondering how I can set this in my own custom theme. I've found
<item name="android:windowNoTitle">true</item>
for hiding the application title bar, but is there an item that will hide the notification bar? I haven't been able to find this yet.
From your question I assume you want fullscreen capability? Here's a possible answer that can at least give you an idea.