android-theme

App crashing after theme update

自闭症网瘾萝莉.ら 提交于 2019-12-02 13:34:54
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. <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light

icon with real color shows black background

淺唱寂寞╮ 提交于 2019-12-02 09:24:27
Using the new theme Theme.MaterialComponents when placing an icon on a button shows me a black box, how can I place an icon with its real color? <Button android:id="@+id/idGoogle" app:icon="@drawable/ic_google" app:iconTintMode="add"/> The solution <Button android:id="@+id/idGoogle" app:icon="@drawable/ic_google" app:iconTint="@null"/> 来源: https://stackoverflow.com/questions/54637591/icon-with-real-color-shows-black-background

Customize android action bar

微笑、不失礼 提交于 2019-12-02 07:39:17
I'm trying to create a new theme and customize the action bar: <resources> <style name="Theme.Shappy.Red" parent="Theme.Sherlock.Light"> <item name="android:actionBarStyle">@style/ActionBar.Shappy.Red</item> ... ... [some_other_customizations] </style> <!-- Action bar --> <style name="ActionBar.Shappy.Red" parent="@style/Widget.Sherlock.Light.ActionBar.Solid"> <item name="android:background">#ffb70000</item> <item name="android:titleTextStyle">@style/ActionBar.Title.Shappy.Red</item> </style> <!-- Action bar text --> <style name="ActionBar.Title.Shappy.Red" parent="@style/TextAppearance

“You need to use a Theme.AppCompat theme (or descendant) with this activity” when using AppCompat theme

纵然是瞬间 提交于 2019-12-02 07:36:43
I have a very strange problem with my app. After updating to the newest versions of Support libraries I get this error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.app/com.example.app.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. This is where the exception is thrown: public class MainActivity extends AppCompatActivity { … @Override protected void onCreate(Bundle savedInstanceState) { getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); super.onCreate(savedInstanceState);/

How to make a CardView have a clickable&checkable effect, and how to make it dark themed?

偶尔善良 提交于 2019-12-02 02:30:36
问题 Background Before CardView was introduced, I made some selectors on my app to mimic cards, and let the user also choose which theme to use for the app (some prefer a dark theme) : The problem I wanted to make it look&work more natively, so I tried using CardView. Sadly, I fail to understand how to set the CardView have a clickable&checkable effect (the native one of each platform, maybe with a different color), and also have the ability to set it a dark theme. The questions How do I make a

Set a consistent theme for all the editTexts in Android

。_饼干妹妹 提交于 2019-12-02 01:30:38
问题 I have finished making my app. Now, I want to reset all my editTexts to have the layout width as fill parent instead of wrap content. android:layout_width="fill_parent" while currently all my editTexts are android:layout_width="wrap_content" Is there any way i can do this in a style xml file, instead of individually in each layout? I currently have this as my styles.xml <style name="AppTheme" parent="android:Theme.Light"> <item name="android:fontFamily">Verdana</item> <item name="android

Android Search Dialog and Suggestions ListView: Change theme and colours

守給你的承諾、 提交于 2019-12-01 23:47:30
问题 I've implemented a simple search dialog that performs a custom search of the data within my app (Via a custom provider) as according to the guidelines here: http://developer.android.com/guide/topics/search/search-dialog.html The problem is that the search bar's colors and size (exceeds the height of the action bar, etc) do not work within the design of my app. I know how to create a theme in my styles.xml file, but I do not know how to target the Android search dialog and suggestions listView

Android Search Dialog and Suggestions ListView: Change theme and colours

大憨熊 提交于 2019-12-01 22:37:03
I've implemented a simple search dialog that performs a custom search of the data within my app (Via a custom provider) as according to the guidelines here: http://developer.android.com/guide/topics/search/search-dialog.html The problem is that the search bar's colors and size (exceeds the height of the action bar, etc) do not work within the design of my app. I know how to create a theme in my styles.xml file, but I do not know how to target the Android search dialog and suggestions listView. Does anyone know how I can do this? After 13 hours spent on the question, it turns out it's not

Set a consistent theme for all the editTexts in Android

佐手、 提交于 2019-12-01 20:51:28
I have finished making my app. Now, I want to reset all my editTexts to have the layout width as fill parent instead of wrap content. android:layout_width="fill_parent" while currently all my editTexts are android:layout_width="wrap_content" Is there any way i can do this in a style xml file, instead of individually in each layout? I currently have this as my styles.xml <style name="AppTheme" parent="android:Theme.Light"> <item name="android:fontFamily">Verdana</item> <item name="android:editTextStyle">@style/EditTextStyle</item> </style> <style name="EditTextStyle" parent="@android:style

Getting AppCompat does not support the current theme features exception after upgrading to version AppCompat v22.1.0 issue

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 18:27:12
问题 Previously i was using AppCompat with version 21.1.2 in my project for the purpose of material design toggle with toolbar. But after upgrading to AppCompat v22.1.0, my app has started working weird. I even tried some of the solutions like as follows <item name="windowActionBar">false</item> <item name="windowNoTitle">true</item> Also applying parent theme as <style name="AppTheme" parent="Theme.AppCompat.NoActionBar"> But none of the above solutions was not helpful for me. So kindly please