android - Status bar not changing color in lollipop -
i trying status bar color changed lollipop. believe happens automatically giving style in xml
<item name="colorprimarydark">@color/colorprimarydark</item>
but not happening in nexus 5? not sure wrong?
can me this?
here style.xml file v21:
<style name="theme.default" parent="theme.appcompat.light.noactionbar"> <item name="md_widget_color">@color/bluetext</item> <item name="colorprimarydark">@color/colorprimarydark</item> <item name="colorprimary">@color/colorprimary</item> <item name="android:windowcontentoverlay">@drawable/toolbar_dropshadow</item> <item name="android:windowbackground">@android:color/white</item> <item name="android:edittextcolor">@android:color/background_dark</item> <item name="android:textcolor">@android:color/background_dark</item> <item name="colorcontrolnormal">@android:color/background_dark</item> <item name="colorcontrolactivated">@color/orangetext</item> <item name="colorcontrolhighlight">@color/numbertext</item> </style>
manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ylg.defaultapp" android:versioncode="1" android:versionname="1.1" > <uses-sdk android:minsdkversion="14" android:targetsdkversion="20" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage" /> <uses-permission android:name="android.permission.receive_sms" /> <uses-permission android:name="android.permission.read_sms" /> <uses-permission android:name="android.permission.read_profile" /> <uses-permission android:name="android.permission.read_contacts" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.receive_boot_completed" /> <uses-permission android:name="android.permission.wake_lock" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/theme.default" > <activity android:name=".ylg_default" android:excludefromrecents="true" android:screenorientation="portrait" android:windowsoftinputmode="adjustpan|adjustresize" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest>
try way:
<resources> <!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light"> <item name="cp">@color/color_primary</item> <item name="cpd">@color/color_secondary</item> <item name="ca">@color/color_accent</item> <item name="android:statusbarcolor">@color/color_primary</item> </style> </resources>
output:
Comments
Post a Comment