Merge "Scroll the hiding page to top on tab changed in sharesheet" into rvc-qpr-dev
This commit is contained in:
@@ -3134,6 +3134,7 @@ public class ChooserActivity extends ResolverActivity implements
|
|||||||
// ends up disabled. That's because at some point the old tab's vertical scrolling is
|
// ends up disabled. That's because at some point the old tab's vertical scrolling is
|
||||||
// disabled and the new tab's is enabled. For context, see b/159997845
|
// disabled and the new tab's is enabled. For context, see b/159997845
|
||||||
setVerticalScrollEnabled(true);
|
setVerticalScrollEnabled(true);
|
||||||
|
mResolverDrawerLayout.scrollNestedScrollableChildBackToTop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -464,11 +464,7 @@ public class ResolverDrawerLayout extends ViewGroup {
|
|||||||
smoothScrollTo(mCollapsibleHeight + mUncollapsibleHeight, yvel);
|
smoothScrollTo(mCollapsibleHeight + mUncollapsibleHeight, yvel);
|
||||||
mDismissOnScrollerFinished = true;
|
mDismissOnScrollerFinished = true;
|
||||||
} else {
|
} else {
|
||||||
if (isNestedListChildScrolled()) {
|
scrollNestedScrollableChildBackToTop();
|
||||||
mNestedListChild.smoothScrollToPosition(0);
|
|
||||||
} else if (isNestedRecyclerChildScrolled()) {
|
|
||||||
mNestedRecyclerChild.smoothScrollToPosition(0);
|
|
||||||
}
|
|
||||||
smoothScrollTo(yvel < 0 ? 0 : mCollapsibleHeight, yvel);
|
smoothScrollTo(yvel < 0 ? 0 : mCollapsibleHeight, yvel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -493,6 +489,17 @@ public class ResolverDrawerLayout extends ViewGroup {
|
|||||||
return handled;
|
return handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scroll nested scrollable child back to top if it has been scrolled.
|
||||||
|
*/
|
||||||
|
public void scrollNestedScrollableChildBackToTop() {
|
||||||
|
if (isNestedListChildScrolled()) {
|
||||||
|
mNestedListChild.smoothScrollToPosition(0);
|
||||||
|
} else if (isNestedRecyclerChildScrolled()) {
|
||||||
|
mNestedRecyclerChild.smoothScrollToPosition(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void onSecondaryPointerUp(MotionEvent ev) {
|
private void onSecondaryPointerUp(MotionEvent ev) {
|
||||||
final int pointerIndex = ev.getActionIndex();
|
final int pointerIndex = ev.getActionIndex();
|
||||||
final int pointerId = ev.getPointerId(pointerIndex);
|
final int pointerId = ev.getPointerId(pointerIndex);
|
||||||
|
|||||||
Reference in New Issue
Block a user