Messaging: Remove compatibility for old android versions
Change-Id: Id9065d60525a509271a0e64c0e349e857cb998e2
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -261,16 +262,14 @@ public class UiUtils {
|
||||
}
|
||||
|
||||
public static void setStatusBarColor(final Activity activity, final int color) {
|
||||
if (OsUtil.isAtLeastL()) {
|
||||
// To achieve the appearance of an 80% opacity blend against a black background,
|
||||
// each color channel is reduced in value by 20%.
|
||||
final int blendedRed = (int) Math.floor(0.8 * Color.red(color));
|
||||
final int blendedGreen = (int) Math.floor(0.8 * Color.green(color));
|
||||
final int blendedBlue = (int) Math.floor(0.8 * Color.blue(color));
|
||||
// To achieve the appearance of an 80% opacity blend against a black background,
|
||||
// each color channel is reduced in value by 20%.
|
||||
final int blendedRed = (int) Math.floor(0.8 * Color.red(color));
|
||||
final int blendedGreen = (int) Math.floor(0.8 * Color.green(color));
|
||||
final int blendedBlue = (int) Math.floor(0.8 * Color.blue(color));
|
||||
|
||||
activity.getWindow().setStatusBarColor(
|
||||
Color.rgb(blendedRed, blendedGreen, blendedBlue));
|
||||
}
|
||||
activity.getWindow().setStatusBarColor(
|
||||
Color.rgb(blendedRed, blendedGreen, blendedBlue));
|
||||
}
|
||||
|
||||
public static void lockOrientation(final Activity activity) {
|
||||
@@ -301,16 +300,8 @@ public class UiUtils {
|
||||
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
|
||||
}
|
||||
|
||||
public static int getPaddingStart(final View view) {
|
||||
return OsUtil.isAtLeastJB_MR1() ? view.getPaddingStart() : view.getPaddingLeft();
|
||||
}
|
||||
|
||||
public static int getPaddingEnd(final View view) {
|
||||
return OsUtil.isAtLeastJB_MR1() ? view.getPaddingEnd() : view.getPaddingRight();
|
||||
}
|
||||
|
||||
public static boolean isRtlMode() {
|
||||
return OsUtil.isAtLeastJB_MR2() && Factory.get().getApplicationContext().getResources()
|
||||
return Factory.get().getApplicationContext().getResources()
|
||||
.getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user