android-styles

Android App : Apply Color Theme Dynamically at Runtime

 ̄綄美尐妖づ 提交于 2019-12-13 16:36:43
问题 In My Application I want to support such functionality where users can select color from the list (which is downloaded from WebService) and as User selects any color(say Orange) all the Buttons in my application will have background color as Orange. I have checked solutions like http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html but with that I need to have different styles created with different color in my app. My need is I only support one style only

How to add Search View on Action bar on one of the fragments in tab layout dynamically?

不想你离开。 提交于 2019-12-13 11:04:14
问题 Please provide me a better solution if you have I am working on android app in which on home Activity by using TabLaout&ViewPager i have added 5 tabs on below Home Social Notice Search Links I have set for MainActivity in values/style but i have placed custom action bar tag in search.xml. I know how to add SearchView on action bar in activity but i am facing issues using fragments. My goal is just to show search view widget on action bar when user will on "Search" tab. On other tabs i don't

Android app masthead display

只谈情不闲聊 提交于 2019-12-13 09:35:22
问题 I have created an app using Android Studio 2.3.3, choosing Empty Activity Template. After its creation I went and changed the background color to something like colorAccent and I also changed the colorPrimary to colorAccent in colors.xml. Now, when I ran the app, following emulator display appeared. As you can see, it displays my app name, followed by a dark line. I don't understand where this dark line has come from and how can I get rid of this? However, this dark line does not appear in

Style showing error in android

末鹿安然 提交于 2019-12-13 06:38:45
问题 The following style shows error in eclipse <style name="AppTheme" parent="android:style/Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary</item> <item name="android:windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="drawerArrowStyle">@style/DrawerArrowStyle</item> <item name="colorControlNormal">@color/primary</item> <item name="colorControlActivated">@color/primary</item> <item name=

Actionbar title font not changing in android

允我心安 提交于 2019-12-13 05:57:57
问题 I want to change a custom font to my action bar title, have gone through couple of accepted answers,but no luck,I have tried as below,But my custom font is not applied to my actionbar title,Please help me to get rid of this,my code is as below: java Typeface font = Typeface.createFromAsset(getActivity().getAssets(), "neuropolx.ttf"); SpannableString s = new SpannableString( " KOLAY RANDEVU"); s.setSpan(new CustomTypefaceSpan("", font), 0, 4, Spanned.SPAN_EXCLUSIVE_INCLUSIVE); getActivity()

how to custom the thin line below actionbar using AppCompat in android?

和自甴很熟 提交于 2019-12-12 20:12:09
问题 i want to custom my actionbar using appcompat but i cant change the color of the line below the actionbar, the little thin line below actionbar, i want to make it color yelow instead of the default light blue color below the actionbar this is my code: values folder <!-- MY CUSTOM THEME FOR MY SUPPORT LIBRARY --> <style name="MyCustomSupportLibraryTheme" parent="@style/Theme.AppCompat.Light"> <item name="actionBarStyle">@style/MyActionBar</item> <item name="actionBarTabTextStyle">@style

Android Button with No Padding

孤街浪徒 提交于 2019-12-12 16:28:54
问题 I am trying to use the open source antennapod application as a reference for building my android application. I am using ActionBarSherlock and want to create a button at the bottom of my layout that extends from side to side with no padding. It should look like this: My Styles.xml looks like this: <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="Theme.Application.Light" parent="@style/Theme.Sherlock.Light"> <item name=

Unable to change switch color

孤者浪人 提交于 2019-12-12 15:45:11
问题 I'm looking for applying this color to all switches only. But by default, it is taking colorAccent instead of this theme for switch. Device: marshmallow. layout: <Switch android:id="@+id/soundSwitch" style="@style/SwitchStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginBottom="@dimen/large_space" android:layout_marginRight="@dimen/medium_space" android:layout

ActionBar tab styles in horizontal view

∥☆過路亽.° 提交于 2019-12-12 14:23:32
问题 When using a phone or a tablet in portrait mode, tabs are shown under the ActionBar that constains the logo and menu items. On tablets in horizontal mode they are shown inline with the logo and menu items. In this configuration the underscore under the seleced tab is lost. What style controls this? In portrait mode I want to use a different selected style than in landscape mode when tabs are shown inline with the logo and menu. My theme has it's parent set to Theme.AppCompat.Light . Under it

Styling ChromeCast MediaRoute button

↘锁芯ラ 提交于 2019-12-12 13:57:57
问题 I can't seem to get the MediaRoute button to show up as 'white' in my solid ActionBar. My question is this: How can we style the MediaRoute button light or dark, without changing drawable names? Looking at a similar question here: How do I change the style of the MediaRouteButton in the ActionBar? the accepted solution is just to use your own set of MediaRoute drawables, and swap the names light<>dark. For my app, I have 3 distinct styles: light-ActionBar, dark-ActionBar, and light solid