本文整理了Java中android.support.v4.widget.NestedScrollView.smoothScrollTo()
方法的一些代码示例,展示了NestedScrollView.smoothScrollTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。NestedScrollView.smoothScrollTo()
方法的具体详情如下:
包路径:android.support.v4.widget.NestedScrollView
类名称:NestedScrollView
方法名:smoothScrollTo
暂无
代码示例来源:origin: xinghongfei/LookLook
@Override
public void onClick(View view) {
mNest.smoothScrollTo(0, 0);
}
});
代码示例来源:origin: xinghongfei/LookLook
@Override
public void onClick(View view) {
mNest.smoothScrollTo(0,0);
}
});
代码示例来源:origin: hidroh/materialistic
@Override
public void scrollToTop() {
mScrollView.smoothScrollTo(0, 0);
}
代码示例来源:origin: xinghongfei/LookLook
@OnClick(R.id.shot)
public void onClick() {
mNest.smoothScrollTo(0, 0);
}
代码示例来源:origin: xinghongfei/LookLook
@OnClick(R.id.shot)
public void onClick() {
mNest.smoothScrollTo(0, 0);
}
代码示例来源:origin: Rukey7/MvpApp
@OnClick(R.id.fab_coping)
public void onClick() {
mSvContent.stopNestedScroll();
mSvContent.smoothScrollTo(0, 0);
}
代码示例来源:origin: iMeiji/Toutiao
@Override
protected void initView(View view) {
Toolbar toolbar = view.findViewById(R.id.toolbar);
initToolBar(toolbar, true, "");
toolbar.setOnClickListener(v -> scrollView.smoothScrollTo(0, 0));
tv_hint = view.findViewById(R.id.tv_hint);
tv_save = view.findViewById(R.id.tv_save);
tv_save.setOnClickListener(this);
viewPager = view.findViewById(R.id.viewPager);
photoView = view.findViewById(R.id.photoView);
webView = view.findViewById(R.id.webview);
scrollView = view.findViewById(R.id.scrollView);
progressBar = view.findViewById(R.id.pb_progress);
int color = SettingUtil.getInstance().getColor();
progressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
progressBar.show();
swipeRefreshLayout = view.findViewById(R.id.refresh_layout);
swipeRefreshLayout.setColorSchemeColors(SettingUtil.getInstance().getColor());
swipeRefreshLayout.setOnRefreshListener(() -> {
swipeRefreshLayout.post(() -> swipeRefreshLayout.setRefreshing(true));
presenter.doLoadData(shareUrl);
});
setHasOptionsMenu(true);
}
代码示例来源:origin: hidroh/materialistic
@Test
public void testScrollToTop() {
helper.scrollToTop();
verify(scrollView).smoothScrollTo(eq(0), eq(0));
}
代码示例来源:origin: hidroh/materialistic
@Implementation
public void smoothScrollTo(int x, int y) {
smoothScrollY = y;
directly().smoothScrollTo(x, y);
}
代码示例来源:origin: iMeiji/Toutiao
initToolBar(toolbar, true, "");
toolbar.setOnClickListener(view1 -> {
scrollView.smoothScrollTo(0, 0);
代码示例来源:origin: iMeiji/Toutiao
Toolbar toolbar = view.findViewById(R.id.toolbar);
initToolBar(toolbar, true, getString(R.string.title_wenda_detail));
toolbar.setOnClickListener(view12 -> scrollView.smoothScrollTo(0, 0));
代码示例来源:origin: hidroh/materialistic
@Config(shadows = ShadowNestedScrollView.class)
@Test
public void testScrollToTop() {
NestedScrollView scrollView = activity.findViewById(R.id.nested_scroll_view);
scrollView.smoothScrollTo(0, 1);
assertThat(customShadowOf(scrollView).getSmoothScrollY()).isEqualTo(1);
activity.fragment.scrollToTop();
assertThat(customShadowOf(scrollView).getSmoothScrollY()).isEqualTo(0);
}
代码示例来源:origin: hidroh/materialistic
@Config(shadows = ShadowNestedScrollView.class)
@Test
public void testScrollToTop() {
NestedScrollView scrollView = (NestedScrollView) activity.findViewById(R.id.nested_scroll_view);
scrollView.smoothScrollTo(0, 1);
assertThat(customShadowOf(scrollView).getSmoothScrollY()).isEqualTo(1);
fragment.scrollToTop();
assertThat(customShadowOf(scrollView).getSmoothScrollY()).isEqualTo(0);
controller.pause().stop().destroy();
}
代码示例来源:origin: hidroh/materialistic
final NestedScrollView scrollView = (NestedScrollView) findViewById(R.id.nested_scroll_view);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setOnClickListener(v -> scrollView.smoothScrollTo(0, 0));
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME |
代码示例来源:origin: ywwynm/EverythingDone
@Override
public void onClick(View v) {
mScrollView.smoothScrollTo(0, 0);
}
});
代码示例来源:origin: whyalwaysmea/BigBoom
@OnClick(R.id.to_top)
public void toTop() {
mNsv.smoothScrollTo(0, 0);
}
代码示例来源:origin: naman14/Hacktoberfest-Android
private void scrollToView(final NestedScrollView scrollViewParent, final View view) {
// Get deepChild Offset
Point childOffset = new Point();
getDeepChildOffset(scrollViewParent, view.getParent(), view, childOffset);
// Scroll to child.
scrollViewParent.smoothScrollTo(0, childOffset.y - 50);
}
代码示例来源:origin: wutq/AndroidModuleDemo
@OnClick(R2.id.ll_go_top)
public void onViewClicked() {
scrollView.fling(0);
scrollView.smoothScrollTo(0, 0);
}
代码示例来源:origin: kmshack/Android-TopScrollHelper
private void doScroll(){
for (View view : mTargetScrollView) {
if (DEBUG)
Log.d(TAG, "is shown ? " + view.isShown());
if (view.isShown()) {
if (view instanceof AbsListView) {
if (((AbsListView) view).getAdapter() != null && ((AbsListView) view).getAdapter().getCount() > 15)
((AbsListView) view).setSelection(15);
((AbsListView) view).smoothScrollToPosition(0, 0);
} else if (view instanceof ScrollView) {
((ScrollView) view).smoothScrollTo(0, 0);
} else if (view instanceof WebView) {
((WebView) view).scrollTo(0, 0);
} else if(view instanceof RecyclerView){
if (((RecyclerView) view).getAdapter() != null && ((RecyclerView) view).getAdapter().getItemCount() > 15 && ((RecyclerView) view).getLayoutManager()!=null) {
((RecyclerView) view).getLayoutManager().scrollToPosition(15);
}
((RecyclerView)view).smoothScrollToPosition(0);
} else if(view instanceof NestedScrollView){
((NestedScrollView) view).smoothScrollTo(0, 0);
}
}
}
}
代码示例来源:origin: CodingBingo/FastReader
bookListView.setMinimumHeight((int) bookListViewHeight);
bookIndexScrollview.smoothScrollTo(0, 0);
内容来源于网络,如有侵权,请联系作者删除!