android-styles

Android statusbar icons color

眉间皱痕 提交于 2019-11-26 14:16:09
I was wondering if it's possible to change the statusbar icons colour ( not the statusbar colour, colorPrimaryDark ) Let's say I want this statusbar with: <item name="colorPrimaryDark">@android:color/white</item> and the icons in black, is it possible? Thanks. EDIT: New in the M developer preview: windowLightStatusBar. Flipping this on in your theme tells the system to use a dark foreground, useful for lighter colored status bars. Note the M preview seems to have a bug where notification icons remain white, while system status icons correctly change to semitransparent black. from: Roman Nurik

How to custom switch button?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 14:11:10
I am looking to Custom The Switch Button to becoming as following : How to achieve this ? you can use the following code to change color and text : <org.jraf.android.backport.switchwidget.Switch android:id="@+id/th" android:layout_width="match_parent" android:layout_height="wrap_content" app:thumb="@drawable/apptheme_switch_inner_holo_light" app:track="@drawable/apptheme_switch_track_holo_light" app:textOn="@string/switch_yes" app:textOff="@string/switch_no" android:textColor="#000000" /> Create a xml named colors.xml in res/values folder: <?xml version="1.0" encoding="utf-8"?> <resources>

How to change color of the back arrow in the new material theme?

╄→гoц情女王★ 提交于 2019-11-26 14:03:11
I've updated my SDK to API 21 and now the back/up icon is a black arrow pointing to the left. I would like it to be grey. How can I do that? In the Play Store, for example, the arrow is white. I've done this to set some styles. I have used @drawable/abc_ic_ab_back_mtrl_am_alpha for homeAsUpIndicator . That drawable is transparent (only alpha) but the arrow is displayed in black. I wonder if I can set the color like I do in the DrawerArrowStyle . Or if the only solution is to create my @drawable/grey_arrow and use it for homeAsUpIndicator . <!-- Base application theme --> <style name="AppTheme"

Changing NumberPicker divider color

﹥>﹥吖頭↗ 提交于 2019-11-26 13:45:38
问题 On recent android versions, number pickers use a blue divider when drawn (cf. image below). I would like to change this color. Is there a working solution? or perhaps a library that package an updated version of NumberPicker that allows customizing the divider color? I have tried android-numberpicker but I get an error (see below) at runtime due to some code from the library that tries to access to a resource id that does not exist. android.content.res.Resources$NotFoundException: Resource ID

Change CalendarView style

我怕爱的太早我们不能终老 提交于 2019-11-26 12:16:30
问题 I\'m trying to add a CalendarView in my application, which uses the Theme.Light theme. The problem is, the days numbers of this calendar are rendered in white, so while using a light theme, you can\'t see them. Right now, I have the following code in my XML layout file : <CalendarView android:id=\"@+id/calendar1\" android:layout_width=\"500dp\" android:layout_height=\"300dp\"/> I tried to force the calendar theme like this : <CalendarView android:id=\"@+id/calendar1\" android:layout_width=\

Why is my Button text forced to ALL CAPS on Lollipop?

佐手、 提交于 2019-11-26 12:00:39
In my app "Tide Now WA" which I recently tested for compatibility using the new Nexus 9 tablet (Lollipop - API 21). It writes some button text. This app writes the text correctly using Android 2.3 and Android 4.0. I.e. mixed capital and lower case letters. When same app is run on my Nexus 9 all the letters in the text are capitalized. FWIW my manifest contains the following statement: uses-sdk android:minSdkVersion="10" android:targetSdkVersion="14" Can I fix this in my code or is it a bug in the O.S. thanks Nikola Despotoski I don't have idea why it is happening but there 3 trivial attempts

How to set Toolbar text and back arrow color

半世苍凉 提交于 2019-11-26 11:49:58
问题 Toolbar background is dark color, I want text and back arrow to be white. I tried following, but it doesnt work. <style name=\"Theme.MyTheme\" parent=\"Theme.AppCompat.Light.NoActionBar\"> <item name=\"colorPrimary\">@color/blue</item> <item name=\"colorPrimaryDark\">@color/blue_darker</item> <item name=\"colorAccent\">@color/purple</item> <!-- item name=\"android:textColorPrimary\">@color/white</item--> // I don\'t want to set this, changes everywhere. <item name=\"android:textColorSecondary

How to use Percentage for android layout?

白昼怎懂夜的黑 提交于 2019-11-26 11:01:07
问题 How can we use percentage values for android view elements? something like this <TextView android:id=\"@+id/\" android:layout_width=\"75%\" android:layout_height=\"50%\"/> 回答1: UPDATE 2018: PercentRelativeLayout and PercentFrameLayout are deprecated. Consider using ConstraintLayout Old Answer: So far Android Support library has limited on where to use this: with RelativeLayout android.support.percent.PercentRelativeLayout with FrameLayout android.support.percent.PercentFrameLayout How to use

How can I style an Android Switch?

老子叫甜甜 提交于 2019-11-26 11:00:57
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 might be after. I just don't know how to go about using them. I'm using ActionbarSherlock if that

Android Toolbar: small title text in landscape mode

家住魔仙堡 提交于 2019-11-26 10:26:01
问题 I\'m testing the new Toolbar and AppCompat theme on Android and ran into a problem. My toolbar title text looks normal-sized on portrait mode but it became rather small on landscape mode although I didn\'t do anything in the code to change the title\'s text size. Here are the screen shots: activity_main.xml: <!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. --> <LinearLayout android:layout