46 lines
1.7 KiB
Java
46 lines
1.7 KiB
Java
package com.yunbao.common.views;
|
|
|
|
import android.content.Context;
|
|
import android.view.View;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.recyclerview.widget.GridLayoutManager;
|
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
import com.yunbao.common.R;
|
|
import com.yunbao.common.adapter.LiveNewRoleInteractionGamesAdapter;
|
|
import com.yunbao.common.bean.CustomSidebarChildModel;
|
|
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
|
|
|
import java.util.List;
|
|
|
|
public class LiveNewRoleInteractionGamesViewHolder extends RecyclerView.ViewHolder {
|
|
private LiveNewRoleInteractionGamesAdapter funGamesAdapter;
|
|
private TextView sendGoodGift;
|
|
private RecyclerView childList;
|
|
private ImageView selectMoreIcon;
|
|
boolean isShowMore = true;
|
|
public LiveNewRoleInteractionGamesViewHolder(@NonNull View itemView, Context context) {
|
|
super(itemView);
|
|
sendGoodGift = itemView.findViewById(R.id.send_good_gift);
|
|
childList = itemView.findViewById(R.id.child_list);
|
|
selectMoreIcon = itemView.findViewById(R.id.select_more_icon);
|
|
funGamesAdapter = new LiveNewRoleInteractionGamesAdapter(itemView.getContext(), true);
|
|
LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false);
|
|
childList.setLayoutManager(layoutManager);
|
|
childList.setAdapter(funGamesAdapter);
|
|
|
|
}
|
|
|
|
public void setData(CustomSidebarInfoModel model) {
|
|
List<CustomSidebarChildModel> sidebarChildModels = model.getChild();
|
|
sendGoodGift.setText(model.getTitle());
|
|
funGamesAdapter.updateData(sidebarChildModels);
|
|
|
|
|
|
}
|
|
}
|