diff options
author | Tony <twickham@google.com> | 2019-05-09 18:03:42 -0500 |
---|---|---|
committer | Tony <twickham@google.com> | 2019-05-13 17:00:58 -0500 |
commit | 52aada013d6977c9d6cd43b590a1816c62e5a979 (patch) | |
tree | a4a04ba5ab21965b58660a9e342702f591225c60 /quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java | |
parent | d849ef084c180c393c7f3c69f6f00a01358a644f (diff) | |
download | android_packages_apps_Trebuchet-52aada013d6977c9d6cd43b590a1816c62e5a979.tar.gz android_packages_apps_Trebuchet-52aada013d6977c9d6cd43b590a1816c62e5a979.tar.bz2 android_packages_apps_Trebuchet-52aada013d6977c9d6cd43b590a1816c62e5a979.zip |
Fix fullscreen and landscape task insets
Previously, we were incorrectly using the thumbnail insets, which
were insufficient for fullscreen tasks, and ignoring rotated tasks
entirely. Now we check what part of the thumbnail is actually
clipped (e.g. based on the scale we apply to get it to fit in the
same width as all the other tasks), and fill that out when setting
the fullscreen progress on each task.
Test:
- Quick switch (from home and from apps) to:
- "Normal" apps such as Calculator in portrait and landscape
- Immersive portrait apps such as Elder Scrolls: Blades
- Immersive landscape apps such as Stardew Valley
- Swipe up from an app with the above cases in the adjacent task,
ensure the thumbnail gets clipped from fullscreen to its final
position in recents
- Do the above tests from landscape launcher as well
Bug: 130020567
Change-Id: I6f6b7f0ee134d464b3704990db9e1d3a01e6de0b
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java')
-rw-r--r-- | quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java index 3109921fb..a650113d5 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/util/ClipAnimationHelper.java @@ -35,12 +35,14 @@ import androidx.annotation.Nullable; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.DeviceProfile; +import com.android.launcher3.LauncherState; import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.views.BaseDragLayer; import com.android.quickstep.RecentsModel; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskThumbnailView; +import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.utilities.RectFEvaluator; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; @@ -280,6 +282,21 @@ public class ClipAnimationHelper { } } + /** + * Compute scale and translation y such that the specified task view fills the screen. + */ + public LauncherState.ScaleAndTranslation getOverviewFullscreenScaleAndTranslation(TaskView v) { + TaskThumbnailView thumbnailView = v.getThumbnail(); + RecentsView recentsView = v.getRecentsView(); + fromTaskThumbnailView(thumbnailView, recentsView); + Rect taskSize = new Rect(); + recentsView.getTaskSize(taskSize); + updateTargetRect(taskSize); + float scale = mSourceRect.width() / mTargetRect.width(); + float translationY = mSourceRect.centerY() - mSourceRect.top - mTargetRect.centerY(); + return new LauncherState.ScaleAndTranslation(scale, 0, translationY); + } + private void updateStackBoundsToMultiWindowTaskSize(BaseDraggingActivity activity) { ISystemUiProxy sysUiProxy = RecentsModel.INSTANCE.get(activity).getSystemUiProxy(); if (sysUiProxy != null) { |