android-styles

Custom Menu on button click as drop down

自古美人都是妖i 提交于 2019-11-28 05:55:01
问题 I am trying to implement the action bar functionality of the flipkart app. . For this I have successfully created a custom Action Bar but I am facing problems in showing the menu as drop down on overflow icon click. If I try Android Option Menu on button click then on I am getting the menu without icons (4.2.2) at the bottom center of my screen. Using a custom dialog or alert dialog fades the background and they also appear on the center of the screen. What should I do to get the

Android: message font size in alertdialog through styles

假装没事ソ 提交于 2019-11-28 04:12:22
问题 I'm trying to change font size of message in alert dialog through styles but I can't make it work. There is a lot of answers describing how to do this but almost all of them I found do it programmatically. I want to do this once in styles, not with every new alertdialog. What I've done so far: In \AndroidSDK\platforms\android-23\data\res\layout\alert_dialog.xml I see the TextView that is showing the message: <TextView android:id="@+id/message" style="?android:attr/textAppearanceMedium"

Setting header color of app in overview (recent apps) screen

最后都变了- 提交于 2019-11-28 03:28:38
I'm adding some Lollipop-only styling to an app. I want to change color of header in overview screeen like Gmail here: I have figured out I can do <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:colorPrimary">@color/my_favorite_color</item> </style> to achieve it, but I would want to specify only the color for this case, just like I can do: <item name="android:statusBarColor">@color/my_favorite_color<item> Is there a specific attribute to set header's color? Side question: can icon and title be also changed? You can change this via ActivityManager

Android :android:configChanges value for Font Style change in Samsung Device

倖福魔咒の 提交于 2019-11-28 01:49:59
问题 Want to handle the Font Style Change myself.what will be the value? Using the below values now.But the system kills the app and restarts . android:configChanges="orientation|keyboardHidden|fontScale|locale|layoutDirection|screenSize|screenLayout|mnc|mcc|uiMode|navigation|smallestScreenSize" Thanks Nitz 回答1: I don't think this is possible, unfortunately. This seems to be using a different mechanism instead of configuration changes. Setting up a service to listen for android.intent.action

How to change color of EditText handles?

冷暖自知 提交于 2019-11-28 01:05:46
Where does the green color comes from? I've tried changing the accentColor attribute, which works in other parts of the app, but not here. Screenshot from app in Lollipop. How can I change the colors of: the text handle drawables? how to tint them? the select-all-background color? And maybe some tips for the future... How did you find out? I've been coming across all these confusing color/styling problems. Is there some kind of list somewhere that tells me, which default color or attribute that I need to overwrite for a certain component? Rajen Raiyarela For changing the handle color you can

MaterialComponents theme alert dialog buttons

感情迁移 提交于 2019-11-27 21:51:30
Recently I switched from support library to com.google.android.material:material:1.0.0 But now I have a problem, in this pages there's a note https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md Note: Using a Material Components theme enables a custom view inflater which replaces default components with their Material counterparts. Currently, this only replaces Button XML components with MaterialButton. And the theme I am using Theme.MaterialComponents.Light.NoActionBar does exactly what it says in that note, it replaces AlertDialog Buttons to

How do you underline a text in Android XML?

我只是一个虾纸丫 提交于 2019-11-27 17:55:26
How do you underline a text in an XML file? I can't find an option in textStyle . George Artemiou If you are using a string resource xml file (supports HTML tags), it can be done using <b> </b> , <i> </i> and <u> </u> . <resources> <string name="your_string_here"> This is an <u>underline</u>. </string> </resources> If you want to underline something from code use: TextView tv = (TextView) view.findViewById(R.id.tv); SpannableString content = new SpannableString("Content"); content.setSpan(new UnderlineSpan(), 0, content.length(), 0); tv.setText(content); Hope this helps abh22ishek Use this:

AlertDialog styling - how to change style (color) of title, message, etc

僤鯓⒐⒋嵵緔 提交于 2019-11-27 17:42:24
I've breaking my head over this quite a bit. What I need to do is, change the style of all AlertDialog s in my android application - dialog background needs to be white-ish, and text needs to be black-ish. I tried creating a lot of styles, themes, and applying from the code, manifest, etc, but no success, with regard to the text colors inside the AlertDialog . Right now, I have the simplest of codes, set like this: Manifest: <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > styles.xml: <style name="AppTheme" parent=

How to programmatically create an Android theme style?

徘徊边缘 提交于 2019-11-27 15:41:11
问题 There are lots of docs and tutorials on creating or customising an Android theme style via XML, but have not been able to find a way to create it in code. Any ideas on how to create the style in code rather than xml? This is the example XML, need to create this programmatically in code: <resources> <style name="AppTheme" parent="android:Theme.Material"> <item name="android:colorPrimary">@color/primary</item> <item name="android:colorPrimaryDark">@color/primary_dark</item> <item name="android

Why the background of ProgressDialog doesn't set to the transparent?

心已入冬 提交于 2019-11-27 12:06:28
I want to set the back ground to the transparent , so I have set the following code in styles.xml <style name="dialog" parent="@android:style/Theme.Dialog"> <item name="android:windowFrame">@null</item> <item name="android:windowIsFloating">true</item> <item name="android:windowContentOverlay">@null</item> <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> <item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowNoTitle">true</item> </style> And I