本文整理了Java中androidx.core.widget.NestedScrollView.getScrollY()
方法的一些代码示例,展示了NestedScrollView.getScrollY()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NestedScrollView.getScrollY()
方法的具体详情如下:
包路径:androidx.core.widget.NestedScrollView
类名称:NestedScrollView
方法名:getScrollY
暂无
代码示例来源:origin: h6ah4i/android-advancedrecyclerview
private int getLastTouchY() {
int touchY = mLastTouchY;
if (mNestedScrollView != null) {
touchY += (mNestedScrollView.getScrollY() - mNestedScrollViewScrollY);
}
return touchY;
}
代码示例来源:origin: h6ah4i/android-advancedrecyclerview
private void handleActionMoveWhileDragging(RecyclerView rv, MotionEvent e) {
mLastTouchX = (int) (e.getX() + 0.5f);
mLastTouchY = (int) (e.getY() + 0.5f);
mNestedScrollViewScrollX = (mNestedScrollView != null) ? mNestedScrollView.getScrollX() : 0;
mNestedScrollViewScrollY = (mNestedScrollView != null) ? mNestedScrollView.getScrollY() : 0;
mDragMinTouchX = Math.min(mDragMinTouchX, mLastTouchX);
mDragMinTouchY = Math.min(mDragMinTouchY, mLastTouchY);
mDragMaxTouchX = Math.max(mDragMaxTouchX, mLastTouchX);
mDragMaxTouchY = Math.max(mDragMaxTouchY, mLastTouchY);
// update drag direction mask
updateDragDirectionMask();
// update decorators
final boolean updated = mDraggingItemDecorator.update(getLastTouchX(), getLastTouchY(), false);
if (updated) {
if (mSwapTargetItemOperator != null) {
mSwapTargetItemOperator.update(mDraggingItemDecorator.getDraggingItemTranslationX(), mDraggingItemDecorator.getDraggingItemTranslationY());
}
// check swapping
checkItemSwapping(rv);
onItemMoveDistanceUpdated();
}
}
代码示例来源:origin: h6ah4i/android-advancedrecyclerview
int nestedScrollViewScrollOffsetY = nestedScrollView.getScrollY();
代码示例来源:origin: h6ah4i/android-advancedrecyclerview
mNestedScrollViewScrollY = (mNestedScrollView != null) ? mNestedScrollView.getScrollY() : 0;
代码示例来源:origin: klinker24/Android-DragDismissActivity
@Override
public void run() {
if (!transparentBackground && scrollView.getScrollY() < topOffset && !isUpdatingBackground) {
animateBackgroundColor(primaryColor, transparentColor, interpolator);
transparentBackground = true;
}
}
}, ANIMATION_DURATION);
代码示例来源:origin: proninyaroslav/libretorrent
@Override
public void onSaveInstanceState(@NonNull Bundle outState)
{
super.onSaveInstanceState(outState);
outState.putInt(TAG_ALL_PIECES_COUNT, allPiecesCount);
outState.putInt(TAG_PIECE_SIZE, pieceSize);
outState.putInt(TAG_DOWNLOADED_PIECES, downloadedPieces);
if (pieceMapScrollView != null && scrollPosition != null) {
scrollPosition[0] = pieceMapScrollView.getScrollX();
scrollPosition[1] = pieceMapScrollView.getScrollY();
outState.putIntArray(TAG_SCROLL_POSITION, scrollPosition);
}
Bundle b = new Bundle();
b.putBooleanArray(TAG_PIECES, pieces);
HeavyInstanceStorage storage = HeavyInstanceStorage.getInstance(getFragmentManager());
if (storage != null)
storage.pushData(HEAVY_STATE_TAG, b);
}
内容来源于网络,如有侵权,请联系作者删除!