From b8ab1ce5e7034c75b14f1edebdd0c642f2b43e13 Mon Sep 17 00:00:00 2001 From: liujing Date: Tue, 8 Dec 2020 16:21:54 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E5=81=B6=E7=8E=B0=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2x/fragment/V2XLinearLayoutManager.java | 31 +++++++++++++++++++ .../v2x/fragment/V2XShareEventsFragment.java | 6 ++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XLinearLayoutManager.java diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XLinearLayoutManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XLinearLayoutManager.java new file mode 100644 index 0000000000..408255e1bc --- /dev/null +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XLinearLayoutManager.java @@ -0,0 +1,31 @@ +package com.mogo.module.v2x.fragment; + +import android.content.Context; +import android.util.AttributeSet; +import android.util.Log; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +class V2XLinearLayoutManager extends LinearLayoutManager { + public V2XLinearLayoutManager(Context context) { + super(context); + } + + public V2XLinearLayoutManager(Context context, int orientation, boolean reverseLayout) { + super(context, orientation, reverseLayout); + } + + public V2XLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + @Override + public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) { + try { + super.onLayoutChildren(recycler, state); + } catch (IndexOutOfBoundsException e) { + Log.d("V2XLinearLayoutManager", "崩溃信息--"+e.toString()); + } + } +} diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java index b270254009..b9bf2b244c 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/fragment/V2XShareEventsFragment.java @@ -68,8 +68,8 @@ public class V2XShareEventsFragment extends MvpFragment 0) { dataArrayList.clear(); + Log.d("V2XShareEventsFragment","onFail--clear"); adapter.notifyDataSetChanged(); } loadingView.stopWithError(msg, View.VISIBLE);