Bladeren bron

修改首页达人风采数据问题

Pq 2 jaren geleden
bovenliggende
commit
6698a92329

+ 1 - 1
student/src/main/java/com/cooleshow/student/adapter/HomeTalentStyleAdapter.java

@@ -42,7 +42,7 @@ public class HomeTalentStyleAdapter extends BaseQuickAdapter<HomeStyleBean.RowsB
             layoutParams.height = normal_img_height;
         }
         coverImagView.setLayoutParams(layoutParams);
-        boolean isLiving = TextUtils.equals(data.liveing, "1");
+        boolean isLiving = TextUtils.equals(data.liveStatus, "1");
         //封面
         GlideUtils.INSTANCE.loadTopRoundImage(getContext(), isLiving ? data.liveCoverImg : data.cover, coverImagView, 10, com.cooleshow.base.R.drawable.bg_video_placeholder);
         //直播标题

+ 1 - 0
student/src/main/java/com/cooleshow/student/bean/HomeStyleBean.java

@@ -58,6 +58,7 @@ public class HomeStyleBean {
         public String cover;
         public String liveCoverImg;
         public String liveTitle;
+        public String liveStatus;
         public String roomUid;
     }
 }

+ 11 - 4
student/src/main/java/com/cooleshow/student/ui/main/TalentStyleFragment.java

@@ -1,16 +1,19 @@
 package com.cooleshow.student.ui.main;
 
+import android.text.TextUtils;
 import android.view.View;
 
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemClickListener;
 import com.cooleshow.base.common.WebConstants;
+import com.cooleshow.base.constanst.Constants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.fragment.BaseFragment;
 import com.cooleshow.student.adapter.HomeTalentStyleAdapter;
 import com.cooleshow.student.bean.HomeStyleBean;
 import com.cooleshow.student.databinding.FragmentHomeTalentLayoutBinding;
+import com.cooleshow.student.ui.live.LiveRoomActivity;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -47,10 +50,14 @@ public class TalentStyleFragment extends BaseFragment<FragmentHomeTalentLayoutBi
             public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
                 if (position < mTalentStyleAdapter.getData().size()) {
                     HomeStyleBean.RowsBean item = mTalentStyleAdapter.getData().get(position);
-                    ARouter.getInstance()
-                            .build(RouterPath.WebCenter.ACTIVITY_HTML)
-                            .withString(WebConstants.WEB_URL, WebConstants.STUDENT_TEACHER_HOME + item.userId)
-                            .navigation();
+                    if (TextUtils.equals(item.liveStatus, Constants.ON_LIVING_TAG)) {
+                        LiveRoomActivity.startLiveRoomActivity(getContext(), item.roomUid);
+                    } else {
+                        ARouter.getInstance()
+                                .build(RouterPath.WebCenter.ACTIVITY_HTML)
+                                .withString(WebConstants.WEB_URL, WebConstants.STUDENT_TEACHER_HOME + item.userId)
+                                .navigation();
+                    }
                 }
             }
         });