Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fdfb5d13 authored by Judy Chang's avatar Judy Chang Committed by Automerger Merge Worker
Browse files

Merge "Revert "Refactor Utilities#isTablet to Utilities#isLargeScreen"" into...

Merge "Revert "Refactor Utilities#isTablet to Utilities#isLargeScreen"" into tm-qpr-dev am: 1a8ac237

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21559004



Change-Id: I891ef7fdf14abb23202eac7f547f375513680a41
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 497fda9c 1a8ac237
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ public class PreviewPositionHelper {
     */
    public void updateThumbnailMatrix(Rect thumbnailBounds, ThumbnailData thumbnailData,
            int canvasWidth, int canvasHeight, int screenWidthPx, int screenHeightPx,
            int taskbarSize, boolean isLargeScreen,
            int taskbarSize, boolean isTablet,
            int currentRotation, boolean isRtl) {
        boolean isRotated = false;
        boolean isOrientationDifferent;
@@ -95,7 +95,7 @@ public class PreviewPositionHelper {
            canvasScreenRatio = (float) canvasWidth / screenWidthPx;
        }
        scaledTaskbarSize = taskbarSize * canvasScreenRatio;
        thumbnailClipHint.bottom = isLargeScreen ? scaledTaskbarSize : 0;
        thumbnailClipHint.bottom = isTablet ? scaledTaskbarSize : 0;

        float scale = thumbnailData.scale;
        final float thumbnailScale;
@@ -103,7 +103,7 @@ public class PreviewPositionHelper {
        // Landscape vs portrait change.
        // Note: Disable rotation in grid layout.
        boolean windowingModeSupportsRotation =
                thumbnailData.windowingMode == WINDOWING_MODE_FULLSCREEN && !isLargeScreen;
                thumbnailData.windowingMode == WINDOWING_MODE_FULLSCREEN && !isTablet;
        isOrientationDifferent = isOrientationChange(deltaRotate)
                && windowingModeSupportsRotation;
        if (canvasWidth == 0 || canvasHeight == 0 || scale == 0) {
+1 −1
Original line number Diff line number Diff line
@@ -137,7 +137,7 @@ public class Utilities {

    /** @return whether or not {@param context} represents that of a large screen device or not */
    @TargetApi(Build.VERSION_CODES.R)
    public static boolean isLargeScreen(Context context) {
    public static boolean isTablet(Context context) {
        final WindowManager windowManager = context.getSystemService(WindowManager.class);
        final Rect bounds = windowManager.getCurrentWindowMetrics().getBounds();

+1 −2
Original line number Diff line number Diff line
@@ -130,8 +130,7 @@ final class WirelessChargingLayout extends FrameLayout {
        animatorSet.playTogether(textSizeAnimator, textOpacityAnimator, textFadeAnimator);

        // For tablet docking animation, we don't play the background scrim.
        // TODO(b/270524780): use utility to check for tablet instead. 
        if (!Utilities.isLargeScreen(context)) {
        if (!Utilities.isTablet(context)) {
            ValueAnimator scrimFadeInAnimator = ObjectAnimator.ofArgb(this,
                    "backgroundColor", Color.TRANSPARENT, SCRIM_COLOR);
            scrimFadeInAnimator.setDuration(SCRIM_FADE_DURATION);
+3 −3
Original line number Diff line number Diff line
@@ -950,9 +950,9 @@ class KeyguardUnlockAnimationController @Inject constructor(
            return false
        }

        // We don't do the shared element on large screens because the smartspace has to fly across
        // large distances, which is distracting.
        if (Utilities.isLargeScreen(context)) {
        // We don't do the shared element on tablets because they're large and the smartspace has to
        // fly across large distances, which is distracting.
        if (Utilities.isTablet(context)) {
            return false
        }

+4 −4
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ import com.android.systemui.R
import com.android.systemui.mediaprojection.appselector.data.RecentTask
import com.android.systemui.shared.recents.model.ThumbnailData
import com.android.systemui.shared.recents.utilities.PreviewPositionHelper
import com.android.systemui.shared.recents.utilities.Utilities.isLargeScreen
import com.android.systemui.shared.recents.utilities.Utilities.isTablet

/**
 * Custom view that shows a thumbnail preview of one recent task based on [ThumbnailData].
@@ -150,9 +150,9 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
        val displayWidthPx = windowMetrics.bounds.width()
        val displayHeightPx = windowMetrics.bounds.height()
        val isRtl = layoutDirection == LAYOUT_DIRECTION_RTL
        val isLargeScreen = isLargeScreen(context)
        val isTablet = isTablet(context)
        val taskbarSize =
            if (isLargeScreen) {
            if (isTablet) {
                resources.getDimensionPixelSize(AndroidR.dimen.taskbar_frame_height)
            } else {
                0
@@ -166,7 +166,7 @@ constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
            displayWidthPx,
            displayHeightPx,
            taskbarSize,
            isLargeScreen,
            isTablet,
            currentRotation,
            isRtl
        )
Loading