android-styles

Android “?colorPrimary” vs “?attr/colorPrimary”?

大憨熊 提交于 2019-12-07 09:07:31
问题 I can't find any information about the differences between: android:textColor="?attr/colorPrimary" vs android:textColor="?colorPrimary" I have read that "?attr" means attribute value specified in the current theme, but without "attr" it gives the same result (=color defined in my theme). It behaves similar with other attributes? For example: Does android:background="?attr/selectableItemBackground" equals android:background="?selectableItemBackground" ? Here it's told that it differs. Thanks

Scrollbar touch area in Android 6

纵饮孤独 提交于 2019-12-07 00:55:29
问题 I observe new behaviour in Android 6.0 Marshmallow. The touching area of scrollbar is widther than the scrollbar. It is visible on following screenshot. Scrollbar has 20 dp (green area) and touching area is probably 48 dp (blue and green area). I would like to have the touch area above the scrollbar only: I use following: <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="MyTheme.Dark" parent="android:Theme.Black"> <item name="android:fastScrollStyle">@style

Change holo spinner text colour

两盒软妹~` 提交于 2019-12-07 00:41:01
问题 I have a spinner in a Holo theme dialog and am trying to change the text colour because it is very hard to read: I have looked at android styles.xml, as well as many other answers, and believe that I am setting the custom style correctly; but it's just not getting picked up. This is an extract from the dialog layout file where the spinner lives: <Spinner android:id="@+id/spn_Type" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android

How to make ActionBar and stacked bar share same background image

大憨熊 提交于 2019-12-06 16:54:35
is it possible for actionbar and it's stacked bar(one that contain navigation tabs) to share same background image? one that starts from actionbar and ends at stacked bar? currently the way am implementing this, am ending up having action bar with it own image and stacked bar with its own. my styles.xml <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="android:actionBarStyle">@style/MyActionBar</item> <item name="android:actionMenuTextColor">@color/app_yellow</item> <item name="android:windowActionBarOverlay">true</item> <!--

Android Action Bar not showing on displayOptions - useLogo

大憨熊 提交于 2019-12-06 11:03:34
问题 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

listPreferredItemHeightSmall is not working on api 16

偶尔善良 提交于 2019-12-06 09:53:45
I am using the code below and it's working fine on api 23 but not on another device on api 16(Jelly Bean) . Style: <style name="NavigationViewStyle"> <item name="android:textSize">20sp</item> <!-- menu item text size--> <item name="android:listPreferredItemHeightSmall">40dp</item><!-- menu item height--> </style> And then, apply this style to NavigationView using app:theme <android.support.design.widget.NavigationView ... ... app:theme="@style/NavigationViewStyle" ... ... </android.support.design.widget.NavigationView> You should use "android:listPreferredItemHeightSmall" without "android"

Change custom Up/Back Button Icon on Android ActionBar

北城余情 提交于 2019-12-06 04:03:40
问题 I'm trying to use a custom up/back button icon with a different color since I haven't been able to figure out a straight forward way of changing the color of the default android up/back button. I downloaded a 128x128 back button icon (PNG) and changed it to the color I want, also placed it in my drawable folder. But i have not been able to get it to display, still. Here's what I tried so far, In my Styles.xml, I included this: <style name="customStyle" parent="@style/Theme.AppCompat.Light

Android: change width of overflow menu

◇◆丶佛笑我妖孽 提交于 2019-12-06 03:04:25
问题 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. 回答1: I was follwing this[http

Android tabs textcolor selector ignores state_pressed

依然范特西╮ 提交于 2019-12-06 02:13:15
I have created my own android theme to change the look of the actionbar tabs. The problem is that textcolor selector seems to ignore state_pressed attribute, so the color of tab text is always the same, even if this tab is pressed. There is no problem with other states, for example state_selected is correctly recognized and selected tab has text color, which is different from unselected tabs text color. What is more, i have also created selector for tabs background and it works fine with state_pressed (if the tab is pressed, it's backround color is changed). There are some pieces of my code:

Android - Change Custom Spinner's DropDownItem style

☆樱花仙子☆ 提交于 2019-12-05 18:39:08
I got a custom spinner, and I'm trying to replace the 9-patch background / the triangle in the DropDownSelector. I just can't get it to work right though. I end up with (the white box is a test asset): the new 9 patch gets shown, but it messes up the padding, and it looks like a Spinner inside a Spinner. Here's what it looks like without the 9 patch added: This is what I want it to look like, but then with the new 9patch instead of the old one, not the Spinner in Spinner effect. Here's my code: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation=