diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 2bb3555c2..95bfb8add 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -147,7 +147,7 @@ public class AppContext extends CommonAppContext { String environment = AdjustConfig.ENVIRONMENT_PRODUCTION; AdjustConfig config = new AdjustConfig(this, "3om5fbglyqdc", environment); if (CommonAppConfig.IS_GOOGLE_PLAY == false) { - config.setDefaultTracker("{xa7k5ut}"); + config.setDefaultTracker("xa7k5ut"); } Adjust.onCreate(config); registerActivityLifecycleCallbacks(new AdjustLifecycleCallbacks()); 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 076449844..62e3fef73 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 a5493325e..2863eacee 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -915,6 +915,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 000000000..6d4c0cd2c Binary files /dev/null and b/live/src/main/res/mipmap-xxxhdpi/icon_emphasis.png differ diff --git a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java index 515da50d2..9e49a4473 100644 --- a/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java +++ b/main/src/main/java/com/yunbao/main/http/MainHttpUtil.java @@ -61,7 +61,7 @@ public class MainHttpUtil { HttpClient.getInstance().get("Login.userLoginByThird", MainHttpConsts.LOGIN_BY_THIRD) .params("openid", openid) .params("nicename", nicename) - .params("app_project", "1") + .params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3") .params("avatar", avatar) .params("type", type) .params("source", DEVICE) @@ -80,7 +80,7 @@ public class MainHttpUtil { String sign = MD5Util.getMD5("openid=" + openid + "&" + SALT); HttpClient.getInstance().get("Login.userLoginByThird", MainHttpConsts.LOGIN_BY_THIRD) .params("openid", openid) - .params("app_project", "1") + .params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3") .params("admin_id", promoCode) .params("uuid_Device", uuidDevice) .params("nicename", nicename) @@ -552,7 +552,7 @@ public class MainHttpUtil { public static void register(String invitecode, String user_login, String promo_code, String uuidDevice, int countryCode, String pass, String pass2, String code, HttpCallback callback) { HttpClient.getInstance().get("Login.userReg", MainHttpConsts.REGISTER) .params("user_login", user_login) - .params("app_project", "1") + .params("app_source", CommonAppConfig.IS_GOOGLE_PLAY==true?"1":"3") //增加参数:推广码 .params("user_activation_key", promo_code) .params("admin_id", promo_code) 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 @@