android-styles

Custom attribute not resolved inside styles and theme

孤人 提交于 2019-12-04 03:19:09
问题 I have android application with custom themes which was developed 2-3 year ago. I had this stylable in my attr.xml resouce file: <declare-styleable name="EVETextViewPlus"> <attr name="customFont" format="string" /> <attr name="pageStripFont" format="string" /> </declare-styleable> And I've used this inside my style_warm.xml resource file: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android" <style name="style_display_page_title_warm">

Hide ActionBar title just for one activity

自古美人都是妖i 提交于 2019-12-04 02:09:40
问题 If I apply theme for whole application it hides ActionBar title successfully: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="AppTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/ActionBarStyle</item> </style> <style name="ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar.Solid"> <item name="android:displayOptions">showHome|useLogo</item> </style> </resources> assign in manifest : <application android:name="myapp"

How to override styles of a library which has its own Activity

寵の児 提交于 2019-12-04 01:57:13
I have a library which has its own Activities with colorPrimary and colorPrimaryDark attributes. In the application which is using this library, there are different values for these color attributes. Is there a way to make the library use the style provided by the caller application? So that in the end, if the app has a green toolbar, the activities in the library would have a green toolbar, not the one defined in library theme. This is the library's theme: <style name="LibraryTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/red</item> <item name=

Remove the shadow below TabLayout on android

允我心安 提交于 2019-12-04 01:21:42
I'm trying to remove the shadow below tabs while using TabLayout, which is defined in a normal layout (and not as a part of a toolbar or actionbar). Setting theme as <item name="android:windowContentOverlay">@null<item/> or <item name="windowContentOverlay">@null<item/> didn't work. Also, setting elevation to 0 didn't help either. <android.support.design.widget.TabLayout xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_tabs" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginLeft=

Android Holo Light styling changes depending on chosen context

妖精的绣舞 提交于 2019-12-04 00:55:37
问题 I have been trying to find the cause of weird formatting style inconsistencies for my Views throughout my application and I think I have narrowed it down with this example. I set up two equivalent layouts of various Views s with exactly the same procedure and only varying the Context supplied in creation. In the first set, each View is created with the application's context through Activity.getApplicationContext() , whereas in the second set the View s are fed the activity's context through

Disable Material Ripple on Tablayout

梦想的初衷 提交于 2019-12-04 00:08:17
I am trying to remove the Material Ripple Effect on my TabLayout's Tabs. I am wondering if it is possible to do this? Any ideas please? I have tried setting the stateListAnimator to null but it still does not work <android.support.design.widget.TabLayout android:id="@+id/tabLayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:stateListAnimator="@null"/> SpongeCake app:tabBackground does not work in my case. This is my solution: tabLayout.setTabRippleColor(null); Try to change the background, for example, use the transparent color of android. <android.support

Changing the text appearance in styles and themes for an Android app

好久不见. 提交于 2019-12-03 22:17:51
I am writing an android app and I am wanting to alter the theme of my app. I have managed to alter the background colour of the app by using a theme, but I am struggling to change the default text appearance. This is my styles.xml resource file. <resources> <style name="QTheme" parent="android:Theme.Light"> <item name="android:windowBackground">@color/q_green</item> <item name="android:colorBackground">@color/q_green</item> <item name="android:textAppearance">@style/QText</item> </style> <color name="q_green">#008000</color> <color name="white">#FFFFFF</color> <style name="QText" parent="

fitSystemWindows programmatically for status bar transparency

守給你的承諾、 提交于 2019-12-03 18:51:42
问题 My app has one activity which hosts different fragments for each section. I have recently made the status bar translucent by setting fitSystemWindows to true , which has set it to the background colour of the app. This is fine for fragments which have a tool bar, where the colours match, like so: However one of my fragments has a photo and a translucent tool bar, so I'd like to have the photo occupy the space of the status bar too, rather than the background colour. I believe the solution is

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

橙三吉。 提交于 2019-12-03 18:35:50
问题 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

Create a 3d shaped button in android [closed]

╄→гoц情女王★ 提交于 2019-12-03 18:24:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . 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