Fix for the small gap between statusbar and header for some users
This commit is contained in:
parent
c0c6627be7
commit
589f81d1c3
2 changed files with 4 additions and 3 deletions
|
|
@ -26,8 +26,8 @@ android {
|
||||||
applicationId "com.kabouzeid.gramophone"
|
applicationId "com.kabouzeid.gramophone"
|
||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 22
|
targetSdkVersion 22
|
||||||
versionCode 37
|
versionCode 38
|
||||||
versionName "0.9.21b dev-1"
|
versionName "0.9.22b dev-1"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,8 @@ public abstract class AbsThemeActivity extends AppCompatActivity implements KabV
|
||||||
protected final void setStatusBarColor(int color) {
|
protected final void setStatusBarColor(int color) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
|
||||||
getWindow().setStatusBarColor(Util.shiftColorDown(color));
|
getWindow().setStatusBarColor(Util.shiftColorDown(color));
|
||||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
// also do this on Lollipop in case the user modified the statusbar height
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
final View statusBar = getWindow().getDecorView().getRootView().findViewById(R.id.status_bar);
|
final View statusBar = getWindow().getDecorView().getRootView().findViewById(R.id.status_bar);
|
||||||
if (statusBar != null) statusBar.setBackgroundColor(color);
|
if (statusBar != null) statusBar.setBackgroundColor(color);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue