score:14
These properties are intended to work with Android 21, Material Theme thus you cannot use them in values/styles.xml
. Instead, you should put them in values-v21/styles.xml
.
If you want to implement Material Design in previous versions of android you should include compatibility library:
dependencies {
compile "com.android.support:appcompat-v7:21.0.+"
}
and then you can use:
values/themes.xml:
<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
<!-- colorPrimary is used for the default action bar background -->
<item name=”colorPrimary”>@color/my_awesome_color</item>
<!-- colorPrimaryDark is used for the status bar -->
<item name=”colorPrimaryDark”>@color/my_awesome_darker_color</item>
<!-- colorAccent is used as the default value for colorControlActivated,
which is used to tint widgets -->
<item name=”colorAccent”>@color/accent</item>
<!-- You can also set colorControlNormal, colorControlActivated
colorControlHighlight, and colorSwitchThumbNormal. -->
</style>
More info here: http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html
score:15
Remove the android prefix before the color name. So it will be:
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
score:63
Just deletes android:
.
Check: http://developer.android.com/guide/topics/ui/actionbar.html#StyleExample
Source: stackoverflow.com
Related Query
- Material design backward compatibility android:colorAccent requires API level 21 when using appcompat7
- android - Call requires API level 9 (current min is 8): android.os.StrictMode#setThreadPolicy
- How to fix "Call requires API level 11" with Android Activity?
- View requires API Level 17 <TextClock>
- @android:color/holo_blue_light requires API level 14 - previously it was OK
- Android View requires API level 14
- Error message: Field requires API level 11 (current min is 8): android.os.AsyncTask#THREAD_POOL_EXECUTOR
- Why "Buttons in button bars should be borderless" in Android API Level 15?
- Can you change min. API level for your Android app in Eclipse?
- How to remove "Call requires API level" error?
- Eclipse Android Change API Level
- Application does not specify API level
- ERROR: Application requires API version 14. Device API version is 13 (Android 3.2.1)
- how to resolve "WARNING: Application does not specify an API level requirement"?
- Android 4.4 ( KITKAT ) API LEVEL 19 is not listed in Android SDK Manager
- Can I set API level X attributes in my manifest when my minSdkVersion is less than X?
- Android: Using PopupMenu in API level 9
- How do I use a Java project that requires a 1.7 compliance level on an Android project build path?
- How to change API level 8 to 3 in Eclipse
- Why some Android code works on previous API level than it should?
- Using different resource files depending of the SDK API level (using Eclipse)?
- Eclipse: keep getting "ERROR: Application requires API version 15. Device API version is 14 (Android 4.0.2)."
- Android & Eclipse: Changing application API level
- I can't run my application since my htc desire device is api level 8 (Android 2.2) what can i do?
- Unsupported major.minor version 52.0 + Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead
- Unable to use appcompat-v7 in eclipse for material design
- Found '1.8' instead. Android requires compiler compliance level 5.0 or 6.0. Please use Android Tools > Fix Project Properties
- NoClassDefFoundError for API level 8
- Is the new Android Calendar API in ICS backward compatible?
- Ensure Android project doesn't call APIs with newer-than-intended API level
More Query from same tag
- Eclipse Failed to create Java Virtual Machine after changing eclipse.ini file
- Eclipse modeling
- Project name not appearing in debugging Eclipse
- How can we view the source of the Grails framework in STS?
- how to prevent the graph from overwriting the previous plot using achartengine
- Eclipse RCP doesn't unpack jar
- How do I enable SVN menu in an editor window in Eclipse?
- Pydev (python 3) on Eclipse Oxygen: "pip" not working with installed packages
- eclipse papyrus look and feel for uml diagrams
- Getting a list of installed features in an Eclipse RCP application
- Location is not set
- How to generate protobuf 3.0 jar java?
- Is there an Eclipse equivalent of Visual Studio snippets?
- Eclipse maven-jar-plugin not signing, because of duplicate entries pom.xml and pom.properties only on Windows
- LuaJava - unprotected error in call to Lua API
- Cannot find bean to autowire which is in maven dependencies in jar,
- Eclipse Maven Missing artifact com.sun.jersey:jersey-servlet:jar:1.20-SNAPSHOT
- Prevent linebreaks with eclipse code formatter
- Run plugin updates outwith Eclipse UI
- GlassFish installation - Java Location Error
- Why does included libary project changes the title of my Android App?
- show loading activity progress bar in notification area
- Android App Crashing (Android.developer Tutorials)
- Exported runnable .jar File w/ Eclipse using libgdx
- Maven Hides Web.xml from Eclipse and JBossAS Tools after Update Project Configuration
- There is no "Run on Server" option on eclipse to run the project on Tomcat
- Filtering eclipse's project explorer view from library entries
- Can't link BOTAN library with eclipse
- Classic error: Unable to update index for central|http://repo1.maven.org/maven2
- Eclipse Java Project Error