android-theme

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

Splash Screen triggers Resources$NotFoundException only on Android 8.1

馋奶兔 提交于 2019-12-13 13:39:59
问题 I followed this tutorial here step by step, it works fine on my API 21 emulator, but on my 27 it crashes as soon as the app loads with: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.myapp/com.myapp.myapp.ui.SplashScreenActivity}: android.content.res.Resources$NotFoundException: Drawable com.myapp.myapp:drawable/splash_screen_background with resource ID #0x7f0700a9 My file drawable/splash_screen_background is this one: <?xml version="1.0" encoding="utf-8"?>

Use Holo light theme/style on gingerbread

久未见 提交于 2019-12-13 07:14:25
问题 I am currently creating an application for a client. I love the Holo light with dark action bar theme/style but that means that I would have to use API 14 and above. If I set the min API level to 14 then only about 50% of android users will be able to get the application, so I need to have min API level set to 9 (Gingerbread). Finally the question: is there any way of using the theme/style on gingerbread or even put a Holo light with dark action bar style in Values? 回答1: You can use Action

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()

Can not running App on android studio

梦想与她 提交于 2019-12-13 05:20:49
问题 when i create a new project in android studio i find the the activity class initially extends AppCompatActivity and i have to change it to extend Activity instead. but the issue that i am facing is, R class is not recognisable and i receive the error "Cant resolve symbol R". i posted the build.gradle file below and it seems to me it has no errors. also, after tryin to find out the solution, i checked all the xml files and i found that the style.xml "posted below" has error at "Theme.AppCompat

Status Bar is white when entering immersive full screen mode

泪湿孤枕 提交于 2019-12-13 03:45:37
问题 I make a simple projet about immersive full screen mode according to Using Immersive Full-Screen Mode But first of all it perfect fine when I select Make Immersive button, app is entering immersion fullscreen mode. My problem is after selecting the Cancel Immersive button, and select Make Immsersive again. Although app is immersive mode, in the place of status bar is being white Here is my hide and show functions private void hideSystemUI() { // Set the IMMERSIVE flag. // Set the content to

Android - how to specify special attribute to some specific view in different theme

妖精的绣舞 提交于 2019-12-13 00:09:31
问题 I am working on a "dynamic change theme" function of my app (light and dark). I have some special customized widget which is using special color. And I also want to specify the color of this widget in theme attributes. For example, I want to set an attribute in the theme like <item name="MySpecialTextColor">@color/white</item> In the layout, how can I set the text color of the TextView? <TextView ... android:color="XXXX????" ... /> How can I achieve this? 回答1: First, define two colors in /res

Splash Theme is not changing anymore

℡╲_俬逩灬. 提交于 2019-12-12 20:06:42
问题 I followed this link to create a SplashActivity which displayed a small icon while loading the MainActivity. Everythink worked fine and I could implement the icon successfully. Now I'm trying to change the icon for the SplashActivity but the Problem is that the icon in the application on my device is not updated. Everything else I change in the code will be updated successful expect the theme. window_background.xml: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http:/

Android click Highlight issue: After updating to Android studio 2.2 preview 3

随声附和 提交于 2019-12-12 15:14:17
问题 I am having this weird issue, for android OS below lollipop. When i click on Toolbar option menu or navigation drawer etc i am getting weird black edges as a highlight. Please see attached pic as an example here is my theme for this activity (using AppCompactActivity as Base Activity) ` <style name="NoActionBar" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color

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