android-styles

Change Android Dialog button text size via styles

旧时模样 提交于 2019-12-23 07:12:59
问题 I am trying to enlarge the text size on all of my applications dialog buttons via styles. The following code will change the buttons background colour and even the text case but for some reason the textSize item is not honoured: <style name="MyAppTheme" parent="@android:style/Theme.Holo"> <item name="android:dialogTheme">@style/MyApp.Dialog</item> <item name="android:alertDialogTheme">@style/MyApp.Dialog.Alert</item> </style> <style name="MyApp.Dialog" parent="@android:style/Theme.Holo.Dialog

Overlaying the Action Bar not working

自闭症网瘾萝莉.ら 提交于 2019-12-23 06:56:35
问题 I was following official developer's guide to overlay actionbar. my style.xml is as following: <!-- Base application theme. --> <style name="AppBaseTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> </style> <style name="AppTheme" parent="AppBaseTheme"> <item name="actionBarStyle">@style/CustomActionBarTheme</item> </style> <style name="CustomActionBarTheme" parent="@android:style/Theme.Holo"> <item name="android:windowActionBarOverlay">true</item> <

Inheritance issue, when using property androidTextapperance vs. property style

对着背影说爱祢 提交于 2019-12-23 06:25:10
问题 I have a root theme and an inheriting child theme: <resources> <color name="colorRed">#FF0000</color> <color name="colorGreen">#00FF00</color> <style name="Root" parent="Theme.AppCompat.Light.DarkActionBar" /> <style name="Root.TextAppearance" parent="android:TextAppearance"> <item name="android:textColor">@color/colorGreen</item> </style> <style name="Child" parent="Root"> <item name="android:textColor">@color/colorRed</item> </style> </resources> In the manifest file I set the theme Child .

Changing TimePickerDialog Styles

大憨熊 提交于 2019-12-23 02:52:15
问题 I want to change the style of my TimePicker but I can't get to change the color of the clock face and the header background. Here's my XML style code - <style name="DateTimeDialog" parent="Theme.AppCompat.Dialog"> <item name="android:colorBackground">@color/colorWhite</item> <item name="android:textColorPrimary">#000000</item> <item name="android:headerBackground">#000000</item> <item name="android:textColorSecondary">#000000</item> <item name="android:button">@color/colorWhite</item> <item

listPreferredItemHeightSmall is not working on api 16

夙愿已清 提交于 2019-12-22 14:08:27
问题 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

listPreferredItemHeightSmall is not working on api 16

╄→尐↘猪︶ㄣ 提交于 2019-12-22 14:05:41
问题 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

Android - Change Custom Spinner's DropDownItem style

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 10:39:49
问题 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

Prevent “Dialog” Activity from interacting with background activity when clicking outside bounds

为君一笑 提交于 2019-12-22 06:56:32
问题 I'm creating an activity that looks like a dialog. Here is the style: <style name="TablesDialogActivity" parent="@android:style/Theme.Holo.Dialog"> <item name="android:windowBackground">@drawable/frame_background_left</item> </style> Here is the activity onCreate(): protected void onCreate(Bundle savedInstanceState) { getWindow().setFlags(LayoutParams.FLAG_NOT_TOUCH_MODAL, LayoutParams.FLAG_NOT_TOUCH_MODAL); getWindow().setFlags(LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH, LayoutParams.FLAG_WATCH

can not remove title bar in Activity

£可爱£侵袭症+ 提交于 2019-12-22 03:57:06
问题 i want to remove title on top of my Activity. i tried this two way they work but not in api level 8. 1: <style name="NOtitleTheme" parent="Theme.AppCompat.Light"> <item name="android:windowFullscreen">true</item> <item name="android:windowNoTitle">true</item> </style> 2: this.requestWindowFeature(Window.FEATURE_NO_TITLE); any idea why this does not work on api 8 ? once i managed to remove it in api 8 , but i do not remember how. EDIT: Solved! the problem was this.requestWindowFeature(Window

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

独自空忆成欢 提交于 2019-12-21 20:59:04
问题 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