apply dark color on navigation bar to match status bar
This commit is contained in:
parent
2c7113ecb9
commit
d6b4b67230
1 changed files with 5 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import android.app.ActivityManager;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
|
|
@ -85,8 +86,11 @@ public abstract class AbsThemeActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
public void setNavigationBarColor(int color) {
|
||||
Window window = getWindow();
|
||||
int dark = ThemeUtil.getColorDark(color);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
getWindow().setNavigationBarColor(color);
|
||||
window.setNavigationBarColor(dark);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue