From b2f35fdc16d3adc5a2b0c4a0f4121db9930187ef Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Fri, 31 Mar 2023 17:52:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B1=AA=E6=B0=94=E6=A6=9C?= =?UTF-8?q?=E7=A5=9E=E7=A7=98=E4=BA=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.gradle | 4 +- .../views/AbsMainListChildViewHolder.java | 44 +++++++++++++------ .../views/MainListContributeViewHolder.java | 3 +- .../main/views/MainListProfitViewHolder.java | 3 +- 4 files changed, 35 insertions(+), 19 deletions(-) diff --git a/config.gradle b/config.gradle index 2285dc3eb..59ac79f7b 100644 --- a/config.gradle +++ b/config.gradle @@ -9,9 +9,9 @@ ext { ] manifestPlaceholders = [ //正式、 -// serverHost : "https://napi.yaoulive.com", + serverHost : "https://napi.yaoulive.com", //测试 - serverHost : "https://ceshi.yaoulive.com", +// serverHost : "https://ceshi.yaoulive.com", //腾讯地图 txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", diff --git a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java index fd4ac7921..72dd7d5db 100644 --- a/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/AbsMainListChildViewHolder.java @@ -1,11 +1,7 @@ package com.yunbao.main.views; import android.content.Context; - -import androidx.recyclerview.widget.LinearLayoutManager; - import android.graphics.Color; -import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.util.Log; import android.view.View; @@ -13,6 +9,8 @@ import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; +import androidx.recyclerview.widget.LinearLayoutManager; + import com.alibaba.fastjson.JSON; import com.google.android.material.appbar.AppBarLayout; import com.google.android.material.appbar.CollapsingToolbarLayout; @@ -29,14 +27,12 @@ import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.HttpCallback; import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.OnItemClickListener; -import com.yunbao.common.manager.NoviceInstructorManager; import com.yunbao.common.utils.CommonIconUtil; import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.SVGAViewUtils; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; import com.yunbao.common.views.AbsMainViewHolder; -import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.presenter.LiveRoomCheckLivePresenter; import com.yunbao.main.R; @@ -91,14 +87,34 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple hv = new HeadView(rootView); mRefreshView.setEmptyLayoutId(R.layout.view_no_data_list); mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); - loadData = list -> { - Log.i("测试", "onData: " + list.size()); - for (int i = 0; i < list.size(); i++) { - if (i < 3) { - hv.setData(list.get(i), i); + loadData = new OnLoadData() { + @Override + public void onData(List list, List outRankHide) { + for (int i = 0; i < list.size(); i++) { + if (outRankHide != null) { + for (String hideId : outRankHide) { + if (i < 3) { + hv.setData(list.get(i).setHide(TextUtils.equals(list.get(i).getUid(), hideId)), i); + } + } + } else { + if (i < 3) { + hv.setData(list.get(i), i); + } + } + } } }; +// list -> { +// Log.i("测试", "onData: " + list.size()); +// for (int i = 0; i < list.size(); i++) { +// if (i < 3) { +// +// hv.setData(list.get(i), i); +// } +// } +// }; rootView.addOnOffsetChangedListener(new AppBarLayout.BaseOnOffsetChangedListener() { @Override public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) { @@ -151,7 +167,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); } @Override @@ -206,7 +222,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple } public interface OnLoadData { - void onData(List list); + void onData(List list, List outRankHide); } public interface OnAppbarListener { @@ -372,7 +388,7 @@ public abstract class AbsMainListChildViewHolder extends AbsMainViewHolder imple new LiveRoomCheckLivePresenter(mContext, liveBean.getUid(), liveBean.getStream(), new LiveRoomCheckLivePresenter.NewActionListener() { @Override public void onLiveRoomChanged(String liveUid, String stream, int liveType, String liveTypeVal, String liveSdk) { - RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); + RouteUtil.forwardLiveAudienceActivity(liveBean, liveType, Integer.parseInt(liveSdk), Integer.parseInt(liveTypeVal)); } @Override diff --git a/main/src/main/java/com/yunbao/main/views/MainListContributeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainListContributeViewHolder.java index 5b9564b23..dc8a0d293 100644 --- a/main/src/main/java/com/yunbao/main/views/MainListContributeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainListContributeViewHolder.java @@ -57,9 +57,10 @@ public class MainListContributeViewHolder extends AbsMainListChildViewHolder { list = JSON.parseArray(Arrays.toString(info), ListBean.class); if (mRefreshView.getPageCount() == 1) { if (loadData != null) { - loadData.onData(list); + loadData.onData(list,outRankHide); } } + mAdapter.setHide(outRankHide); return list; } diff --git a/main/src/main/java/com/yunbao/main/views/MainListProfitViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainListProfitViewHolder.java index 3e0419f45..cb9b1c49c 100644 --- a/main/src/main/java/com/yunbao/main/views/MainListProfitViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainListProfitViewHolder.java @@ -7,7 +7,6 @@ import com.alibaba.fastjson.JSON; import com.yunbao.common.adapter.RefreshAdapter; import com.yunbao.common.custom.CommonRefreshView; import com.yunbao.common.http.HttpCallback; -import com.yunbao.common.utils.ToastUtil; import com.yunbao.main.adapter.MainListAdapter; import com.yunbao.main.bean.ListBean; import com.yunbao.main.http.MainHttpConsts; @@ -54,7 +53,7 @@ public class MainListProfitViewHolder extends AbsMainListChildViewHolder { list = JSON.parseArray(Arrays.toString(info), ListBean.class); if (mRefreshView.getPageCount() == 1) { if (loadData != null) { - loadData.onData(list); + loadData.onData(list, null); } } return list;