|
@@ -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();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|