修复第三方下拉刷新依赖的造成的闪退问题
This commit is contained in:
@ -117,7 +117,6 @@ public class AskQuestionsRecommendsFragment extends ListFragment<AnswerEntity, A
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
refreshLayout.setEnableLoadMore(false);
|
||||
refreshLayout.setOnRefreshListener(
|
||||
refreshLayout -> {
|
||||
if (!mInitRefresh) {
|
||||
@ -226,6 +225,15 @@ public class AskQuestionsRecommendsFragment extends ListFragment<AnswerEntity, A
|
||||
mAdapter.viewPagerAutoScroll(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop() {
|
||||
super.onStop();
|
||||
if (refreshLayout != null) {
|
||||
mInitRefresh = false;
|
||||
refreshLayout.finishRefresh(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void scrollToTop() {
|
||||
mLayoutManager.smoothScrollToPosition(mListRv, null, 0);
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app = "http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width = "match_parent"
|
||||
android:layout_height = "match_parent">
|
||||
|
||||
@ -7,7 +8,10 @@
|
||||
android:id = "@+id/refresh_layout"
|
||||
android:layout_below = "@id/refresh_hint"
|
||||
android:layout_width = "match_parent"
|
||||
android:layout_height = "match_parent">
|
||||
android:layout_height = "match_parent"
|
||||
app:srlEnableLoadMore = "false"
|
||||
app:srlEnableAutoLoadMore = "false"
|
||||
app:srlEnableClipFooterWhenFixedBehind = "false">
|
||||
|
||||
<com.gh.common.view.SwipeRefreshHeader
|
||||
android:id = "@+id/swipe_refresh_header"
|
||||
|
||||
Reference in New Issue
Block a user