Loading core/java/com/android/internal/app/ChooserActivity.java +8 −5 Original line number Diff line number Diff line Loading @@ -3059,10 +3059,9 @@ public class ChooserActivity extends ResolverActivity { int yDiff = (int) ((oldy - y) * DIRECT_SHARE_EXPANSION_RATE); int prevHeight = mDirectShareCurrHeight; mDirectShareCurrHeight = Math.min(mDirectShareCurrHeight + yDiff, mDirectShareMaxHeight); mDirectShareCurrHeight = Math.max(mDirectShareCurrHeight, mDirectShareMinHeight); yDiff = mDirectShareCurrHeight - prevHeight; int newHeight = Math.min(prevHeight + yDiff, mDirectShareMaxHeight); newHeight = Math.max(newHeight, mDirectShareMinHeight); yDiff = newHeight - prevHeight; if (view == null || view.getChildCount() == 0 || yDiff == 0) { return; Loading @@ -3079,7 +3078,7 @@ public class ChooserActivity extends ResolverActivity { if (child.getTag() != null && child.getTag() instanceof DirectShareViewHolder) { int widthSpec = MeasureSpec.makeMeasureSpec(child.getWidth(), MeasureSpec.EXACTLY); int heightSpec = MeasureSpec.makeMeasureSpec(mDirectShareCurrHeight, int heightSpec = MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.EXACTLY); child.measure(widthSpec, heightSpec); child.getLayoutParams().height = child.getMeasuredHeight(); Loading @@ -3090,6 +3089,10 @@ public class ChooserActivity extends ResolverActivity { } } } if (foundExpansion) { mDirectShareCurrHeight = newHeight; } } } Loading core/java/com/android/internal/widget/ResolverDrawerLayout.java +24 −2 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ public class ResolverDrawerLayout extends ViewGroup { private final Rect mTempRect = new Rect(); private AbsListView mNestedScrollingChild; private final ViewTreeObserver.OnTouchModeChangeListener mTouchModeChangeListener = new ViewTreeObserver.OnTouchModeChangeListener() { @Override Loading Loading @@ -317,6 +319,13 @@ public class ResolverDrawerLayout extends ViewGroup { return mIsDragging || mOpenOnClick; } private boolean isNestedChildScrolled() { return mNestedScrollingChild != null && mNestedScrollingChild.getChildCount() > 0 && (mNestedScrollingChild.getFirstVisiblePosition() > 0 || mNestedScrollingChild.getChildAt(0).getTop() < 0); } @Override public boolean onTouchEvent(MotionEvent ev) { final int action = ev.getActionMasked(); Loading Loading @@ -359,8 +368,12 @@ public class ResolverDrawerLayout extends ViewGroup { } if (mIsDragging) { final float dy = y - mLastTouchY; if (dy > 0 && isNestedChildScrolled()) { mNestedScrollingChild.smoothScrollBy((int) -dy, 0); } else { performDrag(dy); } } mLastTouchY = y; } break; Loading Loading @@ -411,6 +424,9 @@ public class ResolverDrawerLayout extends ViewGroup { smoothScrollTo(mCollapsibleHeight + mUncollapsibleHeight, yvel); mDismissOnScrollerFinished = true; } else { if (isNestedChildScrolled()) { mNestedScrollingChild.smoothScrollToPosition(0); } smoothScrollTo(yvel < 0 ? 0 : mCollapsibleHeight, yvel); } } Loading Loading @@ -680,7 +696,13 @@ public class ResolverDrawerLayout extends ViewGroup { @Override public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) { return (nestedScrollAxes & View.SCROLL_AXIS_VERTICAL) != 0; if ((nestedScrollAxes & View.SCROLL_AXIS_VERTICAL) != 0) { if (child instanceof AbsListView) { mNestedScrollingChild = (AbsListView) child; } return true; } return false; } @Override Loading Loading
core/java/com/android/internal/app/ChooserActivity.java +8 −5 Original line number Diff line number Diff line Loading @@ -3059,10 +3059,9 @@ public class ChooserActivity extends ResolverActivity { int yDiff = (int) ((oldy - y) * DIRECT_SHARE_EXPANSION_RATE); int prevHeight = mDirectShareCurrHeight; mDirectShareCurrHeight = Math.min(mDirectShareCurrHeight + yDiff, mDirectShareMaxHeight); mDirectShareCurrHeight = Math.max(mDirectShareCurrHeight, mDirectShareMinHeight); yDiff = mDirectShareCurrHeight - prevHeight; int newHeight = Math.min(prevHeight + yDiff, mDirectShareMaxHeight); newHeight = Math.max(newHeight, mDirectShareMinHeight); yDiff = newHeight - prevHeight; if (view == null || view.getChildCount() == 0 || yDiff == 0) { return; Loading @@ -3079,7 +3078,7 @@ public class ChooserActivity extends ResolverActivity { if (child.getTag() != null && child.getTag() instanceof DirectShareViewHolder) { int widthSpec = MeasureSpec.makeMeasureSpec(child.getWidth(), MeasureSpec.EXACTLY); int heightSpec = MeasureSpec.makeMeasureSpec(mDirectShareCurrHeight, int heightSpec = MeasureSpec.makeMeasureSpec(newHeight, MeasureSpec.EXACTLY); child.measure(widthSpec, heightSpec); child.getLayoutParams().height = child.getMeasuredHeight(); Loading @@ -3090,6 +3089,10 @@ public class ChooserActivity extends ResolverActivity { } } } if (foundExpansion) { mDirectShareCurrHeight = newHeight; } } } Loading
core/java/com/android/internal/widget/ResolverDrawerLayout.java +24 −2 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ public class ResolverDrawerLayout extends ViewGroup { private final Rect mTempRect = new Rect(); private AbsListView mNestedScrollingChild; private final ViewTreeObserver.OnTouchModeChangeListener mTouchModeChangeListener = new ViewTreeObserver.OnTouchModeChangeListener() { @Override Loading Loading @@ -317,6 +319,13 @@ public class ResolverDrawerLayout extends ViewGroup { return mIsDragging || mOpenOnClick; } private boolean isNestedChildScrolled() { return mNestedScrollingChild != null && mNestedScrollingChild.getChildCount() > 0 && (mNestedScrollingChild.getFirstVisiblePosition() > 0 || mNestedScrollingChild.getChildAt(0).getTop() < 0); } @Override public boolean onTouchEvent(MotionEvent ev) { final int action = ev.getActionMasked(); Loading Loading @@ -359,8 +368,12 @@ public class ResolverDrawerLayout extends ViewGroup { } if (mIsDragging) { final float dy = y - mLastTouchY; if (dy > 0 && isNestedChildScrolled()) { mNestedScrollingChild.smoothScrollBy((int) -dy, 0); } else { performDrag(dy); } } mLastTouchY = y; } break; Loading Loading @@ -411,6 +424,9 @@ public class ResolverDrawerLayout extends ViewGroup { smoothScrollTo(mCollapsibleHeight + mUncollapsibleHeight, yvel); mDismissOnScrollerFinished = true; } else { if (isNestedChildScrolled()) { mNestedScrollingChild.smoothScrollToPosition(0); } smoothScrollTo(yvel < 0 ? 0 : mCollapsibleHeight, yvel); } } Loading Loading @@ -680,7 +696,13 @@ public class ResolverDrawerLayout extends ViewGroup { @Override public boolean onStartNestedScroll(View child, View target, int nestedScrollAxes) { return (nestedScrollAxes & View.SCROLL_AXIS_VERTICAL) != 0; if ((nestedScrollAxes & View.SCROLL_AXIS_VERTICAL) != 0) { if (child instanceof AbsListView) { mNestedScrollingChild = (AbsListView) child; } return true; } return false; } @Override Loading