Cleanup API checks for P, Q, and R.

Test: Build with gradle
Flag: NA
Change-Id: I3ef17090741d14bebd76cf09cf3dc5ac4f11e686
This commit is contained in:
Andy Wickham
2024-01-24 14:38:48 -08:00
parent a601341ff5
commit b922dccbf5
67 changed files with 117 additions and 382 deletions

View File

@@ -16,8 +16,6 @@
package com.android.launcher3.widget;
import static com.android.launcher3.Utilities.ATLEAST_R;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Insets;
@@ -153,17 +151,10 @@ public class AddItemWidgetsBottomSheet extends AbstractSlideInView<AddItemActivi
@SuppressLint("NewApi") // Already added API check.
@Override
public WindowInsets onApplyWindowInsets(View view, WindowInsets windowInsets) {
if (ATLEAST_R) {
Insets insets = windowInsets.getInsets(WindowInsets.Type.systemBars());
mInsets.set(insets.left, insets.top, insets.right, insets.bottom);
} else {
mInsets.set(windowInsets.getSystemWindowInsetLeft(),
windowInsets.getSystemWindowInsetTop(),
windowInsets.getSystemWindowInsetRight(),
windowInsets.getSystemWindowInsetBottom());
}
mContent.setPadding(mContent.getPaddingStart(),
mContent.getPaddingTop(), mContent.getPaddingEnd(), mInsets.bottom);
Insets insets = windowInsets.getInsets(WindowInsets.Type.systemBars());
mInsets.set(insets.left, insets.top, insets.right, insets.bottom);
mContent.setPadding(mContent.getPaddingStart(), mContent.getPaddingTop(),
mContent.getPaddingEnd(), mInsets.bottom);
int contentHorizontalMarginInPx = getResources().getDimensionPixelSize(
R.dimen.widget_list_horizontal_margin);