I build android apps using Cordova and it is great. I wanted to change the Title color bar when you view you resent apps on android 5.
I spend quite some time trying to figure this out as I know little about the android development ways but always keen to learn so this is how I managed it:
Under your platforms > android > res folder add a new “values-v14” folder. Add a themes.xml file to the folder:
<?xml version="1.0" encoding="utf-8"?><resources> <style name="MyAppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar"> <!-- Any customizations for your app running on 4.0+ devices here --> <item name="android:colorPrimary">@color/custom_colorPrimary</item> </style></resources>Now add your colors.xml under your values folder:
<?xml version="1.0" encoding="utf-8"?><resources> <color name="custom_colorPrimary">#4FC1C1</color></resources>Now go to your AndroidManifest.xml file located under the platforms > android folder and change the android:theme attribute to android:theme="@style/MyAppTheme" :
<?xml version='1.0' encoding='utf-8'?><manifest android:hardwareAccelerated="true" android:versionCode="1" android:versionName="0.0.1" package="io.cordova.hellocordova" xmlns:android="http://schemas.android.com/apk/res/android"> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:supportsRtl="true"> <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@style/MyAppTheme" android:windowSoftInputMode="adjustResize"> <intent-filter android:label="@string/launcher_name"> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" /></manifest>Run the cordova CLI: $ cordova run Android
And awesome we have a custom colored title.