Messaging: Remove compatibility for old android versions

Change-Id: Id9065d60525a509271a0e64c0e349e857cb998e2
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent 9bbc7a8f99
commit 7c55a6d56a
104 changed files with 580 additions and 2306 deletions
+9 -18
View File
@@ -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;
}