Tune AllApps bottom sheet VisD and motion

- Make AllApps bottom sheet solid and appears from bottom
- Teleport AllApps bottom sheet as user drag to reduce drag range
  - Consider teleport interpolation for state transition sdetection
- Tuned workspace motions for AllApps bottom sheet (no translate, shrink)
- Add portrait vertical translate for tablet portrait including taskbar AllApps
- Updated bottom sheet handle and created common variables for other bottom sheets

Bug: 208599118
Test: manual on tablet AllApps, taskbar Allapps and handheld AllApps
Change-Id: I69dba5f155914cd012cc8ef3be1ef71fb2be5a40
This commit is contained in:
Alex Chau
2022-02-14 18:35:58 +00:00
parent a1370bfc5f
commit b8c22e1155
22 changed files with 214 additions and 84 deletions

View File

@@ -23,6 +23,7 @@ import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.MotionEvent;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.launcher3.views.AbstractSlideInView;
@@ -30,14 +31,14 @@ import com.android.launcher3.views.AbstractSlideInView;
import java.util.Optional;
/** Wrapper for taskbar all apps with slide-in behavior. */
public class TaskbarAllAppsSlideInView extends
AbstractSlideInView<TaskbarAllAppsContext> implements Insettable {
public class TaskbarAllAppsSlideInView extends AbstractSlideInView<TaskbarAllAppsContext>
implements Insettable, DeviceProfile.OnDeviceProfileChangeListener {
static final int DEFAULT_OPEN_DURATION = 500;
static final int DEFAULT_CLOSE_DURATION = 200;
private TaskbarAllAppsContainerView mAppsView;
private OnCloseListener mOnCloseBeginListener;
private float mShiftRange;
public TaskbarAllAppsSlideInView(Context context, AttributeSet attrs) {
this(context, attrs, 0);
@@ -88,6 +89,11 @@ public class TaskbarAllAppsSlideInView extends
super.onFinishInflate();
mAppsView = findViewById(R.id.apps_view);
mContent = mAppsView;
DeviceProfile dp = mActivityContext.getDeviceProfile();
setShiftRange(dp.allAppsShiftRange);
mActivityContext.addOnDeviceProfileChangeListener(this);
}
@Override
@@ -113,4 +119,24 @@ public class TaskbarAllAppsSlideInView extends
public void setInsets(Rect insets) {
mAppsView.setInsets(insets);
}
@Override
public void onDeviceProfileChanged(DeviceProfile dp) {
setShiftRange(dp.allAppsShiftRange);
setTranslationShift(TRANSLATION_SHIFT_OPENED);
}
private void setShiftRange(float shiftRange) {
mShiftRange = shiftRange;
}
@Override
protected float getShiftRange() {
return mShiftRange;
}
@Override
protected boolean isEventOverContent(MotionEvent ev) {
return getPopupContainer().isEventOverView(mAppsView.getVisibleContainerView(), ev);
}
}