android-styles

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

醉酒当歌 提交于 2019-12-04 22:19:03
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? waqaslam use this: ProgressBar pb = new ProgressBar(context, null, android.R.attr.progressBarStyleHorizontal); If you are using a ProgressDialog then, here is a way to change the style of the progressBar in the ProgressDialog. mProgressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); 来源: https:/

Android: Background change in styles.xml

故事扮演 提交于 2019-12-04 21:11:56
问题 I'm trying to change the background color to black in styles.xml. The background changes fine but the actionbar got dirty. Some part of the actiobar background stays the same while the other portion turns black. I don't want the actionbar to change color. Please help <style name="Theme.ApplicationTheme" parent="@style/Theme.Sherlock"> <item name="android:background">#000000</item> <!-- This line is changing the actionbar color --> <item name="actionBarStyle">@style/Widget.MyTheme.ActionBar<

Android Action Bar not showing on displayOptions - useLogo

感情迁移 提交于 2019-12-04 18:01:29
I have an actionBarStyle that I have implemented in my app for my ActionBar . Here is the xml code below: <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="MyActionBarTheme" parent="@android:style/Theme.Holo"> <item name="android:windowActionBarOverlay">true</item> <item name="android:actionBarStyle">@style/MyCustomActionBar</item> </style> <style name="MyCustomActionBar" parent="@android:style/Widget.Holo.ActionBar"> <item name="android:background">@android:color/transparent</item> <item name="android:backgroundSplit">@android:color/transparent</item> <item

Is it possible to reference attributes from styles.xml file?

你离开我真会死。 提交于 2019-12-04 17:06:35
I want to give the user the possibility to switch the colors skin of my entire application. I mean to switch the style of some custom views of the app dynamically when the user presses a button of the screen. I know that if you call Activity.setTheme() before onCreate() method, you can change the theme of the app dynamically, but normal Views (for example, NavigationView ) with custom styles applied on their xml layout, do not have setTheme or setStyle methods, so it is does not appear possible to change their style dynamically. I think that my objective would be possible referencing colors

How to add custom item in android Theme declaration?

末鹿安然 提交于 2019-12-04 11:25:33
问题 I'm having few custom themes in my styles.xml Now whenever the activity takes the theme, it uses the colorPrimary , colorPrimaryDark and colorAccent values. For my layout's background I'm using ?attr/colorAccent , so it can pick the background color based on the selected theme. If I use any of the above values it works fine. But I want to define a custom item value for my background color. I tried like this below but it didn't worked. any ideas to make it work ? My custom theme with custom

How to set height of actionbar tabs for android

痞子三分冷 提交于 2019-12-04 10:36:32
问题 Basically, I want to change the height of the tabs in actionbars. This questions has been asked several times on stackoverflow, for example: ActionBar tabs height I have tried most of the solutions but nothing work, here is my code. <style name="CustomActionBarTheme" parent="@android:style/Theme.Holo"> <item name="android:scrollHorizontally">false</item> <item name="android:paddingLeft">0dp</item> <item name="android:paddingRight">0dp</item> <item name="android:actionBarSize">80dp</item>

Android studio layout size folders

廉价感情. 提交于 2019-12-04 09:05:53
I'm trying to create a different layout for 1080dp and others using "layout-sw1080dp" folder but it seems android studio completely ignores it and loads from the default layout folder. I've tried another way - setting different dimensions using values-sw1080dp and still nothing! What is the correct way to write different layouts for different screen sizes? DP is not the same as PIXEL!!! You think it's ignoring because devices with 1080dp do not exist (yet?). values-sw720dp: that's for Nexus 9 and 10 inch tablets values-sw600dp: that's for 7 to 8 inch tablets values-sw360dp: that's for small

TextInputLayout: Different color for hint label when not focused

帅比萌擦擦* 提交于 2019-12-04 08:28:39
问题 What I want to do: When using an EditText embedded in a TextInputLayout I want to ... Set the Color of the label to GREEN when it's de-focused and floating above the EditText because the user has already entered some value Set the Color of the label to RED when it's de-focused and located inside the EditText, because the user has not yet entered a value I do not want to change the hint text color of all my EditTexts to RED, but only when they're wrapped in a TextInputLayout (I don't need a

What is difference among styles.xml and themes.xml

ぐ巨炮叔叔 提交于 2019-12-04 07:47:43
问题 May I know what is the difference between styles.xml and themes.xml ? To me, they just look same as both XML are in the same format. <style name="... <item name="... So, in my app which provide customization coloring, size, drawable, ... do I need both styles.xml and themes.xml as well? How should I decide which XML to put in which file? 回答1: Out of the whole page of the Styles and Themes. You may be looking for this line. When you apply a style to a single View in the layout, the properties

Android: change width of overflow menu

十年热恋 提交于 2019-12-04 07:14:08
Currently I have an overflow menu which has default width: What I want is: I have tried changing the theme this way: <style name="MyWorkspaceDetailTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar"> <item name="android:popupMenuStyle">@style/MyPopupMenu</item> </style> <style name="MyPopupMenu" parent="@android:style/Widget.Holo.ListPopupWindow"> <item name="android:dropDownWidth">30dp</item> </style> but didn't got any success. Please can anyone help. I was follwing this[ http://keepsafe.github.io/2014/11/19/building-a-custom-overflow-menu.html] tutorial but it did not mention way