From 8be6c7106cf9b0123f7acbeecde1446c8a6bbbf4 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Wed, 7 Jul 2021 13:43:22 +0100 Subject: [PATCH 01/14] Don't create gap between last task and clear all button - If a task is too close to ClearAllButton when being snapped to, change the snap position to barely not seeing ClearAllButton - When snapping to the above tasks from quick switch, apply a horizontal grid translation to smoothly snap into position - Apply the above grid translation to TaskViewSimulator as well Bug: 192254835 Test: manual Change-Id: I32d562a1726f7c8b41ac10c7deece890df7e1304 --- .../android/quickstep/AbsSwipeUpHandler.java | 8 +- .../fallback/FallbackRecentsView.java | 6 +- .../android/quickstep/views/RecentsView.java | 78 ++++++++++++------- 3 files changed, 56 insertions(+), 36 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 096ac6c5ca..aa4a1ca86a 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1026,9 +1026,6 @@ public abstract class AbsSwipeUpHandler, if (mRecentsView != null) { int nearestPage = mRecentsView.getDestinationPage(); boolean isScrolling = false; - // Update page scroll before snapping to page to make sure we snapped to the - // position calculated with target gesture in mind. - mRecentsView.updateScrollSynchronously(); if (mRecentsView.getNextPage() != nearestPage) { // We shouldn't really scroll to the next page when swiping up to recents. // Only allow settling on the next page if it's nearest to the center. @@ -1187,7 +1184,8 @@ public abstract class AbsSwipeUpHandler, mLauncherTransitionController = null; if (mRecentsView != null) { - mRecentsView.onPrepareGestureEndAnimation(null, mGestureState.getEndTarget()); + mRecentsView.onPrepareGestureEndAnimation(null, mGestureState.getEndTarget(), + mTaskViewSimulator); } } else { AnimatorSet animatorSet = new AnimatorSet(); @@ -1229,7 +1227,7 @@ public abstract class AbsSwipeUpHandler, animatorSet.play(windowAnim); if (mRecentsView != null) { mRecentsView.onPrepareGestureEndAnimation( - animatorSet, mGestureState.getEndTarget()); + animatorSet, mGestureState.getEndTarget(), mTaskViewSimulator); } animatorSet.setDuration(duration).setInterpolator(interpolator); animatorSet.start(); diff --git a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java index d9631880dc..3bf79f1579 100644 --- a/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java +++ b/quickstep/src/com/android/quickstep/fallback/FallbackRecentsView.java @@ -36,6 +36,7 @@ import com.android.launcher3.statemanager.StateManager.StateListener; import com.android.quickstep.FallbackActivityInterface; import com.android.quickstep.GestureState; import com.android.quickstep.RecentsActivity; +import com.android.quickstep.util.TaskViewSimulator; import com.android.quickstep.views.OverviewActionsView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.SplitPlaceholderView; @@ -89,8 +90,9 @@ public class FallbackRecentsView extends RecentsView clearAllScroll)) { + pageScroll = clearAllScroll + (mIsRtl ? clearAllWidth : -clearAllWidth); + } if (outPageScrolls[i] != pageScroll) { pageScrollChanged = true; outPageScrolls[i] = pageScroll; From 854fbf8d235a3a8ae6193d29fa68597d60c36ec4 Mon Sep 17 00:00:00 2001 From: Hongwei Wang Date: Mon, 12 Jul 2021 17:49:13 -0700 Subject: [PATCH 02/14] Use display cutout info in auto-enter-pip transition Video: http://recall/-/aaaaaabFQoRHlzixHdtY/bpKcGg1eoOo5Jz5U6IwBYK Bug: 191310680 Test: manual, auto-enter-pip from landscape with source rect hint being turned on, see the video Change-Id: Ic191fc73597132a5119522dda477a4319e35d1c8 Merged-In: Ic191fc73597132a5119522dda477a4319e35d1c8 --- .../android/quickstep/AbsSwipeUpHandler.java | 18 +++++++++--------- .../quickstep/util/AssistantUtilities.java | 3 +-- .../quickstep/util/SwipePipToHomeAnimator.java | 15 ++++++++++++++- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 7e45369692..ac1772c300 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -115,7 +115,6 @@ import com.android.systemui.shared.system.InputConsumerController; import com.android.systemui.shared.system.InteractionJankMonitorWrapper; import com.android.systemui.shared.system.LatencyTrackerCompat; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; -import com.android.systemui.shared.system.TaskInfoCompat; import com.android.systemui.shared.system.TaskStackChangeListener; import com.android.systemui.shared.system.TaskStackChangeListeners; @@ -1105,7 +1104,8 @@ public abstract class AbsSwipeUpHandler, public void onActivityRestartAttempt(ActivityManager.RunningTaskInfo task, boolean homeTaskVisible, boolean clearedTask, boolean wasVisible) { if (task.taskId == mGestureState.getRunningTaskId() - && TaskInfoCompat.getActivityType(task) != ACTIVITY_TYPE_HOME) { + && task.configuration.windowConfiguration.getActivityType() + != ACTIVITY_TYPE_HOME) { // Since this is an edge case, just cancel and relaunch with default activity // options (since we don't know if there's an associated app icon to launch from) endRunningWindowAnim(true /* cancel */); @@ -1146,8 +1146,7 @@ public abstract class AbsSwipeUpHandler, boolean appCanEnterPip = !mDeviceState.isPipActive() && runningTaskTarget != null && runningTaskTarget.taskInfo.pictureInPictureParams != null - && TaskInfoCompat.isAutoEnterPipEnabled( - runningTaskTarget.taskInfo.pictureInPictureParams); + && runningTaskTarget.taskInfo.pictureInPictureParams.isAutoEnterEnabled(); HomeAnimationFactory homeAnimFactory = createHomeAnimationFactory(cookies, duration, isTranslucent, appCanEnterPip, runningTaskTarget); @@ -1248,7 +1247,7 @@ public abstract class AbsSwipeUpHandler, final Rect destinationBounds = SystemUiProxy.INSTANCE.get(mContext) .startSwipePipToHome(taskInfo.topActivity, - TaskInfoCompat.getTopActivityInfo(taskInfo), + taskInfo.topActivityInfo, runningTaskTarget.taskInfo.pictureInPictureParams, homeRotation, mDp.hotseatBarSizePx); @@ -1257,9 +1256,9 @@ public abstract class AbsSwipeUpHandler, .setTaskId(runningTaskTarget.taskId) .setComponentName(taskInfo.topActivity) .setLeash(runningTaskTarget.leash.getSurfaceControl()) - .setSourceRectHint(TaskInfoCompat.getPipSourceRectHint( - runningTaskTarget.taskInfo.pictureInPictureParams)) - .setAppBounds(TaskInfoCompat.getWindowConfigurationBounds(taskInfo)) + .setSourceRectHint( + runningTaskTarget.taskInfo.pictureInPictureParams.getSourceRectHint()) + .setAppBounds(taskInfo.configuration.windowConfiguration.getBounds()) .setHomeToWindowPositionMap(homeToWindowPositionMap) .setStartBounds(startRect) .setDestinationBounds(destinationBounds) @@ -1269,7 +1268,8 @@ public abstract class AbsSwipeUpHandler, // is not ROTATION_0 (which implies the rotation is turned on in launcher settings). if (homeRotation == ROTATION_0 && (windowRotation == ROTATION_90 || windowRotation == ROTATION_270)) { - builder.setFromRotation(mTaskViewSimulator, windowRotation); + builder.setFromRotation(mTaskViewSimulator, windowRotation, + taskInfo.displayCutoutInsets); } final SwipePipToHomeAnimator swipePipToHomeAnimator = builder.build(); AnimatorPlaybackController activityAnimationToHome = diff --git a/quickstep/src/com/android/quickstep/util/AssistantUtilities.java b/quickstep/src/com/android/quickstep/util/AssistantUtilities.java index 552db1f4dd..336f7d1362 100644 --- a/quickstep/src/com/android/quickstep/util/AssistantUtilities.java +++ b/quickstep/src/com/android/quickstep/util/AssistantUtilities.java @@ -23,7 +23,6 @@ import android.content.Intent; import android.os.Build; import com.android.systemui.shared.system.ActivityManagerWrapper; -import com.android.systemui.shared.system.TaskInfoCompat; /** * Utility class for interacting with the Assistant. @@ -39,7 +38,7 @@ public final class AssistantUtilities { /** Returns true if the given task holds an Assistant activity that is excluded from recents. */ public static boolean isExcludedAssistant(TaskInfo info) { return info != null - && TaskInfoCompat.getActivityType(info) == ACTIVITY_TYPE_ASSISTANT + && info.configuration.windowConfiguration.getActivityType() == ACTIVITY_TYPE_ASSISTANT && (info.baseIntent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0; } diff --git a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java index 7488649eb7..c0f5c14e3c 100644 --- a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java +++ b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java @@ -301,6 +301,7 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { private ComponentName mComponentName; private SurfaceControl mLeash; private Rect mSourceRectHint; + private Rect mDisplayCutoutInsets; private Rect mAppBounds; private Matrix mHomeToWindowPositionMap; private RectF mStartBounds; @@ -366,7 +367,8 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { } public Builder setFromRotation(TaskViewSimulator taskViewSimulator, - @RecentsOrientedState.SurfaceRotation int fromRotation) { + @RecentsOrientedState.SurfaceRotation int fromRotation, + Rect displayCutoutInsets) { if (fromRotation != Surface.ROTATION_90 && fromRotation != Surface.ROTATION_270) { Log.wtf(TAG, "Not a supported rotation, rotation=" + fromRotation); return this; @@ -381,6 +383,9 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { transformed.round(mDestinationBoundsTransformed); mFromRotation = fromRotation; + if (displayCutoutInsets != null) { + mDisplayCutoutInsets = new Rect(displayCutoutInsets); + } return this; } @@ -388,6 +393,14 @@ public class SwipePipToHomeAnimator extends RectFSpringAnim { if (mDestinationBoundsTransformed.isEmpty()) { mDestinationBoundsTransformed.set(mDestinationBounds); } + // adjust the mSourceRectHint / mAppBounds by display cutout if applicable. + if (mSourceRectHint != null && mDisplayCutoutInsets != null) { + if (mFromRotation == Surface.ROTATION_90) { + mSourceRectHint.offset(mDisplayCutoutInsets.left, mDisplayCutoutInsets.top); + } else if (mFromRotation == Surface.ROTATION_270) { + mAppBounds.inset(mDisplayCutoutInsets); + } + } return new SwipePipToHomeAnimator(mContext, mTaskId, mComponentName, mLeash, mSourceRectHint, mAppBounds, mHomeToWindowPositionMap, mStartBounds, mDestinationBounds, From 83d5e8ca39d0f90f0003a19413a71b9bb83037a8 Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 14 Jul 2021 21:40:23 +0000 Subject: [PATCH 03/14] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I59d3343c23a12713e00ff0f3b5c96eea4ffb437e --- quickstep/res/values-bn/strings.xml | 18 ++++++------------ quickstep/res/values-bs/strings.xml | 18 ++++++------------ quickstep/res/values-en-rAU/strings.xml | 18 ++++++------------ quickstep/res/values-en-rCA/strings.xml | 18 ++++++------------ quickstep/res/values-en-rGB/strings.xml | 18 ++++++------------ quickstep/res/values-en-rIN/strings.xml | 18 ++++++------------ quickstep/res/values-es-rUS/strings.xml | 18 ++++++------------ quickstep/res/values-fa/strings.xml | 18 ++++++------------ quickstep/res/values-hr/strings.xml | 18 ++++++------------ quickstep/res/values-in/strings.xml | 18 ++++++------------ quickstep/res/values-it/strings.xml | 18 ++++++------------ quickstep/res/values-lo/strings.xml | 18 ++++++------------ quickstep/res/values-pt-rPT/strings.xml | 18 ++++++------------ quickstep/res/values-pt/strings.xml | 18 ++++++------------ quickstep/res/values-sq/strings.xml | 18 ++++++------------ quickstep/res/values-sw/strings.xml | 18 ++++++------------ quickstep/res/values-te/strings.xml | 18 ++++++------------ 17 files changed, 102 insertions(+), 204 deletions(-) diff --git a/quickstep/res/values-bn/strings.xml b/quickstep/res/values-bn/strings.xml index eab0943f8c..90545e1577 100644 --- a/quickstep/res/values-bn/strings.xml +++ b/quickstep/res/values-bn/strings.xml @@ -45,10 +45,8 @@ "অ্যাপ সাজেশন চালু করা আছে" "অ্যাপ সাজেশন বন্ধ করা আছে" "আপনার প্রয়োজন হতে পারে এমন অ্যাপ: %1$s" - - - - + "স্ক্রিনের একেবারে ডান বা বাঁদিকের প্রান্ত থেকে সোয়াইপ করেছেন কিনা তা দেখে নিন।" + "স্ক্রিনের ডান বা বাঁদিকের প্রান্ত থেকে মাঝখান পর্যন্ত সোয়াইপ করে আঙুল তুলে নিয়েছেন কিনা তা দেখে নিন।" "ফিরে যেতে, কীভাবে ডান দিক থেকে সোয়াইপ করতে হয় তা আপনি শিখেছেন। এরপর, একটি অ্যাপ থেকে অন্য অ্যাপে কীভাবে যাবেন জেনে নিন।" "আপনি ফিরে যাওয়ার জেসচার সম্পর্কে জেনেছেন।" "স্ক্রিনের নিচের প্রান্তের খুব কাছে পর্যন্ত যাতে সোয়াইপ না করেন সেটি ভাল করে দেখে নিন।" @@ -68,21 +66,17 @@ "ইঙ্গিত কীভাবে ব্যবহার করতে হয় আপনি তা শিখে ফেলেছেন। ইঙ্গিত বন্ধ করতে, সেটিংসে যান।" "আপনি একটি অ্যাপ থেকে অন্য অ্যাপে যাওয়ার জেসচার সম্পর্কে জেনেছেন।" "একটি অ্যাপ থেকে অন্য অ্যাপে যেতে সোয়াইপ করুন" - - + "একটি অ্যাপ থেকে অন্যটিতে পাল্টাতে, স্ক্রিনের নিচ থেকে উপরে সোয়াইপ করে ধরে রাখুন, তারপরে ছেড়ে দিন।" "সব প্রস্তুত" - - + "সম্পূর্ণ হয়েছে" "সেটিংস" "আবার চেষ্টা করুন" "সাবাস!" "টিউটোরিয়াল %1$d/%2$d" "সব রেডি!" - - + "হোম স্ক্রিনে যেতে উপরের দিকে সোয়াইপ করুন" "এবারে আপনি ফোন ব্যবহার করতে পারবেন" - - + "সিস্টেম নেভিগেশন সেটিংস" "শেয়ার করুন" "স্ক্রিনশট নিন" "এই অ্যাপ বা আপনার প্রতিষ্ঠান এই অ্যাকশনটি পারফর্ম করার অনুমতি দেয়নি" diff --git a/quickstep/res/values-bs/strings.xml b/quickstep/res/values-bs/strings.xml index dce7656cb3..95b5f8e577 100644 --- a/quickstep/res/values-bs/strings.xml +++ b/quickstep/res/values-bs/strings.xml @@ -45,10 +45,8 @@ "Prijedlozi aplikacija su omogućeni" "Prijedlozi aplikacija su onemogućeni" "Predviđena aplikacija: %1$s" - - - - + "Pazite da prijeđete prstom od krajnjeg desnog ili krajnjeg lijevog ruba." + "Pazite da prijeđete prstom od desnog ili lijevog ruba do sredine zaslona i podignite prst." "Naučili ste kako prevući zdesna da se vratite. Sljedeće naučite kako prebacivati između aplikacija." "Završili ste pokret za vraćanje." "Obratite pažnju da ne prevučete preblizu donjem dijelu ekrana." @@ -68,21 +66,17 @@ "Naučili ste kako koristiti pokrete. Idite u Postavke da isključite pokrete." "Završili ste pokret za prebacivanje između aplikacija." "Prevucite da prebacujete između aplikacija" - - + "Za promjenu aplikacije prijeđite prstom od dna zaslona prema gore, zadržite pritisak pa pustite." "Sve je spremno" - - + "Gotovo" "Postavke" "Pokušajte ponovo" "Odlično!" "Vodič %1$d/%2$d" "Sve je spremno!" - - + "Prijeđite prstom prema gore da biste otvorili početni zaslon" "Sve je spremno da počnete koristiti telefon" - - + "Postavke navigacije sustavom" "Dijeli" "Snimak ekrana" "Ovu radnju ne dozvoljava aplikacija ili vaša organizacija" diff --git a/quickstep/res/values-en-rAU/strings.xml b/quickstep/res/values-en-rAU/strings.xml index 24cad6552f..ed7debceb1 100644 --- a/quickstep/res/values-en-rAU/strings.xml +++ b/quickstep/res/values-en-rAU/strings.xml @@ -45,10 +45,8 @@ "App suggestions enabled" "App suggestions are disabled" "Predicted app: %1$s" - - - - + "Make sure that you swipe from the far-right or far-left edge." + "Make sure that you swipe from the right or left edge to the middle of the screen and let go." "You learned how to swipe from the right to go back. Next, learn how to switch apps." "You completed the go back gesture." "Make sure that you don\'t swipe too close to the bottom of the screen." @@ -68,21 +66,17 @@ "You learned how to use gestures. To turn off gestures, go to settings." "You completed the switch apps gesture." "Swipe to switch apps" - - + "To switch between apps, swipe up from the bottom of your screen, hold, then release." "All set" - - + "Done" "Settings" "Try again" "Nice!" "Tutorial %1$d/%2$d" "Ready!" - - + "Swipe up to go home" "You’re ready to start using your phone" - - + "System navigation settings" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-en-rCA/strings.xml b/quickstep/res/values-en-rCA/strings.xml index 24cad6552f..ed7debceb1 100644 --- a/quickstep/res/values-en-rCA/strings.xml +++ b/quickstep/res/values-en-rCA/strings.xml @@ -45,10 +45,8 @@ "App suggestions enabled" "App suggestions are disabled" "Predicted app: %1$s" - - - - + "Make sure that you swipe from the far-right or far-left edge." + "Make sure that you swipe from the right or left edge to the middle of the screen and let go." "You learned how to swipe from the right to go back. Next, learn how to switch apps." "You completed the go back gesture." "Make sure that you don\'t swipe too close to the bottom of the screen." @@ -68,21 +66,17 @@ "You learned how to use gestures. To turn off gestures, go to settings." "You completed the switch apps gesture." "Swipe to switch apps" - - + "To switch between apps, swipe up from the bottom of your screen, hold, then release." "All set" - - + "Done" "Settings" "Try again" "Nice!" "Tutorial %1$d/%2$d" "Ready!" - - + "Swipe up to go home" "You’re ready to start using your phone" - - + "System navigation settings" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-en-rGB/strings.xml b/quickstep/res/values-en-rGB/strings.xml index 24cad6552f..ed7debceb1 100644 --- a/quickstep/res/values-en-rGB/strings.xml +++ b/quickstep/res/values-en-rGB/strings.xml @@ -45,10 +45,8 @@ "App suggestions enabled" "App suggestions are disabled" "Predicted app: %1$s" - - - - + "Make sure that you swipe from the far-right or far-left edge." + "Make sure that you swipe from the right or left edge to the middle of the screen and let go." "You learned how to swipe from the right to go back. Next, learn how to switch apps." "You completed the go back gesture." "Make sure that you don\'t swipe too close to the bottom of the screen." @@ -68,21 +66,17 @@ "You learned how to use gestures. To turn off gestures, go to settings." "You completed the switch apps gesture." "Swipe to switch apps" - - + "To switch between apps, swipe up from the bottom of your screen, hold, then release." "All set" - - + "Done" "Settings" "Try again" "Nice!" "Tutorial %1$d/%2$d" "Ready!" - - + "Swipe up to go home" "You’re ready to start using your phone" - - + "System navigation settings" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-en-rIN/strings.xml b/quickstep/res/values-en-rIN/strings.xml index 24cad6552f..ed7debceb1 100644 --- a/quickstep/res/values-en-rIN/strings.xml +++ b/quickstep/res/values-en-rIN/strings.xml @@ -45,10 +45,8 @@ "App suggestions enabled" "App suggestions are disabled" "Predicted app: %1$s" - - - - + "Make sure that you swipe from the far-right or far-left edge." + "Make sure that you swipe from the right or left edge to the middle of the screen and let go." "You learned how to swipe from the right to go back. Next, learn how to switch apps." "You completed the go back gesture." "Make sure that you don\'t swipe too close to the bottom of the screen." @@ -68,21 +66,17 @@ "You learned how to use gestures. To turn off gestures, go to settings." "You completed the switch apps gesture." "Swipe to switch apps" - - + "To switch between apps, swipe up from the bottom of your screen, hold, then release." "All set" - - + "Done" "Settings" "Try again" "Nice!" "Tutorial %1$d/%2$d" "Ready!" - - + "Swipe up to go home" "You’re ready to start using your phone" - - + "System navigation settings" "Share" "Screenshot" "This action isn\'t allowed by the app or your organisation" diff --git a/quickstep/res/values-es-rUS/strings.xml b/quickstep/res/values-es-rUS/strings.xml index b30f5f3bc4..a4e5778654 100644 --- a/quickstep/res/values-es-rUS/strings.xml +++ b/quickstep/res/values-es-rUS/strings.xml @@ -45,10 +45,8 @@ "Sugerencias de apps habilitadas" "Las sugerencias de aplicaciones están inhabilitadas" "Predicción de app: %1$s" - - - - + "Asegúrate de deslizar desde el extremo derecho o izquierdo." + "Asegúrate de deslizar desde borde izquierdo o derecho hacia centro de la pantalla y, luego, soltar." "Aprendiste a deslizar el dedo desde la derecha para volver. Ahora, descubre cómo cambiar de app." "Completaste el gesto \"Atrás\"." "Asegúrate de no hacerlo muy cerca de la parte inferior de la pantalla." @@ -68,21 +66,17 @@ "Ya sabes cómo usar los gestos. Para desactivarlos, ve a Configuración." "Completaste el gesto para cambiar de app." "Desliza el dedo para cambiar de app" - - + "Para cambiar de app, desliza hacia arriba desde parte inferior, mantén presionado y, luego, suelta." "Listo" - - + "Listo" "Configuración" "Reintentar" "¡Genial!" "Instructivo %1$d/%2$d" "Todo listo" - - + "Desliza el dedo hacia arriba para ir a la pantalla principal" "Ya puedes empezar a usar tu teléfono" - - + "Configuración de navegación del sistema" "Compartir" "Captura de pantalla" "La app o tu organización no permiten realizar esta acción" diff --git a/quickstep/res/values-fa/strings.xml b/quickstep/res/values-fa/strings.xml index cd4bbf1a08..d1e849fa7d 100644 --- a/quickstep/res/values-fa/strings.xml +++ b/quickstep/res/values-fa/strings.xml @@ -45,10 +45,8 @@ "«پیشنهاد برنامه» فعال است" "«پیشنهاد برنامه» غیرفعال است" "برنامه پیش‌بینی‌شده: %1$s" - - - - + "دقت کنید که از انتهای لبه سمت راست یا سمت چپ تند بکشید." + "دقت کنید که از لبه سمت راست یا سمت چپ تند به وسط صفحه بکشید و رها کنید." "یاد گرفتید چگونه برای رفتن به عقب از سمت راست تند بکشید. مورد بعدی، با نحوه جابه‌جا شدن بین برنامه‌ها آشنا شوید." "اشاره برگشتن را تکمیل کردید." "دقت کنید که موقع تند کشیدن بیش‌از حد به پایین صفحه نزدیک نشوید." @@ -68,21 +66,17 @@ "با نحوه استفاده از اشاره‌ها آشنا شدید. برای خاموش کردن اشاره‌ها، به «تنظیمات» بروید." "اشاره جابه‌جا شدن بین برنامه‌ها را تکمیل کردید." "تند کشیدن برای جابه‌جا شدن بین برنامه‌ها" - - + "برای جابه‌جا شدن بین برنامه‌ها، از پایین صفحه تند به‌بالا بکشید، نگه دارید، و سپس رها کنید." "همه چیز آماده است" - - + "تمام" "تنظیمات" "امتحان مجدد" "عالی!" "آموزش گام‌به‌گام %1$d/%2$d" "همه چیز آماده است!" - - + "برای رفتن به «صفحه اصلی»، تند به‌بالا بکشید" "آماده‌اید از تلفنتان استفاده کنید" - - + "تنظیمات پیمایش سیستم" "هم‌رسانی" "نماگرفت" "برنامه یا سازمان شما اجازه نمی‌دهد این کنش انجام شود." diff --git a/quickstep/res/values-hr/strings.xml b/quickstep/res/values-hr/strings.xml index a8a7b24277..5ab1a87bf3 100644 --- a/quickstep/res/values-hr/strings.xml +++ b/quickstep/res/values-hr/strings.xml @@ -45,10 +45,8 @@ "Predlaganje apl. omogućeno" "Predlaganje apl. onemogućeno" "Predviđena aplikacija: %1$s" - - - - + "Pazite da prijeđete prstom od krajnjeg desnog ili krajnjeg lijevog ruba." + "Pazite da prijeđete prstom od desnog ili lijevog ruba do sredine zaslona i podignite prst." "Naučili ste kako prijeći prstom zdesna da biste se vratili. Sad saznajte kako promijeniti aplikaciju." "Izvršili ste pokret za povratak." "Pazite da ne prijeđete prstom preblizu dnu zaslona." @@ -68,21 +66,17 @@ "Naučili ste koristiti pokrete. Pokrete možete isključiti u postavkama." "Izvršili ste pokret za promjenu aplikacije." "Prijeđite prstom da biste promijenili aplikaciju" - - + "Za promjenu aplikacije prijeđite prstom od dna zaslona prema gore, zadržite pritisak pa pustite." "Sve je spremno" - - + "Gotovo" "Postavke" "Pokušajte ponovo" "Odlično!" "Vodič %1$d/%2$d" "Sve je spremno!" - - + "Prijeđite prstom prema gore da biste otvorili početni zaslon" "Spremni ste za početak upotrebe telefona" - - + "Postavke navigacije sustavom" "Podijeli" "Snimka zaslona" "Aplikacija ili vaša organizacija ne dopuštaju ovu radnju" diff --git a/quickstep/res/values-in/strings.xml b/quickstep/res/values-in/strings.xml index 46eb6d8b97..3e24fcb620 100644 --- a/quickstep/res/values-in/strings.xml +++ b/quickstep/res/values-in/strings.xml @@ -45,10 +45,8 @@ "Saran aplikasi diaktifkan" "Saran aplikasi dinonaktifkan" "Aplikasi yang diprediksi: %1$s" - - - - + "Pastikan Anda menggeser dari tepi ujung kanan atau ujung kiri." + "Pastikan Anda menggeser dari tepi kanan atau kiri ke tengah layar, lalu lepaskan." "Anda telah belajar cara geser dari kanan untuk kembali. Berikutnya, pelajari cara beralih aplikasi." "Anda telah menyelesaikan gestur kembali." "Pastikan Anda tidak menggeser terlalu dekat ke bagian bawah layar." @@ -68,21 +66,17 @@ "Anda telah mempelajari cara menggunakan gestur. Untuk menonaktifkan gestur, buka Setelan." "Anda telah menyelesaikan gestur beralih aplikasi." "Geser untuk beralih aplikasi" - - + "Untuk beralih antar-aplikasi, geser ke atas dari bagian bawah layar, tahan, lalu lepaskan." "Semua siap" - - + "Selesai" "Setelan" "Coba lagi" "Bagus!" "Tutorial %1$d/%2$d" "Semua siap." - - + "Geser ke atas untuk beralih ke Layar utama" "Anda sudah siap untuk mulai menggunakan ponsel" - - + "Setelan navigasi sistem" "Bagikan" "Screenshot" "Tindakan ini tidak diizinkan oleh aplikasi atau organisasi Anda" diff --git a/quickstep/res/values-it/strings.xml b/quickstep/res/values-it/strings.xml index 7d8f6db9d3..43a210b9de 100644 --- a/quickstep/res/values-it/strings.xml +++ b/quickstep/res/values-it/strings.xml @@ -45,10 +45,8 @@ "La funzionalità app suggerite è attiva" "La funzionalità app suggerite è disattivata" "App prevista: %1$s" - - - - + "Assicurati di scorrere dal bordo all\'estrema destra o all\'estrema sinistra." + "Assicurati di scorrere dal bordo destro o sinistro verso il centro dello schermo e solleva il dito." "Hai imparato a scorrere da destra per tornare indietro. Ora impara come passare da un\'app all\'altra." "Hai completato il gesto Indietro." "Assicurati di non scorrere troppo vicino alla parte inferiore dello schermo." @@ -68,21 +66,17 @@ "Hai imparato a usare i gesti. Per disattivarli, vai alle Impostazioni." "Hai completato il gesto Cambia app." "Scorri per passare da un\'app all\'altra" - - + "Per spostarti tra le app, scorri verso l\'alto dal fondo dello schermo, tieni premuto e rilascia." "Fatto" - - + "Fine" "Impostazioni" "Riprova" "Bene!" "Tutorial %1$d/%2$d" "Finito." - - + "Scorri verso l\'alto per andare alla schermata Home" "Puoi iniziare a usare il tuo telefono" - - + "Impostazioni Navigazione del sistema" "Condividi" "Screenshot" "Questa azione non è consentita dall\'app o dall\'organizzazione" diff --git a/quickstep/res/values-lo/strings.xml b/quickstep/res/values-lo/strings.xml index 8f9540d751..915578b8e7 100644 --- a/quickstep/res/values-lo/strings.xml +++ b/quickstep/res/values-lo/strings.xml @@ -45,10 +45,8 @@ "ເປີດການນຳໃຊ້ການແນະນຳແອັບແລ້ວ" "ປິດການນຳໃຊ້ການແນະນຳແອັບແລ້ວ" "ແອັບທີ່ຄາດເດົາໄວ້: %1$s" - - - - + "ກະລຸນາກວດສອບວ່າທ່ານປັດຈາກຂອບຂວາສຸດ ຫຼື ຊ້າຍສຸດ." + "ກະລຸນາກວດສອບວ່າທ່ານປັດຈາກຂອບຂວາ ຫຼື ຊ້າຍໄປຫາທາງກາງຂອງໜ້າຈໍແລ້ວປ່ອຍນິ້ວ." "ທ່ານຮຽນຮູ້ວິທີປັດຈາກຂວາເພື່ອກັບຄືນແລ້ວ. ຕໍ່ໄປ, ມາສຶກສາວິທີສະຫຼັບແອັບ." "ທ່ານໃຊ້ທ່າທາງກັບຄືນສຳເລັດແລ້ວ." "ກະລຸນາກວດສອບວ່າທ່ານບໍ່ໄດ້ປັດໃກ້ກັບທາງລຸ່ມຂອງໜ້າຈໍເກີນໄປ." @@ -68,21 +66,17 @@ "ທ່ານໄດ້ສຶກສາວິທີໃຊ້ທ່າທາງແລ້ວ. ເພື່ອປິດທ່າທາງຕ່າງໆ, ໃຫ້ເຂົ້າໄປຫາການຕັ້ງຄ່າ." "ທ່ານໃຊ້ທ່າທາງສະຫຼັບແອັບສຳເລັດແລ້ວ." "ປັດເພື່ອສະຫຼັບແອັບ" - - + "ເພື່ອສະຫຼັບລະຫວ່າງແອັບ, ໃຫ້ປັດຂຶ້ນຈາກລຸ່ມສຸດຂອງໜ້າຈໍທ່ານ, ກົດຄ້າງໄວ້, ຈາກນັ້ນປ່ອຍ." "ທຸກຢ່າງພ້ອມແລ້ວ" - - + "ແລ້ວໆ" "ການຕັ້ງຄ່າ" "ລອງໃໝ່" "ດີ!" "ການສອນການນຳໃຊ້ທີ %1$d/%2$d" "ຮຽບຮ້ອຍໝົດແລ້ວ!" - - + "ປັດຂຶ້ນເພື່ອໄປຫາໜ້າຫຼັກ" "ທ່ານພ້ອມເລີ່ມຕົ້ນໃຊ້ໂທລະສັບຂອງທ່ານແລ້ວ" - - + "ການຕັ້ງຄ່າການນຳທາງລະບົບ" "ແບ່ງປັນ" "ຮູບໜ້າຈໍ" "ແອັບ ຫຼື ອົງການຂອງທ່ານບໍ່ອະນຸຍາດໃຫ້ໃຊ້ຄຳສັ່ງນີ້" diff --git a/quickstep/res/values-pt-rPT/strings.xml b/quickstep/res/values-pt-rPT/strings.xml index 7c28c7210a..7fe20bbd65 100644 --- a/quickstep/res/values-pt-rPT/strings.xml +++ b/quickstep/res/values-pt-rPT/strings.xml @@ -45,10 +45,8 @@ "Sugestões de apps ativadas" "As sugestões de apps estão desativadas" "App prevista: %1$s" - - - - + "Deslize rapidamente a partir da extremidade mais à direita ou mais à esquerda." + "Deslize rapidamente a partir da extremidade esquerda ou direita até ao centro do ecrã e solte." "Aprendeu a deslizar a partir da direita para retroceder. A seguir, saiba como alternar entre apps." "Concluiu o gesto para retroceder." "Garanta que não desliza rapidamente com o dedo demasiado perto da parte inferior do ecrã." @@ -68,21 +66,17 @@ "Aprendeu a utilizar gestos. Para desativar os gestos, aceda às Definições." "Concluiu o gesto para alternar entre apps." "Deslize rapidamente com o dedo para alternar entre apps" - - + "P/ alternar entre apps, deslize p/ cima a partir da parte inf. do ecrã sem soltar e, depois, solte." "Está tudo pronto" - - + "Concluído" "Definições" "Tente novamente" "Boa!" "Tutorial %1$d/%2$d" "Tudo pronto!" - - + "Deslize rapidamente para cima para aceder ao ecrã principal" "Já pode começar a utilizar o seu telemóvel" - - + "Definições de navegação do sistema" "Partilhar" "Fazer captura de ecrã" "Esta ação não é permitida pela app ou a sua entidade." diff --git a/quickstep/res/values-pt/strings.xml b/quickstep/res/values-pt/strings.xml index 1899719af2..422d13af89 100644 --- a/quickstep/res/values-pt/strings.xml +++ b/quickstep/res/values-pt/strings.xml @@ -45,10 +45,8 @@ "O recurso \"sugestões de apps\" está ativado" "O recurso \"sugestões de apps\" está desativado" "App previsto: %1$s" - - - - + "Deslize da borda direita ou esquerda." + "Deslize da borda direita ou esquerda até o meio da tela e solte." "Você aprendeu a deslizar da direita para voltar. A seguir, aprenda a trocar de app." "Você concluiu o gesto para voltar." "Não deslize perto demais da parte inferior da tela." @@ -68,21 +66,17 @@ "Você aprendeu a usar gestos. Para desativá-los, acesse as Configurações." "Você concluiu o gesto para trocar de app." "Deslizar para trocar de app" - - + "Para mudar de app, deslize de baixo para cima na tela, mantenha-a pressionada por um tempo e solte." "Tudo pronto" - - + "Concluído" "Configurações" "Tentar novamente" "Muito bem!" "Tutorial %1$d/%2$d" "Tudo pronto!" - - + "Deslize para cima para acessar a tela inicial" "Você já pode começar a usar seu smartphone" - - + "Configurações de navegação do sistema" "Compartilhar" "Capturar tela" "Essa ação não é permitida pelo app ou pela organização" diff --git a/quickstep/res/values-sq/strings.xml b/quickstep/res/values-sq/strings.xml index 59ae630406..86528d2777 100644 --- a/quickstep/res/values-sq/strings.xml +++ b/quickstep/res/values-sq/strings.xml @@ -45,10 +45,8 @@ "Aplikacionet e sugjeruara janë aktivizuar" "Sugjerimet e aplikacioneve janë çaktivizuar" "Aplikacioni i parashikuar: %1$s" - - - - + "Sigurohu që të rrëshqasësh shpejt nga skaji më i djathtë ose më i majtë." + "Sigurohu që të rrëshqasësh shpejt nga skaji i djathtë ose i majtë drejt mesit të ekranit dhe lëshoje." "Ke mësuar si të rrëshqasësh shpejt nga e djathta për t\'u kthyer prapa. Në vijim do të mësosh se si t\'i ndërrosh aplikacionet." "E ke përfunduar gjestin e kthimit prapa." "Sigurohu që të mos rrëshqasësh shumë afër fundit të ekranit." @@ -68,21 +66,17 @@ "Ke mësuar si të përdorësh gjestet. Për t\'i çaktivizuar gjestet, shko te \"Cilësimet\"." "E ke përfunduar gjestin e ndërrimit të aplikacioneve." "Rrëshqit shpejt për të ndërruar aplikacionet" - - + "Për të ndërruar mes aplikacioneve, rrëshqit shpejt lart nga fundi i ekranit tënd, mbaj dhe pastaj lësho." "Plotësisht gati" - - + "U krye" "Cilësimet" "Provo përsëri" "Bukur!" "Udhëzuesi %1$d/%2$d" "Plotësisht gati!" - - + "Rrëshqit shpejt lart për të shkuar tek \"Ekrani bazë\"" "Je gati për të filluar përdorimin e telefonit tënd" - - + "Cilësimet e navigimit të sistemit" "Ndaj" "Pamja e ekranit" "Ky veprim nuk lejohet nga aplikacioni ose organizata jote" diff --git a/quickstep/res/values-sw/strings.xml b/quickstep/res/values-sw/strings.xml index 66ce61676b..093cbb89b7 100644 --- a/quickstep/res/values-sw/strings.xml +++ b/quickstep/res/values-sw/strings.xml @@ -45,10 +45,8 @@ "Mapendekezo ya programu yamewashwa" "Umezima mapendekezo ya programu" "Programu iliyotabiriwa: %1$s" - - - - + "Hakikisha unatelezesha kidole kuanzia ukingo wa kulia kabisa au ukingo wa kushoto kabisa." + "Hakikisha unatelezesha kidole kuanzia ukingo wa kulia au kushoto kuelekea katikati ya skrini na uachilie." "Umejifunza jinsi ya kutelezesha kidole kuanzia kulia ili kurudi nyuma. Hatua inayofuata, jifunze jinsi ya kubadilisha programu." "Umekamilisha ishara ya kurudi nyuma." "Hakikisha hutelezeshi kidole karibu sana na sehemu ya chini ya skrini." @@ -68,21 +66,17 @@ "Umejifunza jinsi ya kutumia ishara. Ili uzime ishara, nenda kwenye Mipangilio." "Umekamilisha ishara ya kubadilisha programu." "Telezesha kidole ili ubadilishe programu" - - + "Ili ubadili kati ya programu, telezesha kidole juu kuanzia sehemu ya chini ya skrini yako, ushikilie, kisha uachilie." "Kila kitu kiko tayari" - - + "Nimemaliza" "Mipangilio" "Jaribu tena" "Safi!" "Mafunzo ya %1$d kati ya %2$d" "Tayari!" - - + "Telezesha kidole juu ili uende kwenye skrini ya kwanza" "Uko tayari kuanza kutumia simu yako" - - + "Mipangilio ya usogezaji kwenye mfumo" "Shiriki" "Picha ya skrini" "Kitendo hiki hakiruhusiwi na programu au shirika lako" diff --git a/quickstep/res/values-te/strings.xml b/quickstep/res/values-te/strings.xml index 4c493e2c5b..be2ffbd4ab 100644 --- a/quickstep/res/values-te/strings.xml +++ b/quickstep/res/values-te/strings.xml @@ -45,10 +45,8 @@ "యాప్ సలహాలు ఎనేబుల్ చేయబడ్డాయి" "యాప్ సూచ‌న‌లు డిజేబుల్‌ చేయబడ్డాయి" "సూచించబడిన యాప్: %1$s" - - - - + "కుడి వైపు చిట్ట చివరి లేదా ఎడమ వైపు చిట్ట చివరి అంచు నుండి స్వైప్ చేస్తున్నారని నిర్ధారించుకోండి." + "మీరు కుడి లేదా ఎడమ అంచు నుండి స్క్రీన్ మధ్యలోకి స్వైప్ చేశారని నిర్ధారించుకోని, మీ వేలిని ఎత్తండి." "వెనుకకు వెళ్లడానికి కుడి నుండి స్వైప్ ఎలానో మీకు తెలుసు. తర్వాత, యాప్‌ల మధ్య ఎలా మారాలో తెలుసుకోండి." "మీరు తిరిగి వెనక్కు వెళ్లే సంజ్ఞను పూర్తి చేశారు." "మీరు స్క్రీన్ దిగువకు చాలా దగ్గరగా స్వైప్ చేయలేదని నిర్ధారించుకోండి." @@ -68,21 +66,17 @@ "మీరు సంజ్ఞలను ఎలా ఉపయోగించాలో నేర్చుకున్నారు. సంజ్ఞలను ఆఫ్ చేయడానికి, సెట్టింగ్‌లకు వెళ్లండి." "మీరు \'యాప్‌ల మధ్య మార్పు\' సంజ్ఞను పూర్తి చేశారు." "యాప్‌ల మధ్య మార్చడం కోసం స్వైప్ చేయండి" - - + "యాప్‌ల మధ్య మారడానికి, మీ స్క్రీన్ కింది వైపు నుండి పైకి స్వైప్ చేసి, పట్టుకుని, తర్వాత వదలండి." "అంతా సిద్ధంగా ఉంది" - - + "పూర్తయింది" "సెట్టింగ్‌లు" "మళ్లీ ట్రై చేయండి" "పనితీరు బాగుంది!" "ట్యుటోరియల్ %1$d/%2$d" "అంతా సెట్ అయింది!" - - + "మొదటి స్క్రీన్‌కు వెళ్లడానికి పైకి స్వైప్ చేయండి" "మీరు మీ ఫోన్‌ను ఉపయోగించడానికి సిద్ధంగా ఉన్నారు" - - + "సిస్టమ్ నావిగేషన్ సెట్టింగ్‌లు" "షేర్ చేయండి" "స్క్రీన్‌షాట్" "ఈ చర్యను యాప్ గానీ, మీ సంస్థ గానీ అనుమతించవు" From f2b0e01dd87bb62e8fda8c297e7ec8f5f556cd0f Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 14 Jul 2021 21:40:52 +0000 Subject: [PATCH 04/14] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I1cb8955229751514f4577ba5d37f8ad1d0ab56c5 --- go/quickstep/res/values-sq/strings.xml | 27 +++++++++----------------- 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/go/quickstep/res/values-sq/strings.xml b/go/quickstep/res/values-sq/strings.xml index 9e379311fd..bc9c429d05 100644 --- a/go/quickstep/res/values-sq/strings.xml +++ b/go/quickstep/res/values-sq/strings.xml @@ -5,24 +5,15 @@ "Dëgjo" "Përkthe" "Lentja" - - - - - - + "E KUPTOVA" + "ANULO" + "CILËSIMET" "Përkthe ose dëgjo tekstin në ekran" "Informacionet si teksti në ekranin tënd, adresat e uebit dhe pamjet e ekranit mund të ndahen me Google.\n\nPër të ndryshuar se çfarë informacionesh ndahen, shko te ""Cilësimet > Aplikacionet > Aplikacionet e parazgjedhura > Aplikacioni i asistentit dixhital""." - - - - - - - - - - - - + "Zgjidh një asistent për të përdorur këtë veçori" + "Për të dëgjuar ose përkthyer tekstin në ekran, zgjidh një aplikacion të asistentit dixhital te \"Cilësimet\"" + "Ndrysho asistentin për të përdorur këtë veçori" + "Për të dëgjuar ose përkthyer tekstin në ekran, ndrysho aplikacionin e asistentit dixhital te \"Cilësimet\"" + "Trokit këtu për të dëgjuar tekstin në këtë ekran" + "Trokit këtu për të përkthyer tekstin në këtë ekran" From c00f82b9a246a8f440ed2435971b17156c5f82df Mon Sep 17 00:00:00 2001 From: Bill Yi Date: Wed, 14 Jul 2021 21:41:32 +0000 Subject: [PATCH 05/14] Import translations. DO NOT MERGE ANYWHERE Auto-generated-cl: translation import Change-Id: I66e91e3b191845a9055ab7a7229447b5d73cd06e --- res/values-bn/strings.xml | 3 +-- res/values-bs/strings.xml | 3 +-- res/values-en-rAU/strings.xml | 3 +-- res/values-en-rCA/strings.xml | 3 +-- res/values-en-rGB/strings.xml | 3 +-- res/values-en-rIN/strings.xml | 3 +-- res/values-es-rUS/strings.xml | 3 +-- res/values-fa/strings.xml | 3 +-- res/values-hr/strings.xml | 3 +-- res/values-in/strings.xml | 3 +-- res/values-it/strings.xml | 3 +-- res/values-lo/strings.xml | 3 +-- res/values-pt-rPT/strings.xml | 3 +-- res/values-pt/strings.xml | 3 +-- res/values-sq/strings.xml | 3 +-- res/values-sw/strings.xml | 3 +-- res/values-te/strings.xml | 3 +-- 17 files changed, 17 insertions(+), 34 deletions(-) diff --git a/res/values-bn/strings.xml b/res/values-bn/strings.xml index d74097578b..d39f82a0fa 100644 --- a/res/values-bn/strings.xml +++ b/res/values-bn/strings.xml @@ -35,8 +35,7 @@ "%1$sটি উইজেট" "হোম স্ক্রিনের যেকোনও জায়গায় উইজেটটি নিয়ে যেতে, টাচ করে ধরে থাকুন" "হোম স্ক্রিনে যোগ করুন" - - + "%1$s উইজেট হোম স্ক্রিনে যোগ করা হয়েছে" %1$dটি উইজেট %1$dটি উইজেট diff --git a/res/values-bs/strings.xml b/res/values-bs/strings.xml index b9a3b1d59c..6872e9d89a 100644 --- a/res/values-bs/strings.xml +++ b/res/values-bs/strings.xml @@ -35,8 +35,7 @@ "Vidžet %1$s" "Dodirnite i držite vidžet da ga pomjerate po Početnom ekranu" "Dodaj na početni ekran" - - + "Widget %1$s dodan je na početni zaslon" %1$d vidžet %1$d vidžeta diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml index da80b1b37d..aec1cbf5ce 100644 --- a/res/values-en-rAU/strings.xml +++ b/res/values-en-rAU/strings.xml @@ -35,8 +35,7 @@ "%1$s widget" "Touch and hold the widget to move it around the home screen" "Add to home screen" - - + "%1$s widget added to home screen" %1$d widgets %1$d widget diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml index da80b1b37d..aec1cbf5ce 100644 --- a/res/values-en-rCA/strings.xml +++ b/res/values-en-rCA/strings.xml @@ -35,8 +35,7 @@ "%1$s widget" "Touch and hold the widget to move it around the home screen" "Add to home screen" - - + "%1$s widget added to home screen" %1$d widgets %1$d widget diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml index da80b1b37d..aec1cbf5ce 100644 --- a/res/values-en-rGB/strings.xml +++ b/res/values-en-rGB/strings.xml @@ -35,8 +35,7 @@ "%1$s widget" "Touch and hold the widget to move it around the home screen" "Add to home screen" - - + "%1$s widget added to home screen" %1$d widgets %1$d widget diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml index da80b1b37d..aec1cbf5ce 100644 --- a/res/values-en-rIN/strings.xml +++ b/res/values-en-rIN/strings.xml @@ -35,8 +35,7 @@ "%1$s widget" "Touch and hold the widget to move it around the home screen" "Add to home screen" - - + "%1$s widget added to home screen" %1$d widgets %1$d widget diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml index b0381f86d1..36387ac060 100644 --- a/res/values-es-rUS/strings.xml +++ b/res/values-es-rUS/strings.xml @@ -35,8 +35,7 @@ "%1$s widget" "Mantén presionado el widget para moverlo por la pantalla principal" "Agregar a pantalla principal" - - + "Se agregó el widget de %1$s a la pantalla principal" %1$d widgets %1$d widget diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml index e2aaae6b6a..9cc78185d4 100644 --- a/res/values-fa/strings.xml +++ b/res/values-fa/strings.xml @@ -35,8 +35,7 @@ "ابزارک %1$s" "ابزارک را لمس کنید و نگه دارید تا آن را در صفحه اصلی حرکت دهید" "افزودن به صفحه اصلی" - - + "ابزارک %1$s به صفحه اصلی اضافه شد" %1$d ابزارک %1$d ابزارک diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml index 7561e9586a..eb4456d525 100644 --- a/res/values-hr/strings.xml +++ b/res/values-hr/strings.xml @@ -35,8 +35,7 @@ "Widget %1$s" "Dodirnite i zadržite widget da biste ga pomicali po početnom zaslonu" "Dodaj na početni zaslon" - - + "Widget %1$s dodan je na početni zaslon" %1$d widget %1$d widgeta diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml index 512498d6d9..a7f67bcdd8 100644 --- a/res/values-in/strings.xml +++ b/res/values-in/strings.xml @@ -35,8 +35,7 @@ "Widget %1$s" "Sentuh lama widget untuk memindahkannya di sekitar Layar utama" "Tambahkan ke Layar utama" - - + "Widget %1$s ditambahkan ke layar utama" %1$d widget %1$d widget diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml index fd1f110fda..aee2c73709 100644 --- a/res/values-it/strings.xml +++ b/res/values-it/strings.xml @@ -35,8 +35,7 @@ "Widget %1$s" "Tocca e tieni premuto il widget per spostarlo nella schermata Home" "Aggiungi a schermata Home" - - + "Widget %1$s aggiunto alla schermata Home" %1$d widget %1$d widget diff --git a/res/values-lo/strings.xml b/res/values-lo/strings.xml index 63e005f8e9..934229c64c 100644 --- a/res/values-lo/strings.xml +++ b/res/values-lo/strings.xml @@ -35,8 +35,7 @@ "ວິດເຈັດ %1$s" "ແຕະວິດເຈັດຄ້າງໄວ້ເພື່ອຍ້າຍມັນໄປມາຢູ່ໂຮມສະກຣີນ" "ເພີ່ມໄປໃສ່ໂຮມສະກຣີນ" - - + "ເພີ່ມວິດເຈັດ %1$s ໃສ່ໂຮມສະກຣີນແລ້ວ" %1$d ວິດເຈັດ %1$d ວິດເຈັດ diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml index 00fa5ce001..f0ba02156a 100644 --- a/res/values-pt-rPT/strings.xml +++ b/res/values-pt-rPT/strings.xml @@ -35,8 +35,7 @@ "Widget %1$s" "Toque sem soltar no widget para o mover à volta do ecrã principal" "Adicionar ao ecrã principal" - - + "Widget %1$s adicionado ao ecrã principal" %1$d widgets %1$d widget diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml index 07c9058cdc..74bca02e82 100644 --- a/res/values-pt/strings.xml +++ b/res/values-pt/strings.xml @@ -35,8 +35,7 @@ "Widget %1$s" "Toque no widget e mantenha-o pressionado para movê-lo pela tela inicial" "Adicionar à tela inicial" - - + "Widget %1$s adicionado à tela inicial" %1$d widget %1$d widgets diff --git a/res/values-sq/strings.xml b/res/values-sq/strings.xml index 1110cd734b..9498d9674d 100644 --- a/res/values-sq/strings.xml +++ b/res/values-sq/strings.xml @@ -35,8 +35,7 @@ "%1$s miniaplikacion" "Prek dhe mbaj të shtypur miniaplikacionin për ta lëvizur nëpër \"Ekranin bazë\"" "Shto në \"Ekranin bazë\"" - - + "Miniaplikacioni %1$s u shtua në ekranin bazë" %1$d miniaplikacione %1$d miniaplikacion diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml index 8e27312297..43abecb9a2 100644 --- a/res/values-sw/strings.xml +++ b/res/values-sw/strings.xml @@ -35,8 +35,7 @@ "Wijeti ya %1$s" "Gusa na ushikilie wijeti ili uisogeze kwenye Skrini ya kwanza" "Weka kwenye Skrini ya kwanza" - - + "Umeongeza wijeti ya %1$s kwenye skrini ya kwanza" Wijeti %1$d Wijeti %1$d diff --git a/res/values-te/strings.xml b/res/values-te/strings.xml index 854ffedde3..80a6f10bf1 100644 --- a/res/values-te/strings.xml +++ b/res/values-te/strings.xml @@ -35,8 +35,7 @@ "%1$s విడ్జెట్" "ఈ విడ్జెట్‌ను మొదటి స్క్రీన్‌లో కావాల్సిన చోట ఉంచడానికి, దాన్ని తాకి అలాగే నొక్కి పట్టుకోండి" "మొదటి స్క్రీన్‌కు జోడించు" - - + "మొదటి స్క్రీన్‌కు %1$s విడ్జెట్ జోడించబడింది" %1$d విడ్జెట్‌లు %1$d విడ్జెట్ From 44424572b4bb378995e138e2e5f89c6fcc3a1ca7 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Wed, 14 Jul 2021 11:39:43 -0700 Subject: [PATCH 06/14] Fix work profile disable button falsing Bug: 191996677 Test: before this CL: when tapping on immediately above keyboard when keyboard is translating or when onApplyWindowInset is called, the hidden (GONE) view handles touch and triggers work profile to be disabled. After the CL, the button view is not attached to the parent container when on personal tab. Also, the onApplyWindowInsets method translations can only be called when work tab is selected. Change-Id: Ib3e9a5c4b3280052f9ccb62a199ed256ae4e094f --- .../launcher3/allapps/AllAppsContainerView.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 516af59d75..d2c71b2afe 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -477,10 +477,6 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo } else { mAH[AdapterHolder.MAIN].setup(findViewById(R.id.apps_list_view), null); mAH[AdapterHolder.WORK].recyclerView = null; - if (mWorkModeSwitch != null) { - ((ViewGroup) mWorkModeSwitch.getParent()).removeView(mWorkModeSwitch); - mWorkModeSwitch = null; - } } setupHeader(); @@ -532,7 +528,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo @Override public void onActivePageChanged(int currentActivePage) { - mHeader.setMainActive(currentActivePage == 0); + mHeader.setMainActive(currentActivePage == AdapterHolder.MAIN); if (mAH[currentActivePage].recyclerView != null) { mAH[currentActivePage].recyclerView.bindFastScrollbar(); } @@ -541,6 +537,14 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo mWorkModeSwitch.setWorkTabVisible(currentActivePage == AdapterHolder.WORK && mAllAppsStore.hasModelFlag( FLAG_HAS_SHORTCUT_PERMISSION | FLAG_QUIET_MODE_CHANGE_PERMISSION)); + + if (currentActivePage == AdapterHolder.WORK) { + if (mWorkModeSwitch.getParent() == null) { + addView(mWorkModeSwitch); + } + } else { + removeView(mWorkModeSwitch); + } } } From d0767c86ffeffa27b746a8793ab96baa9b978893 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 14 Jul 2021 14:54:24 -0700 Subject: [PATCH 07/14] Making it clear that the diagnosed state is the final, current one Test: presubmit Bug: 187761685 Change-Id: I739a0b9158518a3495b5df7010a0641ed8db8506 --- .../com/android/launcher3/tapl/LauncherInstrumentation.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 42f9cb80f6..1b8adefba1 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -505,7 +505,7 @@ public final class LauncherInstrumentation { checkForAnomaly(); Assert.fail(formatSystemHealthMessage(formatErrorWithEvents( "http://go/tapl test failure:\nContext: " + getContextDescription() - + " - visible state is " + getVisibleStateMessage() + + " => resulting visible state is " + getVisibleStateMessage() + ";\nDetails: " + message, true))); } From fa0be316dff5b397253e2b0014ff3d2085876c96 Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 14 Jul 2021 14:46:00 -0700 Subject: [PATCH 08/14] Adding more context to swipe-to-home diags Test: presubmit Bug: 187761685 Change-Id: I89c6bac2258e63d95971dec9a5c688125b885229 --- .../android/launcher3/tapl/LauncherInstrumentation.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java index 42f9cb80f6..8bb2a382e3 100644 --- a/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java +++ b/tests/tapl/com/android/launcher3/tapl/LauncherInstrumentation.java @@ -699,7 +699,8 @@ public final class LauncherInstrumentation { * @return the Workspace object. */ public Workspace pressHome() { - try (LauncherInstrumentation.Closable e = eventsCheck()) { + try (LauncherInstrumentation.Closable e = eventsCheck(); + LauncherInstrumentation.Closable c = addContextLayer("want to switch to home")) { waitForLauncherInitialized(); // Click home, then wait for any accessibility event, then wait until accessibility // events stop. @@ -719,7 +720,7 @@ public final class LauncherInstrumentation { displaySize.x / 2, 0, ZERO_BUTTON_STEPS_FROM_BACKGROUND_TO_HOME, false, GestureScope.INSIDE_TO_OUTSIDE); - try (LauncherInstrumentation.Closable c = addContextLayer( + try (LauncherInstrumentation.Closable c1 = addContextLayer( "Swiped up from context menu to home")) { waitUntilLauncherObjectGone(CONTEXT_MENU_RES_ID); // Swiping up can temporarily bring Nexus Launcher if the current @@ -768,7 +769,7 @@ public final class LauncherInstrumentation { || hasLauncherObject(OVERVIEW_RES_ID)), action); } - try (LauncherInstrumentation.Closable c = addContextLayer( + try (LauncherInstrumentation.Closable c1 = addContextLayer( "performed action to switch to Home - " + action)) { return getWorkspace(); } From b8d13d7a700c7c6c37b51b58f09c4abeaca83c8e Mon Sep 17 00:00:00 2001 From: vadimt Date: Wed, 14 Jul 2021 13:25:58 -0700 Subject: [PATCH 09/14] Moving launcher state verification higher. This will result in better messages when accidentally scrolling closes All Apps. Test: presubmit Bug: 187761685 Change-Id: Iadb8847ba66b1d6fe903577f67fcf3e504c2b28c --- tests/tapl/com/android/launcher3/tapl/AllApps.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tapl/com/android/launcher3/tapl/AllApps.java b/tests/tapl/com/android/launcher3/tapl/AllApps.java index 1cb6b2debf..78301e48cd 100644 --- a/tests/tapl/com/android/launcher3/tapl/AllApps.java +++ b/tests/tapl/com/android/launcher3/tapl/AllApps.java @@ -135,6 +135,7 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { .collect(Collectors.toList()), mLauncher.getVisibleBounds(searchBox).bottom - mLauncher.getVisibleBounds(allAppsContainer).top); + verifyActiveContainer(); final int newScroll = getAllAppsScroll(); mLauncher.assertTrue( "Scrolled in a wrong direction in AllApps: from " + scroll + " to " @@ -144,7 +145,6 @@ public class AllApps extends LauncherInstrumentation.VisibleContainer { mLauncher.assertTrue( "Exceeded max scroll attempts: " + MAX_SCROLL_ATTEMPTS, ++attempts <= MAX_SCROLL_ATTEMPTS); - verifyActiveContainer(); scroll = newScroll; } } From f3d23f67bdeca06aafd50affdc5b83ab882818b4 Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Tue, 13 Jul 2021 19:34:16 +0100 Subject: [PATCH 10/14] Scale widget previews This CL covers drag requests initiated from Launcher.java but not from other activities. Test: Manual Bug: 193144010 Change-Id: Ieb862d689afe81a5b35aedeb9a277de08c775230 --- .../android/launcher3/dragndrop/DragView.java | 6 + .../android/launcher3/widget/WidgetCell.java | 118 +++++++++++++----- 2 files changed, 96 insertions(+), 28 deletions(-) diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index 1f9373042a..f2ab96ce22 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -148,6 +148,12 @@ public abstract class DragView extends Fram addView(content, new LayoutParams(width, height)); + // If there is already a scale set on the content, we don't want to clip the children. + if (content.getScaleX() != 1 || content.getScaleY() != 1) { + setClipChildren(false); + setClipToPadding(false); + } + final float scale = (width + finalScaleDps) / width; // Set the initial scale to avoid any jumps diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java index 5759f75535..edcab4e5c6 100644 --- a/src/com/android/launcher3/widget/WidgetCell.java +++ b/src/com/android/launcher3/widget/WidgetCell.java @@ -16,12 +16,14 @@ package com.android.launcher3.widget; +import static android.view.View.MeasureSpec.makeMeasureSpec; +import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; + import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_WIDGETS_TRAY; import static com.android.launcher3.Utilities.ATLEAST_S; import android.content.Context; import android.graphics.Bitmap; -import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.os.CancellationSignal; import android.util.AttributeSet; @@ -31,6 +33,7 @@ import android.view.Gravity; import android.view.MotionEvent; import android.view.View; import android.view.View.OnLayoutChangeListener; +import android.view.ViewGroup; import android.view.ViewPropertyAnimator; import android.view.accessibility.AccessibilityNodeInfo; import android.widget.FrameLayout; @@ -71,11 +74,36 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { /** Widget preview width is calculated by multiplying this factor to the widget cell width. */ private static final float PREVIEW_SCALE = 0.8f; - protected int mPreviewWidth; - protected int mPreviewHeight; + /** + * The maximum dimension that can be used as the size in + * {@link android.view.View.MeasureSpec#makeMeasureSpec(int, int)}. + * + *

This is equal to (1 << MeasureSpec.MODE_SHIFT) - 1. + */ + private static final int MAX_MEASURE_SPEC_DIMENSION = (1 << 30) - 1; + + /** + * The target preview width, in pixels, of a widget or a shortcut. + * + *

The actual preview width may be smaller than or equal to this value subjected to scaling. + */ + protected int mTargetPreviewWidth; + + /** + * The target preview height, in pixels, of a widget or a shortcut. + * + *

The actual preview height may be smaller than or equal to this value subjected to scaling. + */ + protected int mTargetPreviewHeight; + protected int mPresetPreviewSize; + private int mCellSize; - private float mPreviewScale = 1f; + + /** + * The scale of the preview container. + */ + private float mPreviewContainerScale = 1f; private FrameLayout mWidgetImageContainer; private WidgetImageView mWidgetImage; @@ -96,7 +124,6 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { protected final BaseActivity mActivity; private final CheckLongPressHelper mLongPressHelper; private final float mEnforcedCornerRadius; - private final int mShortcutPreviewPadding; private RemoteViews mRemoteViewsPreview; private NavigableAppWidgetHostView mAppWidgetHostViewPreview; @@ -122,14 +149,12 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { setClipToPadding(false); setAccessibilityDelegate(mActivity.getAccessibilityDelegate()); mEnforcedCornerRadius = RoundedCornerEnforcement.computeEnforcedRadius(context); - mShortcutPreviewPadding = - 2 * getResources().getDimensionPixelSize(R.dimen.widget_preview_shortcut_padding); } private void setContainerWidth() { mCellSize = (int) (mActivity.getDeviceProfile().allAppsIconSizePx * WIDTH_SCALE); mPresetPreviewSize = (int) (mCellSize * PREVIEW_SCALE); - mPreviewWidth = mPreviewHeight = mPresetPreviewSize; + mTargetPreviewWidth = mTargetPreviewHeight = mPresetPreviewSize; } @Override @@ -166,7 +191,7 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { mWidgetDims.setText(null); mWidgetDescription.setText(null); mWidgetDescription.setVisibility(GONE); - mPreviewWidth = mPreviewHeight = mPresetPreviewSize; + mTargetPreviewWidth = mTargetPreviewHeight = mPresetPreviewSize; if (mActiveRequest != null) { mActiveRequest.cancel(); @@ -248,16 +273,6 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { @Nullable RemoteViews remoteViews) { appWidgetHostViewPreview.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO); appWidgetHostViewPreview.setAppWidget(/* appWidgetId= */ -1, providerInfo); - Rect padding; - DeviceProfile deviceProfile = mActivity.getDeviceProfile(); - if (deviceProfile.shouldInsetWidgets()) { - padding = new Rect(); - appWidgetHostViewPreview.getWidgetInset(deviceProfile, padding); - } else { - padding = deviceProfile.inv.defaultWidgetPadding; - } - appWidgetHostViewPreview.setPadding(padding.left, padding.top, padding.right, - padding.bottom); appWidgetHostViewPreview.updateAppWidget(remoteViews); } @@ -305,7 +320,7 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { if (getWidth() > 0 && getHeight() > 0) { // Scale down the preview size if it's wider than the cell. float maxWidth = getWidth(); - float previewWidth = drawable.getIntrinsicWidth() * mPreviewScale; + float previewWidth = drawable.getIntrinsicWidth() * mPreviewContainerScale; scale = Math.min(maxWidth / previewWidth, 1); } setContainerSize( @@ -329,16 +344,32 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { private void setContainerSize(int width, int height) { LayoutParams layoutParams = (LayoutParams) mWidgetImageContainer.getLayoutParams(); - layoutParams.width = (int) (width * mPreviewScale); - layoutParams.height = (int) (height * mPreviewScale); + layoutParams.width = width; + layoutParams.height = height; mWidgetImageContainer.setLayoutParams(layoutParams); } public void ensurePreview() { if (mAppWidgetHostViewPreview != null) { - setContainerSize(mPreviewWidth, mPreviewHeight); + int containerWidth = (int) (mTargetPreviewWidth * mPreviewContainerScale); + int containerHeight = (int) (mTargetPreviewHeight * mPreviewContainerScale); + setContainerSize(containerWidth, containerHeight); + if (mAppWidgetHostViewPreview.getChildCount() == 1) { + View widgetContent = mAppWidgetHostViewPreview.getChildAt(0); + ViewGroup.LayoutParams layoutParams = widgetContent.getLayoutParams(); + // We only scale preview if both the width & height of the outermost view group are + // not set to MATCH_PARENT. + boolean shouldScale = + layoutParams.width != MATCH_PARENT && layoutParams.height != MATCH_PARENT; + if (shouldScale) { + setNoClip(mWidgetImageContainer); + setNoClip(mAppWidgetHostViewPreview); + float previewLayoutScale = computeWidgetPreviewScale(); + mAppWidgetHostViewPreview.setScaleToFit(previewLayoutScale); + } + } FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( - mPreviewWidth, mPreviewHeight, Gravity.FILL); + containerWidth, containerHeight, Gravity.FILL); mAppWidgetHostViewPreview.setLayoutParams(params); mWidgetImageContainer.addView(mAppWidgetHostViewPreview, /* index= */ 0); mWidgetImage.setVisibility(View.GONE); @@ -350,7 +381,7 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { } mActiveRequest = mWidgetPreviewLoader.loadPreview( BaseActivity.fromContext(getContext()), mItem, - new Size(mPreviewWidth, mPreviewHeight), + new Size(mTargetPreviewWidth, mTargetPreviewHeight), this::applyPreview); } @@ -363,9 +394,9 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { public Size setPreviewSize(WidgetItem widgetItem, float previewScale) { DeviceProfile deviceProfile = mActivity.getDeviceProfile(); Size widgetSize = WidgetSizes.getWidgetItemSizePx(getContext(), deviceProfile, widgetItem); - mPreviewWidth = widgetSize.getWidth(); - mPreviewHeight = widgetSize.getHeight(); - mPreviewScale = previewScale; + mTargetPreviewWidth = widgetSize.getWidth(); + mTargetPreviewHeight = widgetSize.getHeight(); + mPreviewContainerScale = previewScale; return widgetSize; } @@ -410,4 +441,35 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { super.onInitializeAccessibilityNodeInfo(info); info.removeAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_CLICK); } + + private static void setNoClip(ViewGroup view) { + view.setClipChildren(false); + view.setClipToPadding(false); + } + + private float computeWidgetPreviewScale() { + if (mAppWidgetHostViewPreview.getChildCount() != 1) { + return 1f; + } + + // Measure the largest possible width & height that the app widget wants to display. + mAppWidgetHostViewPreview.measure( + makeMeasureSpec(MAX_MEASURE_SPEC_DIMENSION, MeasureSpec.UNSPECIFIED), + makeMeasureSpec(MAX_MEASURE_SPEC_DIMENSION, MeasureSpec.UNSPECIFIED)); + int appWidgetContentWidth = mAppWidgetHostViewPreview.getChildAt(0).getMeasuredWidth(); + int appWidgetContentHeight = mAppWidgetHostViewPreview.getChildAt(0).getMeasuredHeight(); + if (appWidgetContentWidth == 0 || appWidgetContentHeight == 0) { + return 1f; + } + + int horizontalPadding = mAppWidgetHostViewPreview.getPaddingStart() + + mAppWidgetHostViewPreview.getPaddingEnd(); + int verticalPadding = mAppWidgetHostViewPreview.getPaddingTop() + + mAppWidgetHostViewPreview.getPaddingBottom(); + return Math.min( + (mTargetPreviewWidth - horizontalPadding) * mPreviewContainerScale + / appWidgetContentWidth, + (mTargetPreviewHeight - verticalPadding) * mPreviewContainerScale + / appWidgetContentHeight); + } } From 031373daa39c54582872da49a15b017ee8034099 Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 15 Jun 2021 16:29:19 +0100 Subject: [PATCH 11/14] Reland "Snap to relative position to snappd task when dismissing" This reland commit ba61b98fca3a95f02b8802c4508fca5aa6903213 accidentally reverted by http://ag/15162411 Bug: 188793333 Test: manual Change-Id: Iae07a67d528aa80e8f87d37758244d0c46b61cf7 --- .../com/android/quickstep/views/RecentsView.java | 14 ++++++++------ src/com/android/launcher3/PagedView.java | 7 ++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 6146b2d4cb..25b98d7b51 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -2504,12 +2504,15 @@ public abstract class RecentsView extends ViewGrou @ViewDebug.ExportedProperty(category = "launcher") protected int mCurrentPage; + // Difference between current scroll position and mCurrentPage's page scroll. Used to maintain + // relative scroll position unchanged in updateCurrentPageScroll. Cleared when snapping to a + // page. + protected int mCurrentPageScrollDiff; @ViewDebug.ExportedProperty(category = "launcher") protected int mNextPage = INVALID_PAGE; @@ -247,7 +251,7 @@ public abstract class PagedView extends ViewGrou // If the current page is invalid, just reset the scroll position to zero int newPosition = 0; if (0 <= mCurrentPage && mCurrentPage < getPageCount()) { - newPosition = getScrollForPage(mCurrentPage); + newPosition = getScrollForPage(mCurrentPage) + mCurrentPageScrollDiff; } mOrientationHandler.set(this, VIEW_SCROLL_TO, newPosition); mScroller.startScroll(mScroller.getCurrX(), 0, newPosition - mScroller.getCurrX(), 0); @@ -452,6 +456,7 @@ public abstract class PagedView extends ViewGrou * to provide custom behavior during animation. */ protected void onPageEndTransition() { + mCurrentPageScrollDiff = 0; AccessibilityManagerCompat.sendScrollFinishedEventToTest(getContext()); AccessibilityManagerCompat.sendCustomAccessibilityEvent(getPageAt(mCurrentPage), AccessibilityEvent.TYPE_VIEW_FOCUSED, null); From 86ac825061d48d169998485f419208e851ee402c Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Tue, 15 Jun 2021 15:09:11 +0100 Subject: [PATCH 12/14] Move focused task to front when attaching RecentsView - Only move focused task it's the first time attaching RecentsView - Simpily remove and re-add focused task to move it to front Bug: 192471181 Test: manual Change-Id: I95b29c39328911beec7fd3d254f7a22be5e10cc1 --- .../android/quickstep/AbsSwipeUpHandler.java | 18 ++++++++++-- .../quickstep/BaseActivityInterface.java | 13 +++++++++ .../android/quickstep/views/RecentsView.java | 29 +++++++++++++++++++ 3 files changed, 57 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 9180bd026f..bda2b77bb3 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -539,7 +539,7 @@ public abstract class AbsSwipeUpHandler, @Override public void onMotionPauseDetected() { mHasMotionEverBeenPaused = true; - maybeUpdateRecentsAttachedState(); + maybeUpdateRecentsAttachedState(true/* animate */, true/* moveFocusedTask */); performHapticFeedback(); } @@ -550,18 +550,24 @@ public abstract class AbsSwipeUpHandler, }; } - public void maybeUpdateRecentsAttachedState() { + private void maybeUpdateRecentsAttachedState() { maybeUpdateRecentsAttachedState(true /* animate */); } + private void maybeUpdateRecentsAttachedState(boolean animate) { + maybeUpdateRecentsAttachedState(animate, false /* moveFocusedTask */); + } + /** * Determines whether to show or hide RecentsView. The window is always * synchronized with its corresponding TaskView in RecentsView, so if * RecentsView is shown, it will appear to be attached to the window. * * Note this method has no effect unless the navigation mode is NO_BUTTON. + * @param animate whether to animate when attaching RecentsView + * @param moveFocusedTask whether to move focused task to front when attaching */ - private void maybeUpdateRecentsAttachedState(boolean animate) { + private void maybeUpdateRecentsAttachedState(boolean animate, boolean moveFocusedTask) { if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) { return; } @@ -580,6 +586,12 @@ public abstract class AbsSwipeUpHandler, } else { recentsAttachedToAppWindow = mHasMotionEverBeenPaused || mIsLikelyToStartNewTask; } + if (moveFocusedTask && !mAnimationFactory.hasRecentsEverAttachedToAppWindow() + && recentsAttachedToAppWindow) { + // Only move focused task if RecentsView has never been attached before, to avoid + // TaskView jumping to new position as we move the tasks. + mRecentsView.moveFocusedTaskToFront(); + } mAnimationFactory.setRecentsAttachedToAppWindow(recentsAttachedToAppWindow, animate); // Reapply window transform throughout the attach animation, as the animation affects how diff --git a/quickstep/src/com/android/quickstep/BaseActivityInterface.java b/quickstep/src/com/android/quickstep/BaseActivityInterface.java index 1412b1add6..389509f978 100644 --- a/quickstep/src/com/android/quickstep/BaseActivityInterface.java +++ b/quickstep/src/com/android/quickstep/BaseActivityInterface.java @@ -396,6 +396,10 @@ public abstract class BaseActivityInterface mCallback; private boolean mIsAttachedToWindow; + private boolean mHasEverAttachedToWindow; DefaultAnimationFactory(Consumer callback) { mCallback = callback; @@ -458,6 +463,9 @@ public abstract class BaseActivityInterface tasks) { if (mPendingAnimation != null) { mPendingAnimation.addEndListener(success -> applyLoadPlan(tasks)); From 671ffb88ca8543cfe9f33fe6b6dc30e70ee08e38 Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Thu, 15 Jul 2021 13:11:59 +0100 Subject: [PATCH 13/14] Fix class cast issue in AddItemActivity AddItemActivity is a standalone activity. There is no Launcher activity instance. Avoid using LauncherAppWidgetHostView in WidgetCell by replacing it NavigableAppWidgetHostView instead Test: Check preview layouts are correctly rendered in widgets picker and pin widget dialog. Also test drag and drop to verify the local color extraction still works when dragging a preview layout from widgets picker to home screen. Fix: 193765783 Change-Id: I3a734a54941257cebcd7b7f6a4c2c9cc764c5c12 --- .../android/launcher3/widget/WidgetCell.java | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/src/com/android/launcher3/widget/WidgetCell.java b/src/com/android/launcher3/widget/WidgetCell.java index 5759f75535..5769ba0c69 100644 --- a/src/com/android/launcher3/widget/WidgetCell.java +++ b/src/com/android/launcher3/widget/WidgetCell.java @@ -43,6 +43,7 @@ import androidx.annotation.Nullable; import com.android.launcher3.BaseActivity; import com.android.launcher3.CheckLongPressHelper; import com.android.launcher3.DeviceProfile; +import com.android.launcher3.Launcher; import com.android.launcher3.R; import com.android.launcher3.icons.FastBitmapDrawable; import com.android.launcher3.icons.RoundDrawableWrapper; @@ -217,12 +218,7 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { private void applyPreviewOnAppWidgetHostView(WidgetItem item) { if (mRemoteViewsPreview != null) { - mAppWidgetHostViewPreview = new NavigableAppWidgetHostView(getContext()) { - @Override - protected boolean shouldAllowDirectClick() { - return false; - } - }; + mAppWidgetHostViewPreview = createAppWidgetHostView(getContext()); setAppWidgetHostViewPreview(mAppWidgetHostViewPreview, item.widgetInfo, mRemoteViewsPreview); return; @@ -230,10 +226,15 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { if (!item.hasPreviewLayout()) return; - mAppWidgetHostViewPreview = new LauncherAppWidgetHostView(getContext()); + Context context = getContext(); + // If the context is a Launcher activity, DragView will show mAppWidgetHostViewPreview as + // a preview during drag & drop. And thus, we should use LauncherAppWidgetHostView, which + // supports applying local color extraction during drag & drop. + mAppWidgetHostViewPreview = isLauncherContext(context) + ? new LauncherAppWidgetHostView(context) + : createAppWidgetHostView(context); LauncherAppWidgetProviderInfo launcherAppWidgetProviderInfo = - LauncherAppWidgetProviderInfo.fromProviderInfo(getContext(), - item.widgetInfo.clone()); + LauncherAppWidgetProviderInfo.fromProviderInfo(context, item.widgetInfo.clone()); // A hack to force the initial layout to be the preview layout since there is no API for // rendering a preview layout for work profile apps yet. For non-work profile layout, a // proper solution is to use RemoteViews(PackageName, LayoutId). @@ -400,6 +401,24 @@ public class WidgetCell extends LinearLayout implements OnLayoutChangeListener { return ""; } + private static NavigableAppWidgetHostView createAppWidgetHostView(Context context) { + return new NavigableAppWidgetHostView(context) { + @Override + protected boolean shouldAllowDirectClick() { + return false; + } + }; + } + + private static boolean isLauncherContext(Context context) { + try { + Launcher.getLauncher(context); + return true; + } catch (Exception e) { + return false; + } + } + @Override public CharSequence getAccessibilityClassName() { return WidgetCell.class.getName(); From 8a6179bb7dc2e40a5f6eb7627cf51a72aa7d2321 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Thu, 15 Jul 2021 11:34:32 +0000 Subject: [PATCH 14/14] Scale task rounded corners proportional to TaskView size. Test: manual Fix: 183936745 Change-Id: I2e2dd806826cba135d5a1e6ab9a5e80b8994d64d --- .../com/android/quickstep/views/TaskView.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index b272def2ea..2e154f610b 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -794,7 +794,7 @@ public class TaskView extends FrameLayout implements Reusable { mIconView.setRotation(orientationHandler.getDegreesRotated()); snapshotParams.topMargin = deviceProfile.overviewTaskThumbnailTopMarginPx; mSnapshotView.setLayoutParams(snapshotParams); - getThumbnail().getTaskOverlay().updateOrientationState(orientationState); + mSnapshotView.getTaskOverlay().updateOrientationState(orientationState); } private void setIconAndDimTransitionProgress(float progress, boolean invert) { @@ -958,6 +958,7 @@ public class TaskView extends FrameLayout implements Reusable { private void setNonGridScale(float nonGridScale) { mNonGridScale = nonGridScale; + updateCornerRadius(); applyScale(); } @@ -1296,18 +1297,21 @@ public class TaskView extends FrameLayout implements Reusable { progress = Utilities.boundToRange(progress, 0, 1); mFullscreenProgress = progress; mIconView.setVisibility(progress < 1 ? VISIBLE : INVISIBLE); - getThumbnail().getTaskOverlay().setFullscreenProgress(progress); + mSnapshotView.getTaskOverlay().setFullscreenProgress(progress); - TaskThumbnailView thumbnail = getThumbnail(); - updateCurrentFullscreenParams(thumbnail.getPreviewPositionHelper()); + updateCornerRadius(); - thumbnail.setFullscreenParams(mCurrentFullscreenParams); + mSnapshotView.setFullscreenParams(mCurrentFullscreenParams); mOutlineProvider.updateParams( mCurrentFullscreenParams, mActivity.getDeviceProfile().overviewTaskThumbnailTopMarginPx); invalidateOutline(); } + private void updateCornerRadius() { + updateCurrentFullscreenParams(mSnapshotView.getPreviewPositionHelper()); + } + void updateCurrentFullscreenParams(PreviewPositionHelper previewPositionHelper) { if (getRecentsView() == null) { return; @@ -1315,7 +1319,7 @@ public class TaskView extends FrameLayout implements Reusable { mCurrentFullscreenParams.setProgress( mFullscreenProgress, getRecentsView().getScaleX(), - getScaleX(), + mNonGridScale, getWidth(), mActivity.getDeviceProfile(), previewPositionHelper); }