新增搜索主播等级标志,
This commit is contained in:
@@ -15,17 +15,21 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.WordsTypeUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.main.R;
|
||||
import com.yunbao.main.event.JumpUserHomeEvent;
|
||||
import com.yunbao.common.utils.WordsTypeUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView avatar, isLive, sex, focusOn, contribute;
|
||||
private TextView nickName;
|
||||
private TextView nickName, leave;
|
||||
private LinearLayout nickLayout;
|
||||
private RelativeLayout avatarLayout;
|
||||
private SearchModel model;
|
||||
@@ -41,6 +45,7 @@ public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
|
||||
super(itemView);
|
||||
avatar = itemView.findViewById(R.id.avatar);
|
||||
isLive = itemView.findViewById(R.id.is_live);
|
||||
leave = itemView.findViewById(R.id.leave);
|
||||
sex = itemView.findViewById(R.id.sex);
|
||||
focusOn = itemView.findViewById(R.id.focus_on);
|
||||
nickName = itemView.findViewById(R.id.nick_name);
|
||||
@@ -76,11 +81,21 @@ public class SearchResultsViewHolder extends RecyclerView.ViewHolder {
|
||||
}
|
||||
isLive.setVisibility(View.GONE);
|
||||
} else {
|
||||
LevelBean anchorLevelBean = CommonAppConfig.getInstance().getAnchorLevel(Integer.parseInt(model.getLevelAnchor()));
|
||||
if (anchorLevelBean != null) {
|
||||
ImgLoader.display(isLive.getContext(), CommonAppConfig.getInstance().HOST + anchorLevelBean.getThumb(), contribute);
|
||||
List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
|
||||
if (!TextUtils.isEmpty(model.getLevelAnchor())) {
|
||||
anchorLevel = Integer.parseInt(model.getLevelAnchor());
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
leave.setText(model.getLevelAnchor());
|
||||
ImgLoader.display(itemView.getContext(), imgUrl, contribute);
|
||||
}
|
||||
isLive.setVisibility(model.getIslive() == 0 ? View.GONE : View.VISIBLE);
|
||||
|
||||
}
|
||||
|
||||
if (model.getSex() == 2) {
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="55dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_height="55dp" />
|
||||
android:layout_height="55dp"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/is_live"
|
||||
@@ -52,11 +52,27 @@
|
||||
android:layout_height="19dp"
|
||||
android:src="@mipmap/icon_sex_female_1" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contribute"
|
||||
<FrameLayout
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp" />
|
||||
android:layout_height="19dp">
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/contribute"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp" />
|
||||
<TextView
|
||||
android:id="@+id/leave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="28dp"
|
||||
android:textStyle="bold"
|
||||
android:textSize="10sp" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user