Commit fb6a1389 by 段启岩

重复点击底部导航后滚动到第一项

parent 3fe7234a
......@@ -113,5 +113,9 @@ public abstract class RefreshableFragment<T, VM extends PageableViewModel<T>> ex
viewModel.loadFirstPage(category);
}
public void scrollToTop() {
binding.recyclerView.scrollToPosition(0);
}
protected abstract BaseQuickAdapter<T, BaseViewHolder> createAdapter();
}
\ No newline at end of file
......@@ -56,6 +56,7 @@ public class CategoryViewpagerUtils {
if (adapter instanceof CategoryFragmentPagerAdapter) {
Fragment fragment = ((CategoryFragmentPagerAdapter) adapter).getCurrentFragment();
if (null != fragment && fragment instanceof RefreshableFragment) {
((RefreshableFragment) fragment).scrollToTop();
((RefreshableFragment) fragment).onRefresh();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment