android-theme

How to apply a custom style to SwitchCompat

你离开我真会死。 提交于 2020-01-14 06:59:06
问题 I would like to apply a custom style to SwitchCompat. Change drawables and text for on and off state. How can I achieve this? I can't find any examples on how this is done. I tried the following in my styles.xml but apparently I'm not using the right parent: <style name="Switch" parent="android:Widget.AppCompat.Widget.CompoundButton.SwitchCompat"> <item name="android:textOn">@string/common_yes</item> <item name="android:textOff">@string/common_no</item> <item name="android:thumb">@drawable

How to apply a custom style to SwitchCompat

放肆的年华 提交于 2020-01-14 06:58:15
问题 I would like to apply a custom style to SwitchCompat. Change drawables and text for on and off state. How can I achieve this? I can't find any examples on how this is done. I tried the following in my styles.xml but apparently I'm not using the right parent: <style name="Switch" parent="android:Widget.AppCompat.Widget.CompoundButton.SwitchCompat"> <item name="android:textOn">@string/common_yes</item> <item name="android:textOff">@string/common_no</item> <item name="android:thumb">@drawable

Setting style android:windowIsTranslucent seems to conflict with windowAnimationStyle

送分小仙女□ 提交于 2020-01-14 03:21:08
问题 I have the following style on in my style.xml and is a follow up to my question here Activity transition effects: slide in for the top activity and scale for the bottom activity: <style name="RevealTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@style/ActivityAnimation</item> </style> <style name="ActivityAnimation" parent="

App crashing after theme update

时光总嘲笑我的痴心妄想 提交于 2020-01-11 14:48:07
问题 The app I was working on so far was working fine until I added a couple of new activities and tried applied some changes to the theme. The following is my styles.xml file. I looked into other results and added a parent to AppTheme as I was getting an error regarding AppCompat earlier. I also made AppTheme parent of NoActionBar. One thing I noticed was when I apply AppBarOverlay to Register User Activity it crashes and when I apply other it doesn't. Main Activity is crashing regardless.

Remove action bar shadow programmatically

空扰寡人 提交于 2020-01-10 17:43:31
问题 How can i remove the drop shadow of action bar from java code ?. If i remove from the style it is working fine. <style name="MyTheme" parent="Theme.Sherlock"> .... <item name="windowContentOverlay">@null</item> <item name="android:windowContentOverlay">@null</item> .... </style> But i need to remove and add it dynamically from java code. 回答1: There is no way to set value for windowContentOverlay attribute programmatically. But you can define two different themes, one for Activities with a

Android set edit text style globally in theme doesn't work

僤鯓⒐⒋嵵緔 提交于 2020-01-10 00:38:30
问题 I am facing with problem. I am trying to make edit texts in my app look the same with the help of theme. I have generated styles with the help of online tools (9-patch images) and tried to set it in my theme like this <!-- Base application theme. --> <style name="DefaultAppTheme" parent="Theme.AppCompat"> <!-- Main theme colors --> <!-- your app branding color for the app bar --> <item name="colorPrimary">@color/blue</item> <!-- darker variant for the status bar and contextual app bars -->

Android - change dialog title style of all dialogs in application

自古美人都是妖i 提交于 2020-01-09 10:38:26
问题 Is there a way I can change all the alert dialogs appearing in my Android application? I want to change the dialogs that are system generated as well ( like the Edit Text dialog that opens up when you long tap on any EditText ). I want to change the title font color and size of all the dialogs in my app. Is there a way to do it? I have tried setting android:alertDialogTheme in my theme. But it seems to be not working. Code following - <style name="Theme.DLight" parent="android:Theme.Light

Change background, textcolor of AlertDialog

跟風遠走 提交于 2020-01-06 12:26:11
问题 I try to change background and textcolor of AlertDialog. But I can change only color of title with android:windowTitleStyle Activity: AlertDialog.Builder adb = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.AlertDialogCustom)); styles.xml style name="AlertDialogCustom" parent="Holo.Theme.Sherlock" How can I do that? Thanks. 回答1: adb.setMessage(Html.fromHtml("<font color='#FF0000'><b>John:</b></font>"+"How are you?")) this is for changing text color You can create you own dialog

Clipboard shows a different label

ε祈祈猫儿з 提交于 2020-01-06 05:30:08
问题 The behavior of long-pressing on an edittext is showing a Clipboard with a wrong label as shown in the picture below. instead of having the normal label Clipboard it's showing tw_clipboard_title_text . This is especially happening in samsung. What could be the issue? I'm not even dealing with ClipboardManager <EditText android:id="@+id/signup_Phone" android:layout_width="match_parent" android:layout_height="wrap_content" android:afterTextChanged="@{viewModel::onUsernameChanged}" android

Clipboard shows a different label

和自甴很熟 提交于 2020-01-06 05:30:07
问题 The behavior of long-pressing on an edittext is showing a Clipboard with a wrong label as shown in the picture below. instead of having the normal label Clipboard it's showing tw_clipboard_title_text . This is especially happening in samsung. What could be the issue? I'm not even dealing with ClipboardManager <EditText android:id="@+id/signup_Phone" android:layout_width="match_parent" android:layout_height="wrap_content" android:afterTextChanged="@{viewModel::onUsernameChanged}" android