Browse Source

1.修改他人阅读界面

FailedToRead 1 year ago
parent
commit
b0cdd3ed07

+ 17 - 25
app/src/main/java/com/edufound/reader/activity/OthersRecordActivity.java

@@ -7,48 +7,36 @@ import android.graphics.Rect;
 import android.os.Build;
 import android.os.Bundle;
 import android.view.View;
-import android.widget.CompoundButton;
 import android.widget.FrameLayout;
-import android.widget.GridLayout;
 import android.widget.HorizontalScrollView;
 import android.widget.ImageView;
 import android.widget.Space;
 import android.widget.TextView;
-import android.widget.Toast;
 
-import com.baidu.duer.bot.directive.payload.AmountInfo;
-import com.baidu.duer.botsdk.BotIntent;
 import com.edufound.reader.R;
 import com.edufound.reader.annotation.BindView;
 import com.edufound.reader.base.BaseMvpActivity;
 import com.edufound.reader.bean.MyInfoBean;
-import com.edufound.reader.bean.UserBean;
 import com.edufound.reader.contract.OthersRecordContract;
 import com.edufound.reader.model.MyFollowModel;
-import com.edufound.reader.presenter.OthersRecordPresenter;
+import com.edufound.reader.presenter.OthersRecordRecyclerPresenter;
 import com.edufound.reader.receiver.BackPageReceiver;
 import com.edufound.reader.util.Consts;
 import com.edufound.reader.util.GlideUtils;
 import com.jakewharton.rxbinding4.view.RxView;
-import com.jakewharton.rxbinding4.widget.RxCompoundButton;
 import com.orhanobut.logger.Logger;
 
-import java.util.HashMap;
-
-import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.annotation.RequiresApi;
-import androidx.appcompat.widget.AppCompatCheckBox;
-
-import io.reactivex.rxjava3.functions.Consumer;
+import androidx.recyclerview.widget.RecyclerView;
 
-public class OthersRecordActivity extends BaseMvpActivity<OthersRecordPresenter> implements OthersRecordContract.View {
+public class OthersRecordActivity extends BaseMvpActivity<OthersRecordRecyclerPresenter> implements OthersRecordContract.View {
 
 
     Activity mActivity;
 
     @BindView(id = R.id.activity_otherrecord_gridlayout)
-    GridLayout mGridLayout;
+    RecyclerView mRecyclerView;
 
     @BindView(id = R.id.activity_otherrecord_norecord)
     FrameLayout mNoRecordLayout;
@@ -103,9 +91,13 @@ public class OthersRecordActivity extends BaseMvpActivity<OthersRecordPresenter>
     @Override
     public void initView() {
         mActivity = this;
-        mPresenter = new OthersRecordPresenter();
+        mPresenter = new OthersRecordRecyclerPresenter();
         mPresenter.attachView(this);
         mScreenRect = new Rect(0, 0, Consts.getScreenSize()[0], Consts.getScreenSize()[1]);
+
+
+
+
         RxView.scrollChangeEvents(mScrollView).subscribe(viewScrollChangeEvent -> {
             loadMoreItem();
         });
@@ -122,7 +114,7 @@ public class OthersRecordActivity extends BaseMvpActivity<OthersRecordPresenter>
         intoPage = params.getString("intoPage", "default");
         mOtherId = params.getString("other_uid");
         mPresenter.setBackRecordId(params.getString("record_id"));
-        mPresenter.getOtherRecordList(mOtherId);
+        mPresenter.getOtherRecordList();
 
     }
 
@@ -178,16 +170,17 @@ public class OthersRecordActivity extends BaseMvpActivity<OthersRecordPresenter>
         } else if (intoPage.equals("default")) {
 
         }
-        mPresenter.onDestory(mGridLayout);
+        mPresenter.onDestory(mRecyclerView);
         super.onDestroy();
     }
 
     @Override
     public void loadMoreItem() {
-        if (mBottomView.getLocalVisibleRect(mScreenRect) || mGridLayout.getChildCount() <= 2) {
+        if (mBottomView.getLocalVisibleRect(mScreenRect) || mRecyclerView.getChildCount() <= 2) {
             if (isNeedLoad) {
                 isNeedLoad = false;
-                mPresenter.setGridData(mGridLayout, mNoRecordLayout);
+//                mPresenter.setGridData(mGridLayout, mNoRecordLayout);
+                mPresenter.addMoreData(mRecyclerView);
             }
         } else {
             isNeedLoad = true;
@@ -197,13 +190,12 @@ public class OthersRecordActivity extends BaseMvpActivity<OthersRecordPresenter>
     @Override
     protected void onResume() {
         super.onResume();
-
         mPresenter.getOtherUserInfo(mOtherId);
     }
 
     @Override
     public void getOtherRecordSuccess() {
-        mPresenter.initGridLayout(mGridLayout, mNoRecordLayout);
+        mPresenter.initGridLayout(mRecyclerView, mNoRecordLayout);
     }
 
     @SuppressLint("AutoDispose")
@@ -251,8 +243,8 @@ public class OthersRecordActivity extends BaseMvpActivity<OthersRecordPresenter>
     }
 
     @Override
-    public GridLayout mGetGridLayout() {
-        return mGridLayout;
+    public String getOtherUserId() {
+        return mOtherId;
     }
 
 

+ 129 - 0
app/src/main/java/com/edufound/reader/adapter/OthersRecordAdapter.java

@@ -0,0 +1,129 @@
+package com.edufound.reader.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.edufound.reader.R;
+import com.edufound.reader.bean.UserRecordBean;
+import com.edufound.reader.listener.RecyclerItemClickListener;
+import com.edufound.reader.util.Consts;
+import com.edufound.reader.util.EfunboxUtil;
+import com.edufound.reader.util.GlideUtils;
+
+import java.util.List;
+
+import cc.taylorzhang.singleclick.SingleClickUtil;
+
+public class OthersRecordAdapter extends RecyclerView.Adapter<OthersRecordAdapter.OtherRecordViewHolder> {
+
+    private LayoutInflater mLayoutInflater;
+    private Context mContext;
+    private List<UserRecordBean> mListData;
+    private RecyclerItemClickListener mRecyclerItemClickListener;
+
+    public OthersRecordAdapter(Context context, List<UserRecordBean> listData) {
+        mContext = context;
+        mLayoutInflater = LayoutInflater.from(context);
+        mListData = listData;
+    }
+
+
+    public void addMore(List<UserRecordBean> list) {
+        mListData.addAll(list);
+    }
+
+    public void setNewList(List<UserRecordBean> list) {
+        mListData = list;
+    }
+
+    public List<UserRecordBean> getmListData() {
+        return mListData;
+    }
+
+    public void setRecyclerItemClickListener(RecyclerItemClickListener listener) {
+        mRecyclerItemClickListener = listener;
+    }
+
+    @NonNull
+    @Override
+    public OtherRecordViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        return new OtherRecordViewHolder(mLayoutInflater.inflate(R.layout.adapter_item_record_user, parent, false));
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull OtherRecordViewHolder holder, @SuppressLint("RecyclerView") int position) {
+        holder.name.setText(mListData.get(position).getUserRead().getTitle());
+
+        if (holder.imgIcon.getTag().toString().equals("0")) {
+            //没有设置过图片
+            GlideUtils.loadImageSizeKipMemoryCache(mContext, mListData.get(position).getUserRead().getCoverImg(), holder.imgIcon);
+        }
+        holder.imgIcon.setTag("1");
+        holder.lookAmount.setText(EfunboxUtil.checkNum10000(mListData.get(position).getUserRead().getPlayAmount()));
+        holder.likeAmount.setText(EfunboxUtil.checkNum10000(mListData.get(position).getUserRead().getLikeAmount()));
+        holder.commentAmount.setText(EfunboxUtil.checkNum10000(mListData.get(position).getUserRead().getCommentAmount()));
+        holder.favoritesAmount.setText(EfunboxUtil.checkNum10000(mListData.get(position).getUserRead().getFavoritesAmount()));
+
+        if (mRecyclerItemClickListener != null) {
+            SingleClickUtil.onSingleClick(holder.itemView, Consts.VIEW_CLICK_TIME, true, new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    mRecyclerItemClickListener.onClickListener(position, holder.itemView, mListData.get(position));
+                }
+            });
+        }
+    }
+
+    @Override
+    public int getItemViewType(int position) {
+        return position;
+    }
+
+
+    @Override
+    public int getItemCount() {
+        return mListData.size();
+    }
+
+
+    public class OtherRecordViewHolder extends RecyclerView.ViewHolder {
+
+        ImageView imgIcon;
+        TextView name;
+        ImageView imgDel;
+        ImageView imgPriv;
+        TextView lookAmount;
+        TextView likeAmount;
+        TextView commentAmount;
+        TextView favoritesAmount;
+        FrameLayout checkLayout;
+
+
+        public OtherRecordViewHolder(@NonNull View itemView) {
+            super(itemView);
+            imgIcon = itemView.findViewById(R.id.adapter_item_record_user_icon);
+            imgIcon.setTag("0");
+            name = itemView.findViewById(R.id.adapter_item_record_user_name);
+            imgDel = itemView.findViewById(R.id.adapter_item_record_user_del);
+            imgPriv = itemView.findViewById(R.id.adapter_item_record_user_priv);
+            lookAmount = itemView.findViewById(R.id.adapter_item_record_user_look_num);
+            likeAmount = itemView.findViewById(R.id.adapter_item_record_user_thumb_num);
+            commentAmount = itemView.findViewById(R.id.adapter_item_record_user_comment_num);
+            favoritesAmount = itemView.findViewById(R.id.adapter_item_record_user_start_num);
+            checkLayout = itemView.findViewById(R.id.adapter_item_record_user_examine_layout);
+            imgDel.setVisibility(View.GONE);
+            imgPriv.setVisibility(View.GONE);
+            checkLayout.setVisibility(View.GONE);
+        }
+    }
+
+}

+ 3 - 1
app/src/main/java/com/edufound/reader/application/EApplication.java

@@ -63,7 +63,9 @@ public class EApplication extends Application {
             Consts.setmApplicAtion(this);
 
             //初始化异常监听
-            initException();
+            if (!Consts.isIsDebug()) {
+                initException();
+            }
 
             XmlPullParserFactory.newInstance().setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
 

+ 6 - 4
app/src/main/java/com/edufound/reader/contract/OthersRecordContract.java

@@ -7,6 +7,7 @@ import android.widget.FrameLayout;
 import android.widget.GridLayout;
 
 import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.RecyclerView;
 
 import com.edufound.reader.base.BaseView;
 import com.edufound.reader.bean.MyInfoBean;
@@ -37,19 +38,20 @@ public interface OthersRecordContract {
 
         void doFollowSuccess(boolean isfollow);
 
-        GridLayout mGetGridLayout();
+
+        String getOtherUserId();
 
 
     }
 
     interface Presenter {
-        void initGridLayout(GridLayout gridLayout, FrameLayout norecordlayout);
+        void initGridLayout(RecyclerView gridLayout, FrameLayout norecordlayout);
 
-        void onDestory(GridLayout layout);
+        void onDestory(RecyclerView layout);
 
         void getOtherUserInfo(String uid);
 
-        void getOtherRecordList(String uid);
+        void getOtherRecordList();
 
         void doFollow(String uid);
 

+ 0 - 328
app/src/main/java/com/edufound/reader/presenter/OthersRecordPresenter.java

@@ -1,328 +0,0 @@
-package com.edufound.reader.presenter;
-
-import android.content.Intent;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Handler;
-import android.os.Message;
-import android.view.LayoutInflater;
-import android.view.MotionEvent;
-import android.view.View;
-import android.widget.FrameLayout;
-import android.widget.GridLayout;
-import android.widget.ImageView;
-import android.widget.LinearLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import com.edufound.reader.R;
-import com.edufound.reader.activity.OthersRecordActivity;
-import com.edufound.reader.activity.SmallFullVideoActivity;
-import com.edufound.reader.apiserver.UserApiServerImpl;
-import com.edufound.reader.base.BaseActivity;
-import com.edufound.reader.base.BasePresenter;
-import com.edufound.reader.bean.FansBean;
-import com.edufound.reader.bean.HttpResultBean;
-import com.edufound.reader.bean.HttpResultDataListBean;
-import com.edufound.reader.bean.MyInfoBean;
-import com.edufound.reader.bean.UserRecordBean;
-import com.edufound.reader.contract.OthersRecordContract;
-import com.edufound.reader.model.CharacterFragmentModel;
-import com.edufound.reader.model.MyFollowModel;
-import com.edufound.reader.model.OthersRecordModel;
-import com.edufound.reader.receiver.BackPageReceiver;
-import com.edufound.reader.util.EfunboxUtil;
-import com.edufound.reader.util.GlideUtils;
-import com.edufound.reader.util.MMKVUtil;
-import com.edufound.reader.util.SizeUtils;
-import com.google.gson.Gson;
-import com.google.gson.reflect.TypeToken;
-import com.okhttplib.HttpInfo;
-import com.okhttplib.callback.Callback;
-import com.orhanobut.logger.Logger;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import androidx.annotation.Nullable;
-import androidx.annotation.RequiresApi;
-
-public class OthersRecordPresenter extends BasePresenter<OthersRecordContract.View> implements OthersRecordContract.Presenter {
-
-
-    OthersRecordModel mModel;
-    UserApiServerImpl mUserApi;
-    List<UserRecordBean> mDataList;
-    int onceLoadCount = 10;
-    int mListStart = 0;
-    int mListEnd = onceLoadCount;
-    String backRecordId = null;
-    final int START_SMALLFULLVIDEO = 0x2231;
-    String refVideoId = null;
-    int startIndex = 0;
-
-    public OthersRecordPresenter() {
-        mModel = new OthersRecordModel();
-        mUserApi = new UserApiServerImpl();
-    }
-
-
-    @Override
-    public void initGridLayout(GridLayout gridLayout, FrameLayout norecordlayout) {
-        gridLayout.removeAllViews();
-        gridLayout.setRowCount(2);
-        onceLoadCount = 10;
-        mListStart = 0;
-        mListEnd = onceLoadCount;
-        setGridData(gridLayout, norecordlayout);
-    }
-
-
-    private void setGridItemView(GridLayout gridLayout, int index, int gridIndex) {
-        if (mView == null) {
-            return;
-        }
-        View view = LayoutInflater.from(mView.getActivity()).inflate(R.layout.adapter_item_record_user, null);
-        UserRecordBean.UserRead reader = mDataList.get(index).getUserRead();
-        ImageView imgIcon = view.findViewById(R.id.adapter_item_record_user_icon);
-        TextView name = view.findViewById(R.id.adapter_item_record_user_name);
-        ImageView imgDel = view.findViewById(R.id.adapter_item_record_user_del);
-        ImageView imgPriv = view.findViewById(R.id.adapter_item_record_user_priv);
-        TextView lookAmount = view.findViewById(R.id.adapter_item_record_user_look_num);
-        TextView likeAmount = view.findViewById(R.id.adapter_item_record_user_thumb_num);
-        TextView commentAmount = view.findViewById(R.id.adapter_item_record_user_comment_num);
-        TextView favoritesAmount = view.findViewById(R.id.adapter_item_record_user_start_num);
-        FrameLayout checkLayout = view.findViewById(R.id.adapter_item_record_user_examine_layout);
-//        GlideUtils.loadRoundCircleImage(mView.getActivity(), reader.getCoverImg(), imgIcon, SizeUtils.dp2px(mView.getActivity(), 20));
-        GlideUtils.loadImage(mView.getActivity(), reader.getCoverImg(), imgIcon);
-        name.setText(reader.getTitle());
-        lookAmount.setText(EfunboxUtil.checkNum10000(reader.getPlayAmount()));
-        likeAmount.setText(EfunboxUtil.checkNum10000(reader.getLikeAmount()));
-        commentAmount.setText(EfunboxUtil.checkNum10000(reader.getCommentAmount()));
-        favoritesAmount.setText(EfunboxUtil.checkNum10000(reader.getFavoritesAmount()));
-        imgDel.setVisibility(View.GONE);
-        imgPriv.setVisibility(View.GONE);
-        checkLayout.setVisibility(View.GONE);
-
-        mView.addUiClick(view, o -> {
-            startIndex = index;
-            Bundle bundle = new Bundle();
-            bundle.putString("index", index + "");
-            bundle.putString("dataJson", "getmmkv");
-            bundle.putString("intoPage", "OthersRecord");
-            //数据太多了。直接传不过去,通过MMKV写一下再读一下
-            try {
-                System.gc();
-                MMKVUtil.getInstance().removeKey("video_data");
-                String json = ((BaseActivity) mView.getActivity()).getGson().toJson(mDataList);
-                MMKVUtil.getInstance().encode("video_data", json);
-                refVideoId = mDataList.get(index).getUserRead().getId();
-                Logger.e("refVideoId:" + refVideoId);
-//            bundle.putString("dataJson", ((BaseActivity) mView.getActivity()).getGson().toJson(mDataList));
-                ((BaseActivity) mView.getActivity()).toNextActivityForResult(SmallFullVideoActivity.class, bundle, START_SMALLFULLVIDEO);
-            } catch (Exception e) {
-                Logger.e("报错数据:" + mDataList);
-                e.printStackTrace();
-
-            }
-
-        });
-
-        checkLayout.setOnTouchListener(new View.OnTouchListener() {
-            @Override
-            public boolean onTouch(View view, MotionEvent motionEvent) {
-                return true;
-            }
-        });
-        GridLayout.LayoutParams params = new GridLayout.LayoutParams(new FrameLayout.LayoutParams(SizeUtils.dp2px(mView.getActivity(), 415), SizeUtils.dp2px(mView.getActivity(), 290)));
-        params.setMargins(SizeUtils.dp2px(mView.getActivity(), 10), 0, SizeUtils.dp2px(mView.getActivity(), 20), SizeUtils.dp2px(mView.getActivity(), 30));
-        view.setLayoutParams(params);
-        gridLayout.setOrientation(GridLayout.VERTICAL);
-        if (gridIndex != -1) {
-            gridLayout.addView(view, gridIndex);
-        } else {
-            gridLayout.addView(view);
-        }
-    }
-
-
-    public void setGridData(GridLayout gridLayout, FrameLayout norecordlayout) {
-        if (mDataList == null || mDataList.size() <= 0) {
-            norecordlayout.setVisibility(View.VISIBLE);
-            gridLayout.setVisibility(View.GONE);
-            return;
-        }
-        if (mListEnd > mDataList.size()) {
-            mListEnd = mDataList.size();
-        }
-        int timeCount = 0;
-        for (int j = mListStart; j < mListEnd; j++) {
-            timeCount++;
-            Message message = new Message();
-            message.obj = gridLayout;
-            message.what = OthersRecordModel.LOAD_GRID;
-            message.arg1 = j;
-            otherRecordHandler.sendMessageDelayed(message, 50 * timeCount);
-        }
-        mListStart = mListEnd;
-        if (mListEnd + onceLoadCount > mDataList.size()) {
-            mListEnd = mDataList.size();
-        } else {
-            mListEnd = mListEnd + onceLoadCount;
-        }
-    }
-
-
-    @Override
-    public void getOtherRecordList(String uid) {
-        mModel.getOtherRecordList(mView.getActivity(), uid, new Callback() {
-            @Override
-            public void onSuccess(HttpInfo info) throws IOException {
-                HttpResultBean<HttpResultDataListBean<UserRecordBean>> bean = info.getRetDetail(new TypeToken<HttpResultBean<HttpResultDataListBean<UserRecordBean>>>() {
-                }.getType());
-                mDataList = bean.getData().getList();
-                mView.getOtherRecordSuccess();
-//                mView.loadMoreItem();
-            }
-
-            @Override
-            public void onFailure(HttpInfo info) throws IOException {
-
-            }
-        });
-    }
-
-    @Override
-    public void doFollow(String uid) {
-        Map<String, String> map = new HashMap<>();
-        map.put("uid", uid);
-        String json = ((BaseActivity) mView.getActivity()).getGson().toJson(map);
-        mModel.doFollow(mView.getActivity(), json, new Callback() {
-            @RequiresApi(api = Build.VERSION_CODES.N)
-            @Override
-            public void onSuccess(HttpInfo info) throws IOException {
-                HttpResultBean<FansBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<FansBean>>() {
-                }.getType());
-                if (bean.getData().getStatus().equals("NORMAL")) {
-                    //已关注状态
-                    mView.doFollowSuccess(true);
-
-                    setFans(true);
-                } else if (bean.getData().getStatus().equals("DEL")) {
-                    //未关注状态
-                    mView.doFollowSuccess(false);
-                    setFans(false);
-                }
-                getOtherUserInfo(uid);
-            }
-
-            @Override
-            public void onFailure(HttpInfo info) throws IOException {
-            }
-        });
-    }
-
-    public void setFans(boolean fans) {
-        for (int i = 0; i < mDataList.size(); i++) {
-            mDataList.get(i).setFans(fans);
-        }
-    }
-
-    @Override
-    public void sendBackReceiver(String action) {
-        Intent intent = new Intent(action);
-        intent.putExtra("recordId", backRecordId);
-        mView.getActivity().sendBroadcast(intent);
-    }
-
-    @Override
-    public void setBackRecordId(String id) {
-        backRecordId = id;
-    }
-
-    @Override
-    public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
-        switch (requestCode) {
-            case START_SMALLFULLVIDEO:
-                //刷新refVideoId的数据
-                mModel.getReadInfo(mView.getActivity(), refVideoId, new Callback() {
-                    @Override
-                    public void onSuccess(HttpInfo info) throws IOException {
-                        HttpResultBean<UserRecordBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<UserRecordBean>>() {
-                        }.getType());
-                        if (bean.getSuccess() && bean.getCode().equals("200")) {
-                            if (otherRecordHandler == null) {
-                                return;
-                            }
-                            otherRecordHandler.postDelayed(new Runnable() {
-                                @Override
-                                public void run() {
-                                    if (mDataList != null) {
-                                        mDataList.remove(startIndex);
-                                        mDataList.add(startIndex, bean.getData());
-                                        if (mView.mGetGridLayout() != null) {
-                                            mView.mGetGridLayout().removeView(mView.mGetGridLayout().getChildAt(startIndex));
-                                            setGridItemView(mView.mGetGridLayout(), startIndex, startIndex);
-                                        }
-                                    }
-                                }
-                            }, 50);
-
-                        }
-                    }
-
-                    @Override
-                    public void onFailure(HttpInfo info) throws IOException {
-                        Logger.e("获取单独的失败了:" + info.getRetDetail());
-                    }
-                });
-                break;
-        }
-    }
-
-    @Override
-    public void onDestory(GridLayout layout) {
-
-        otherRecordHandler.removeMessages(CharacterFragmentModel.LOAD_GRID);
-        otherRecordHandler = null;
-        layout.removeAllViews();
-        layout = null;
-        mView = null;
-    }
-
-    @Override
-    public void getOtherUserInfo(String uid) {
-        mUserApi.getOtherUserInfo(mView.getActivity(), uid, new Callback() {
-            @Override
-            public void onSuccess(HttpInfo info) throws IOException {
-                HttpResultBean<MyInfoBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<MyInfoBean>>() {
-                }.getType());
-                mView.setLeftUserInfo(bean.getData());
-            }
-
-            @Override
-            public void onFailure(HttpInfo info) throws IOException {
-
-            }
-        });
-    }
-
-    Handler otherRecordHandler = new Handler(new Handler.Callback() {
-        @Override
-        public boolean handleMessage(Message msg) {
-            switch (msg.what) {
-                case OthersRecordModel.LOAD_GRID:
-                    setGridItemView((GridLayout) msg.obj, msg.arg1, -1);
-                    break;
-                default:
-                    throw new IllegalStateException("Unexpected value: " + msg.what);
-            }
-            return false;
-        }
-    });
-
-
-}

+ 295 - 0
app/src/main/java/com/edufound/reader/presenter/OthersRecordRecyclerPresenter.java

@@ -0,0 +1,295 @@
+package com.edufound.reader.presenter;
+
+import android.content.Intent;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.view.View;
+import android.widget.FrameLayout;
+
+import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
+import androidx.recyclerview.widget.GridLayoutManager;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.edufound.reader.activity.SmallFullVideoActivity;
+import com.edufound.reader.adapter.MyCollectionItemAdapter;
+import com.edufound.reader.adapter.OthersRecordAdapter;
+import com.edufound.reader.apiserver.UserApiServerImpl;
+import com.edufound.reader.base.BaseActivity;
+import com.edufound.reader.base.BasePresenter;
+import com.edufound.reader.bean.FansBean;
+import com.edufound.reader.bean.HttpResultBean;
+import com.edufound.reader.bean.HttpResultDataListBean;
+import com.edufound.reader.bean.MyInfoBean;
+import com.edufound.reader.bean.UserRecordBean;
+import com.edufound.reader.contract.OthersRecordContract;
+import com.edufound.reader.cusview.CusToast;
+import com.edufound.reader.listener.RecyclerItemClickListener;
+import com.edufound.reader.model.CharacterFragmentModel;
+import com.edufound.reader.model.OthersRecordModel;
+import com.edufound.reader.util.MMKVUtil;
+import com.edufound.reader.util.SizeUtils;
+import com.google.gson.reflect.TypeToken;
+import com.okhttplib.HttpInfo;
+import com.okhttplib.callback.Callback;
+import com.orhanobut.logger.Logger;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class OthersRecordRecyclerPresenter extends BasePresenter<OthersRecordContract.View> implements OthersRecordContract.Presenter {
+
+
+    OthersRecordModel mModel;
+    UserApiServerImpl mUserApi;
+    List<UserRecordBean> mDataList;
+    String backRecordId = null;
+    OthersRecordAdapter mOthersRecordAdapter;
+    boolean rvAdditemDecoration = false;
+    int startIndex = 0;
+    int endIndex = 10;
+    int mTotalSize = -1;
+    boolean loadOver = false;
+    final int START_SMALLFULLVIDEO = 0x2231;
+
+    public OthersRecordRecyclerPresenter() {
+        mModel = new OthersRecordModel();
+        mUserApi = new UserApiServerImpl();
+    }
+
+
+    @Override
+    public void initGridLayout(RecyclerView recyclerView, FrameLayout norecordlayout) {
+        List<UserRecordBean> test = new ArrayList<>();
+        if (mTotalSize < endIndex) {
+            endIndex = mTotalSize;
+        }
+        for (int i = startIndex; i < endIndex; i++) {
+            test.add(mDataList.get(i));
+        }
+        mOthersRecordAdapter = new OthersRecordAdapter(mView.getActivity(), test);
+        startIndex = endIndex;
+        endIndex = startIndex + 20;
+        recyclerView.setHasFixedSize(true);
+        GridLayoutManager gridLayoutManager = new GridLayoutManager(mView.getActivity(), 2) {
+            @Override
+            public boolean canScrollHorizontally() {
+                return false;
+            }
+        };
+        recyclerView.setNestedScrollingEnabled(true);
+        gridLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
+        if (!rvAdditemDecoration) {
+            recyclerView.addItemDecoration(new MyCollectionItemDecoration(
+                    SizeUtils.dp2px(mView.getActivity(), 27f),
+                    SizeUtils.dp2px(mView.getActivity(), 27f)));
+            rvAdditemDecoration = true;
+        }
+
+        recyclerView.setLayoutManager(gridLayoutManager);
+        recyclerView.addOnChildAttachStateChangeListener(new RecyclerView.OnChildAttachStateChangeListener() {
+            @Override
+            public void onChildViewAttachedToWindow(@androidx.annotation.NonNull View view) {
+            }
+
+            @Override
+            public void onChildViewDetachedFromWindow(@androidx.annotation.NonNull View view) {
+
+            }
+        });
+        recyclerView.setAdapter(mOthersRecordAdapter);
+        mOthersRecordAdapter.setRecyclerItemClickListener(new RecyclerItemClickListener() {
+            @Override
+            public void onClickListener(int position, View view, Object o) {
+                Bundle bundle = new Bundle();
+                bundle.putString("index", position + "");
+                bundle.putString("dataJson", "getmmkv");
+                bundle.putString("intoPage", "OthersRecord");
+                //数据太多了。直接传不过去,通过MMKV写一下再读一下
+                try {
+                    System.gc();
+                    MMKVUtil.getInstance().removeKey("video_data");
+                    String json = ((BaseActivity) mView.getActivity()).getGson().toJson(mDataList);
+                    MMKVUtil.getInstance().encode("video_data", json);
+//            bundle.putString("dataJson", ((BaseActivity) mView.getActivity()).getGson().toJson(mDataList));
+                    ((BaseActivity) mView.getActivity()).toNextActivityForResult(SmallFullVideoActivity.class, bundle, START_SMALLFULLVIDEO);
+                } catch (Exception e) {
+                    Logger.e("报错数据:" + mDataList);
+                    e.printStackTrace();
+
+                }
+            }
+        });
+
+    }
+
+    public void addMoreData(RecyclerView rv) {
+        //获取当前显示的View 的数据
+        int childCount = rv.getChildCount();
+        //获取最后一具 Item 对应的View
+        View childAt = rv.getChildAt(childCount - 1);
+        //获取当前军舰中显示的最后一个 Item 的位置  Postion
+        int childLayoutPosition = rv.getChildLayoutPosition(childAt);
+        //如果不是最后一个就向下滑动
+
+        if (childLayoutPosition < rv.getAdapter().getItemCount() - 2) {
+        } else {
+            if (loadOver) {
+                CusToast.getInstance(mView.getActivity()).show("没有更多了", 2000);
+                return;
+            } else {
+                Logger.e("mTotalSize:" + mTotalSize);
+                if (mTotalSize < endIndex) {
+                    endIndex = mTotalSize;
+                }
+                List<UserRecordBean> test = new ArrayList<>();
+                for (int i = startIndex; i < endIndex; i++) {
+                    test.add(mDataList.get(i));
+                }
+                mOthersRecordAdapter.addMore(test);
+                mView.getRootView().post(new Runnable() {
+                    @Override
+                    public void run() {
+                        mOthersRecordAdapter.notifyDataSetChanged();
+                        if (mOthersRecordAdapter.getmListData().size() >= mDataList.size()) {
+                            loadOver = true;
+                        }
+                        startIndex = endIndex;
+                        endIndex = startIndex + 20;
+                        if (endIndex >= mDataList.size()) {
+                            loadOver = true;
+                        }
+                    }
+                });
+            }
+        }
+    }
+
+
+    @Override
+    public void getOtherRecordList() {
+        mModel.getOtherRecordList(mView.getActivity(), mView.getOtherUserId(), new Callback() {
+            @Override
+            public void onSuccess(HttpInfo info) throws IOException {
+                HttpResultBean<HttpResultDataListBean<UserRecordBean>> bean = info.getRetDetail(new TypeToken<HttpResultBean<HttpResultDataListBean<UserRecordBean>>>() {
+                }.getType());
+                if (bean.getSuccess() && bean.getCode().equals("200")) {
+                    if (mDataList == null || mDataList.size() <= 0) {
+                        mDataList = bean.getData().getList();
+                        mTotalSize = Integer.valueOf(bean.getData().getTotalSize());
+                        mView.getOtherRecordSuccess();
+                    } else {
+                        mView.getRootView().post(new Runnable() {
+                            @Override
+                            public void run() {
+                                mDataList = bean.getData().getList();
+                                if (mTotalSize < endIndex) {
+                                    endIndex = mTotalSize;
+                                }
+                                List<UserRecordBean> list = new ArrayList<>();
+                                for (int i = 0; i < endIndex; i++) {
+                                    list.add(mDataList.get(i));
+                                }
+                                mOthersRecordAdapter.setNewList(list);
+                                mOthersRecordAdapter.notifyDataSetChanged();
+                            }
+                        });
+                    }
+                }
+
+            }
+
+            @Override
+            public void onFailure(HttpInfo info) throws IOException {
+
+            }
+        });
+    }
+
+    @Override
+    public void doFollow(String uid) {
+        Map<String, String> map = new HashMap<>();
+        map.put("uid", uid);
+        String json = ((BaseActivity) mView.getActivity()).getGson().toJson(map);
+        mModel.doFollow(mView.getActivity(), json, new Callback() {
+            @RequiresApi(api = Build.VERSION_CODES.N)
+            @Override
+            public void onSuccess(HttpInfo info) throws IOException {
+                HttpResultBean<FansBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<FansBean>>() {
+                }.getType());
+                if (bean.getData().getStatus().equals("NORMAL")) {
+                    //已关注状态
+                    mView.doFollowSuccess(true);
+
+                    setFans(true);
+                } else if (bean.getData().getStatus().equals("DEL")) {
+                    //未关注状态
+                    mView.doFollowSuccess(false);
+                    setFans(false);
+                }
+                getOtherUserInfo(uid);
+            }
+
+            @Override
+            public void onFailure(HttpInfo info) throws IOException {
+            }
+        });
+    }
+
+    public void setFans(boolean fans) {
+        for (int i = 0; i < mDataList.size(); i++) {
+            mDataList.get(i).setFans(fans);
+        }
+    }
+
+    @Override
+    public void sendBackReceiver(String action) {
+        Intent intent = new Intent(action);
+        intent.putExtra("recordId", backRecordId);
+        mView.getActivity().sendBroadcast(intent);
+    }
+
+    @Override
+    public void setBackRecordId(String id) {
+        backRecordId = id;
+    }
+
+    @Override
+    public void onDestory(RecyclerView layout) {
+        layout.removeAllViews();
+        layout = null;
+        mView = null;
+    }
+
+    @Override
+    public void getOtherUserInfo(String uid) {
+        mUserApi.getOtherUserInfo(mView.getActivity(), uid, new Callback() {
+            @Override
+            public void onSuccess(HttpInfo info) throws IOException {
+                HttpResultBean<MyInfoBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<MyInfoBean>>() {
+                }.getType());
+                mView.setLeftUserInfo(bean.getData());
+            }
+
+            @Override
+            public void onFailure(HttpInfo info) throws IOException {
+
+            }
+        });
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
+        switch (requestCode) {
+            case START_SMALLFULLVIDEO:
+                getOtherRecordList();
+                break;
+        }
+    }
+}

+ 0 - 1
app/src/main/java/com/edufound/reader/presenter/RecommendFragmentPresenter.java

@@ -416,7 +416,6 @@ public class RecommendFragmentPresenter extends BasePresenter<RecommendFragmentC
         mModel.getRecordInfoById(mView.getActivity(), id, new Callback() {
             @Override
             public void onSuccess(HttpInfo info) throws IOException {
-                Logger.e("获取单独的成功了");
                 HttpResultBean<UserRecordBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<UserRecordBean>>() {
                 }.getType());
                 mDataList.set(mCurrentPosition, bean.getData());

+ 2 - 1
app/src/main/java/com/edufound/reader/util/Consts.java

@@ -160,7 +160,8 @@ public class Consts {
 
         if (isDebug) {
             //测试环境
-            FinalApiUrl = "http://reader-api.efunbox.cn";
+//            FinalApiUrl = "http://reader-api.efunbox.cn";
+            FinalApiUrl = "https://reader-xiaoai-api.ai160.com";
         } else {
             FinalApiUrl = "https://reader-xiaoai-api.ai160.com";
         }

+ 3 - 1
app/src/main/java/com/edufound/reader/videoutil/JZMediaIjk.java

@@ -106,7 +106,9 @@ public class JZMediaIjk extends JZMediaInterface implements IMediaPlayer.OnPrepa
 
     @Override
     public void pause() {
-        ijkMediaPlayer.pause();
+        if (ijkMediaPlayer != null) {
+            ijkMediaPlayer.pause();
+        }
     }
 
     @Override

+ 195 - 184
app/src/main/res/layout/activity_otherrecord.xml

@@ -1,228 +1,230 @@
 <?xml version="1.0" encoding="utf-8"?>
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
-        xmlns:app="http://schemas.android.com/apk/res-auto"
-        xmlns:tools="http://schemas.android.com/tools"
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:background="#70C1FF">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#70C1FF">
 
 
     <FrameLayout
-            android:id="@+id/background"
-            android:layout_width="1280dp"
-            android:layout_height="720dp"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent"></FrameLayout>
+        android:id="@+id/background"
+        android:layout_width="1280dp"
+        android:layout_height="720dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent"></FrameLayout>
 
 
     <FrameLayout
-            android:layout_width="1280dp"
-            android:layout_height="720dp"
-            android:orientation="vertical"
-            android:paddingBottom="41dp"
-            app:layout_constraintBottom_toBottomOf="parent"
-            app:layout_constraintDimensionRatio="h,16:9"
-            app:layout_constraintEnd_toEndOf="parent"
-            app:layout_constraintStart_toStartOf="parent"
-            app:layout_constraintTop_toTopOf="parent">
+        android:layout_width="1280dp"
+        android:layout_height="720dp"
+        android:orientation="vertical"
+        android:paddingBottom="41dp"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintDimensionRatio="h,16:9"
+        app:layout_constraintEnd_toEndOf="parent"
+        app:layout_constraintStart_toStartOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
 
 
         <HorizontalScrollView
-                android:id="@+id/activity_otherrecord_scroll"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:scrollbars="none">
+            android:id="@+id/activity_otherrecord_scroll"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:fillViewport="true"
+            android:focusableInTouchMode="true"
+            android:scrollbars="none">
 
 
             <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="match_parent"
-                    android:layout_marginLeft="60dp"
-                    android:orientation="horizontal">
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="60dp"
+                android:orientation="horizontal">
 
                 <FrameLayout
-                        android:layout_width="214dp"
-                        android:layout_height="match_parent"
-                        android:layout_marginTop="57dp"
-                        android:layout_marginBottom="10dp">
+                    android:layout_width="214dp"
+                    android:layout_height="match_parent"
+                    android:layout_marginTop="57dp"
+                    android:layout_marginBottom="10dp">
 
                     <com.edufound.reader.cusview.RoundFrameLayout
-                            android:layout_width="match_parent"
-                            android:layout_height="match_parent"
-                            android:background="@color/white"
-                            android:paddingTop="15dp">
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:background="@color/white"
+                        android:paddingTop="15dp">
 
                         <LinearLayout
-                                android:layout_width="match_parent"
-                                android:layout_height="match_parent"
-                                android:layout_marginBottom="10dp"
-                                android:orientation="vertical">
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:layout_marginBottom="10dp"
+                            android:orientation="vertical">
 
                             <FrameLayout
-                                    android:layout_width="match_parent"
-                                    android:layout_height="0dp"
-                                    android:layout_weight="1.3">
+                                android:layout_width="match_parent"
+                                android:layout_height="0dp"
+                                android:layout_weight="1.3">
 
                                 <LinearLayout
-                                        android:layout_width="match_parent"
-                                        android:layout_height="match_parent"
-                                        android:layout_gravity="center"
-                                        android:gravity="center"
-                                        android:orientation="vertical">
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent"
+                                    android:layout_gravity="center"
+                                    android:gravity="center"
+                                    android:orientation="vertical">
 
                                     <FrameLayout
-                                            android:layout_width="100dp"
-                                            android:layout_height="100dp"
-                                            android:background="@drawable/fragment_recommend_userhead">
+                                        android:layout_width="100dp"
+                                        android:layout_height="100dp"
+                                        android:background="@drawable/fragment_recommend_userhead">
 
                                         <ImageView
-                                                android:id="@+id/activity_otherrecord_userhead"
-                                                android:layout_width="match_parent"
-                                                android:layout_height="match_parent"
-                                                android:padding="5dp"></ImageView>
+                                            android:id="@+id/activity_otherrecord_userhead"
+                                            android:layout_width="match_parent"
+                                            android:layout_height="match_parent"
+                                            android:padding="5dp"></ImageView>
                                     </FrameLayout>
 
                                     <TextView
-                                            android:id="@+id/activity_otherrecord_username"
-                                            android:layout_width="match_parent"
-                                            android:layout_height="37dp"
-                                            android:layout_marginTop="4dp"
-                                            android:alpha="0.6"
-                                            android:gravity="center"
-                                            android:text=""
-                                            android:textColor="@color/black"
-                                            android:textSize="26dp"></TextView>
+                                        android:id="@+id/activity_otherrecord_username"
+                                        android:layout_width="match_parent"
+                                        android:layout_height="37dp"
+                                        android:layout_marginTop="4dp"
+                                        android:alpha="0.6"
+                                        android:gravity="center"
+                                        android:text=""
+                                        android:textColor="@color/black"
+                                        android:textSize="26dp"></TextView>
                                 </LinearLayout>
                             </FrameLayout>
 
                             <FrameLayout
-                                    android:layout_width="match_parent"
-                                    android:layout_height="0dp"
-                                    android:layout_weight="1">
+                                android:layout_width="match_parent"
+                                android:layout_height="0dp"
+                                android:layout_weight="1">
 
                                 <FrameLayout
-                                        android:id="@+id/activity_otherrecord_isfans"
-                                        android:layout_width="165dp"
-                                        android:layout_height="66dp"
-                                        android:layout_gravity="center">
+                                    android:id="@+id/activity_otherrecord_isfans"
+                                    android:layout_width="165dp"
+                                    android:layout_height="66dp"
+                                    android:layout_gravity="center">
 
 
                                     <ImageView
-                                            android:id="@+id/activity_otherrecord_isfans_img"
-                                            android:layout_width="match_parent"
-                                            android:layout_height="match_parent"
-                                            android:layout_gravity="center"></ImageView>
+                                        android:id="@+id/activity_otherrecord_isfans_img"
+                                        android:layout_width="match_parent"
+                                        android:layout_height="match_parent"
+                                        android:layout_gravity="center"></ImageView>
                                 </FrameLayout>
                             </FrameLayout>
 
                             <FrameLayout
-                                    android:layout_width="match_parent"
-                                    android:layout_height="0dp"
-                                    android:layout_weight="1">
+                                android:layout_width="match_parent"
+                                android:layout_height="0dp"
+                                android:layout_weight="1">
 
                                 <LinearLayout
-                                        android:layout_width="match_parent"
-                                        android:layout_height="match_parent"
-                                        android:layout_gravity="center"
-                                        android:gravity="center"
-                                        android:orientation="vertical">
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent"
+                                    android:layout_gravity="center"
+                                    android:gravity="center"
+                                    android:orientation="vertical">
 
                                     <TextView
-                                            android:layout_width="wrap_content"
-                                            android:layout_height="wrap_content"
-                                            android:alpha="0.6"
-                                            android:text="粉丝"
-                                            android:textColor="@color/black"
-                                            android:textSize="28dp"></TextView>
+                                        android:layout_width="wrap_content"
+                                        android:layout_height="wrap_content"
+                                        android:alpha="0.6"
+                                        android:text="粉丝"
+                                        android:textColor="@color/black"
+                                        android:textSize="28dp"></TextView>
 
                                     <TextView
-                                            android:id="@+id/activity_otherrecord_fans_count"
-                                            android:layout_width="wrap_content"
-                                            android:layout_height="wrap_content"
-                                            android:alpha="0.6"
-                                            android:text="0"
-                                            android:textColor="@color/black"
-                                            android:textSize="28dp"></TextView>
+                                        android:id="@+id/activity_otherrecord_fans_count"
+                                        android:layout_width="wrap_content"
+                                        android:layout_height="wrap_content"
+                                        android:alpha="0.6"
+                                        android:text="0"
+                                        android:textColor="@color/black"
+                                        android:textSize="28dp"></TextView>
                                 </LinearLayout>
 
                                 <FrameLayout
-                                        android:layout_width="match_parent"
-                                        android:layout_height="1dp"
-                                        android:layout_gravity="bottom"
-                                        android:layout_marginLeft="23dp"
-                                        android:layout_marginRight="23dp"
-                                        android:background="#EEEEEE"></FrameLayout>
+                                    android:layout_width="match_parent"
+                                    android:layout_height="1dp"
+                                    android:layout_gravity="bottom"
+                                    android:layout_marginLeft="23dp"
+                                    android:layout_marginRight="23dp"
+                                    android:background="#EEEEEE"></FrameLayout>
                             </FrameLayout>
 
                             <FrameLayout
-                                    android:layout_width="match_parent"
-                                    android:layout_height="0dp"
-                                    android:layout_weight="1">
+                                android:layout_width="match_parent"
+                                android:layout_height="0dp"
+                                android:layout_weight="1">
 
                                 <LinearLayout
-                                        android:layout_width="match_parent"
-                                        android:layout_height="match_parent"
-                                        android:layout_gravity="center"
-                                        android:gravity="center"
-                                        android:orientation="vertical">
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent"
+                                    android:layout_gravity="center"
+                                    android:gravity="center"
+                                    android:orientation="vertical">
 
                                     <TextView
-                                            android:layout_width="wrap_content"
-                                            android:layout_height="wrap_content"
-                                            android:alpha="0.6"
-                                            android:text="小红花"
-                                            android:textColor="@color/black"
-                                            android:textSize="28dp"></TextView>
+                                        android:layout_width="wrap_content"
+                                        android:layout_height="wrap_content"
+                                        android:alpha="0.6"
+                                        android:text="小红花"
+                                        android:textColor="@color/black"
+                                        android:textSize="28dp"></TextView>
 
                                     <TextView
-                                            android:id="@+id/activity_otherrecord_flower_count"
-                                            android:layout_width="wrap_content"
-                                            android:layout_height="wrap_content"
-                                            android:alpha="0.6"
-                                            android:text="0"
-                                            android:textColor="@color/black"
-                                            android:textSize="28dp"></TextView>
+                                        android:id="@+id/activity_otherrecord_flower_count"
+                                        android:layout_width="wrap_content"
+                                        android:layout_height="wrap_content"
+                                        android:alpha="0.6"
+                                        android:text="0"
+                                        android:textColor="@color/black"
+                                        android:textSize="28dp"></TextView>
                                 </LinearLayout>
 
                                 <FrameLayout
-                                        android:layout_width="match_parent"
-                                        android:layout_height="1dp"
-                                        android:layout_gravity="bottom"
-                                        android:layout_marginLeft="23dp"
-                                        android:layout_marginRight="23dp"
-                                        android:background="#EEEEEE"></FrameLayout>
+                                    android:layout_width="match_parent"
+                                    android:layout_height="1dp"
+                                    android:layout_gravity="bottom"
+                                    android:layout_marginLeft="23dp"
+                                    android:layout_marginRight="23dp"
+                                    android:background="#EEEEEE"></FrameLayout>
                             </FrameLayout>
 
                             <FrameLayout
-                                    android:layout_width="match_parent"
-                                    android:layout_height="0dp"
-                                    android:layout_weight="1">
+                                android:layout_width="match_parent"
+                                android:layout_height="0dp"
+                                android:layout_weight="1">
 
                                 <LinearLayout
-                                        android:layout_width="match_parent"
-                                        android:layout_height="match_parent"
-                                        android:layout_gravity="center"
-                                        android:gravity="center"
-                                        android:orientation="vertical">
+                                    android:layout_width="match_parent"
+                                    android:layout_height="match_parent"
+                                    android:layout_gravity="center"
+                                    android:gravity="center"
+                                    android:orientation="vertical">
 
                                     <TextView
-                                            android:layout_width="wrap_content"
-                                            android:layout_height="wrap_content"
-                                            android:alpha="0.6"
-                                            android:text="观看量"
-                                            android:textColor="@color/black"
-                                            android:textSize="28dp"></TextView>
+                                        android:layout_width="wrap_content"
+                                        android:layout_height="wrap_content"
+                                        android:alpha="0.6"
+                                        android:text="观看量"
+                                        android:textColor="@color/black"
+                                        android:textSize="28dp"></TextView>
 
                                     <TextView
-                                            android:id="@+id/activity_otherrecord_look_count"
-                                            android:layout_width="wrap_content"
-                                            android:layout_height="wrap_content"
-                                            android:alpha="0.6"
-                                            android:text="0"
-                                            android:textColor="@color/black"
-                                            android:textSize="28dp"></TextView>
+                                        android:id="@+id/activity_otherrecord_look_count"
+                                        android:layout_width="wrap_content"
+                                        android:layout_height="wrap_content"
+                                        android:alpha="0.6"
+                                        android:text="0"
+                                        android:textColor="@color/black"
+                                        android:textSize="28dp"></TextView>
                                 </LinearLayout>
 
                             </FrameLayout>
@@ -233,59 +235,68 @@
 
 
                 <LinearLayout
-                        android:layout_width="match_parent"
-                        android:layout_height="match_parent"
-                        android:orientation="vertical"
-                        android:paddingLeft="50dp"
-                        android:paddingTop="20dp">
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:descendantFocusability="blocksDescendants"
+                    android:orientation="vertical"
+                    android:paddingLeft="50dp"
+                    android:paddingTop="20dp">
 
                     <TextView
-                            android:id="@+id/activity_otherrecord_allcount"
-                            android:layout_width="match_parent"
-                            android:layout_height="wrap_content"
-                            android:gravity="center|left"
-                            android:paddingLeft="10dp"
-                            android:text="作品:0"
-                            android:textColor="@color/white"
-                            android:textSize="26dp"></TextView>
+                        android:id="@+id/activity_otherrecord_allcount"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:gravity="center|left"
+                        android:paddingLeft="10dp"
+                        android:text="作品:0"
+                        android:textColor="@color/white"
+                        android:textSize="26dp"></TextView>
 
 
                     <FrameLayout
-                            android:id="@+id/activity_otherrecord_norecord"
-                            android:layout_width="930dp"
-                            android:layout_height="match_parent"
-                            android:visibility="gone">
+                        android:id="@+id/activity_otherrecord_norecord"
+                        android:layout_width="930dp"
+                        android:layout_height="match_parent"
+                        android:visibility="gone">
 
                         <ImageView
-                                android:layout_width="wrap_content"
-                                android:layout_height="wrap_content"
-                                android:layout_gravity="center"
-                                android:src="@drawable/fragment_user_no_record"></ImageView>
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center"
+                            android:src="@drawable/fragment_user_no_record"></ImageView>
                     </FrameLayout>
 
-                    <GridLayout
+                    <RelativeLayout
+                        android:layout_width="wrap_content"
+                        android:layout_height="match_parent"
+                        android:descendantFocusability="blocksDescendants">
+
+                        <androidx.recyclerview.widget.RecyclerView
                             android:id="@+id/activity_otherrecord_gridlayout"
                             android:layout_width="match_parent"
                             android:layout_height="match_parent"
                             android:layout_gravity="center"
-                            android:orientation="vertical"></GridLayout>
+                            android:orientation="horizontal"></androidx.recyclerview.widget.RecyclerView>
+                    </RelativeLayout>
+
+
                 </LinearLayout>
 
                 <Space
-                        android:id="@+id/activity_otherrecord_bottomview"
-                        android:layout_width="100dp"
-                        android:layout_height="match_parent"></Space>
+                    android:id="@+id/activity_otherrecord_bottomview"
+                    android:layout_width="100dp"
+                    android:layout_height="match_parent"></Space>
             </LinearLayout>
         </HorizontalScrollView>
 
         <ImageView
-                android:id="@+id/activity_otherrecord_back"
-                android:layout_width="77dp"
-                android:layout_height="77dp"
-                android:layout_gravity="left|top"
-                android:layout_marginLeft="32dp"
-                android:layout_marginTop="20dp"
-                android:src="@drawable/main_back"></ImageView>
+            android:id="@+id/activity_otherrecord_back"
+            android:layout_width="77dp"
+            android:layout_height="77dp"
+            android:layout_gravity="left|top"
+            android:layout_marginLeft="32dp"
+            android:layout_marginTop="20dp"
+            android:src="@drawable/main_back"></ImageView>
 
     </FrameLayout>