android-theme

Styles and themes on values, values-v11 and values-v14 folders

不羁的心 提交于 2019-12-17 17:54:30
问题 I am currently working on my app to base its design on the Holo theme. Globally what I want to do is working but I am a little confused about the way that are working the folders values , values-v11 and values-v14 . So I know that: values is targeting the API inferior to 11 values-v11 is targeting the API between 11 and 13 values-v14 is targeting the API superior to 13 At first I thought I had to specify for every folder all the styles needed for the app but then I realized a kind of

Making resources theme dependent

ⅰ亾dé卋堺 提交于 2019-12-17 17:29:29
问题 Now that we have two Icons (Dark and Light) as described in ActionBar Icon Guide. @drawable/ic_search_light @drawable/ic_search_dark How to reference these Icons in XML menu resource: <item android:title="Search" android:icon=" Which drawable here ? "/> Every time switch Application theme between Light and Dark, Do I have to update all these drawable references ? 回答1: There's a way to define android drawables (and many other elements found in res/values ) to be Theme dependent. Lets suppose

java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable

…衆ロ難τιáo~ 提交于 2019-12-17 16:44:54
问题 I develop an android application. I use AppCombat Theme and when I run my program, I have a java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable . Its logs are: Process: com.nomad, PID: 12866 java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:107) at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58) at android

android search dialog customization

让人想犯罪 __ 提交于 2019-12-17 10:03:00
问题 After several searches I couldn't figure out how to customize the search dialog (the top search bar that appears when you click the search button). I want to change the background color of the search bar. I got articles on how to customize a title bar. But that doesn't work for search bar. Any helpful pointers please... 回答1: It seems that it's not customizable: https://groups.google.com/forum/?fromgroups=#!topic/android-developers/ZqZ-KZPLGtk 来源: https://stackoverflow.com/questions/13936674

Android FAB icon always black with MaterialComponents theme

我的梦境 提交于 2019-12-17 09:41:51
问题 I'm creating an Android app and I'm using the AndroidX libraries and Material design theme. My app theme on styles.xml is: <style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> I have the following FAB from a custom library: <com.leinardi.android.speeddial.SpeedDialView android:id="@+id/work_log

Android 5.0: how to change recent apps title color?

為{幸葍}努か 提交于 2019-12-17 07:13:19
问题 I'm using AppCompat and my theme is extending Theme.AppCompat.Light.DarkActionBar . When in Android 5 Lollipop and I press the recent apps button, my app appears with a dark title instead of a white title in the ActionBar. When I'm inside the app everything looks fine. What can I do to change the title color in the recent apps view? EDIT : just figured out that if I use a darker colorPrimary , the title becomes white. I still need a way to force the white title with the original color. 回答1:

How can I style an Android Switch?

☆樱花仙子☆ 提交于 2019-12-17 02:01:05
问题 The switch widget introduced in API 14 is styled by default with holo theme. I want to style it slightly different, changing its colors and shape a bit for branding reasons. How does one go about this? I know it must be possible, as ive seen the difference between default ICS and Samsung's touchwiz theme I assume I'll need some state drawables, and I've seen a few styles in http://developer.android.com/reference/android/R.styleable.html with Switch_thumb and Switch_track that look like what I

How to center align the ActionBar title in Android?

泄露秘密 提交于 2019-12-16 22:21:29
问题 I am trying to use the following code to center the text in the ActionBar , but it aligns itself to the left. How do you make it appear in the center? ActionBar actionBar = getActionBar(); actionBar.setDisplayShowTitleEnabled(true); actionBar.setTitle("Canteen Home"); actionBar.setHomeButtonEnabled(true); actionBar.setIcon(R.drawable.back); 回答1: To have a centered title in ABS (if you want to have this in the default ActionBar , just remove the "support" in the method names), you could just

How to get the parent theme programmatically

可紊 提交于 2019-12-14 01:26:02
问题 Let's say I have the following custom theme declared in themes.xml : <style name="Theme.Custom.Light" parent="@style/Theme.Sherlock.Light"> <item name="android:actionBarTabStyle">@style/Widget.Custom.Light.ActionBar.TabView</item> <item name="android:actionBarTabTextStyle">@style/Widget.Custom.Light.ActionBar.TabText</item> <item name="android:actionMenuTextColor">@color/ab_item_text</item> <item name="android:actionMenuTextAppearance">@style/TextAppearance.Custom.Light.Widget.ActionBar.Menu<

Xamarin Forms Android AppCompatActivity Toolbar background color is not changing

左心房为你撑大大i 提交于 2019-12-13 20:43:31
问题 In my Xamarin Forms Android Project I need to change the ToolBar Title color and background color I have tried with many workarounds suggested in Google but unfortunately I am unable to find the correct solution to me What I Need is What I am getting Now is by using below codes MainActivity.cs [Activity(Label = "Sample.Droid", Icon = "@mipmap/icon_launcher", Theme = "@style/MyTheme")] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity { protected