mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-03 17:36:49 +00:00
Exposing some private methods to easily customize widgets popup
Change-Id: Ie7bd879200b1f14d472ff03fd64429930651a39f
This commit is contained in:
@@ -30,7 +30,6 @@ import android.view.animation.Interpolator;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherAnimUtils;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.touch.SwipeDetector;
|
||||
@@ -76,7 +75,7 @@ public abstract class AbstractSlideInView extends AbstractFloatingView
|
||||
mScrollInterpolator = Interpolators.SCROLL_CUBIC;
|
||||
mSwipeDetector = new SwipeDetector(context, this, SwipeDetector.VERTICAL);
|
||||
|
||||
mOpenCloseAnimator = LauncherAnimUtils.ofPropertyValuesHolder(this);
|
||||
mOpenCloseAnimator = ObjectAnimator.ofPropertyValuesHolder(this);
|
||||
mOpenCloseAnimator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
@@ -103,7 +102,7 @@ public abstract class AbstractSlideInView extends AbstractFloatingView
|
||||
directionsToDetectScroll, false);
|
||||
mSwipeDetector.onTouchEvent(ev);
|
||||
return mSwipeDetector.isDraggingOrSettling()
|
||||
|| !mLauncher.getDragLayer().isEventOverView(mContent, ev);
|
||||
|| !getPopupContainer().isEventOverView(mContent, ev);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -111,7 +110,7 @@ public abstract class AbstractSlideInView extends AbstractFloatingView
|
||||
mSwipeDetector.onTouchEvent(ev);
|
||||
if (ev.getAction() == MotionEvent.ACTION_UP && mSwipeDetector.isIdleState()) {
|
||||
// If we got ACTION_UP without ever starting swipe, close the panel.
|
||||
if (!mLauncher.getDragLayer().isEventOverView(mContent, ev)) {
|
||||
if (!getPopupContainer().isEventOverView(mContent, ev)) {
|
||||
close(true);
|
||||
}
|
||||
}
|
||||
@@ -178,6 +177,10 @@ public abstract class AbstractSlideInView extends AbstractFloatingView
|
||||
|
||||
protected void onCloseComplete() {
|
||||
mIsOpen = false;
|
||||
mLauncher.getDragLayer().removeView(this);
|
||||
getPopupContainer().removeView(this);
|
||||
}
|
||||
|
||||
protected BaseDragLayer getPopupContainer() {
|
||||
return mLauncher.getDragLayer();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user