Fixed issues with statusBar coloring appearing on KitKat, read the instructions in ThemeBaseActivity
This commit is contained in:
parent
69ffac805a
commit
9f9fc51088
6 changed files with 26 additions and 7 deletions
|
|
@ -94,7 +94,7 @@ public class MainActivity extends AbsFabActivity
|
|||
|
||||
@Override
|
||||
protected boolean shouldColorStatusBar() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.kabouzeid.gramophone.ui.activities.base.AbsFabActivity;
|
|||
import com.kabouzeid.gramophone.util.NavigationUtil;
|
||||
import com.kabouzeid.gramophone.util.PlaylistsUtil;
|
||||
import com.kabouzeid.gramophone.util.PreferenceUtils;
|
||||
import com.kabouzeid.gramophone.util.Util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ public class PlaylistDetailActivity extends AbsFabActivity {
|
|||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setStatusBarTranslucent(false);
|
||||
setStatusBarTranslucent(!Util.hasLollipopSDK());
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_playlist_detail);
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,22 @@ import com.readystatesoftware.systembartint.SystemBarTintManager;
|
|||
/**
|
||||
* @author Aidan Follestad (afollestad)
|
||||
*/
|
||||
|
||||
/**
|
||||
* READ!
|
||||
*
|
||||
* Instructions:
|
||||
*
|
||||
* KitKat or Lollipop solid statusBar with the right color (primaryDark):
|
||||
* - shouldColorStatusBar return true OR return false and call setStatusBarColor() in the activity with a custom color
|
||||
* - setStatusBarTranslucent(!Util.hasLollipopSDK())
|
||||
*
|
||||
* KitKat or Lollipop translucent statusBar (not the color is too dark on Lollipop and KitKat only does fading but MUCH better performance the setStatusBarColor in onScrollCallback)
|
||||
* - shouldColorStatusBar return false DO NOT return true and do not call setStatusBarColor() in this case at all here
|
||||
* - setStatusBarTranslucent(true)
|
||||
* - use a view below the statusBar to color it
|
||||
*/
|
||||
|
||||
public abstract class ThemeBaseActivity extends ActionBarActivity implements KabViewsDisableAble {
|
||||
|
||||
// private boolean mLastDarkTheme;
|
||||
|
|
@ -39,7 +55,7 @@ public abstract class ThemeBaseActivity extends ActionBarActivity implements Kab
|
|||
getWindow().setNavigationBarColor(primaryDark);
|
||||
}
|
||||
|
||||
setStatusBarColor(primaryDark, false);
|
||||
if (shouldColorStatusBar()) setStatusBarColor(primaryDark, false);
|
||||
|
||||
// Persist current values so the Activity knows if they change
|
||||
// mLastDarkTheme = PreferenceUtils.getInstance(this).getGeneralTheme() == 1;
|
||||
|
|
@ -77,7 +93,7 @@ public abstract class ThemeBaseActivity extends ActionBarActivity implements Kab
|
|||
|
||||
protected void setStatusBarTranslucent(boolean statusBarTranslucent) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
Util.setStatusBarTranslucent(getWindow(), statusBarTranslucent);
|
||||
Util.setStatusBarTranslucent(getWindow(), statusBarTranslucent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
|
|||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setStatusBarTranslucent(false);
|
||||
setStatusBarTranslucent(!Util.hasLollipopSDK());
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(getContentViewResId());
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true">
|
||||
|
||||
|
|
@ -26,13 +27,13 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/image"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:minHeight="@dimen/title_view_height"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true">
|
||||
|
||||
|
|
@ -26,13 +27,13 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/image"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
android:minHeight="@dimen/title_view_height"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingTop="8dp"
|
||||
android:elevation="@dimen/toolbar_elevation"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<com.kabouzeid.gramophone.views.DynamicEditText
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue