Android Studio 2.2.3 themes issue - android

I am not sure what's going on I searched everywhere not what to do. I am trying to change the themes of the app, but only certain themes are available coding
available themes1
available themes2
These are the only themes available if I try using other themes it's causing an error

Use #android:theme/... as follow

Related

Android Studio Render Issue

Alright, I have spent 3~ hours total trying to fix this issue, and I can't for the life of me figure it out. I'm trying to start programming in Android Studio and I'm following TheNewBostons tutorials. I've followed it exactly, and every time that I switch the theme to "Material.Light" I get a Rendering Issue.
Here's the issue:
Error Message
I've tried several different fixes, like switching the renderer to a lower version of Android, editing styles.xml or something like that, and nothing has fixed it.
I've just started a new project, and haven't done a single thing. Does anyone have any light they can shed on this?
You are using the Support Design Library, and when you use the design library you must use a theme that extends Theme.AppCompat, as the error message says:
You need to use a Theme.AppCompat theme (or decendant) with the design library.
So instead of selecting Material.Light, rather select Appcompat.Light.

How can I create an Android action-bar that works with both Dark and Light theme?

I've got an action bar built following some docs and tutorials found on a google search, but it doesn't style correctly on KitKat. Any pointers / guides that are sure to work correctly on KitKat, and looking good for both Dark and Light theme?
I just so happens that I've been solving a very similar issue myself. If you decide to wirte the style yourself, there is a greater chance of error. I would recommend using this tool to design your action bar
http://jgilfelt.github.io/android-actionbarstylegenerator/
It generates all necessary 9-patch sources and xml files, all you have to do is download the archived bundle and include them in your project. Don't forget to update the theme in your manifest.

Using Android L Material Design on KitKat

Reading the Compatibility section of Android L Developer Preview (http://developer.android.com/preview/material/compatibility.html) I've seen that i can create an APP using L-sdk and also be able to run it on older sdk (like KitKat).
I've created a new project using Android L sdk and configured "build.gradle" as said in this post: Android Studio : Failure [INSTALL_FAILED_OLDER_SDK].
I've tried both the configurations:
the one proposed in question that gives me this error:
pkg: /data/local/tmp/com.example.{my user name}.materialapp
Failure [INSTALL_FAILED_OLDER_SDK]
and the one proposed in answer that gives me error on
<style name="AppTheme" parent="android:Theme.Material.Light"></style>
I've searched on others question on StackOverflow but I can't find no solutions.
SOLUTION:
Android L preview material style can be used only on devices that run Android L.
The "compatibility" is only a preview and it's not enabled.
You have to create 2 different styles.xml files with the same name that you will put in different folders.
The first, will go here:
res/styles.xml
and will look NOT have a reference to the Material theme (use the Holo theme):
so would have something like this:
<style name="AppTheme" parent="android:Theme.Holo.Light"></style>
The second will go here:
res/values-v21/styles.xml
and WILL contain the reference to the new Material theme, and would have:
<style name="AppTheme" parent="android:Theme.Material.Light"></style>
The Android framework will automatically use the correct one depending on which API the device supports (so on API 21 devices it will use Material, and on all other devices, it will use whatever else you define).
This has changed since the original answer, as Google released better support for Material design in the AppCompat libraries (which support mostly all versions of Android).
At this point, you should be using these libraries for all development, then you will be able to support Material design related features in all your apps.
Here is how to set it up: https://developer.android.com/topic/libraries/support-library/setup.html

Converting older spinner style to newer style

I know this may sound a trivial question, but I can't figure it out on my own. I've Googled and searched many many times. I know it may have a simple solution but I don't know where to search anymore. In general, I'm a Windows programmer, but I started programming for Android about 4 months ago. I've developed a fairly extensive application. The problem began when I started programming...my spinners are the solid gray rectangular style (unlike the newer style with the triangle in the lower right corner). When I started developing this app several months ago, I couldn't figure out why my spinners were different (after many hours) so I just ignored it. I'm at the point now of polishing my program and want the newer spinner style. So, I'm beating my head against the wall again. I went to my Android SDK Manager in Eclipse and updated my Android SDK Tools, Platform-tools, and Build-tools. I have the latest versions of all of these (22.3 and 19.0.1). When I create a new project, the newer spinner style appears. However, none of my older projects changed. They still have the same old gray, rectangular type spinners. I tried using a "android format" line command I found while Googling, but no luck with that either. I know there is probably something really simple I can do, but I can't find it. Can anyone help me with this? I'm using ADT Bundle with build v22.2.1-833290 on a Mac OSX Mavericks.
Newer spinner style works from API level 11.
So, you have to run in Android 3.0 and higher devices. If u want the same style in below 3.0 versions, then you have to customize your style. Like, take that newer style type of image and apply as a background to the spinner.
Try using ActionBarSherlock in your code. This will give you an advantage to have actionbar in lower versions of android. Also it contains ICSSpinner(An alternative to androids default spinner), which will give the newer look of spinners in lower versions of android.
Here's the link for ActionBarSherlock
http://actionbarsherlock.com/

Android styles aren't applied

I'm trying to style my application with custom styles. However, I am facing a problem when on install of application the styles aren't applied, then if I change something (anything) in the styles and compile it again (reinstall not uninstall followed by install) it applies all the styles. But as you understand this isn't an intended experience for users.
What could cause such a strange behavior?
UDATE:
The api is from 13 to 17.
I'm getting this:
Instead of this:
As you can see the styles aren't applied to this dialog. This also happens to other activities.

Categories

Resources