android-styles

Android CollapsingToolbarLayout Title background

妖精的绣舞 提交于 2019-11-28 15:58:27
I'm working with the CollapsingToolbarLayout from the new Android Design Support Library. I have set its title and it is working fine, the only problem I still have is that when you scroll, the text is lost, depending on the image in the background. What I'd like to do, is set a background to the CollapsingToolbarLayout title, but I haven't find a way to do it. Is there anyway to achieve this? Thanks! Layout: <android.support.design.widget.CoordinatorLayout android:id="@+id/main_content" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res

Android actionbar style ignored by later devices, using appcompat v7

…衆ロ難τιáo~ 提交于 2019-11-28 14:22:32
I am using the Action Bar support library (appcompat v7), my app is set to a minimum api of 7, and a target of 21. I have two styles files, a base one, and one targeted at devices api 11+. When running the app on a device running KitKat, it seems that android:actionBarStyle is ignored, leaving the action bar styled as default (@style/Widget.AppCompat.ActionBar.Solid), instead of applying the given background. But if I remove my v11 styles/comment them out, KitKat listens to the actionBarStyle attribute set in the base styles.xml file and sets my custom background without any problems. So my

How we add styles programmatically?

喜欢而已 提交于 2019-11-28 10:50:08
问题 I have written one style for TextView and I set that one for my TextView as style="@style/popup_window_text_style" working fine, no issues. Now I want that same style to do in programmatically for my textview TextView textView = new TextView(mContext); Is there any way to do it programmatically in Java? My style in styles.xml <style name="popup_window_text_style"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android

Android theme not being set

家住魔仙堡 提交于 2019-11-28 09:04:32
I have a theme that refuses to be applied to activities - none of the styles are applied. If I don't supply the layout_width / layout_height attributes for <Button> it also gets a runtime error, showing that the Button class isn't being applied. /res/values/themes.xml : <?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme" parent="android:style/Theme.Black"> <item name="android:windowNoTitle">true</item> <item name="android:buttonStyle">@style/Button</item> <item name="android:windowBackground">@color/page_background_light</item> <item name="android:textAppearance">@style

Theme style for custom view

最后都变了- 提交于 2019-11-28 08:52:28
问题 My app has several themes from which the user can chose (red, blue, green etc.) Every theme has a corresponding button style (RedTheme => RedButton). Now I have created a custom view which slightly extends "Button" and unfortunately this button does not get any style, except I use the "style" attribute in a layout.xml. I don’t use any additional attributes, I just want that my Button style is applied. I want to do something similar than: <item name="android:imageButtonStyle">@style

Android Alert Dialog with extra background

核能气质少年 提交于 2019-11-28 08:02:04
问题 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<

Output: error: resource style/TextAppearance.Compat.Notification.Info (aka package_name:style/TextAppearance.Compat.Notification.Info) not found

百般思念 提交于 2019-11-28 07:30:12
问题 After switching to Android Studio 3.2 canary I am getting the following build error. I have seen this post where the guy had a similar issue but no solution was mentioned over their. I want to try new material components and jetpack so is there any possibility where I don't have to switch back. com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed Output: error: resource style/TextAppearance.Compat.Notification.Info (aka com.nsnik.nrs.kotlintest.debug:style

How to style the cursor color of SearchView under AppCompat

十年热恋 提交于 2019-11-28 07:13:15
My SearchView is android.support.v7.widget.SearchView and AppTheme is showed below. <style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/color_accent</item> </style> <style name="AppTheme" parent="AppBaseTheme"> </style> The color of SearchView seems strange, its cursor and bottom line showed white and trans to the accent color quickly, how to deal with it? I want to make the cursor and bottom line stay

Creating styles-v21.xml

本秂侑毒 提交于 2019-11-28 07:13:11
In Android Studio, I imported a project which did not include styles.xml (v21) . So I created a styles-v21.xml file in the values directory. Both styles.xml and styles-v21.xml are in the values directory now. styles.xml <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="AppTheme.Base"> <!-- Customize your theme here. --> </style> <style name="AppTheme.Base" parent="Theme.AppCompat.Light"> </style> </resources> styles-v21.xml <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar"> </style> <

Is possible set Expanded Notification as default in Big Text Notifications?

自作多情 提交于 2019-11-28 06:44:46
I followed this Sample Code In Big Text Notifications section, he said that need expand to see Big text notification form, as image im below : I wonder that we can not set Expanded Notification as default in Big Text Notifications? People who know it is can or not, If can, Please tell me how to do it, Thanks, Emanuel Moecklin The documentation states : A notification's big view appears only when the notification is expanded, which happens when the notification is at the top of the notification drawer, or when the user expands the notification with a gesture. So my answer is no, you can't