mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user