Resources Style Item Name "android:blablabla" RED Highlighted, NOT WORKING, NO ERROR
Iam rather new android studio. I would like to test out some code to apply dark mode. However, I got problem with resources style. Not only to apply this dark mode, but also whenever i tried to do following like:
<style name"myStyle" parent="Base.blablabla">
<item name="android:blablabla">"@"</item>
</style>
the name in item tag which is "android:someLibrary" always highlited with RED color, and when i run the app, the style not working (but NO ERROR).
i dont have any idea how to fix
my full styles.xml file:
<resources>
<!-- Base application theme. -->
<!-- Light/Day Mode application theme. -->
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimaryLightMode</item>
<item name="colorPrimaryDark">@color/colorPrimaryDarkLightMode</item>
<item name="colorAccent">@color/colorAccentLightMode</item>
<item name="backgroundcolor">@color/backgroundcolorLightMode</item>
<item name="cardbackground">@color/cardbackgroundLightMode</item>
<item name="textcolor">@color/textbackgroundLightMode</item>
<item name="tintcolor">@color/tintcolorLightMode</item>
<item name="buttoncolor">@color/buttoncolorLightMode</item>
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
</style>
<!-- Base application theme. -->
<!-- Dark/Night Mode application theme. -->
<style name="DarkAppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimaryDarkMode</item>
<item name="colorPrimaryDark">@color/colorPrimaryDarkDarkMode</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="backgroundcolor">@color/backgroundcolorDarkMode</item>
<item name="cardbackground">@color/cardbackgroundDarkMode</item>
<item name="textcolor">@color/tintcolorDarkMode</item>
<item name="tintcolor">@color/tintcolorDarkMode</item>
<item name="buttoncolor">@color/colorAccent</item>
<item name="android:windowAnimationStyle">@style/WindowAnimationTransition</item>
</style>
<style name="WindowAnimationTransition">
<item name="android:windowEnterAnimation">@android:anim/fade_in</item>
<item name="android:windowExitAnimation">@android:anim/fade_out</item>
</style>
</resources>
build.gradle (PROJECT)build.gradle PROJECT
build.gradle (APP)build.gradle APP
styles.xmlenter image description here
Answer
I've tested it in my current project and it builds fine. The only major difference i can see is i have upgraded gradle to 3.4.0, worth trying. I also find with XML invalidating and restarting tends to fix it.
File > Invalidate Caches and Restart
Related Questions
- → should I choose reactjs+f7 or f7+vue.js?
- → Phonegap Android write to sd card
- → Local reference jquery script in nanohttpd (Android)
- → Click to navigate on mobile devices
- → How to allow api access to android or ios app only(laravel)?
- → Access the Camera and CameraRoll on Android using React Native?
- → React native change listening port
- → What is the default unit of style in React Native?
- → Google play market autocomplete icon
- → Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `ListView`
- → Using Laravel with Genymotion
- → react native using like web-based ajax function
- → react native pdf View