android-styles

values-21, values-22 or values-xx folder is gone after Android Studio 1.0

我是研究僧i 提交于 2019-11-30 04:41:58
When I create a new project with API14 as minimum, then there is no values-21 or values-22 folder in my project. I don't see any styles.XML anywhere, so how should I put in XML code for just Lollipop? I use Android Studio 1.0.1, and I have SDK 21, 21.1.1, 24.0.2 installed. Updated : Since API 22 has been released. API 23 is the same idea. Right click the RES folder Then type values-v22 as the directory name and choose xml as the resource type. If you do NOT see the values-v22 show up, click the Project pulldown at the top of the screen like so. e.g. Change from Android to Project Now right

Android Styles: Difference between 'style=“@android:style/XYZ”' and 'style=“?android:attr/XYZ”'?

天大地大妈咪最大 提交于 2019-11-30 03:43:07
I'm trying to style buttons to look like those I ask about in Android Full Width ICS style Minimalist Bottom ButtonsViews . I've succeeded, with the following xml for anyone interested: <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="bottom" android:divider="@android:drawable/divider_horizontal_dark" android:gravity="bottom" android:orientation="vertical" android:paddingTop="16dip" android:showDividers="beginning|end" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android

How to Style ActionBar, tab background on selected tab

蹲街弑〆低调 提交于 2019-11-30 03:23:47
I'm struggling with styling the ActionBar. My app has an ActionBar with three tabs. I'm trying to get the selected tab to have a background color, and the unselected tabs to show a different color. I'm following this reference: Customizing Action Bar . But all the TABs are showing the Selected color. My styles.xml file is as follows: <style name="MyActionBarTabStyle" parent="android:style/Widget.Holo.Light.ActionBar.TabBar"> <item name="android:background">@drawable/tab_background</item> <item name="android:paddingLeft">32dp</item> <item name="android:paddingRight">32dp</item> </style> <style

Setting Android Toolbar Background and Text Colors in Android Studio 1.4.1

Deadly 提交于 2019-11-30 02:33:26
I'm trying to change activity action bar's background color and title color, i tried official tutorial and some answers from here but none worked for me , i'm missing something. styles.xml <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="colorAccent">@color/colorAccent</item> </style> <style name="AppTheme.NoActionBar"> <item name="windowActionBar">false</item> <item name=

Can't change the text color with Android Action Bar drop-down navigation

我们两清 提交于 2019-11-30 01:00:59
I'm using Drop-down Navigation with my Action bar, and I can't get a sensible color for the corresponding text when using a dark action bar. The action bar itself is a dark grey, and the text color is black, so it's very hard to read. I followed the basic instructions on the Action Bar developer's guide so my code is simply SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.array.action_list, android.R.layout.simple_spinner_dropdown_item); ActionBar.OnNavigationListener navigationListener = new OnNavigationListener() { @Override public boolean onNavigationItemSelected(int

How do I use obtainStyledAttributes(int []) with internal Themes of Android

佐手、 提交于 2019-11-29 23:08:36
So I have looked around and found out that android.R.styleable is no longer part of the SDK even though it is still documented here . That wouldn't really be an issue if it was clearly documented what the alternative is. For example the AOSP Calendar App is still using the android.R.styleable // Get the dim amount from the theme TypedArray a = obtainStyledAttributes(com.android.internal.R.styleable.Theme); lp.dimAmount = a.getFloat(android.R.styleable.Theme_backgroundDimAmount, 0.5f); a.recycle(); So how would one get the backgroundDimAmount without getting the int[] from android.R.styleable

What's the meaning of android:progressBarStyle attribute in ProgressBar?

爷,独闯天下 提交于 2019-11-29 20:53:56
I've been looking through the documentation for ProgressBar class and found these attributes: android:progressBarStyle android:progressBarStyleHorizontal android:progressBarStyleLarge android:progressBarStyleSmall These four parameters are supposed to be a reference to some style as I take it. So the question is, what are these for? Style for the progress bar is set via android:style attribute and a reference to the global style attributes. Documentation doesn't say anything helpful, searched the Web, found nothing. The four attributes that you mention can be applied to a ProgressBar 's style

Create a 3d shaped button in android [closed]

我只是一个虾纸丫 提交于 2019-11-29 20:42:21
I was trying to create a button similar in look to the round buttons over here - http://livetools.uiparade.com/index.html (every button looks like it is inside an immersed section) I had it by placing the button in a circle background and giving them both a little gradient that didnt end up the same though I got this result - (I will upload my code once I can) how can I achieve that same look? Try this code. I am able to produce an image that looks like this which is similar to the first button you link to, using the following code. The key is to use <layer-list> to layer shapes one over the

Android Google plus login button style

三世轮回 提交于 2019-11-29 19:41:11
问题 I need the long style button for google+ signin in android. According to the Branding guidelines here there are different styles for the button like long, medium, short etc I am getting the medium style button with help of the sample app, But I want the long style button. here is my button ` <com.google.android.gms.common.SignInButton android:id="@+id/sign_in_button" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:visibility=

Android Alert Dialog with extra background

风流意气都作罢 提交于 2019-11-29 13:41:39
I recently migrated my app to Material Design and I stumbled upon this problem with my Alert Dialogs: I'm applying the dialog style like this: <item name="android:alertDialogTheme">@style/Theme.AlertDialog</item> and Theme.AlertDialog looks like this: <style name="Theme.AlertDialog" parent="Base.V14.Theme.AppCompat.Dialog"> <item name="colorPrimary">@color/theme_primary</item> <item name="colorPrimaryDark">@color/theme_primary_dark</item> <item name="colorAccent">@color/theme_accent_dark</item> </style> This is happening on my Kitkat device and it works fine on Lollipop. Can you help me with