android.widget.ScrollView.getScrollY()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中android.widget.ScrollView.getScrollY()方法的一些代码示例,展示了ScrollView.getScrollY()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollView.getScrollY()方法的具体详情如下:
包路径:android.widget.ScrollView
类名称:ScrollView
方法名:getScrollY

ScrollView.getScrollY介绍

暂无

代码示例

代码示例来源:origin: Aspsine/SwipeToLoadLayout

@Override
  public void onScrollChanged() {
    if (scrollView.getChildAt(0).getHeight() < scrollView.getScrollY() + scrollView.getHeight() && !ViewCompat.canScrollVertically(scrollView, 1)) {
      swipeToLoadLayout.setLoadingMore(true);
    }
  }
};

代码示例来源:origin: huburt-Hu/NewbieGuide

int scrollY = scrollView.getScrollY();
LogUtil.i("scrollY:" + scrollY);
result.top -= scrollY;

代码示例来源:origin: umano/AndroidSlidingUpPanel

ScrollView sv = ((ScrollView) scrollableView);
View child = sv.getChildAt(0);
return (child.getBottom() - (sv.getHeight() + sv.getScrollY()));

代码示例来源:origin: aa112901/remusic

if (view != null) {
  int diff = (view.getBottom() - (scrollView.getHeight() + scrollView
      .getScrollY()));
  if (diff == 0) {
    return true;

代码示例来源:origin: tianshaojie/AndroidFine

@Override
protected boolean isReadyForPullStart() {
  return mRefreshableView.getScrollY() == 0;
}

代码示例来源:origin: tianshaojie/AndroidFine

@Override
protected boolean isReadyForPullStart() {
  return mRootView.getScrollY() == 0;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void shouldSmoothScrollTo() throws Exception {
 ScrollView scrollView = new ScrollView(ApplicationProvider.getApplicationContext());
 scrollView.smoothScrollTo(7, 6);
 assertEquals(7, scrollView.getScrollX());
 assertEquals(6, scrollView.getScrollY());
}

代码示例来源:origin: robolectric/robolectric

@Test
 public void shouldSmoothScrollBy() throws Exception {
  ScrollView scrollView = new ScrollView(ApplicationProvider.getApplicationContext());
  scrollView.smoothScrollTo(7, 6);
  scrollView.smoothScrollBy(10, 20);

  assertEquals(17, scrollView.getScrollX());
  assertEquals(26, scrollView.getScrollY());
 }
}

代码示例来源:origin: tianshaojie/AndroidFine

@Override
protected boolean isReadyForPullEnd() {
  View scrollViewChild = mRefreshableView.getChildAt(0);
  if (null != scrollViewChild) {
    return mRefreshableView.getScrollY() >= (scrollViewChild.getHeight() - getHeight());
  }
  return false;
}

代码示例来源:origin: tianshaojie/AndroidFine

@Override
  public void onInternalScrollChanged(int left, int top, int oldLeft, int oldTop) {
    if (isPullToZoomEnabled() && isParallax()) {
      Log.d(TAG, "onScrollChanged --> getScrollY() = " + mRootView.getScrollY());
      float f = mHeaderHeight - mHeaderContainer.getBottom() + mRootView.getScrollY();
      Log.d(TAG, "onScrollChanged --> f = " + f);
      if ((f > 0.0F) && (f < mHeaderHeight)) {
        int i = (int) (0.65D * f);
        mHeaderContainer.scrollTo(0, -i);
      } else if (mHeaderContainer.getScrollY() != 0) {
        mHeaderContainer.scrollTo(0, 0);
      }
    }
  }
});

代码示例来源:origin: chaychan/TouTiao

public static boolean isScrollViewToBottom(ScrollView scrollView) {
  if (scrollView != null) {
    int scrollContentHeight = scrollView.getScrollY() + scrollView.getMeasuredHeight() - scrollView.getPaddingTop() - scrollView.getPaddingBottom();
    int realContentHeight = scrollView.getChildAt(0).getMeasuredHeight();
    if (scrollContentHeight == realContentHeight) {
      return true;
    }
  }
  return false;
}

代码示例来源:origin: nuptboyzhb/SuperSwipeRefreshLayout

if (view != null) {
  int diff = (view.getBottom() - (scrollView.getHeight() + scrollView
      .getScrollY()));
  if (diff == 0) {
    return true;

代码示例来源:origin: w446108264/ScrollableLayout

private static boolean isScrollViewTop(ScrollView scrollView) {
  if (scrollView != null) {
    int scrollViewY = scrollView.getScrollY();
    return scrollViewY <= 0;
  }
  return false;
}

代码示例来源:origin: jeasonlzy/HeaderViewPager

private boolean isScrollViewTop(ScrollView scrollView) {
  if (scrollView != null) {
    int scrollViewY = scrollView.getScrollY();
    return scrollViewY <= 0;
  }
  return false;
}

代码示例来源:origin: com.albedinsky.android/ui-widget-layout

/**
 */
@Override
public boolean isScrolledAtStart() {
  return mScrollableView.getScrollY() == 0;
}

代码示例来源:origin: huxq17/XRefreshView

public boolean canChildPullUp() {
  if (child instanceof AbsListView) {
    AbsListView absListView = (AbsListView) child;
    return canScrollVertically(child, 1)
        || absListView.getLastVisiblePosition() != mTotalItemCount - 1;
  } else if (child instanceof WebView) {
    WebView webview = (WebView) child;
    if (webview instanceof XWebView) {
      return !((XWebView) webview).isBottom();
    } else {
      float left = webview.getContentHeight() * webview.getScale();
      int right = webview.getHeight() + webview.getScrollY();
      return left != right;
    }
  } else if (child instanceof ScrollView) {
    ScrollView scrollView = (ScrollView) child;
    View childView = scrollView.getChildAt(0);
    if (childView != null) {
      return canScrollVertically(child, 1)
          || scrollView.getScrollY() < childView.getHeight() - scrollView.getHeight();
    }
  } else {
    return canScrollVertically(child, 1);
  }
  return true;
}

代码示例来源:origin: myxh/CoolShopping

@Override
protected boolean isReadyForPullEnd() {
  View scrollViewChild = mRefreshableView.getChildAt(0);
  if (null != scrollViewChild) {
    return mRefreshableView.getScrollY() >= (scrollViewChild.getHeight() - getHeight());
  }
  return false;
}

代码示例来源:origin: com.albedinsky.android/ui

/**
   */
  @Override
  public boolean isScrolledAtEnd() {
    final View view = mScrollableView.getChildAt(0);
    return view != null && (view.getHeight() - mScrollableView.getHeight()) == mScrollableView.getScrollY();
  }
}

代码示例来源:origin: kaku2015/WeatherAlarmClock

@Override
protected boolean isReadyForPullEnd() {
  View scrollViewChild = mRefreshableView.getChildAt(0);
  if (null != scrollViewChild) {
    return mRefreshableView.getScrollY() >= (scrollViewChild.getHeight() - getHeight());
  }
  return false;
}

代码示例来源:origin: Justson/AgentWebX5

public static boolean isScrollViewToBottom(ScrollView scrollView) {
  if (scrollView != null) {
    int scrollContentHeight = scrollView.getScrollY() + scrollView.getMeasuredHeight() - scrollView.getPaddingTop() - scrollView.getPaddingBottom();
    int realContentHeight = scrollView.getChildAt(0).getMeasuredHeight();
    if (scrollContentHeight == realContentHeight) {
      return true;
    }
  }
  return false;
}

相关文章

ScrollView类方法