mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:38:21 +00:00
Fix scrolling in WidgetsBottomSheet
Popup container shouldn't intercept the scroll event if its child scroll view isn't scrolled to the top yet. Test: manual Bug: 183599207 Change-Id: I434ba5e91b154e9862f22c08cd01c9d459e6707b
This commit is contained in:
@@ -26,6 +26,7 @@ import android.util.IntProperty;
|
||||
import android.util.Pair;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Interpolator;
|
||||
@@ -152,6 +153,19 @@ public class WidgetsBottomSheet extends BaseWidgetSheet implements Insettable {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
|
||||
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
mNoIntercept = false;
|
||||
ScrollView scrollView = findViewById(R.id.widgets_table_scroll_view);
|
||||
if (getPopupContainer().isEventOverView(scrollView, ev)
|
||||
&& scrollView.getScrollY() > 0) {
|
||||
mNoIntercept = true;
|
||||
}
|
||||
}
|
||||
return super.onControllerInterceptTouchEvent(ev);
|
||||
}
|
||||
|
||||
protected WidgetCell addItemCell(ViewGroup parent) {
|
||||
WidgetCell widget = (WidgetCell) LayoutInflater.from(getContext())
|
||||
.inflate(R.layout.widget_cell, parent, false);
|
||||
|
||||
Reference in New Issue
Block a user