diff options
author | Tony <twickham@google.com> | 2019-06-14 20:26:12 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2019-06-18 13:41:08 -0700 |
commit | 32cb616fab1ad495968d1eadd503a61b8bf3db35 (patch) | |
tree | c34099791eaea36a725233b55d054e8f5b0efe8f /src | |
parent | e1abaa64c25fdc9841f5cbeff2647ff4f95ac255 (diff) | |
download | android_packages_apps_Trebuchet-32cb616fab1ad495968d1eadd503a61b8bf3db35.tar.gz android_packages_apps_Trebuchet-32cb616fab1ad495968d1eadd503a61b8bf3db35.tar.bz2 android_packages_apps_Trebuchet-32cb616fab1ad495968d1eadd503a61b8bf3db35.zip |
Fix bugs with hotseat in overview
- Allow touches to go through recents to the hotseat.
- Translate the hotseat with the all apps shelf when swiping
up in background app state.
Bug: 135222111
Change-Id: Ib887fc25ccfeb406a44074198c11f7b1d245443c
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsTransitionController.java | 16 | ||||
-rw-r--r-- | src/com/android/launcher3/views/BaseDragLayer.java | 14 |
2 files changed, 26 insertions, 4 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java index c62fc3d8f..a351b9ae1 100644 --- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java +++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java @@ -2,6 +2,8 @@ package com.android.launcher3.allapps; import static com.android.launcher3.LauncherState.ALL_APPS_CONTENT; import static com.android.launcher3.LauncherState.ALL_APPS_HEADER_EXTRA; +import static com.android.launcher3.LauncherState.BACKGROUND_APP; +import static com.android.launcher3.LauncherState.HOTSEAT_ICONS; import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.VERTICAL_SWIPE_INDICATOR; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_ALL_APPS_FADE; @@ -28,15 +30,12 @@ import com.android.launcher3.ProgressInterface; import com.android.launcher3.R; import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorSetBuilder; -import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.anim.PropertySetter; +import com.android.launcher3.anim.SpringObjectAnimator; import com.android.launcher3.testing.TestProtocol; -import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.Themes; import com.android.launcher3.views.ScrimView; -import androidx.dynamicanimation.animation.FloatPropertyCompat; - /** * Handles AllApps view transition. * 1) Slides all apps view using direct manipulation @@ -139,6 +138,15 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil } else { mLauncher.getSystemUiController().updateUiState(UI_STATE_ALL_APPS, 0); } + + if ((OVERVIEW.getVisibleElements(mLauncher) & HOTSEAT_ICONS) != 0) { + // Translate hotseat with the shelf until reaching overview. + float overviewProgress = OVERVIEW.getVerticalProgress(mLauncher); + if (progress >= overviewProgress || mLauncher.isInState(BACKGROUND_APP)) { + float hotseatShift = (progress - overviewProgress) * mShiftRange; + mLauncher.getHotseat().setTranslationY(hotseatShift); + } + } } @Override diff --git a/src/com/android/launcher3/views/BaseDragLayer.java b/src/com/android/launcher3/views/BaseDragLayer.java index ac152dbff..51c7022bd 100644 --- a/src/com/android/launcher3/views/BaseDragLayer.java +++ b/src/com/android/launcher3/views/BaseDragLayer.java @@ -116,11 +116,25 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext> mMultiValueAlpha = new MultiValueAlpha(this, alphaChannelCount); } + /** + * Same as {@link #isEventOverView(View, MotionEvent, View)} where evView == this drag layer. + */ public boolean isEventOverView(View view, MotionEvent ev) { getDescendantRectRelativeToSelf(view, mHitRect); return mHitRect.contains((int) ev.getX(), (int) ev.getY()); } + /** + * Given a motion event in evView's coordinates, return whether the event is within another + * view's bounds. + */ + public boolean isEventOverView(View view, MotionEvent ev, View evView) { + int[] xy = new int[] {(int) ev.getX(), (int) ev.getY()}; + getDescendantCoordRelativeToSelf(evView, xy); + getDescendantRectRelativeToSelf(view, mHitRect); + return mHitRect.contains(xy[0], xy[1]); + } + @Override public boolean onInterceptTouchEvent(MotionEvent ev) { int action = ev.getAction(); |