Hide notification via theme - android

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.

Related

Style Android ActionMode bar

I'm trying to style the ActionMode bar. I want the bar to remain the same except for some margin on the right (end).
<style name="GalleryActionMode" parent="#android:style/Widget.Material.ActionMode">
<item name="android:paddingEnd">56dp</item>
<item name="android:layout_marginEnd">56dp</item>
</style>
I'm not interested in the padding, but I used it as a test and the padding adjustment works. Margin, however, has no effect. I imagine this might be related to some unusual way it enters the existing layout. Is there some way to style the layout of the ActionMode bar?
I could not find a way to do this natively, but in my searching I found a great (and tiny) library that can be used as a replacement for the CAB that behaves more like a toolbar. It was easily customizable and almost plugs right into the existing CAB model.
https://github.com/afollestad/material-cab/

Allowing views behind the status bar

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>

make android HomeAsUp icon disappear on demand

In my android app, in the Action Bar, next to the < image is an icon. I want to make it invisible/gone ondemand dynamically. How do I do that? The icon is actually defined as follows (this should help you realize where in the action bar I am talking about).
<style name="MyAppName.LogoTheme.LogoActionBar" parent="MyAppName.Theme.ActionBar">
<item name="android:displayOptions">showHome|homeAsUp</item>
<item name="android:icon">#drawable/my_icon</item>
I tried the following, but nothing.
this.getActionBar().setDisplayHomeAsUpEnabled(false);
this.getActionBar().setLogo(null);
this.getActionBar().setDisplayUseLogoEnabled(true);
In Java, call setDisplayShowHomeEnabled(false) and setDisplayShowTitleEnabled(false) on your ActionBar.

Custom Title bar with Holo Themes

Like a lot of people, I would like to use a custom title bar in android but also use the Holo theme. I've seen a lot of posts recommending using Theme.Holo.NoActionBar but it still gives me the same error as when I change my custom theme to use Theme.Holo. I want to resolve once and for all, is it possible to use a custom title bar like this:
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.activity_main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,R.layout.custom_title_bar);
which seems to be the most common way to do it.
Well you can create another element layout which looks like title bar for you and in the current activity you can set requestWindowFeature(Window.FEATURE_NO_TITLE)
This way you get the holo theme aswell as custom title. This is commonly used practice in this scenario.
you can define parent="#android:style/Theme.Holo"
then just disable the windows action bar
like this
<item name="android:windowActionBar">false</item>
in theme.
It's working for me...

ActionBarsherlock how to set dividers on menu items with icons only

Hello android developers,
I know this question have been asked many of times, and I have also tried many solutions but they are not working for me.
Firstly I am using action bar sherlock library to show action bar,and I want to show dividers between menu items with icons only.
For that I create custom style for showing divider but they are not showing.
<style name="Theme.SherlockCustom" parent="#style/Theme.Sherlock.Light">
<item name="android:actionBarDivider">#drawable/actionbar_seprator</item>
<item name="android:showDividers">middle</item>
</style>
And also tried to update sherlock library ActionMenuItemView.java for ActionBar where needsDividerBefore() will always give true. But this patch also not worked for me. Please help where I am going wrong. Thanks.
You can't get dividers on versions > 4.0 for your scenario unless you use a custom view for your action bar; the native implementation controls the behavior internally and doesn't give any hook to modify that.
HTH,
Ali.

Categories

Resources