There are various ways of changing the status bar color.
1) Using the styles.xml. You can use the android:statusBarColor attribute to do this the easy but static way.
Note: You can also use this attribute with the Material theme.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="AppTheme.Base">
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
2) You can get it done dynamically using the setStatusBarColor(int) method in the Window class. But remember that this method is only available for API 21 or higher. So be sure to check that, or your app will surely crash in lower devices.
Here is a working example of this method.
if (Build.VERSION.SDK_INT >= 21) {
Window window = getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(getResources().getColor(R.color.primaryDark));
}
where primaryDark is the 700 tint of the primary color I am using in my app. You can define this color in the colors.xml file.
Do give it a try and let me know if you have any questions. Hope it helps.