How to customize android style in FirebaseUI - android

I'd like to customize the FirebaseUI style for the login activity.
I used a bit of this github.
So far so good but I'd like to take off the shadow below the action bar.
I tried taking off the elevation but still showing up.
<style name="LoginTheme" parent="FirebaseUI">
<item name="android:textColorPrimary">#android:color/black</item>
<item name="colorPrimary">#FFFFFF</item>
<item name="colorPrimaryDark">#FFFFFF</item>
<item name="colorAccent">#000000</item>
<item name="elevation">0dp</item>
</style>
Any recommendation is very welcome.
Thanks!

Related

ScrimBackground from Theme.MaterialComponents is not Working

I'm trying to change the scrimBackground that show up when you opened a dialog. And I know that in the new MaterialComponents-Theme is an attribute for this case (scrimBackground). But it is currently not working for me.
On the material.io website that background is also descriped as the scrimBackground and it looks like that it is customizable from the Theme. Has anyone an idea what I'm doing wrong?
https://material.io/design/components/dialogs.html#theming
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="scrimBackground">#android:color/holo_blue_light</item>
<item name="dialogTheme">#drawable/window_scrim</item>
<item name="android:dialogTheme">#style/DialogTheme</item>
<item name="alertDialogTheme">#style/AlertDialogTheme</item>
<item name="android:alertDialogTheme">#style/AlertDialogTheme</item>
</style>
<style name="DialogTheme" parent="Theme.MaterialComponents.Dialog">
<item name="scrimBackground">#drawable/window_scrim</item>
</style>
<style name="AlertDialogTheme" parent="Theme.MaterialComponents.Dialog.Alert">
<item name="scrimBackground">#drawable/window_scrim</item>
</style>
The Material code does not appear to use this attribute even though it is defined. This issue tracks this problem. In the meantime, you may be able to change this without a Material Theme using the advise in Changing default Android fade/scrim color when calling a Dialog.

Change color of frame around the dialog title in Android

I want to change the background of alert dialog title in theme.
I do following changes in theme:
<style name="NgTheme" parent="#android:style/Theme.Holo.Light">
<item name="android:dialogTheme">#style/NgDialogTheme</item>
<item name="android:alertDialogTheme">#style/NgAlertDialogTheme</item>
</style>
<style name="NgDialogTheme" parent="#android:style/Theme.Holo.Light.Dialog">
<item name="android:background">#android:color/transparent</item>
<item name="android:windowTitleStyle">#style/NgWindowTitleStyle</item>
</style>
<style name="NgAlertDialogTheme" parent="#style/NgDialogTheme">
</style>
<style name="NgWindowTitleStyle" parent="android:TextAppearance.Holo.DialogWindowTitle">
<item name="android:background">#318d99</item>
<item name="android:textColor">#fff</item>
</style>
I expected that background of title becomes #318d99. But only background of text is #318d99:
How can I change white frame around the title to #318d99?
Also the frame around the dialog isn't transparent. How can I fix it?
There are some valuable posts about this already and very closely related to your question.
Google's post on customizing this is possibly worth looking at first:
https://sites.google.com/site/androidhowto/how-to-1/customize-alertdialog-theme
Take a look at this blog post:
http://blog.supenta.com/2014/07/02/how-to-style-alertdialogs-like-a-pro/
Specifically, go to Part 5: Styling the Background.
To summarize, they suggest that you will probably have to
Stop inheriting from Holo
Give your main theme an alertDialogStyle
Then create a style with the following attributes, which you can get a reference to here: http://developer.android.com/reference/android/R.styleable.html#AlertDialog
You'll want to create a new style that inherits from the default alertdialog theme (this is discussed in both posts I mentioned above):
<style name="CustomDialogTheme" parent="#android:style/Theme.Dialog">
<item name="android:bottomBright">#color/white</item>
<item name="android:bottomDark">#color/white</item>
<item name="android:bottomMedium">#color/white</item>
<item name="android:centerBright">#color/white</item>
<item name="android:centerDark">#color/white</item>
<item name="android:centerMedium">#color/white</item>
<item name="android:fullBright">#color/orange</item>
<item name="android:fullDark">#color/orange</item>
<item name="android:topBright">#color/blue</item>
<item name="android:topDark">#color/blue</item>
</style>

Change Android 5.0 Actionbar color

I'm working with the new Lollipop Material Design guidelines and would like to incorporate that nifty navigation drawer animation in my app. I've gotten that far, by using the android.support.v7.app.ActionBarDrawerToggle, but now I'm having difficulty changing the color of said action bar. It stays bright gray no matter what I set the theme to. How would one go about changing the color of the actionbar? This is what my app theme looks like:
//res/values/styles.xml
<style name="AppTheme" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/ActionBar</item>
<item name="android:colorPrimary">#color/primaryDef</item>
<item name="android:colorPrimaryDark">#color/primaryDarkDef</item>
<item name="android:activatedBackgroundIndicator">#drawable/defbg</item>
<item name="android:colorAccent">#color/primaryDef</item>
<item name="android:navigationBarColor">#color/primaryDarkDef</item>
</style>
<style name="ActionBar" parent="android:Widget.ActionBar">
<item name="android:background">#color/primaryDef</item>
</style>
AppCompat does not use the android: prefixed attributes for the Material Theme color palette items per the migration guide to v21 by the author of AppCompat. Instead, just use the names themselves:
<style name="AppTheme" parent="#style/Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/primaryDef</item>
<item name="colorPrimaryDark">#color/primaryDarkDef</item>
<item name="colorAccent">#color/primaryDef</item>
<item name="android:navigationBarColor">#color/primaryDarkDef</item>
<item name="android:activatedBackgroundIndicator">#drawable/defbg</item>
</style>
The Action Bar will be colored by colorPrimary.

Android Action bar Background

I have been trying to change the background of my action bar for quite some time now. I found some posts here of users who could change the background but not the text color. In my example this is the contrary as the background is giving me problems.
I have not created any dynamic design from my activity.
The following is my style.xml:
<style name="MyTheme" parent="android:style/Theme.Holo.Light">
<item name="android:actionBarStyle">#style/MyTheme.ActionBarStyle</item>
</style>
<style name="MyTheme.ActionBarStyle" parent="android:style/Widget.Holo.Light.ActionBar">
<item name="android:titleTextStyle">#style/MyTheme.ActionBar.TitleTextStyle</item>
<item name="android:background">#FD5200</item>
</style>
<style name="MyTheme.ActionBar.TitleTextStyle" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
<item name="android:textColor">#FD5200</item>
</style>
Any knows what might be causing this?
Consider using ActionBarSherlock a link here may help you going.

Style Inheritance with ActionBar Tab troubles

Many of my questions about "styling" actionbar tabs were answered by adamp in this thread on tab style, but I am still struggling with my arriving at the desired presentation.
Specifically, I am attempting to do what adamp suggested in the following fragment from my styles.xml file, but, I cannot get the inherited (Widget.holo.actionbar) feature of a light blue line to appear under the selected tab nor is there any indication of selection:
<style name="MyTheme" parent="android:style/Theme.Holo">
<item name="android:actionBarStyle">#style/CustomActionBar</item>
</style>
<style name="CustomActionBar" parent="android:style/Widget.Holo.ActionBar">
<item name="android:actionBarTabTextStyle">#style/customActionBarTabTextStyle</item>
<item name="android:actionBarTabStyle">#style/customActionBarTabStyle</item>
<item name="android:actionBarTabBarStyle">#style/customActionBarTabBarStyle</item>
</style>
<style name="customActionBarTabTextStyle" parent="#style/CustomActionBar">
<item name="android:textColor">#2966c2</item>
<item name="android:textSize">20sp</item>
<item name="android:typeface">sans</item>
</style>
<style name="customActionBarTabStyle" parent="#style/CustomActionBar">
<!-- <item name="android:background">#drawable/actionbar_tab_bg</item> -->
<item name="android:paddingLeft">20dp</item>
<item name="android:paddingRight">20dp</item>
</style>
<style name="customActionBarTabBarStyle" parent="#style/CustomActionBar">
<item name="android:paddingLeft">240dp</item>
</style>
Can someone explain why the thin blue line selection behavior of the Honeycomb Gallery Sample App does not work for me?
New insight since this was written: the problem here, I think, is that the style I have created to overide ActionBarTabStyle is entirely bogus:
<style name="customActionBarTabStyle" parent="#style/CustomActionBar">
<item name="android:paddingLeft">20dp</item>
<item name="android:paddingRight">20dp</item>
</style>
I need to specify the correct parent of this style per "Theme.holo"....how can one find where the default style is so it can be specified as a parent?
Thanks
To specify the correct parents for actionbar style in API 11, Check doc here:
https://developer.android.com/training/basics/actionbar/styling.html

Categories

Resources