mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 18:30:20 +01:00
Refactor with WindowUtil and correct some colors.
This commit is contained in:
@@ -5,6 +5,7 @@ import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public final class WindowUtil {
|
||||
@@ -54,6 +55,12 @@ public final class WindowUtil {
|
||||
setSystemUiFlags(window, View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
|
||||
}
|
||||
|
||||
public static void setStatusBarColor(@NonNull Window window, @ColorInt int color) {
|
||||
if (Build.VERSION.SDK_INT < 21) return;
|
||||
|
||||
window.setStatusBarColor(color);
|
||||
}
|
||||
|
||||
private static void clearSystemUiFlags(@NonNull Window window, int flags) {
|
||||
View view = window.getDecorView();
|
||||
int uiFlags = view.getSystemUiVisibility();
|
||||
|
||||
Reference in New Issue
Block a user