Show 3 button nav on phone in Taskbar (1/2)

* TODO: Landscape/seascape support,
        Separate nav spacing out into
        separate class/add tests

Bug: 219035565
Change-Id: I8f5c007f04ea4d6df15962772806356181d764ff
This commit is contained in:
Vinit Nayak
2022-08-05 10:43:29 -07:00
parent d6f79830e5
commit 8a3d05587e
9 changed files with 135 additions and 34 deletions

View File

@@ -15,8 +15,6 @@
*/
package com.android.launcher3.taskbar;
import static com.android.launcher3.taskbar.TaskbarManager.isPhoneMode;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
@@ -96,7 +94,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
mControllers = controllers;
DeviceProfile deviceProfile = mActivity.getDeviceProfile();
Resources resources = mActivity.getResources();
if (isPhoneMode(mActivity.getDeviceProfile())) {
if (isPhoneGestureNavMode(mActivity.getDeviceProfile())) {
mStashedHandleView.getLayoutParams().height =
resources.getDimensionPixelSize(R.dimen.taskbar_size);
mStashedHandleWidth =
@@ -108,7 +106,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
}
mTaskbarStashedHandleAlpha.getProperty(ALPHA_INDEX_STASHED).setValue(
isPhoneMode(deviceProfile) ? 1 : 0);
isPhoneGestureNavMode(deviceProfile) ? 1 : 0);
mTaskbarStashedHandleHintScale.updateValue(1f);
final int stashedTaskbarHeight = mControllers.taskbarStashController.getStashedHeight();
@@ -136,7 +134,7 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
view.setPivotY(stashedCenterY);
});
initRegionSampler();
if (isPhoneMode(deviceProfile)) {
if (isPhoneGestureNavMode(deviceProfile)) {
onIsStashedChanged(true);
}
}
@@ -164,6 +162,10 @@ public class StashedHandleViewController implements TaskbarControllers.LoggableT
mRegionSamplingHelper = null;
}
private boolean isPhoneGestureNavMode(DeviceProfile deviceProfile) {
return TaskbarManager.isPhoneMode(deviceProfile) && !mActivity.isThreeButtonNav();
}
public MultiValueAlpha getStashedHandleAlpha() {
return mTaskbarStashedHandleAlpha;
}