android-styles

How to create 'Horizontal style' progress bar programmatically in Android?

血红的双手。 提交于 2020-01-01 23:12:55
问题 I am creating a ProgressBar in my app programmatically it is of SPIN style by default however I want it in HORIZONTAL style. I don't see any method/constant to achieve this. And I don't want to use ProgressDialog as it'd be inconsistent with my App UI theme. Any suggestions please? 回答1: use this: ProgressBar pb = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal); 回答2: If you are using a ProgressDialog then, here is a way to change the style of the progressBar in the

Styling Tab Widget's using XML

妖精的绣舞 提交于 2020-01-01 16:09:28
问题 So I am having great difficultly styling tab widgets using xml. Everywhere I have searched seem's to either suggest solutions to do this programmatically, or refers to the actionBarTab style >:| What I am trying to achieve is a customised tab from the tabwidget drawables that was generated using http://android-holo-colors.com/ I manage to get the So in my custom theme I have this code: <style name="RR.App.Theme" parent="android:Theme.Holo.Light"> ... <item name="android:tabWidgetStyle">@style

Android TimePickerDialog styling guide/docs?

家住魔仙堡 提交于 2019-12-31 22:23:11
问题 I'm trying to style a TimePickerDialog for sdk 21+ (Lollipop). So far I've figured out how to change the default colorscheme in XML: <style name="TimePickerTheme" parent="@style/Theme.AppCompat.Light.Dialog"> <item name="colorPrimary">#ff2d6073</item> <!-- no effect --> <item name="colorPrimaryDark">#ff2d6073</item> <!-- no effect --> <item name="colorAccent">#ff2d6073</item> <item name="android:textColor">#ffD0D102</item> <item name="android:textColorPrimary">#ffD0D102</item> </style> This

How to change the navigation icon color

和自甴很熟 提交于 2019-12-31 05:40:12
问题 I have a navigationView in my app and after add two lines in app style : <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> The Navigation icon color changed to black and for this problem i added this line in style : <item name="android:textColorSecondary">@android:color/white</item> Now navigation icon is white again but now i have a new problem . With above code , the title of navigation items is change color too. I didn't find a solution to this Interference

Custom view style, android's attributes are ignored

限于喜欢 提交于 2019-12-30 08:23:07
问题 I created a custom compound view - the view loads, no crashes, so far so good. Now, i plan to use this view MANY MANY times in my app, so the view needs a style. I declared a styleable for it in my attr.xml file <declare-styleable name="MyCustomView"> <attr name="ff_label" format="string" /> <attr name="ff_fieldText" format="string" /> </declare-styleable> <declare-styleable name="MyCustomViewStyle"> <attr name="customViewStyle" format="reference" /> </declare-styleable> Then i went to my

Error inflating class Button in Android

柔情痞子 提交于 2019-12-30 07:22:24
问题 I have an application with min sdk 16 up to 23. I want to use Material design as much as possible. It also has to be fullscreen app. AppCompat support library is included. Now I have Logon activity with some buttons: <Button android:id="@+id/act_logon_btn_logon" style="@style/ButtonDefault" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/act_logon_logon" /> Styles are as follows (values/styles.xml): <style name="Theme.AppCompat.Light.NoActionBar

Error inflating class Button in Android

蹲街弑〆低调 提交于 2019-12-30 07:22:08
问题 I have an application with min sdk 16 up to 23. I want to use Material design as much as possible. It also has to be fullscreen app. AppCompat support library is included. Now I have Logon activity with some buttons: <Button android:id="@+id/act_logon_btn_logon" style="@style/ButtonDefault" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/act_logon_logon" /> Styles are as follows (values/styles.xml): <style name="Theme.AppCompat.Light.NoActionBar

Repeating style in v19/v21

送分小仙女□ 提交于 2019-12-30 04:03:41
问题 I have this in my styles.xml : <style name="UserTheme" parent="ThemeBase"> <item name="android:editTextStyle">@style/EditTextTheme</item> </style> Why do I have to repeat the editTextStyle line in v19/styles.xml and v21/styles.xml . v21/styles.xml : <style name="UserTheme" parent="ThemeBase"> <item name="android:windowTranslucentStatus">true</item> <item name="android:windowTranslucentNavigation">true</item> <item name="android:editTextStyle">@style/EditTextTheme</item> </style> Is there a

What's the meaning of android:progressBarStyle attribute in ProgressBar?

☆樱花仙子☆ 提交于 2019-12-29 11:48:20
问题 I've been looking through the documentation for ProgressBar class and found these attributes: android:progressBarStyle android:progressBarStyleHorizontal android:progressBarStyleLarge android:progressBarStyleSmall These four parameters are supposed to be a reference to some style as I take it. So the question is, what are these for? Style for the progress bar is set via android:style attribute and a reference to the global style attributes. Documentation doesn't say anything helpful, searched

What's the meaning of android:progressBarStyle attribute in ProgressBar?

瘦欲@ 提交于 2019-12-29 11:48:03
问题 I've been looking through the documentation for ProgressBar class and found these attributes: android:progressBarStyle android:progressBarStyleHorizontal android:progressBarStyleLarge android:progressBarStyleSmall These four parameters are supposed to be a reference to some style as I take it. So the question is, what are these for? Style for the progress bar is set via android:style attribute and a reference to the global style attributes. Documentation doesn't say anything helpful, searched