From 80655a866251310a54009e3cb51ef62c91423ba8 Mon Sep 17 00:00:00 2001 From: 18401019693 Date: Sat, 8 Oct 2022 10:01:58 +0800 Subject: [PATCH] =?UTF-8?q?@=E6=B6=88=E6=81=AF=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/bean/OlineModel.java | 65 +++++ .../common/bean/OlineUserlistModel.java | 270 ++++++++++++++++++ common/src/main/res/values-en/strings.xml | 2 +- common/src/main/res/values/strings.xml | 5 + live/src/main/AndroidManifest.xml | 9 +- .../yunbao/live/activity/LiveActivity.java | 1 + .../yunbao/live/adapter/LiveChatAdapter.java | 4 +- .../yunbao/live/adapter/OlineListAdapter.java | 73 +++++ .../live/adapter/OlineListItemAdapter.java | 46 +++ .../live/dialog/LiveInputDialogFragment.java | 42 +-- .../yunbao/live/socket/SocketLinkMicUtil.java | 28 -- .../live/views/OlineAudienceViewHolder.java | 41 +++ .../yunbao/live/views/OlineListActivity.java | 86 ++++++ .../live/views/OlineListItemViewHolder.java | 33 +++ .../live/views/OlineNobleViewHolder.java | 41 +++ .../main/res/drawable/bg_search_input_2.xml | 5 + .../main/res/layout/acticity_oline_list.xml | 44 +++ .../res/layout/dialog_live_chat_input.xml | 21 +- live/src/main/res/layout/view_live_room.xml | 74 ++--- .../main/res/layout/view_oline_audience.xml | 24 ++ live/src/main/res/layout/view_oline_item.xml | 28 ++ .../main/res/mipmap-xxxhdpi/icon_emphasis.png | Bin 0 -> 4313 bytes ...view_anchor_search_results_item_holder.xml | 2 +- 23 files changed, 848 insertions(+), 96 deletions(-) create mode 100644 common/src/main/java/com/yunbao/common/bean/OlineModel.java create mode 100644 common/src/main/java/com/yunbao/common/bean/OlineUserlistModel.java create mode 100644 live/src/main/java/com/yunbao/live/adapter/OlineListAdapter.java create mode 100644 live/src/main/java/com/yunbao/live/adapter/OlineListItemAdapter.java create mode 100644 live/src/main/java/com/yunbao/live/views/OlineAudienceViewHolder.java create mode 100644 live/src/main/java/com/yunbao/live/views/OlineListActivity.java create mode 100644 live/src/main/java/com/yunbao/live/views/OlineListItemViewHolder.java create mode 100644 live/src/main/java/com/yunbao/live/views/OlineNobleViewHolder.java create mode 100644 live/src/main/res/drawable/bg_search_input_2.xml create mode 100644 live/src/main/res/layout/acticity_oline_list.xml create mode 100644 live/src/main/res/layout/view_oline_audience.xml create mode 100644 live/src/main/res/layout/view_oline_item.xml create mode 100644 live/src/main/res/mipmap-xxxhdpi/icon_emphasis.png diff --git a/common/src/main/java/com/yunbao/common/bean/OlineModel.java b/common/src/main/java/com/yunbao/common/bean/OlineModel.java new file mode 100644 index 000000000..139b3ce0e --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/OlineModel.java @@ -0,0 +1,65 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; +import java.util.List; + +public class OlineModel extends BaseModel { + + @SerializedName("userlist") + private List userlist = new ArrayList<>(); + @SerializedName("nums") + private String nums; + @SerializedName("medal_num") + private String medalNum; + @SerializedName("votestotal") + private String votestotal; + @SerializedName("medalRankNum") + private String medalRankNum; + + public List getUserlist() { + return userlist; + } + + public OlineModel setUserlist(List userlist) { + this.userlist = userlist; + return this; + } + + public String getNums() { + return nums; + } + + public OlineModel setNums(String nums) { + this.nums = nums; + return this; + } + + public String getMedalNum() { + return medalNum; + } + + public OlineModel setMedalNum(String medalNum) { + this.medalNum = medalNum; + return this; + } + + public String getVotestotal() { + return votestotal; + } + + public OlineModel setVotestotal(String votestotal) { + this.votestotal = votestotal; + return this; + } + + public String getMedalRankNum() { + return medalRankNum; + } + + public OlineModel setMedalRankNum(String medalRankNum) { + this.medalRankNum = medalRankNum; + return this; + } +} diff --git a/common/src/main/java/com/yunbao/common/bean/OlineUserlistModel.java b/common/src/main/java/com/yunbao/common/bean/OlineUserlistModel.java new file mode 100644 index 000000000..87f126f40 --- /dev/null +++ b/common/src/main/java/com/yunbao/common/bean/OlineUserlistModel.java @@ -0,0 +1,270 @@ +package com.yunbao.common.bean; + +import com.google.gson.annotations.SerializedName; + +public class OlineUserlistModel extends BaseModel { + @SerializedName("id") + private String id; + @SerializedName("user_nicename") + private String userNicename; + @SerializedName("avatar") + private String avatar; + @SerializedName("sex") + private String sex; + @SerializedName("noble_id") + private String nobleId; + @SerializedName("goodnum") + private String goodnum; + @SerializedName("is_guess") + private String isGuess; + @SerializedName("langue") + private String langue; + @SerializedName("goodnum_expire_time") + private String goodnumExpireTime; + @SerializedName("avatar2") + private String avatar2; + @SerializedName("version") + private String version; + @SerializedName("front_task") + private String frontTask; + @SerializedName("max_noble_end_time") + private String maxNobleEndTime; + @SerializedName("custom_color_id") + private String customColorId; + @SerializedName("is_chat") + private String isChat; + @SerializedName("level") + private String level; + @SerializedName("level_anchor") + private String levelAnchor; + @SerializedName("vip") + private VipModel vip; + @SerializedName("liang") + private LiangModel liang; + @SerializedName("medal_level") + private String medalLevel; + @SerializedName("medal_name") + private String medalName; + @SerializedName("contribution") + private String contribution; + @SerializedName("guard_type") + private String guardType; + @SerializedName("dress") + private DressModel dress; + + public String getId() { + return id; + } + + public OlineUserlistModel setId(String id) { + this.id = id; + return this; + } + + public String getUserNicename() { + return userNicename; + } + + public OlineUserlistModel setUserNicename(String userNicename) { + this.userNicename = userNicename; + return this; + } + + public String getAvatar() { + return avatar; + } + + public OlineUserlistModel setAvatar(String avatar) { + this.avatar = avatar; + return this; + } + + public String getSex() { + return sex; + } + + public OlineUserlistModel setSex(String sex) { + this.sex = sex; + return this; + } + + public String getNobleId() { + return nobleId; + } + + public OlineUserlistModel setNobleId(String nobleId) { + this.nobleId = nobleId; + return this; + } + + public String getGoodnum() { + return goodnum; + } + + public OlineUserlistModel setGoodnum(String goodnum) { + this.goodnum = goodnum; + return this; + } + + public String getIsGuess() { + return isGuess; + } + + public OlineUserlistModel setIsGuess(String isGuess) { + this.isGuess = isGuess; + return this; + } + + public String getLangue() { + return langue; + } + + public OlineUserlistModel setLangue(String langue) { + this.langue = langue; + return this; + } + + public String getGoodnumExpireTime() { + return goodnumExpireTime; + } + + public OlineUserlistModel setGoodnumExpireTime(String goodnumExpireTime) { + this.goodnumExpireTime = goodnumExpireTime; + return this; + } + + public String getAvatar2() { + return avatar2; + } + + public OlineUserlistModel setAvatar2(String avatar2) { + this.avatar2 = avatar2; + return this; + } + + public String getVersion() { + return version; + } + + public OlineUserlistModel setVersion(String version) { + this.version = version; + return this; + } + + public String getFrontTask() { + return frontTask; + } + + public OlineUserlistModel setFrontTask(String frontTask) { + this.frontTask = frontTask; + return this; + } + + public String getMaxNobleEndTime() { + return maxNobleEndTime; + } + + public OlineUserlistModel setMaxNobleEndTime(String maxNobleEndTime) { + this.maxNobleEndTime = maxNobleEndTime; + return this; + } + + public String getCustomColorId() { + return customColorId; + } + + public OlineUserlistModel setCustomColorId(String customColorId) { + this.customColorId = customColorId; + return this; + } + + public String getIsChat() { + return isChat; + } + + public OlineUserlistModel setIsChat(String isChat) { + this.isChat = isChat; + return this; + } + + public String getLevel() { + return level; + } + + public OlineUserlistModel setLevel(String level) { + this.level = level; + return this; + } + + public String getLevelAnchor() { + return levelAnchor; + } + + public OlineUserlistModel setLevelAnchor(String levelAnchor) { + this.levelAnchor = levelAnchor; + return this; + } + + public VipModel getVip() { + return vip; + } + + public OlineUserlistModel setVip(VipModel vip) { + this.vip = vip; + return this; + } + + public LiangModel getLiang() { + return liang; + } + + public OlineUserlistModel setLiang(LiangModel liang) { + this.liang = liang; + return this; + } + + public String getMedalLevel() { + return medalLevel; + } + + public OlineUserlistModel setMedalLevel(String medalLevel) { + this.medalLevel = medalLevel; + return this; + } + + public String getMedalName() { + return medalName; + } + + public OlineUserlistModel setMedalName(String medalName) { + this.medalName = medalName; + return this; + } + + public String getContribution() { + return contribution; + } + + public OlineUserlistModel setContribution(String contribution) { + this.contribution = contribution; + return this; + } + + public String getGuardType() { + return guardType; + } + + public OlineUserlistModel setGuardType(String guardType) { + this.guardType = guardType; + return this; + } + + public DressModel getDress() { + return dress; + } + + public OlineUserlistModel setDress(DressModel dress) { + this.dress = dress; + return this; + } +} diff --git a/common/src/main/res/values-en/strings.xml b/common/src/main/res/values-en/strings.xml index 7e5371430..dd4ce8222 100644 --- a/common/src/main/res/values-en/strings.xml +++ b/common/src/main/res/values-en/strings.xml @@ -859,7 +859,7 @@ Limited ride And limited avatar frame you may also like anchor More - Wonderful live + Live More Fun Games Value-added benefits diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 676a36515..8c0e2a226 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -914,6 +914,11 @@ 登錄失效,請重新登錄 滑動設置 上下滑動切換直播間 + \@用户昵称\t\t你好啊~ + 在线列表 + 搜索想要@的人 + 在線觀眾 + 觀眾 diff --git a/live/src/main/AndroidManifest.xml b/live/src/main/AndroidManifest.xml index 6740a04d5..e04abfdfa 100644 --- a/live/src/main/AndroidManifest.xml +++ b/live/src/main/AndroidManifest.xml @@ -6,7 +6,7 @@ android:allowBackup="true" android:theme="@style/AppTheme"> - + + android:windowSoftInputMode="stateAlwaysHidden|adjustResize" /> + android:theme="@style/DialogActivity" /> + \ No newline at end of file diff --git a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java index c01cf2387..1ec757e10 100644 --- a/live/src/main/java/com/yunbao/live/activity/LiveActivity.java +++ b/live/src/main/java/com/yunbao/live/activity/LiveActivity.java @@ -855,6 +855,7 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL bundle.putString(Constants.LIVE_DANMU_PRICE, mDanmuPrice); bundle.putString(Constants.COIN_NAME, mCoinName); bundle.putString(Constants.LIVE_UID, mLiveUid); + bundle.putString(Constants.LIVE_STREAM, mStream); bundle.putString(Constants.LIVE_UID, mLiveUid); fragment.setArguments(bundle); fragment.show(getSupportFragmentManager(), "LiveInputDialogFragment"); diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index 799363de0..336a4bb4d 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -289,7 +289,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { } else if (bean.getType() == LiveChatBean.SYSTEM) { boolean isContains = false; for (LiveChatBean model : mList) { - if (!TextUtils.isEmpty(model.getContent()) && model.getContent().contains("堅決維護青少年群體精神文明健康")) { + if (!TextUtils.isEmpty(model.getContent()) && (model.getContent().contains("堅決維護青少年群體精神文明健康")||model.getContent().contains("click to register if you like. pdlive conducts"))) { isContains = true; } } @@ -408,7 +408,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { public void scrollToBottom() { if (mList.size() > 0) { - mRecyclerView.smoothScrollToPosition(mList.size() - 1); + mRecyclerView.smoothScrollToPosition(getItemCount()); } } diff --git a/live/src/main/java/com/yunbao/live/adapter/OlineListAdapter.java b/live/src/main/java/com/yunbao/live/adapter/OlineListAdapter.java new file mode 100644 index 000000000..d67df15b1 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/OlineListAdapter.java @@ -0,0 +1,73 @@ +package com.yunbao.live.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.bean.OlineUserlistModel; +import com.yunbao.live.R; +import com.yunbao.live.views.OlineAudienceViewHolder; +import com.yunbao.live.views.OlineNobleViewHolder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class OlineListAdapter extends RecyclerView.Adapter { + + private int nobleType = 0; + + private int audienceType = 1; + + private List>> mapList = new ArrayList<>(); + + private Context mContext; + + public OlineListAdapter(Context mContext) { + this.mContext = mContext; + } + + public void addAll(List>> models) { + mapList.addAll(models); + notifyDataSetChanged(); + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + if (viewType == nobleType) { + return new OlineNobleViewHolder(LayoutInflater.from(mContext).inflate(R.layout.view_oline_audience, parent, false)); + } else { + return new OlineAudienceViewHolder(LayoutInflater.from(mContext).inflate(R.layout.view_oline_audience, parent, false)); + } + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + if (holder instanceof OlineNobleViewHolder) { + OlineNobleViewHolder nobleViewHolder = (OlineNobleViewHolder) holder; + nobleViewHolder.setData(mapList.get(position).get(nobleType)); + } else { + OlineAudienceViewHolder audienceViewHolder = (OlineAudienceViewHolder) holder; + audienceViewHolder.setData(mapList.get(position).get(audienceType)); + } + + } + + @Override + public int getItemViewType(int position) { + boolean isNoble = true; + for (int number : mapList.get(position).keySet()) { + isNoble = number == nobleType; + } + return isNoble ? nobleType : audienceType; + } + + @Override + public int getItemCount() { + return mapList.size(); + } +} diff --git a/live/src/main/java/com/yunbao/live/adapter/OlineListItemAdapter.java b/live/src/main/java/com/yunbao/live/adapter/OlineListItemAdapter.java new file mode 100644 index 000000000..46d58b235 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/adapter/OlineListItemAdapter.java @@ -0,0 +1,46 @@ +package com.yunbao.live.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.bean.OlineUserlistModel; +import com.yunbao.live.R; +import com.yunbao.live.views.OlineListItemViewHolder; + +import java.util.ArrayList; +import java.util.List; + +public class OlineListItemAdapter extends RecyclerView.Adapter { + private Context mContext; + private List models = new ArrayList<>(); + + public void addAll(List userlistModels) { + models.addAll(userlistModels); + notifyDataSetChanged(); + } + + public OlineListItemAdapter(Context mContext) { + this.mContext = mContext; + } + + @NonNull + @Override + public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + return new OlineListItemViewHolder(LayoutInflater.from(mContext).inflate(R.layout.view_oline_item, parent, false)); + } + + @Override + public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) { + OlineListItemViewHolder itemViewHolder = (OlineListItemViewHolder) holder; + itemViewHolder.setData(models.get(position)); + } + + @Override + public int getItemCount() { + return models.size(); + } +} diff --git a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java index 1ac176c7a..bb1e17c22 100644 --- a/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java +++ b/live/src/main/java/com/yunbao/live/dialog/LiveInputDialogFragment.java @@ -3,6 +3,7 @@ package com.yunbao.live.dialog; import static android.content.Context.INPUT_METHOD_SERVICE; import android.app.Activity; +import android.content.Intent; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -12,7 +13,6 @@ import android.text.TextUtils; import android.text.TextWatcher; import android.util.Log; import android.view.Gravity; -import android.view.KeyEvent; import android.view.View; import android.view.Window; import android.view.WindowManager; @@ -23,7 +23,6 @@ import android.widget.CompoundButton; import android.widget.EditText; import android.widget.RadioButton; import android.widget.RadioGroup; -import android.widget.TextView; import androidx.fragment.app.FragmentActivity; @@ -37,10 +36,11 @@ import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.WordUtil; +import com.yunbao.common.views.weight.ViewClicksAntiShake; import com.yunbao.live.R; import com.yunbao.live.activity.LiveActivity; -import com.yunbao.live.activity.LiveAnchorActivity; import com.yunbao.live.activity.LiveRyAnchorActivity; +import com.yunbao.live.views.OlineListActivity; import java.util.ArrayList; import java.util.List; @@ -94,6 +94,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O params.height = DpUtil.dp2px(100); params.gravity = Gravity.BOTTOM; window.setAttributes(params); + } @Override @@ -103,6 +104,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O imm = (InputMethodManager) mContext.getSystemService(INPUT_METHOD_SERVICE); mInput = (EditText) mRootView.findViewById(R.id.input); radioHornType = mRootView.findViewById(R.id.radio_horn_type); + for (int id : radioList) { RadioButton radioButton = mRootView.findViewById(id); radioHornTypes.add(radioButton); @@ -116,15 +118,12 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O mInput.setFocusableInTouchMode(true); mInput.requestFocus(); - mInput.setOnEditorActionListener(new TextView.OnEditorActionListener() { - @Override - public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { - if (actionId == EditorInfo.IME_ACTION_SEND) { - sendMessage(); - return true; - } - return false; + mInput.setOnEditorActionListener((v, actionId, event) -> { + if (actionId == EditorInfo.IME_ACTION_SEND) { + sendMessage(); + return true; } + return false; }); mInput.addTextChangedListener(new TextWatcher() { @Override @@ -146,13 +145,10 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O } }); - mInput.postDelayed(new Runnable() { - @Override - public void run() { - //软键盘弹出 - imm.showSoftInput(mInput, InputMethodManager.SHOW_FORCED); - mInput.requestFocus(); - } + mInput.postDelayed(() -> { + //软键盘弹出 + imm.showSoftInput(mInput, InputMethodManager.SHOW_FORCED); + mInput.requestFocus(); }, 200); mCheckBox = (CheckBox) mRootView.findViewById(R.id.danmu); mMyRadioButton = (MyRadioButton) mRootView.findViewById(R.id.btn_send); @@ -180,6 +176,16 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O radioHornType.setOnCheckedChangeListener(changeListener); radioHornType.getCheckedRadioButtonId(); netHandler.post(getNobleTrumpetNumRunnable); + ViewClicksAntiShake.clicksAntiShake(mRootView.findViewById(R.id.ai_te), new ViewClicksAntiShake.ViewClicksCallBack() { + @Override + public void onViewClicks() { + Intent intent = new Intent(getActivity(), OlineListActivity.class); + intent.putExtra("liveID", mLiveUid); + intent.putExtra("stream", bundle.getString(Constants.LIVE_STREAM)); + getActivity().startActivity(intent); + } + }); + ; } @Override diff --git a/live/src/main/java/com/yunbao/live/socket/SocketLinkMicUtil.java b/live/src/main/java/com/yunbao/live/socket/SocketLinkMicUtil.java index 4dbd93fd8..d9480b84f 100644 --- a/live/src/main/java/com/yunbao/live/socket/SocketLinkMicUtil.java +++ b/live/src/main/java/com/yunbao/live/socket/SocketLinkMicUtil.java @@ -44,15 +44,6 @@ public class SocketLinkMicUtil { if (u == null) { return; } -// client.send(new SocketSendBean() -// .param("_method_", Constants.SOCKET_LINK_MIC) -// .param("action", 2) -// .param("msgtype", 10) -// .param("uid", u.getId()) -// .param("uname", u.getUserNiceName()) -// .param("level", u.getLevel()) -// .param("touid", toUid) -// .param("ct", "")); } @@ -67,15 +58,6 @@ public class SocketLinkMicUtil { if (u == null) { return; } -// client.send(new SocketSendBean() -// .param("_method_", Constants.SOCKET_LINK_MIC) -// .param("action", 3) -// .param("msgtype", 10) -// .param("uid", u.getId()) -// .param("uname", u.getUserNiceName()) -// .param("level", u.getLevel()) -// .param("touid", touid) -// .param("ct", "")); } /** @@ -144,11 +126,6 @@ public class SocketLinkMicUtil { if (client == null) { return; } -// client.send(new SocketSendBean() -// .param("_method_", Constants.SOCKET_LINK_MIC) -// .param("action", 7) -// .param("msgtype", 10) -// .param("touid", touid)); } /** @@ -158,10 +135,5 @@ public class SocketLinkMicUtil { if (client == null) { return; } -// client.send(new SocketSendBean() -// .param("_method_", Constants.SOCKET_LINK_MIC) -// .param("action", 8) -// .param("msgtype", 10) -// .param("touid", touid)); } } diff --git a/live/src/main/java/com/yunbao/live/views/OlineAudienceViewHolder.java b/live/src/main/java/com/yunbao/live/views/OlineAudienceViewHolder.java new file mode 100644 index 000000000..7cfc5fd63 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/OlineAudienceViewHolder.java @@ -0,0 +1,41 @@ +package com.yunbao.live.views; + +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.bean.OlineUserlistModel; +import com.yunbao.live.R; +import com.yunbao.live.adapter.OlineListItemAdapter; + +import java.util.List; + +/** + * 在线普通观众 + */ +public class OlineAudienceViewHolder extends RecyclerView.ViewHolder { + private TextView avatarType; + private RecyclerView audienceList; + private OlineListItemAdapter itemAdapter; + + public OlineAudienceViewHolder(@NonNull View itemView) { + super(itemView); + avatarType = itemView.findViewById(R.id.avatar_type); + itemAdapter = new OlineListItemAdapter(itemView.getContext()); + audienceList = itemView.findViewById(R.id.audience_list); + audienceList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.VERTICAL, false)); + audienceList.setAdapter(itemAdapter); + } + + /** + * 设置列表数据 + */ + public void setData(List models) { + avatarType.setText(R.string.audience); + avatarType.setVisibility(View.VISIBLE); + itemAdapter.addAll(models); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/OlineListActivity.java b/live/src/main/java/com/yunbao/live/views/OlineListActivity.java new file mode 100644 index 000000000..ce3db8da7 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/OlineListActivity.java @@ -0,0 +1,86 @@ +package com.yunbao.live.views; + +import android.widget.TextView; + +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.blankj.utilcode.util.GsonUtils; +import com.yunbao.common.activity.AbsActivity; +import com.yunbao.common.bean.OlineModel; +import com.yunbao.common.bean.OlineUserlistModel; +import com.yunbao.common.http.HttpCallback; +import com.yunbao.live.R; +import com.yunbao.live.adapter.OlineListAdapter; +import com.yunbao.live.http.LiveHttpUtil; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OlineListActivity extends AbsActivity { + private RecyclerView audienceList; + private OlineListAdapter itemAdapter; + + + @Override + protected int getLayoutId() { + return R.layout.acticity_oline_list; + } + + @Override + protected void main() { + super.main(); + initView(); + initData(); + } + + /** + * 初始化数据 + */ + private void initData() { + LiveHttpUtil. + getUserList( + getIntent().getStringExtra("liveID"), + getIntent().getStringExtra("stream"), "guanzhong", 1, new HttpCallback() { + @Override + public void onSuccess(int code, String msg, String[] info) { + OlineModel responseData = GsonUtils.fromJson(info[0], OlineModel.class); + List userlistModels = responseData.getUserlist(); + List noblelistModels = new ArrayList<>(); + List audiencelistModels = new ArrayList<>(); + List>> mapList = new ArrayList<>(); + //讲贵族前置顺序 + for (OlineUserlistModel model : userlistModels) { + int nobleId = Integer.parseInt(model.getNobleId()); + if (nobleId > 0) { + noblelistModels.add(model); + } else { + audiencelistModels.add(model); + } + } + Map> noblerMap = new HashMap<>(); + noblerMap.put(0, noblelistModels); + Map> audienceMap = new HashMap<>(); + audienceMap.put(1,audiencelistModels); + mapList.add(0,noblerMap); + mapList.add(1, audienceMap); + itemAdapter.addAll(mapList); + } + }); + } + + /** + * 初始化控件 + */ + private void initView() { + itemAdapter = new OlineListAdapter(mContext); + audienceList = findViewById(R.id.audience_list); + TextView titleView = findViewById(R.id.titleView); + titleView.setText(R.string.online_audience); + audienceList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); + audienceList.setAdapter(itemAdapter); + + } +} diff --git a/live/src/main/java/com/yunbao/live/views/OlineListItemViewHolder.java b/live/src/main/java/com/yunbao/live/views/OlineListItemViewHolder.java new file mode 100644 index 000000000..66e2ddab7 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/OlineListItemViewHolder.java @@ -0,0 +1,33 @@ +package com.yunbao.live.views; + +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.bean.OlineUserlistModel; +import com.yunbao.common.glide.ImgLoader; +import com.yunbao.common.views.weight.ClipPathCircleImage; +import com.yunbao.live.R; + +public class OlineListItemViewHolder extends RecyclerView.ViewHolder { + private TextView userName; + private ClipPathCircleImage avatar; + + public OlineListItemViewHolder(@NonNull View itemView) { + super(itemView); + userName = itemView.findViewById(R.id.user_name); + avatar = itemView.findViewById(R.id.avatar); + } + + /** + * 设置列表数据 + * + * @param model 数据 + */ + public void setData(OlineUserlistModel model) { + ImgLoader.displayAvatar(itemView.getContext(), model.getAvatar(), avatar); + userName.setText(model.getUserNicename()); + } +} diff --git a/live/src/main/java/com/yunbao/live/views/OlineNobleViewHolder.java b/live/src/main/java/com/yunbao/live/views/OlineNobleViewHolder.java new file mode 100644 index 000000000..94c5350e3 --- /dev/null +++ b/live/src/main/java/com/yunbao/live/views/OlineNobleViewHolder.java @@ -0,0 +1,41 @@ +package com.yunbao.live.views; + +import android.view.View; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.yunbao.common.bean.OlineUserlistModel; +import com.yunbao.live.R; +import com.yunbao.live.adapter.OlineListItemAdapter; + +import java.util.List; + +/** + * 在线贵族 + */ +public class OlineNobleViewHolder extends RecyclerView.ViewHolder { + private TextView avatarType; + private RecyclerView audienceList; + private OlineListItemAdapter itemAdapter; + + public OlineNobleViewHolder(@NonNull View itemView) { + super(itemView); + avatarType = itemView.findViewById(R.id.avatar_type); + itemAdapter = new OlineListItemAdapter(itemView.getContext()); + audienceList = itemView.findViewById(R.id.audience_list); + audienceList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.VERTICAL, false)); + audienceList.setAdapter(itemAdapter); + } + + /** + * 设置列表数据 + */ + public void setData(List models) { + avatarType.setText(R.string.noble); + avatarType.setVisibility(View.VISIBLE); + itemAdapter.addAll(models); + } +} diff --git a/live/src/main/res/drawable/bg_search_input_2.xml b/live/src/main/res/drawable/bg_search_input_2.xml new file mode 100644 index 000000000..dcbd299eb --- /dev/null +++ b/live/src/main/res/drawable/bg_search_input_2.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/acticity_oline_list.xml b/live/src/main/res/layout/acticity_oline_list.xml new file mode 100644 index 000000000..e7fe924b6 --- /dev/null +++ b/live/src/main/res/layout/acticity_oline_list.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/dialog_live_chat_input.xml b/live/src/main/res/layout/dialog_live_chat_input.xml index e0d7805ca..b99e0c3b7 100644 --- a/live/src/main/res/layout/dialog_live_chat_input.xml +++ b/live/src/main/res/layout/dialog_live_chat_input.xml @@ -26,10 +26,10 @@ android:background="@drawable/radio_horn_type" android:button="@null" android:checked="true" + android:drawableLeft="@mipmap/icon_general_message_p" android:gravity="center" android:text="@string/normal_barrage" android:textColor="@color/white" - android:drawableLeft="@mipmap/icon_general_message_p" android:textSize="12sp" /> @@ -54,12 +54,12 @@ android:layout_weight="1" android:background="@drawable/radio_horn_type" android:button="@null" - android:gravity="center" android:drawableStart="@mipmap/icon_world_horn" + android:gravity="center" android:text="@string/whole_station_horn" android:textColor="#FFB1B6C7" - android:visibility="visible" - android:textSize="12sp" /> + android:textSize="12sp" + android:visibility="visible" /> + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/layout/view_oline_item.xml b/live/src/main/res/layout/view_oline_item.xml new file mode 100644 index 000000000..2a70923a5 --- /dev/null +++ b/live/src/main/res/layout/view_oline_item.xml @@ -0,0 +1,28 @@ + + + + + + + + + + \ No newline at end of file diff --git a/live/src/main/res/mipmap-xxxhdpi/icon_emphasis.png b/live/src/main/res/mipmap-xxxhdpi/icon_emphasis.png new file mode 100644 index 0000000000000000000000000000000000000000..6d4c0cd2c0ec214f8ff52927b7f22eae800fe9ae GIT binary patch literal 4313 zcmV;~5GL=5P)Px_lSxEDRCr$PU3++3#dZIkyDQtWF|i>b5Nd<=uKYk)d)LU?D`A`(5*~&SLyXe` z2{dh7(vLg{4QUFb1R4jZd4xx3X(7SD7eavsL-K{@1Ctm_cWoKnwK2hX@5+w=jsqC* zOO|%;={KvjD;sI&+|{nuO*Q}SnRCvZ-^`tv^Oz-!w5nQwsw#a%I7R@d@+24mU<80F zTcFC~M^?ZH09Cd?mBo*&fDr&>7I^$|4%JQdrsrTx19Oy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83 z?18s|a$Iu^`8nkroWd{~VED7ZG`*ONpgH_PeM=%MD*#G^z9gy45->z%swHVX^iD6> zmZ{#5u6ipw0Q*N&s3=r5SVvTSlpj`r{TxqeJtdm1wr&*zKn-l=x{YSorw6ok1y!&D z0k!^4T~6L`Q@D zS^_5cL}UQ(GqVqa-tlwB+u+K zK$XRhtbh>!s%(KOiyv75BLGy{0#z12vI0f`sImpBEdGB034}?z7PPC500000NkvXX Hu0mjfyDBCm literal 0 HcmV?d00001 diff --git a/main/src/main/res/layout/view_anchor_search_results_item_holder.xml b/main/src/main/res/layout/view_anchor_search_results_item_holder.xml index af1b5f8d0..061333863 100644 --- a/main/src/main/res/layout/view_anchor_search_results_item_holder.xml +++ b/main/src/main/res/layout/view_anchor_search_results_item_holder.xml @@ -46,9 +46,9 @@