Merge branch 'master' into pdlive_samsung
# Conflicts: # config.gradle # live/src/main/java/com/yunbao/live/views/SystemMessageViewHolder.java
This commit is contained in:
@@ -84,6 +84,9 @@
|
||||
<activity
|
||||
android:name=".activity.WebViewActivityMedal"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.SudGameActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activity.MedalQuestionWebViewActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@@ -117,6 +120,10 @@
|
||||
<activity
|
||||
android:name=".views.OlineListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
|
||||
<activity
|
||||
android:name=".activity.CompensateActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Outline;
|
||||
import android.text.format.DateUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewOutlineProvider;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.blankj.utilcode.util.StringUtils;
|
||||
import com.ms.banner.Banner;
|
||||
import com.ms.banner.BannerConfig;
|
||||
import com.ms.banner.listener.OnBannerClickListener;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.MsgSysGiftAdapter;
|
||||
import com.yunbao.live.bean.MsgSysGiftInfoBean;
|
||||
import com.yunbao.live.bean.SlideBean;
|
||||
import com.yunbao.live.bean.SystemMessageBean;
|
||||
import com.yunbao.live.http.ImHttpUtil;
|
||||
import com.yunbao.live.views.CustomMyViewHolder;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Route(path = RouteUtil.PATH_COMPENSATE_ACTIVITY)
|
||||
public class CompensateActivity extends AbsActivity {
|
||||
|
||||
TextView content;
|
||||
TextView time;
|
||||
RecyclerView recyclerView;
|
||||
MsgSysGiftAdapter msgSysGiftAdapter;
|
||||
String msgId, mBanner, mContent, link;
|
||||
Button submit;
|
||||
|
||||
ImageView imgContent;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_compensate;
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void refreshStatus(SystemMessageBean systemMessageBean) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
setTitle(getIntent().getStringExtra("title"));
|
||||
EventBus.getDefault().register(this);
|
||||
content = findViewById(R.id.content);
|
||||
submit = findViewById(R.id.submit);
|
||||
time = findViewById(R.id.time);
|
||||
imgContent = findViewById(R.id.img_content);
|
||||
|
||||
recyclerView = findViewById(R.id.hor_recycler);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
recyclerView.addItemDecoration(new TopGradual());
|
||||
|
||||
msgSysGiftAdapter = new MsgSysGiftAdapter(mContext);
|
||||
|
||||
recyclerView.setAdapter(msgSysGiftAdapter);
|
||||
|
||||
msgId = getIntent().getStringExtra("msgid");
|
||||
mBanner = getIntent().getStringExtra("banner");
|
||||
mContent = getIntent().getStringExtra("content");
|
||||
link = getIntent().getStringExtra("link");
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy" + getString(R.string.sys_msg_year) + "MM" + getString(R.string.sys_msg_month) + "dd" + getString(R.string.sys_msg_day) + " HH:mm");
|
||||
Date currenTimeZone = new Date(Long.parseLong(getIntent().getStringExtra("time") + "000"));
|
||||
time.setText(sdf.format(currenTimeZone));
|
||||
|
||||
content.setText(mContent);
|
||||
if (!getIntent().getBooleanExtra("receive", false)) {
|
||||
submit.setBackground(mContext.getDrawable(R.mipmap.icon_sys_received));
|
||||
submit.setText(getString(R.string.receive2));
|
||||
submit.setTextColor(mContext.getResources().getColor(R.color.gray_F4F4F4));
|
||||
}
|
||||
submit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
ImHttpUtil.receiveGift(msgId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
SystemMessageBean systemMessageBean = new SystemMessageBean();
|
||||
systemMessageBean.setId(msgId);
|
||||
EventBus.getDefault().post(systemMessageBean);
|
||||
submit.setBackground(mContext.getDrawable(R.mipmap.icon_sys_received));
|
||||
submit.setText(getString(R.string.receive2));
|
||||
submit.setTextColor(mContext.getResources().getColor(R.color.gray_F4F4F4));
|
||||
ToastUtil.show(msg);
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
getMessageGiftInfo();
|
||||
|
||||
if (!StringUtils.isEmpty(mBanner)) {
|
||||
ImgLoader.display(mContext, mBanner, imgContent);
|
||||
findViewById(R.id.lt_advertisement).setVisibility(View.VISIBLE);
|
||||
|
||||
if (!StringUtils.isEmpty(link)) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
StringBuffer urlBuffer = new StringBuffer();
|
||||
urlBuffer.append(link).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0);
|
||||
|
||||
findViewById(R.id.lt_advertisement).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getMessageGiftInfo() {
|
||||
ImHttpUtil.getMessageGiftInfo(msgId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
List<MsgSysGiftInfoBean> list = JSON.parseArray(Arrays.toString(info), MsgSysGiftInfoBean.class);
|
||||
msgSysGiftAdapter.setList(list);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -824,7 +824,10 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
if (manager != null && !StringUtil.isEmpty(is_fans)) {
|
||||
if (is_fans.equals("-2")) {
|
||||
manager.setAttention(0);
|
||||
mLiveRoomViewHolder.setFansGroup("0");
|
||||
if (mLiveRoomViewHolder!=null){
|
||||
mLiveRoomViewHolder.setFansGroup("0");
|
||||
}
|
||||
|
||||
is_fans = "2";
|
||||
}
|
||||
}
|
||||
@@ -1902,9 +1905,11 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
/**
|
||||
* 检查消息,有未读就要显示红点
|
||||
*/
|
||||
|
||||
private void checkMsgRed() {
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.getContactMsg(new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
.getContactMsg(1, new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveUserMailBoxModel> data) {
|
||||
Log.i(TAG, "onSuccess: " + data.size());
|
||||
@@ -1927,6 +1932,8 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
showMsgRed(-1);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -9,14 +9,14 @@ import android.widget.ImageView;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.SearchUserBean;
|
||||
@@ -24,6 +24,8 @@ import com.yunbao.live.dialog.LiveShareDialogFragment;
|
||||
import com.yunbao.live.presenter.UserHomeSharePresenter;
|
||||
import com.yunbao.live.views.LiveRecordPlayViewHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/10/29.
|
||||
*/
|
||||
@@ -82,10 +84,14 @@ public class LiveRecordPlayActivity extends AbsActivity implements
|
||||
mName = (TextView) findViewById(R.id.name);
|
||||
mID = (TextView) findViewById(R.id.id_val);
|
||||
mBtnFollow = findViewById(R.id.btn_follow);
|
||||
ImgLoader.displayAvatar(mContext,mUserBean.getAvatar(), mAvatar);
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext,levelBean.getThumbIcon(), mLevelAnchor);
|
||||
ImgLoader.displayAvatar(mContext, mUserBean.getAvatar(), mAvatar);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= mUserBean.getLevelAnchor() && mUserBean.getLevelAnchor() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getIcon();
|
||||
}
|
||||
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
|
||||
}
|
||||
mName.setText(mUserBean.getUserNiceName());
|
||||
mID.setText(mUserBean.getLiangNameTip());
|
||||
|
||||
683
live/src/main/java/com/yunbao/live/activity/SudGameActivity.java
Normal file
683
live/src/main/java/com/yunbao/live/activity/SudGameActivity.java
Normal file
@@ -0,0 +1,683 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.lifecycle.Observer;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.google.gson.Gson;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.adapter.SudGameChatAdapter;
|
||||
import com.yunbao.common.adapter.SudGameUserListAdapter;
|
||||
import com.yunbao.common.bean.CheckRemainingBalance;
|
||||
import com.yunbao.common.bean.CreateSudRoomModel;
|
||||
import com.yunbao.common.bean.CustomSidebarChildModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.RoomMicStatusModel;
|
||||
import com.yunbao.common.bean.SudGameChatImModel;
|
||||
import com.yunbao.common.bean.SudGameUserModel;
|
||||
import com.yunbao.common.dialog.SudGameInputPopupWindow;
|
||||
import com.yunbao.common.event.CheckRemainingBalanceEvent;
|
||||
import com.yunbao.common.event.SudGameSocketImEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.imrongcloud.GameMicManager;
|
||||
import com.yunbao.common.sud.QuickStartGameViewModel;
|
||||
import com.yunbao.common.sud.model.GameConfigModel;
|
||||
import com.yunbao.common.sud.model.GameViewInfoModel;
|
||||
import com.yunbao.common.sud.state.SudMGPMGState;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.LiveSudGameHistoryPopup;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.dialog.LiveUserDialogFragment;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||
import cn.rongcloud.rtc.api.RCRTCRemoteUser;
|
||||
import cn.rongcloud.rtc.api.RCRTCRoom;
|
||||
import cn.rongcloud.rtc.api.stream.RCRTCInputStream;
|
||||
import cn.rongcloud.rtc.base.RTCErrorCode;
|
||||
|
||||
@Route(path = RouteUtil.PATH_SudGameActivity)
|
||||
public class SudGameActivity extends AbsActivity implements GameMicManager.MeetingCallback {
|
||||
private FrameLayout gameContainer;
|
||||
private long mInteractionID;
|
||||
private String mLiveUid;
|
||||
private final QuickStartGameViewModel gameViewModel = new QuickStartGameViewModel(); // 创建ViewModel
|
||||
|
||||
private CreateSudRoomModel mCreateSudRoomModel;
|
||||
private TextView roomName, roomNumber;
|
||||
private GameMicManager gameMicManager;
|
||||
private ImageView gameCloseWheat, gameSeat;
|
||||
private boolean disable = true, publishDefault = false;
|
||||
|
||||
private RecyclerView chatList, userList;
|
||||
private SudGameChatAdapter mLiveChatAdapter;
|
||||
private SudGameUserListAdapter sudGameUserListAdapter;
|
||||
private ProcessResultUtil mProcessResultUtil;
|
||||
private List<String> muteUser = new ArrayList<>();
|
||||
private boolean imOff;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_sud_game;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void main() {
|
||||
Bus.getOn(this);
|
||||
super.main();
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
private List<CustomSidebarChildModel> customSidebarChildModels = new ArrayList<>();
|
||||
|
||||
private void initDate() {
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.getCustomSidebarInfo("1", new HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
for (CustomSidebarInfoModel datum : data) {
|
||||
if (datum.getType().equals("6")) {
|
||||
customSidebarChildModels = datum.getChild();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// 设置禁用麦克风采集
|
||||
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
||||
ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat);
|
||||
gameCloseWheat.setVisibility(View.INVISIBLE);
|
||||
|
||||
|
||||
mProcessResultUtil = new ProcessResultUtil(this);
|
||||
LiveNetManager.get(mContext)
|
||||
.getRoomMicStatus(new HttpCallback<RoomMicStatusModel>() {
|
||||
@Override
|
||||
public void onSuccess(RoomMicStatusModel data) {
|
||||
gameMicManager = new GameMicManager();
|
||||
gameMicManager.attachView(SudGameActivity.this);
|
||||
gameMicManager.config(SudGameActivity.this);
|
||||
//语音
|
||||
if (TextUtils.equals(data.getMicStatus(), "1")) {
|
||||
imOff = true;
|
||||
gameSeat.setVisibility(View.VISIBLE);
|
||||
userList.setVisibility(View.VISIBLE);
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) {
|
||||
ToastUtil.show("拒绝权限将无法使用上麦功能");
|
||||
mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}, 1500);
|
||||
} else {
|
||||
imOff = false;
|
||||
gameSeat.setVisibility(View.GONE);
|
||||
userList.setVisibility(View.GONE);
|
||||
}
|
||||
if (TextUtils.equals(data.getImStatus(), "1")) {
|
||||
findViewById(R.id.game_review_input).setVisibility(View.VISIBLE);
|
||||
chatList.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
findViewById(R.id.game_review_input).setVisibility(View.GONE);
|
||||
chatList.setVisibility(View.GONE);
|
||||
}
|
||||
gameMicManager.joinRoom(mLiveUid, imOff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
imOff = false;
|
||||
//文字
|
||||
findViewById(R.id.game_review_input).setVisibility(View.GONE);
|
||||
chatList.setVisibility(View.GONE);
|
||||
//语音
|
||||
gameCloseWheat.setVisibility(View.GONE);
|
||||
gameSeat.setVisibility(View.GONE);
|
||||
userList.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.leaveMic(mLiveUid, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if (gameMicManager != null) {
|
||||
gameMicManager.leaveRoom();
|
||||
gameMicManager.detachView();
|
||||
}
|
||||
Bus.getOff(this);
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
|
||||
String createSudRoomJson = getIntent().getStringExtra("CreateSudRoom");
|
||||
mCreateSudRoomModel = new Gson().fromJson(createSudRoomJson, CreateSudRoomModel.class);
|
||||
mInteractionID = mCreateSudRoomModel.getLongSudGameId();
|
||||
mLiveUid = mCreateSudRoomModel.getSudGameRoomId();
|
||||
|
||||
gameContainer = findViewById(R.id.game_container);
|
||||
roomName = findViewById(R.id.room_name);
|
||||
roomNumber = findViewById(R.id.room_number);
|
||||
gameCloseWheat = findViewById(R.id.game_close_wheat);
|
||||
gameSeat = findViewById(R.id.game_seat);
|
||||
chatList = findViewById(R.id.chat_list);
|
||||
userList = findViewById(R.id.user_list);
|
||||
//聊天栏
|
||||
FrameLayout.LayoutParams params1 = (FrameLayout.LayoutParams)
|
||||
chatList.getLayoutParams();
|
||||
params1.topMargin = DpUtil.dp2px(65);
|
||||
chatList.setLayoutParams(params1);
|
||||
|
||||
chatList.setHasFixedSize(true);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(mContext);
|
||||
layoutManager.setOrientation(RecyclerView.VERTICAL);
|
||||
layoutManager.setStackFromEnd(true);
|
||||
chatList.setLayoutManager(layoutManager);
|
||||
chatList.addItemDecoration(new TopGradual());
|
||||
chatList.setItemViewCacheSize(10);
|
||||
mLiveChatAdapter = new SudGameChatAdapter(mContext);
|
||||
chatList.setAdapter(mLiveChatAdapter);
|
||||
sudGameUserListAdapter = new SudGameUserListAdapter(new ArrayList<>());
|
||||
ImgLoader.display(mContext, WordUtil.isNewZh() ? R.mipmap.icon_game_seat : R.mipmap.icon_game_seat_en, gameSeat);
|
||||
sudGameUserListAdapter.setSudGameSmallCallBack(new SudGameUserListAdapter.SudGameSmallCallBack() {
|
||||
@Override
|
||||
public void unMute(String userID, int position) {
|
||||
if (!TextUtils.equals(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()), userID)) {
|
||||
gameMicManager.refreshStreams(userID, false, position);
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "無法對本人靜音" : "Unable to mute myself");
|
||||
}
|
||||
muteUser.remove(userID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mute(String userID, int position) {
|
||||
muteUser.add(userID);
|
||||
if (!TextUtils.equals(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()), userID)) {
|
||||
gameMicManager.refreshStreams(userID, true, position);
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "無法對本人靜音" : "Unable to mute myself");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void viewInformation(SudGameUserModel sudGameUserModel) {
|
||||
LiveUserDialogFragment fragment = new LiveUserDialogFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, "uid");
|
||||
bundle.putString(Constants.STREAM, "");
|
||||
bundle.putString(Constants.TO_UID, sudGameUserModel.getId() + "");
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((SudGameActivity) mContext).getSupportFragmentManager(), "LiveUserDialogFragment");
|
||||
}
|
||||
});
|
||||
userList.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
userList.setAdapter(sudGameUserListAdapter);
|
||||
if (mCreateSudRoomModel != null) {
|
||||
roomName.setText(mCreateSudRoomModel.getRoomName());
|
||||
roomNumber.setText(mCreateSudRoomModel.getSudGameRoomId());
|
||||
}
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.exit), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
gameViewModel.onDestroy();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.sud_history), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.asCustom(new LiveSudGameHistoryPopup(mContext, customSidebarChildModels)).show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.game_seat), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (imOff && gameMicManager != null) {
|
||||
if (mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) {
|
||||
if (publishDefault) {
|
||||
disable = true;
|
||||
// 设置禁用麦克风采集
|
||||
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
||||
// ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat);
|
||||
gameMicManager.unPublishStreams();
|
||||
} else {
|
||||
if (sudGameUserListAdapter.isMicMax()) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "上麥人數最大7人" : "The maximum number of people on the microphone is 7");
|
||||
} else {
|
||||
gameMicManager.publishDefaultAVStream();
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(gameCloseWheat, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (imOff && gameMicManager != null) {
|
||||
if (mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) {
|
||||
if (disable) {
|
||||
disable = false;
|
||||
// 设置禁用麦克风采集
|
||||
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
||||
ImgLoader.display(mContext, R.mipmap.icon_game_open_wheat, gameCloseWheat);
|
||||
LiveNetManager.get(mContext)
|
||||
.onMic(mLiveUid, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "麥克風已開啟" : "Microphone turned on");
|
||||
} else {
|
||||
disable = true;
|
||||
// 设置禁用麦克风采集
|
||||
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
||||
ImgLoader.display(mContext, R.mipmap.icon_game_close_wheat, gameCloseWheat);
|
||||
LiveNetManager.get(mContext)
|
||||
.offMic(mLiveUid, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "麥克風已關閉" : "Microphone turned off");
|
||||
}
|
||||
|
||||
} else {
|
||||
mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.game_review_input), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(mContext)
|
||||
.enableDrag(false)
|
||||
.asCustom(new SudGameInputPopupWindow(mContext, new SudGameInputPopupWindow.SudGameInputCallBack() {
|
||||
@Override
|
||||
public void sendMessage(String textMessage) {
|
||||
gameMicManager.sendMessage(textMessage);
|
||||
}
|
||||
}))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
|
||||
gameViewModel.gameViewLiveData.observe(this, new Observer<View>() {
|
||||
@Override
|
||||
public void onChanged(View view) {
|
||||
if (view == null) { // 在关闭游戏时,把游戏View给移除
|
||||
gameContainer.removeAllViews();
|
||||
} else { // 把游戏View添加到容器内
|
||||
gameContainer.addView(view, FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
// 加载游戏,参数定义可查看BaseGameViewModel.switchGame()方法注释
|
||||
// 游戏配置
|
||||
GameConfigModel gameConfigModel = gameViewModel.getGameConfigModel();
|
||||
gameConfigModel.ui.ping.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.level.hide = true; // 配置不隐藏ping值
|
||||
gameConfigModel.ui.lobby_game_setting.hide = true; // 配置不隐藏ping值
|
||||
|
||||
gameConfigModel.ui.lobby_players.custom = true;
|
||||
gameConfigModel.ui.join_btn.custom = true;
|
||||
gameConfigModel.ui.game_settle_again_btn.custom = true;
|
||||
gameConfigModel.ui.start_btn.custom = true;
|
||||
|
||||
|
||||
// SudMGP平台64bit游戏ID
|
||||
gameViewModel.switchGame((Activity) mContext, mLiveUid, mInteractionID);
|
||||
// gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, -1, true, 1);
|
||||
// gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfCaptain(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId()));
|
||||
// ViewClicksAntiShake.clicksAntiShake(gameTitle, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
// @Override
|
||||
// public void onViewClicks() {
|
||||
//
|
||||
// }
|
||||
// });
|
||||
// 设置游戏安全操作区域
|
||||
GameViewInfoModel.GameViewRectModel gameViewRectModel = new GameViewInfoModel.GameViewRectModel();
|
||||
gameViewRectModel.left = 0;
|
||||
gameViewRectModel.top = DpUtil.dp2px(155);
|
||||
gameViewRectModel.right = 0;
|
||||
gameViewRectModel.bottom = DpUtil.dp2px(155);
|
||||
gameViewModel.gameViewRectModel = gameViewRectModel;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCheckRemainingBalanceEvent(CheckRemainingBalanceEvent event) {
|
||||
switch (event.getSudMGPMGState()) {
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_JOIN_BTN:
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_GAME_SETTLE_AGAIN_BTN:
|
||||
|
||||
LiveNetManager.get(mContext).checkRemainingBalance(mCreateSudRoomModel.getSudGameRoomId(), new HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (TextUtils.equals(String.valueOf(data.getGoldenBeanRemainingBalance()), "1")) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(true, event.getSeatIndex(), true, 1);
|
||||
} else {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
|
||||
}
|
||||
// ToastUtil.show(data.toString());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
if (IMLoginManager.get(mContext).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) {
|
||||
ToastUtil.show("貨幣数量不足 ");
|
||||
} else {
|
||||
ToastUtil.show("Shortage of money");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_SETTLE:
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfIn(false, event.getSeatIndex(), true, 1);
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_SELF_CLICK_START_BTN:
|
||||
LiveNetManager.get(mContext).gameStartCheckRemainingBalance(mCreateSudRoomModel.getSudGameId(),
|
||||
mCreateSudRoomModel.getSudGameRoomId(), new
|
||||
HttpCallback<CheckRemainingBalance>() {
|
||||
@Override
|
||||
public void onSuccess(CheckRemainingBalance data) {
|
||||
if (data.getStatus() == 1) {
|
||||
gameViewModel.sudFSTAPPDecorator.notifyAPPCommonSelfPlaying(true);
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case SudMGPMGState.MG_COMMON_GAME_STATE:
|
||||
LiveNetManager.get(mContext).deductMoney(mCreateSudRoomModel.getSudGameRoomId());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinRoomSuccess(RCRTCRoom rcrtcRoom) {
|
||||
LiveNetManager.get(mContext).getRoomMicData(mLiveUid, new HttpCallback<List<SudGameUserModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<SudGameUserModel> data) {
|
||||
|
||||
gameMicManager.refreshStreams(data);
|
||||
sudGameUserListAdapter.refreshSudGameUserList(data, muteUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
// 主动订阅远端用户发布的资源
|
||||
// gameMicManager.subscribeAVStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onJoinRoomFailed(RTCErrorCode rtcErrorCode) {
|
||||
ToastUtil.show("加入失败 " + rtcErrorCode.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPublishSuccess() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImgLoader.display(mContext, WordUtil.isNewZh() ? R.mipmap.icon_game_hang_up : R.mipmap.icon_game_hang_up_en, gameSeat);
|
||||
publishDefault = true;
|
||||
gameCloseWheat.setVisibility(View.VISIBLE);
|
||||
disable = false;
|
||||
// 设置禁用麦克风采集
|
||||
RCRTCEngine.getInstance().getDefaultAudioStream().setMicrophoneDisable(disable);
|
||||
ImgLoader.display(mContext, R.mipmap.icon_game_open_wheat, gameCloseWheat);
|
||||
}
|
||||
});
|
||||
|
||||
LiveNetManager.get(mContext)
|
||||
.joinMic(mLiveUid, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPublishFailed() {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "語音加入失敗" : "Voice joining failed");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribeSuccess(List<RCRTCInputStream> inputStreamList) {
|
||||
// ToastUtil.show("订阅成功 ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribeFailed() {
|
||||
ToastUtil.show("订阅失败 ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribeSuccess(String userID, boolean mute, int position) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mute) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "已靜音該用戶" : "The user has been muted");
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "已取消該用戶靜音" : "The user has been unmuted");
|
||||
}
|
||||
sudGameUserListAdapter.muteUser(userID, mute, position);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSubscribeFailed(String userID) {
|
||||
ToastUtil.show("订阅失败 ");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserJoined(RCRTCRemoteUser rcrtcRemoteUser) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserLeft(RCRTCRemoteUser rcrtcRemoteUser) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertItem(SudGameChatImModel sudGameChatImModel) {
|
||||
mLiveChatAdapter.insertItem(sudGameChatImModel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshSudGameUserList(List<SudGameUserModel> personList) {
|
||||
sudGameUserListAdapter.refreshSudGameUserList(personList, muteUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnPublishStreamsSuccess() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ImgLoader.display(mContext, WordUtil.isNewZh() ? R.mipmap.icon_game_seat : R.mipmap.icon_game_seat_en, gameSeat);
|
||||
publishDefault = false;
|
||||
gameCloseWheat.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
});
|
||||
LiveNetManager.get(mContext)
|
||||
.leaveMic(mLiveUid, new HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUnPublishStreamsFailed() {
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameSocketImEvent(SudGameSocketImEvent event) {
|
||||
gameMicManager.processingMessage(event);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onSudGameUserModel(SudGameUserModel model) {
|
||||
if (model.isNullUser()) {
|
||||
if (!publishDefault) {
|
||||
if (mProcessResultUtil.checkPermissions(new String[]{Manifest.permission.RECORD_AUDIO})) {
|
||||
if (sudGameUserListAdapter.isMicMax()) {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "上麥人數最大7人" : "The maximum number of people on the microphone is 7");
|
||||
} else {
|
||||
gameMicManager.publishDefaultAVStream();
|
||||
}
|
||||
|
||||
} else {
|
||||
mProcessResultUtil.requestPermissions(new String[]{Manifest.permission.RECORD_AUDIO}, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
ToastUtil.show(WordUtil.isNewZh() ? "已經是上麥狀態" : "It is already in the wheat state");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,9 +10,15 @@ import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.activity.SelectImageActivity;
|
||||
import com.yunbao.common.bean.ImageEntity;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.SystemMessageBean;
|
||||
import com.yunbao.live.views.SystemMessageViewHolder;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
@@ -32,11 +38,7 @@ public class SystemMessageActivity extends AbsActivity {
|
||||
public static String nowUid, nowTitle, mowHeadImg;
|
||||
|
||||
public static void forward(Context context, String type, String uid, String title, String headImg) {
|
||||
context.startActivity(new Intent(context, SystemMessageActivity.class)
|
||||
.putExtra("type", type)
|
||||
.putExtra("uid", uid)
|
||||
.putExtra("title", title)
|
||||
.putExtra("headImg", headImg));
|
||||
context.startActivity(new Intent(context, SystemMessageActivity.class).putExtra("type", type).putExtra("uid", uid).putExtra("title", title).putExtra("headImg", headImg));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@@ -36,6 +37,7 @@ import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.socket.SocketSendBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@@ -287,10 +289,18 @@ public class AnchorUserMicInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
mName.setText(bean.getUserNiceName());
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.GuardUserBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/6.
|
||||
@@ -111,10 +112,18 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mVotes.setText(Html.fromHtml(" <font color='#ffdd00'>" + bean.getContribute() + "</font> " + mVotesName));
|
||||
}
|
||||
}
|
||||
@@ -146,10 +155,17 @@ public class GuardAdapter extends RefreshAdapter<GuardUserBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mVotes.setText(bean.getContribute() + " " + mVotesName);
|
||||
if (bean.getType() == Constants.GUARD_TYPE_DAY) {
|
||||
mIcon.setImageDrawable(mGuardDrawable0);
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -18,6 +20,7 @@ import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -106,10 +109,17 @@ public class LiveAdminListAdapter extends RecyclerView.Adapter<LiveAdminListAdap
|
||||
ImgLoader.displayAvatar(mContext,bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext,levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -16,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveShutUpBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -103,10 +106,17 @@ public class LiveBlackAdapter extends RefreshAdapter<LiveShutUpBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ public class LiveParcelItemAdapter extends RecyclerView.Adapter {
|
||||
frameGiftViewHolder.giftSelect(giftJson.get(position), position, mStream, mLiveUid, new LiveParcelItemViewHolder.FrameGiftClickListener() {
|
||||
@Override
|
||||
public void onCallBack(int position, LiveGiftBean model) {
|
||||
model.setPageGift(true);
|
||||
Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(model));
|
||||
giftSelect(model);
|
||||
}
|
||||
|
||||
@@ -1,22 +1,24 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LivePkBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/15.
|
||||
*/
|
||||
@@ -39,7 +41,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
}
|
||||
};
|
||||
mLivePkInviteString = "PK";
|
||||
mLivePkInviteString2 =mContext.getString(R.string.live_pk_invite_2);
|
||||
mLivePkInviteString2 = mContext.getString(R.string.live_pk_invite_2);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@@ -57,7 +59,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView mAvatar;
|
||||
TextView mName;
|
||||
TextView mName, leave;
|
||||
ImageView mSex;
|
||||
ImageView mLevel;
|
||||
TextView mBtnInvite;
|
||||
@@ -66,6 +68,7 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
super(itemView);
|
||||
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
|
||||
mName = (TextView) itemView.findViewById(R.id.name);
|
||||
leave = itemView.findViewById(R.id.leave);
|
||||
mSex = (ImageView) itemView.findViewById(R.id.sex);
|
||||
mLevel = (ImageView) itemView.findViewById(R.id.level);
|
||||
mBtnInvite = (TextView) itemView.findViewById(R.id.btn_invite);
|
||||
@@ -74,13 +77,22 @@ public class LivePkAdapter extends RefreshAdapter<LivePkBean> {
|
||||
|
||||
void setData(LivePkBean bean) {
|
||||
mBtnInvite.setTag(bean);
|
||||
ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(bean.getLevelAnchor());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext,levelBean.getThumb(), mLevel);
|
||||
|
||||
List<NewLevelModel> models = new NewLevelManager(itemView.getContext()).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
anchorLevel = bean.getLevelAnchor();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
leave.setText(String.valueOf(bean.getLevelAnchor()));
|
||||
ImgLoader.display(itemView.getContext(), imgUrl, mLevel);
|
||||
|
||||
if (bean.isLinkMic()) {
|
||||
mBtnInvite.setText(mLivePkInviteString2);
|
||||
mBtnInvite.setEnabled(false);
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.yunbao.live.adapter;
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -16,6 +18,7 @@ import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveShutUpBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -103,10 +106,17 @@ public class LiveShutUpAdapter extends RefreshAdapter<LiveShutUpBean> {
|
||||
ImgLoader.displayAvatar(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
@@ -21,28 +22,15 @@ import com.yunbao.common.views.weight.MarqueeTextView;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.dialog.LiveUserAnchorMailBoxWebInfoPopDialog;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
public class LiveUserAnchorMailBoxAdapter extends RefreshAdapter<LiveUserMailBoxModel> {
|
||||
|
||||
public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserAnchorMailBoxAdapter.MailBoxViewHolder> {
|
||||
private Context mContext;
|
||||
private List<LiveUserMailBoxModel> list;
|
||||
OnItemClickListener<LiveUserMailBoxModel> onItemClickListener;
|
||||
DialogInterface.OnDismissListener onWebDismissListener;
|
||||
|
||||
public LiveUserAnchorMailBoxAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
list = new ArrayList<>();
|
||||
public LiveUserAnchorMailBoxAdapter(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public void setList(List<LiveUserMailBoxModel> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public List<LiveUserMailBoxModel> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setOnItemClickListener(OnItemClickListener<LiveUserMailBoxModel> onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
@@ -56,18 +44,20 @@ public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserA
|
||||
@NonNull
|
||||
@Override
|
||||
public MailBoxViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new MailBoxViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_live_user_mailbox, parent, false));
|
||||
return new MailBoxViewHolder(mInflater.inflate(R.layout.item_live_user_mailbox, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull MailBoxViewHolder holder, int position) {
|
||||
holder.setData(list.get(position), position);
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
MailBoxViewHolder viewHolder = (MailBoxViewHolder) holder;
|
||||
viewHolder.setData(mList.get(position), position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
// @Override
|
||||
// public void onBindViewHolder(@NonNull MailBoxViewHolder holder, int position) {
|
||||
// holder.setData(list.get(position), position);
|
||||
// }
|
||||
|
||||
|
||||
public class MailBoxViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView topText;
|
||||
@@ -100,9 +90,9 @@ public class LiveUserAnchorMailBoxAdapter extends RecyclerView.Adapter<LiveUserA
|
||||
public void onSuccess(String data) {
|
||||
Log.i("刪除信件", "onSuccess:刪除成功 ");
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
list.removeIf(it -> it.getId() == box.getId());
|
||||
mList.removeIf(it -> it.getId() == box.getId());
|
||||
}
|
||||
System.err.println("-----> list size = " + list.size());
|
||||
System.err.println("-----> list size = " + mList.size());
|
||||
notifyDataSetChanged();
|
||||
if (onItemClickListener != null) {
|
||||
onItemClickListener.onItemClick(box, position);
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.MsgSysGiftInfoBean;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class MsgSysGiftAdapter extends RecyclerView.Adapter {
|
||||
private Context mContext;
|
||||
private RecyclerView mRecyclerView;
|
||||
private List<MsgSysGiftInfoBean> mList;
|
||||
private LayoutInflater mInflater;
|
||||
|
||||
public MsgSysGiftAdapter(Context context) {
|
||||
mContext = context;
|
||||
mList = new ArrayList<>();
|
||||
mList.add(new MsgSysGiftInfoBean());
|
||||
mInflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
public void setList(List<MsgSysGiftInfoBean> list) {
|
||||
if (list != null && list.size() > 0) {
|
||||
mList.clear();
|
||||
mList.addAll(list);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return new Vh(mInflater.inflate(R.layout.item_msg_sys_gift, parent, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position, @NonNull List payloads) {
|
||||
Object payload = payloads.size() > 0 ? payloads.get(0) : null;
|
||||
((Vh) vh).setData(mList.get(position), position, payload);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return mList.size();
|
||||
}
|
||||
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
|
||||
ImageView mAvatar;
|
||||
TextView mName, name_remarks;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mAvatar = (ImageView) itemView.findViewById(R.id.avatar);
|
||||
mName = (TextView) itemView.findViewById(R.id.name);
|
||||
name_remarks = (TextView) itemView.findViewById(R.id.name_remarks);
|
||||
}
|
||||
|
||||
void setData(MsgSysGiftInfoBean bean, int position, Object payload) {
|
||||
itemView.setTag(position);
|
||||
ImgLoader.display(mContext, bean.getItem_image(), mAvatar);
|
||||
mName.setText(bean.getItem_name());
|
||||
name_remarks.setText(String.valueOf(bean.getStr_value()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
|
||||
super.onAttachedToRecyclerView(recyclerView);
|
||||
mRecyclerView = recyclerView;
|
||||
}
|
||||
|
||||
public interface ActionListener {
|
||||
void onItemClick(MsgSysGiftInfoBean bean);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,9 +2,12 @@ package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
@@ -14,10 +17,12 @@ import android.widget.TextView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.SystemMessageBean;
|
||||
import com.yunbao.live.activity.ZhuangBanActivity;
|
||||
import com.yunbao.live.http.ImHttpUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -52,7 +57,9 @@ public class SystemMessageAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||
TextView mTime, text;
|
||||
LinearLayout toView, bg;
|
||||
ImageView img_content;
|
||||
CardView cv_img_content;
|
||||
CardView cv_img_content, radius;
|
||||
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
mContent = itemView.findViewById(R.id.content);
|
||||
@@ -62,6 +69,7 @@ public class SystemMessageAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||
text = itemView.findViewById(R.id.text);
|
||||
img_content = itemView.findViewById(R.id.img_content);
|
||||
cv_img_content = itemView.findViewById(R.id.cv_img_content);
|
||||
radius = itemView.findViewById(R.id.radius);
|
||||
}
|
||||
|
||||
void setData(SystemMessageBean bean) {
|
||||
@@ -69,10 +77,22 @@ public class SystemMessageAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (bean.getLink() != null && !bean.getLink().equals("")) {
|
||||
startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", bean.getLink()+ "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken()+ "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")));
|
||||
startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", bean.getLink() + "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken() + "&isZh=" + (WordUtil.isNewZh() ? "1" : "0")));
|
||||
if (bean.getRead_status() == 2) {
|
||||
ImHttpUtil.readMsg(bean.getId(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
}
|
||||
});
|
||||
radius.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
radius.setVisibility((bean.getRead_status() == 2 && !TextUtils.isEmpty(bean.getLink())) ? View.VISIBLE : View.GONE);
|
||||
|
||||
mContent.setText(bean.getContent());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
Date currenTimeZone = new Date(Long.parseLong(bean.getAddtime() + "000"));
|
||||
@@ -91,5 +111,4 @@ public class SystemMessageAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,23 +1,32 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cardview.widget.CardView;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.blankj.utilcode.util.StringUtils;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.ZhuangBanActivity;
|
||||
import com.yunbao.live.bean.SystemMessageBean;
|
||||
import com.yunbao.live.http.ImHttpUtil;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -28,12 +37,13 @@ import java.util.Date;
|
||||
|
||||
public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||
|
||||
public SystemMessageNewAdapter(Context context) {
|
||||
ItemLongListener itemLongListener;
|
||||
|
||||
public SystemMessageNewAdapter(Context context, ItemLongListener itemLongListener) {
|
||||
super(context);
|
||||
|
||||
this.itemLongListener = itemLongListener;
|
||||
}
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
@@ -42,46 +52,105 @@ public class SystemMessageNewAdapter extends RefreshAdapter<SystemMessageBean> {
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {
|
||||
((Vh) vh).setData(mList.get(position));
|
||||
((Vh) vh).setData(mList.get(position), position);
|
||||
}
|
||||
|
||||
class Vh extends RecyclerView.ViewHolder {
|
||||
TextView messageContext, messageTime;
|
||||
LinearLayout layoutMore;
|
||||
TextView messageContext, messageTime, title, del;
|
||||
CardView radius, bannerImgLayout;
|
||||
LinearLayout layoutMore, itemLayout;
|
||||
ImageView img_content;
|
||||
ImageView icon;
|
||||
|
||||
public Vh(View itemView) {
|
||||
super(itemView);
|
||||
messageContext = itemView.findViewById(R.id.message_context);
|
||||
layoutMore = itemView.findViewById(R.id.layout_more);
|
||||
itemLayout = itemView.findViewById(R.id.itemLayout);
|
||||
messageTime = itemView.findViewById(R.id.message_time);
|
||||
radius = itemView.findViewById(R.id.radius);
|
||||
icon = itemView.findViewById(R.id.icon);
|
||||
img_content = itemView.findViewById(R.id.img_content);
|
||||
bannerImgLayout = itemView.findViewById(R.id.cv_img_content);
|
||||
title = itemLayout.findViewById(R.id.title);
|
||||
del = itemLayout.findViewById(R.id.del);
|
||||
}
|
||||
|
||||
void setData(SystemMessageBean bean) {
|
||||
void setData(SystemMessageBean bean, int position) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm");
|
||||
Date currenTimeZone = new Date(Long.parseLong(bean.getAddtime() + "000"));
|
||||
messageTime.setText(sdf.format(currenTimeZone));
|
||||
messageContext.setText(bean.getContent());
|
||||
layoutMore.setVisibility(TextUtils.isEmpty(bean.getLink()) ? View.GONE : View.VISIBLE);
|
||||
layoutMore.setOnClickListener(new View.OnClickListener() {
|
||||
title.setText(String.valueOf(bean.getTitle()));
|
||||
|
||||
if (bean.getSystem_message_type() == 2) {
|
||||
//带礼物的消息
|
||||
if (bean.getGet_status() == 2) {
|
||||
icon.setImageDrawable(mContext.getDrawable(R.mipmap.icon_msg_sys_gift));
|
||||
} else {
|
||||
icon.setImageDrawable(mContext.getDrawable(R.mipmap.icon_msg_sys_gifted));
|
||||
}
|
||||
messageContext.setVisibility(View.GONE);
|
||||
radius.setVisibility((bean.getRead_status() == 2) ? View.VISIBLE : View.GONE);
|
||||
layoutMore.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
//普通消息
|
||||
icon.setImageDrawable(mContext.getDrawable(R.mipmap.icon_notification_speaker));
|
||||
if (StringUtils.isEmpty(bean.getLink())) {
|
||||
//无跳转
|
||||
messageContext.setVisibility(View.VISIBLE);
|
||||
layoutMore.setVisibility(View.GONE);
|
||||
} else {
|
||||
messageContext.setVisibility(View.GONE);
|
||||
}
|
||||
layoutMore.setVisibility(TextUtils.isEmpty(bean.getLink()) ? View.GONE : View.VISIBLE);
|
||||
radius.setVisibility((bean.getRead_status() == 2 && !TextUtils.isEmpty(bean.getLink())) ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
if (!StringUtils.isEmpty(bean.getImgBanner())) {
|
||||
ImgLoader.display(mContext, bean.getImgBanner(), img_content);
|
||||
img_content.setVisibility(View.VISIBLE);
|
||||
bannerImgLayout.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
img_content.setVisibility(View.GONE);
|
||||
bannerImgLayout.setVisibility(View.GONE);
|
||||
}
|
||||
itemLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (bean.getLink() != null && !bean.getLink().equals("")) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
StringBuffer urlBuffer = new StringBuffer();
|
||||
urlBuffer.append(bean.getLink())
|
||||
.append("&uid=")
|
||||
.append(userInfo.getId())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken()) .append("&isZh=")
|
||||
.append(WordUtil.isNewZh() ? "1" : 0);
|
||||
mContext.startActivity(
|
||||
new Intent(mContext, ZhuangBanActivity.class)
|
||||
.putExtra("url", urlBuffer.toString()));
|
||||
|
||||
//普通消息
|
||||
if (bean.getSystem_message_type() == 1) {
|
||||
if (bean.getLink() != null && !bean.getLink().equals("")) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
StringBuffer urlBuffer = new StringBuffer();
|
||||
urlBuffer.append(bean.getLink()).append("&uid=").append(userInfo.getId()).append("&token=").append(userInfo.getToken()).append("&isZh=").append(WordUtil.isNewZh() ? "1" : 0);
|
||||
mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", urlBuffer.toString()));
|
||||
}
|
||||
} else {
|
||||
RouteUtil.forwardLiveCompensateActivity(mContext, String.valueOf(bean.getId()), bean.getImgBanner(), bean.getTitle(), bean.getContent(), bean.getAddtime(), bean.getLink(), bean.getGet_status() == 2);
|
||||
}
|
||||
//未读才调用
|
||||
if (bean.getRead_status() == 2) {
|
||||
ImHttpUtil.readMsg(bean.getId(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
|
||||
}
|
||||
});
|
||||
radius.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
itemLayout.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
itemLongListener.onItemLong(bean, position, del);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public interface ItemLongListener {
|
||||
void onItemLong(SystemMessageBean bean, int position, View view);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
@@ -24,6 +25,7 @@ import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@@ -114,10 +116,17 @@ public class UserMicInfoAdapter extends RefreshAdapter<MicUserBean> {
|
||||
mName.setText(bean.getUserNiceName());
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), mLevel);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserRankBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
@@ -148,7 +147,7 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
|
||||
}
|
||||
});
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
|
||||
|
||||
title.setVisibility(View.GONE);
|
||||
title1.setVisibility(View.GONE);
|
||||
@@ -285,20 +284,20 @@ public class UserMoreInfoAdapter extends RefreshAdapter<UserBean> {
|
||||
}
|
||||
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
if (levelBean != null) {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
if (bean.isHide() && (type.equals("5") || type.equals("4"))) {
|
||||
mName.setText(R.string.mystery_man);
|
||||
ImgLoader.display2(mContext, R.mipmap.hide, mAvatar);
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.yunbao.live.bean;
|
||||
|
||||
public class MsgSysGiftInfoBean {
|
||||
int id;
|
||||
String item_name;
|
||||
String restrict_time;
|
||||
String item_image;
|
||||
String str_value;
|
||||
|
||||
public String getStr_value() {
|
||||
return str_value;
|
||||
}
|
||||
|
||||
public void setStr_value(String str_value) {
|
||||
this.str_value = str_value;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getItem_name() {
|
||||
return item_name;
|
||||
}
|
||||
|
||||
public void setItem_name(String item_name) {
|
||||
this.item_name = item_name;
|
||||
}
|
||||
|
||||
public String getRestrict_time() {
|
||||
return restrict_time;
|
||||
}
|
||||
|
||||
public void setRestrict_time(String restrict_time) {
|
||||
this.restrict_time = restrict_time;
|
||||
}
|
||||
|
||||
public String getItem_image() {
|
||||
return item_image;
|
||||
}
|
||||
|
||||
public void setItem_image(String item_image) {
|
||||
this.item_image = item_image;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,36 @@ public class SystemMessageBean {
|
||||
private String showImg;
|
||||
private String imgBanner;
|
||||
|
||||
private int system_message_type; //1 普通消息 2 礼包消息
|
||||
|
||||
private int get_status; // 1 已领取 2 未领取
|
||||
|
||||
private int read_status; // 1 已读 2 未读
|
||||
|
||||
public int getRead_status() {
|
||||
return read_status;
|
||||
}
|
||||
|
||||
public void setRead_status(int read_status) {
|
||||
this.read_status = read_status;
|
||||
}
|
||||
|
||||
public int getSystem_message_type() {
|
||||
return system_message_type;
|
||||
}
|
||||
|
||||
public void setSystem_message_type(int system_message_type) {
|
||||
this.system_message_type = system_message_type;
|
||||
}
|
||||
|
||||
public int getGet_status() {
|
||||
return get_status;
|
||||
}
|
||||
|
||||
public void setGet_status(int get_status) {
|
||||
this.get_status = get_status;
|
||||
}
|
||||
|
||||
@JSONField(name = "banner")
|
||||
public String getImgBanner() {
|
||||
return imgBanner;
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.yunbao.live.custom;
|
||||
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.LinearGradient;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.PorterDuff;
|
||||
import android.graphics.PorterDuffXfermode;
|
||||
import android.graphics.Shader;
|
||||
import android.graphics.Xfermode;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/1/27.
|
||||
* RecyclerView顶部渐变的itemDecoration
|
||||
*/
|
||||
|
||||
public class TopGradual extends RecyclerView.ItemDecoration {
|
||||
|
||||
private Paint mPaint;
|
||||
private Xfermode mXfermode;
|
||||
private LinearGradient mLinearGradient;
|
||||
private int mLayerId;
|
||||
|
||||
public TopGradual() {
|
||||
mPaint = new Paint();
|
||||
mXfermode = new PorterDuffXfermode(PorterDuff.Mode.DST_IN);
|
||||
mLinearGradient = new LinearGradient(0.0f, 0.0f, 0.0f, 50.0f, new int[]{0, Color.BLACK}, null, Shader.TileMode.CLAMP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
|
||||
super.onDrawOver(canvas, parent, state);
|
||||
mPaint.setXfermode(mXfermode);
|
||||
mPaint.setShader(mLinearGradient);
|
||||
canvas.drawRect(0.0f, 0.0f, parent.getRight(), 100.0f, mPaint);
|
||||
mPaint.setXfermode(null);
|
||||
canvas.restoreToCount(mLayerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
|
||||
super.onDraw(c, parent, state);
|
||||
mLayerId = c.saveLayer(0.0f, 0.0f, (float) parent.getWidth(), (float) parent.getHeight(), mPaint, Canvas.ALL_SAVE_FLAG);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class LiveFansGroupSendGiftDialog extends AbsDialogCenterPopupWindow {
|
||||
recyclerView = findViewById(R.id.giftList);
|
||||
adapter = new LiveFansGroupSendGiftAdapter(mContext);
|
||||
adapter.setOnItemClickListener((bean, position) -> {
|
||||
LiveHttpUtil.sendGift("0",
|
||||
LiveHttpUtil.sendGiftForFansGroup("0",
|
||||
liveUid,
|
||||
mStream,
|
||||
bean.getId(),
|
||||
|
||||
@@ -129,7 +129,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
private MarqueeTextView giftDescription, namingName;
|
||||
private boolean isPk;
|
||||
|
||||
private FragmentTransaction transaction=null;
|
||||
private FragmentTransaction transaction = null;
|
||||
private FragmentManager fragmentManager;
|
||||
private Fragment contentFragment;
|
||||
|
||||
@@ -137,8 +137,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
if(transaction==null){
|
||||
transaction=getChildFragmentManager().beginTransaction();
|
||||
if (transaction == null) {
|
||||
transaction = getChildFragmentManager().beginTransaction();
|
||||
}
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
@@ -243,8 +243,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
giftTitleAdapter.uncheck();
|
||||
liveWrap.setAlpha(1.0f);
|
||||
liveWrap.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
|
||||
transaction=getTransaction();
|
||||
contentFragment=LiveParcelFragment.newInstance(mStream, mLiveUid);
|
||||
transaction = getTransaction();
|
||||
contentFragment = LiveParcelFragment.newInstance(mStream, mLiveUid);
|
||||
transaction.replace(R.id.context_layout_gift, contentFragment);
|
||||
transaction.commitAllowingStateLoss();
|
||||
isWrap = true;
|
||||
@@ -328,13 +328,13 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
.append(userInfo.getToken())
|
||||
.append("&no_back=1")
|
||||
.append("&type=")
|
||||
.append(blindBoxType-1)
|
||||
.append(blindBoxType - 1)
|
||||
|
||||
.append("&isZh=")
|
||||
.append(WordUtil.isNewZh() ? "1" : 0);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", htmlUrl.toString());
|
||||
// System.out.println("盲盒页面 = "+htmlUrl.toString());
|
||||
// System.out.println("盲盒页面 = "+htmlUrl.toString());
|
||||
LiveHDDialogFragment fragment = new LiveHDDialogFragment();
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
|
||||
@@ -399,7 +399,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
.append(userInfo.getId())
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken())
|
||||
.append("&for") .append("&isZh=")
|
||||
.append("&for").append("&isZh=")
|
||||
.append(WordUtil.isNewZh() ? "1" : 0);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("url", htmlUrl.toString());
|
||||
@@ -480,8 +480,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
List<LiveGiftBean> liveGiftBeans = JSONArray.parseArray(giftJson, LiveGiftBean.class);
|
||||
for (LiveGiftBean model : liveGiftBeans) {
|
||||
if (TextUtils.equals(model.getId() + "", mWishGiftId)) {
|
||||
transaction=getTransaction();
|
||||
contentFragment=LiveGiftFragment.newInstance(giftJson,
|
||||
transaction = getTransaction();
|
||||
contentFragment = LiveGiftFragment.newInstance(giftJson,
|
||||
liveGiftList.getJSONObject(i).getString("name"),
|
||||
mStream, mLiveUid, mWishGiftId);
|
||||
transaction.replace(R.id.context_layout_gift, contentFragment);
|
||||
@@ -495,11 +495,11 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
|
||||
JSONObject obj2 = liveGiftList.getJSONObject(0);
|
||||
String giftJson = obj2.getString("giftlist");
|
||||
transaction=getTransaction();
|
||||
contentFragment= LiveGiftFragment.newInstance(giftJson,
|
||||
transaction = getTransaction();
|
||||
contentFragment = LiveGiftFragment.newInstance(giftJson,
|
||||
liveGiftList.getJSONObject(0).getString("name"),
|
||||
mStream, mLiveUid, mWishGiftId);
|
||||
transaction.replace(R.id.context_layout_gift,contentFragment);
|
||||
transaction.replace(R.id.context_layout_gift, contentFragment);
|
||||
transaction.commitAllowingStateLoss();
|
||||
}
|
||||
|
||||
@@ -620,7 +620,11 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
if (isWrap && liveGiftModel.getType() == 7) {
|
||||
sendBlindBoxTicket();
|
||||
} else {
|
||||
sendGift();
|
||||
if (liveGiftModel.isPageGift()) {
|
||||
sendGiftForPage();
|
||||
} else {
|
||||
sendGift();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -636,7 +640,7 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
LiveHttpUtil.sendBlindBoxTicket((by != null ? "1" : "0"),
|
||||
mLiveUid,
|
||||
mStream,
|
||||
isWrap ? liveGiftModel.getId() : liveGiftModel.getBlindBoxTicketId(), new HttpCallback() {
|
||||
isWrap ? liveGiftModel.getGift_id() : liveGiftModel.getBlindBoxTicketId(), new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
@@ -755,6 +759,16 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
}
|
||||
}
|
||||
|
||||
private void sendGiftForPage() {
|
||||
if (liveGiftModel == null) return;
|
||||
SendGiftCallback callback = new SendGiftCallback(liveGiftModel);
|
||||
if (by != null) {
|
||||
LiveHttpUtil.sendGiftForPage("1", mLiveUid, mStream, liveGiftModel.getGift_id(), mCount, 0, false, callback);
|
||||
} else {
|
||||
LiveHttpUtil.sendGiftForPage("0", mLiveUid, mStream, liveGiftModel.getGift_id(), mCount, 0, false, callback);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到我的钻石
|
||||
*/
|
||||
@@ -888,8 +902,8 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
giftNumberLayout.setVisibility(View.INVISIBLE);
|
||||
JSONObject obj2 = liveGiftList.getJSONObject(event.getmPosition());
|
||||
String giftJson = obj2.getString("giftlist");
|
||||
transaction=getTransaction();
|
||||
contentFragment=LiveGiftFragment.newInstance(giftJson, event.getGiftTitle(), mStream, mLiveUid, mWishGiftId);
|
||||
transaction = getTransaction();
|
||||
contentFragment = LiveGiftFragment.newInstance(giftJson, event.getGiftTitle(), mStream, mLiveUid, mWishGiftId);
|
||||
transaction.replace(R.id.context_layout_gift, contentFragment);
|
||||
transaction.commitAllowingStateLoss();
|
||||
isWrap = false;
|
||||
@@ -1115,12 +1129,12 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
}
|
||||
if (!TextUtils.isEmpty(event.getDressName()) && !TextUtils.isEmpty(event.getDressMsg())) {
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
|
||||
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability2), WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en(),WordUtil.isNewZh()? event.getDressName():event.getDress_nameen());
|
||||
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability2), WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en(), WordUtil.isNewZh() ? event.getDressName() : event.getDress_nameen());
|
||||
stringBuilder.append(boxBlindMsg);
|
||||
int dressNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh()? event.getDressName():event.getDress_nameen());
|
||||
int dressNameSize =(WordUtil.isNewZh()? event.getDressName():event.getDress_nameen()).length();
|
||||
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en());
|
||||
int giftNameSize = (WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en()).length();
|
||||
int dressNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh() ? event.getDressName() : event.getDress_nameen());
|
||||
int dressNameSize = (WordUtil.isNewZh() ? event.getDressName() : event.getDress_nameen()).length();
|
||||
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en());
|
||||
int giftNameSize = (WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en()).length();
|
||||
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getDressColour())),
|
||||
dressNameIndex,
|
||||
dressNameIndex + dressNameSize,
|
||||
@@ -1132,11 +1146,11 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
stringBuilders.add(stringBuilder);
|
||||
} else {
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
|
||||
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability3), WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en());
|
||||
String boxBlindMsg = String.format(mContext.getString(R.string.random_availability3), WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en());
|
||||
stringBuilder.append(boxBlindMsg);
|
||||
if (!TextUtils.isEmpty(event.getGiftname_en())){
|
||||
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en());
|
||||
int giftNameSize = (WordUtil.isNewZh()?event.getGiftname():event.getGiftname_en()).length();
|
||||
if (!TextUtils.isEmpty(event.getGiftname_en())) {
|
||||
int giftNameIndex = boxBlindMsg.indexOf(WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en());
|
||||
int giftNameSize = (WordUtil.isNewZh() ? event.getGiftname() : event.getGiftname_en()).length();
|
||||
stringBuilder.setSpan(new ForegroundColorSpan(Color.parseColor(event.getGiftColour())),
|
||||
giftNameIndex,
|
||||
giftNameIndex + giftNameSize,
|
||||
@@ -1446,15 +1460,16 @@ public class LiveGiftPopup extends AbsDialogFragment {
|
||||
}
|
||||
}
|
||||
}
|
||||
private FragmentTransaction getTransaction(){
|
||||
if(contentFragment!=null && transaction!=null){
|
||||
|
||||
private FragmentTransaction getTransaction() {
|
||||
if (contentFragment != null && transaction != null) {
|
||||
transaction.remove(contentFragment);
|
||||
contentFragment=null;
|
||||
contentFragment = null;
|
||||
}
|
||||
if(fragmentManager==null){
|
||||
fragmentManager=getChildFragmentManager();
|
||||
if (fragmentManager == null) {
|
||||
fragmentManager = getChildFragmentManager();
|
||||
}
|
||||
transaction=fragmentManager.beginTransaction();
|
||||
transaction = fragmentManager.beginTransaction();
|
||||
return transaction;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,7 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
@@ -36,7 +34,7 @@ import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.bean.HotBean;
|
||||
import com.yunbao.live.custom.TopGradual;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
@@ -205,9 +203,8 @@ public class LiveGiveHotDialogFragment extends AbsDialogFragment {
|
||||
ImgLoader.displayAvatar(mContext, mDatas.get(position).getUser_avatar(), viewHolder.img_head);
|
||||
viewHolder.tv_name.setText(mDatas.get(position).getUser_name());
|
||||
viewHolder.sex.setImageResource(CommonIconUtil.getSexIcon(mDatas.get(position).getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(mDatas.get(position).getLevel());
|
||||
if (levelBean != null) {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
|
||||
new LiveTextRender().getLevelImage(mContext, mDatas.get(position).getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, viewHolder.level);
|
||||
@@ -218,7 +215,7 @@ public class LiveGiveHotDialogFragment extends AbsDialogFragment {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
String hotStr = mDatas.get(position).getHot_score().substring(0, mDatas.get(position).getHot_score().length() - 3);
|
||||
viewHolder.tv_hot_number.setText(hotStr + "k");
|
||||
viewHolder.tv_hot_time.setText(mDatas.get(position).getHot_score_end_time());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
@@ -18,21 +19,20 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.adapter.GuardAdapter;
|
||||
import com.yunbao.live.bean.GuardUserBean;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -45,7 +45,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
private ImageView guardIcon, userSex, userLevel;
|
||||
private ConstraintLayout mRootLayout;
|
||||
private CommonRefreshView mRefreshView;
|
||||
private TextView mBtnBuy, userName, userGuard,tip1, tip2;
|
||||
private TextView mBtnBuy, userName, userGuard, tip1, tip2;
|
||||
private SVGAImageView giftSvga;
|
||||
private LinearLayout userLayout;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
private String mLiveUid;
|
||||
private boolean mIsAnchor;//是否是主播
|
||||
private boolean showBuyView;
|
||||
private List<GuardUserBean> list=new ArrayList<>();
|
||||
private List<GuardUserBean> list = new ArrayList<>();
|
||||
private RelativeLayout relativeLayout;
|
||||
|
||||
@Override
|
||||
@@ -95,7 +95,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
}
|
||||
mIsAnchor = bundle.getBoolean(Constants.ANCHOR, false);
|
||||
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||
showBuyView = bundle.getBoolean("showBuyView",true);
|
||||
showBuyView = bundle.getBoolean("showBuyView", true);
|
||||
guardIcon = mRootView.findViewById(R.id.guard_imageView);
|
||||
mRootLayout = mRootView.findViewById(R.id.guard_constraintLayout);
|
||||
mBtnBuy = mRootView.findViewById(R.id.guard_btn_buy);
|
||||
@@ -138,8 +138,8 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
@Override
|
||||
public List<GuardUserBean> processData(String[] info) {
|
||||
List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class);
|
||||
if(!list.isEmpty()){
|
||||
LiveNewGuardListDialogFragment.this.list=list;
|
||||
if (!list.isEmpty()) {
|
||||
LiveNewGuardListDialogFragment.this.list = list;
|
||||
setAdapterData();
|
||||
}
|
||||
return list;
|
||||
@@ -167,7 +167,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
});
|
||||
mRefreshView.setRecyclerViewAdapter(mGuardAdapter);
|
||||
mGuardAdapter.notifyDataSetChanged();
|
||||
if(!showBuyView){
|
||||
if (!showBuyView) {
|
||||
relativeLayout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
@@ -184,10 +184,11 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
initView();
|
||||
return show;
|
||||
}
|
||||
private void setAdapterData(){
|
||||
|
||||
private void setAdapterData() {
|
||||
if (list.isEmpty()) {
|
||||
userLayout.setVisibility(View.INVISIBLE);
|
||||
}else {
|
||||
} else {
|
||||
GuardUserBean bean = list.get(0);
|
||||
giftSvga.setImageResource(R.mipmap.guardian_img_wings_p);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), guardIcon);
|
||||
@@ -196,10 +197,18 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
String guardString = mContext.getString(R.string.guard_week_con);
|
||||
userGuard.setText(guardString + " " + bean.getContribute());
|
||||
userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), userLevel);
|
||||
}
|
||||
|
||||
new LiveTextRender().getLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, userLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
if (mLiveGuardInfo != null) {
|
||||
int guardType = mLiveGuardInfo.getMyGuardType();
|
||||
@@ -217,7 +226,8 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setList(List<GuardUserBean> list) {
|
||||
this.list=list;
|
||||
this.list = list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,12 +23,11 @@ import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.tencent.imsdk.v2.V2TIMCallback;
|
||||
import com.tencent.imsdk.v2.V2TIMManager;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.event.LiveRoomChangeEvent;
|
||||
@@ -38,6 +37,7 @@ import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpConsts;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.LiveRoomCheckLivePresenter;
|
||||
@@ -58,9 +58,6 @@ import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.rong.imlib.IRongCoreCallback;
|
||||
import io.rong.imlib.IRongCoreEnum;
|
||||
import io.rong.imlib.chatroom.base.RongChatRoomClient;
|
||||
import pl.droidsonroids.gif.GifImageView;
|
||||
|
||||
/**
|
||||
@@ -406,14 +403,28 @@ public class LiveOldUserDialogFragment extends AbsDialogFragment implements View
|
||||
int levelAnchor = obj.getIntValue("level_anchor");
|
||||
int level = obj.getIntValue("level");
|
||||
mSign.setText(obj.getString("signature"));
|
||||
LevelBean anchorLevelBean = appConfig.getAnchorLevel(obj.getIntValue("level_anchor"));
|
||||
if (anchorLevelBean != null) {
|
||||
ImgLoader.display(mContext, anchorLevelBean.getBgIcon(), mLevelAnchor);
|
||||
}
|
||||
LevelBean levelBean = appConfig.getLevel(obj.getIntValue("level"));
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getBgIcon(), mLevel);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
|
||||
anchorLevel = obj.getIntValue("level_anchor");
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getIcon();
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
|
||||
new LiveTextRender().getLevelImage(mContext,obj.getIntValue("level"), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mLevelAnchorText.setText(String.valueOf(levelAnchor));
|
||||
mLevelText.setText(String.valueOf(level));
|
||||
mSex.setImageResource(CommonIconUtil.getSexIcon(obj.getIntValue("sex")));
|
||||
|
||||
@@ -1,33 +1,35 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.adapter.RefreshAdapter;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveUserAnchorMailBoxAdapter;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户获取主播联系方式信箱弹框
|
||||
*/
|
||||
public class LiveUserAnchorMailBoxPopDialog extends AbsDialogPopupWindow {
|
||||
private RecyclerView list;
|
||||
private CommonRefreshView list;
|
||||
private LiveUserAnchorMailBoxAdapter adapter;
|
||||
private View empty;
|
||||
|
||||
@@ -48,26 +50,86 @@ public class LiveUserAnchorMailBoxPopDialog extends AbsDialogPopupWindow {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
|
||||
list = findViewById(R.id.mailbox);
|
||||
empty = findViewById(R.id.ic_empty);
|
||||
list.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
list.setAdapter(adapter);
|
||||
if (adapter == null) {
|
||||
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
|
||||
}
|
||||
list.setDataHelper(new CommonRefreshView.DataHelper<LiveUserMailBoxModel>() {
|
||||
@Override
|
||||
public RefreshAdapter<LiveUserMailBoxModel> getAdapter() {
|
||||
if (adapter == null) {
|
||||
adapter = new LiveUserAnchorMailBoxAdapter(getContext());
|
||||
}
|
||||
return adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadData(int p, com.yunbao.common.http.HttpCallback callback) {
|
||||
LiveHttpUtil.getContactMsg(p, callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LiveUserMailBoxModel> processData(String[] info) {
|
||||
if (info != null) {
|
||||
if (info.length > 0) {
|
||||
empty.setVisibility(View.GONE);
|
||||
list.setVisibility(View.VISIBLE);
|
||||
return JSON.parseArray(Arrays.toString(info), LiveUserMailBoxModel.class);
|
||||
} else if (adapter.getList().size() == 0) {
|
||||
empty.setVisibility(VISIBLE);
|
||||
list.setVisibility(GONE);
|
||||
return new ArrayList<LiveUserMailBoxModel>();
|
||||
}else{
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
} else {
|
||||
empty.setVisibility(VISIBLE);
|
||||
list.setVisibility(GONE);
|
||||
return new ArrayList<LiveUserMailBoxModel>();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshSuccess(List<LiveUserMailBoxModel> list, int listCount) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefreshFailure() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreSuccess(List<LiveUserMailBoxModel> loadItemList, int loadItemCount) {
|
||||
if (loadItemList.size() > 0)
|
||||
adapter.insertList(loadItemList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMoreFailure() {
|
||||
|
||||
}
|
||||
});
|
||||
list.initData();
|
||||
adapter.setOnItemClickListener((bean, position) -> {
|
||||
if (adapter.getItemCount() == 0) {
|
||||
empty.setVisibility(VISIBLE);
|
||||
list.setVisibility(GONE);
|
||||
}
|
||||
});
|
||||
adapter.setOnWebDismissListener(dialog -> initData());
|
||||
initData();
|
||||
// adapter.setOnWebDismissListener(dialog -> initData());
|
||||
// initData();
|
||||
}
|
||||
|
||||
String TAG = "信箱";
|
||||
|
||||
void initData() {
|
||||
LiveNetManager.get(getContext())
|
||||
.getContactMsg(new HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
.getContactMsg(1, new HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveUserMailBoxModel> data) {
|
||||
Log.i(TAG, "onSuccess: " + data.size());
|
||||
|
||||
@@ -26,8 +26,8 @@ import com.umeng.analytics.MobclickAgent;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.FansModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.OlineUserlistModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
@@ -248,6 +248,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
mHonorLayout.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
|
||||
if (!isAnchor) {
|
||||
MobclickAgent.onEvent(mContext, "user_avatar_honor", "荣誉墙按钮");
|
||||
} else {
|
||||
@@ -279,6 +280,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL)
|
||||
.setUid(mToUid)
|
||||
@@ -410,21 +412,33 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
// textGiftWall.setText(mContext.getString(R.string.gift_wall));
|
||||
// valueGiftWall.setText(String.format(mContext.getString(R.string.has_been_lit), obj.getString("gift_wall_lighten_number")));
|
||||
}
|
||||
LevelBean levelBean;
|
||||
if (isAnchor) {
|
||||
levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
|
||||
userLv.setText("Lv." + mUserBean.getLevelAnchor());
|
||||
mLvDesc.setText(R.string.live_user_level_anchor);
|
||||
|
||||
} else {
|
||||
levelBean = CommonAppConfig.getInstance().getLevel(mUserBean.getLevel());
|
||||
userLv.setText("Lv." + mUserBean.getLevel());
|
||||
mLvDesc.setText(R.string.live_user_card_level);
|
||||
|
||||
}
|
||||
if (isAnchor) {
|
||||
ImgLoader.display2(mContext, obj.getJSONObject("level_thumb").getString("thumb"), mLiveIcon);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
|
||||
|
||||
anchorLevel = mUserBean.getLevelAnchor();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
mLvVal.setText(obj.getInteger("level_anchor") + "");
|
||||
ImgLoader.display2(mContext, imgUrl, mLiveIcon);
|
||||
|
||||
|
||||
} else {
|
||||
new LiveTextRender().getLevelImage(mContext, levelBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
new LiveTextRender().getLevelImage(mContext, mUserBean.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, mLiveIcon);
|
||||
@@ -436,7 +450,8 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
});
|
||||
}
|
||||
ImgLoader.display(mContext, levelBean.getBgIcon(), mLiveIcon2);
|
||||
|
||||
|
||||
FansModel fansMedalBean = new NewLevelManager(mContext).getFansModel(obj.getIntValue("medal_level"));
|
||||
if (fansMedalBean != null && !isAnchor) {
|
||||
ImgLoader.display(mContext, fansMedalBean.getThumb(), mNoble);
|
||||
@@ -541,6 +556,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.ai_te), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
if (!TextUtils.isEmpty(mUserBean.getId()) && !TextUtils.isEmpty(mUserBean.getUserNiceName())) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.INPUT_DIALOG)
|
||||
@@ -617,7 +633,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 跳转到个人主页
|
||||
*/
|
||||
private void forwardHomePage() {
|
||||
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
dismiss();
|
||||
Constants.mStream = mStream;
|
||||
RouteUtil.forwardUserHome(mContext, mToUid, true, mLiveUid, 0);
|
||||
@@ -627,11 +643,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 举报
|
||||
*/
|
||||
private void report() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
LiveReportActivity.forward(mContext, mToUid);
|
||||
}
|
||||
|
||||
|
||||
private void gotoLive(String live_id) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
dismiss();
|
||||
DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.party_studio), new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
@@ -685,6 +703,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
setAttention();
|
||||
} else if (i == R.id.btn_home_page) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
if (isAnchor) {
|
||||
MobclickAgent.onEvent(mContext, "anchor_avatar_index", "点主播主页");
|
||||
} else {
|
||||
@@ -692,18 +711,22 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
forwardHomePage();
|
||||
} else if (i == R.id.btn_report) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
report();
|
||||
} else if (i == R.id.avatar) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
if (isAnchor) {
|
||||
MobclickAgent.onEvent(mContext, "anchor_avatar_btn", "点主播头像");
|
||||
}
|
||||
forwardHomePage();
|
||||
} else if (i == R.id.btn_guard) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
MobclickAgent.onEvent(mContext, "anchor_avatar_guard", "守护按钮");
|
||||
((LiveActivity) mContext).openNewGuardListWindow(mContext instanceof LiveRyAnchorActivity, mToUid);
|
||||
} else if (i == R.id.btn_live) {
|
||||
gotoLive(mToUid);
|
||||
} else if (i == R.id.noble_icon_layout) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
if (isAnchor) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openFansWindow(mToUid);
|
||||
@@ -713,6 +736,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.NOBLE));
|
||||
}
|
||||
} else if (i == R.id.btn_setting) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
setting();
|
||||
}
|
||||
}
|
||||
@@ -769,6 +793,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
private DialogUitl.StringArrayDialogCallback mArrayDialogCallback = new DialogUitl.StringArrayDialogCallback() {
|
||||
@Override
|
||||
public void onItemClick(String text, int tag) {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
if (tag == R.string.live_setting_kick) {
|
||||
kick();
|
||||
|
||||
@@ -802,6 +827,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 查看管理员列表
|
||||
*/
|
||||
private void adminList() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openAdminListWindow();
|
||||
}
|
||||
@@ -810,6 +836,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 踢人
|
||||
*/
|
||||
private void kick() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
LiveHttpUtil.kicking(mLiveUid, mToUid, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -826,6 +853,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 永久禁言->改成三天禁言
|
||||
*/
|
||||
private void setShutUp() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
LiveHttpUtil.setShutUp(mLiveUid, "0", 0, mToUid, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -842,6 +870,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 本场禁言
|
||||
*/
|
||||
private void setShutUp2() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
LiveHttpUtil.setShutUp(mLiveUid, mStream, 1, mToUid, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -859,6 +888,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 设置或取消管理员
|
||||
*/
|
||||
private void setAdmin() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
LiveHttpUtil.setAdmin(mLiveUid, mToUid, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
@@ -880,6 +910,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 超管关闭直播间
|
||||
*/
|
||||
private void closeLive() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
dismiss();
|
||||
LiveHttpUtil.superCloseRoom(mLiveUid, 0, mSuperCloseRoomCallback);
|
||||
}
|
||||
@@ -888,11 +919,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 超管关闭直播间并禁止主播直播
|
||||
*/
|
||||
private void closeLive2() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
dismiss();
|
||||
LiveHttpUtil.superCloseRoom(mLiveUid, 1, mSuperCloseRoomCallback);
|
||||
}
|
||||
|
||||
private void setShutUp3() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
new LiveSettingSilenceDialog(mContext)
|
||||
.setItemClickListener((bean, position) -> {
|
||||
LiveHttpUtil.setShutUp(mLiveUid, mStream, 1, mToUid, bean + "", new HttpCallback() {
|
||||
@@ -914,6 +947,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 超管关闭直播间并禁用主播账户
|
||||
*/
|
||||
private void forbidAccount() {
|
||||
if (TextUtils.equals(mLiveUid, "uid")) return;
|
||||
dismiss();
|
||||
LiveHttpUtil.superCloseRoom(mLiveUid, 2, mSuperCloseRoomCallback);
|
||||
}
|
||||
|
||||
@@ -487,7 +487,8 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
IS_ATTENTION(72, "是否关注主播"),
|
||||
GIFT_WALL(73, "礼物墙"),
|
||||
UPDATE_FANS_TASK_STATUS(74, "更新粉丝任务状态"),
|
||||
SUD_GAME_CREATE_ROOM(75, "主播创建sud游戏");
|
||||
SUD_GAME_CREATE_ROOM(75, "主播创建sud游戏"),
|
||||
PK_RANK_START(76, "PK排位赛开始");
|
||||
|
||||
private int type;
|
||||
private String name;
|
||||
|
||||
@@ -11,4 +11,6 @@ public class ImHttpConsts {
|
||||
public static final String CHECK_BLACK = "checkBlack";
|
||||
public static final String SEND_DYNAMICCOMMENT = "sendDynamicComment";
|
||||
public static final String SET_BLACK = "setBlack";
|
||||
|
||||
public static final String GET_MESSAGEGIFTINFO = "getMessageGiftInfo";
|
||||
}
|
||||
|
||||
@@ -73,4 +73,41 @@ public class ImHttpUtil {
|
||||
.params("touid", touid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取补偿消息详情
|
||||
*/
|
||||
public static void getMessageGiftInfo(String msgid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Message.getMessageGiftInfo", ImHttpConsts.GET_MESSAGEGIFTINFO)
|
||||
.params("message_id", msgid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统消息
|
||||
*/
|
||||
public static void delMsg(String msgid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Message.deleteSystemMessage", ImHttpConsts.GET_MESSAGEGIFTINFO)
|
||||
.params("message_id", msgid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 已读 系统消息
|
||||
*/
|
||||
public static void readMsg(String msgid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Message.systemMessageRead", ImHttpConsts.GET_MESSAGEGIFTINFO)
|
||||
.params("message_id", msgid)
|
||||
.execute(callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* 领取礼物
|
||||
*/
|
||||
public static void receiveGift(String msgid, HttpCallback callback) {
|
||||
HttpClient.getInstance().get("Message.getMessageGiftDetails", ImHttpConsts.GET_MESSAGEGIFTINFO)
|
||||
.params("message_id", msgid)
|
||||
.execute(callback);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,13 @@ import android.widget.TextView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
@@ -31,7 +32,6 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveAnchorActivity;
|
||||
import com.yunbao.live.event.LinkMicTxMixStreamEvent;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
|
||||
import com.yunbao.live.socket.SocketClient;
|
||||
import com.yunbao.live.socket.SocketLinkMicAnchorUtil;
|
||||
@@ -40,6 +40,8 @@ import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2018/11/16.
|
||||
* 主播与主播连麦逻辑
|
||||
@@ -84,7 +86,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
mPkContainer = linkMicViewHolder.getPkContainer();
|
||||
|
||||
|
||||
mLinkMicWaitString =mContext.getString(R.string.link_mic_wait);
|
||||
mLinkMicWaitString = mContext.getString(R.string.link_mic_wait);
|
||||
mHandler = new Handler() {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
@@ -174,17 +176,25 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
ImageView avatar = (ImageView) v.findViewById(R.id.avatar);
|
||||
TextView name = (TextView) v.findViewById(R.id.name);
|
||||
ImageView sex = (ImageView) v.findViewById(R.id.sex);
|
||||
ImageView level = (ImageView) v.findViewById(R.id.level);
|
||||
TextView level = (TextView) v.findViewById(R.id.level);
|
||||
ImageView contribute = (ImageView) v.findViewById(R.id.contribute);
|
||||
mLinkMicWaitText = v.findViewById(R.id.wait_text);
|
||||
v.findViewById(R.id.btn_refuse).setOnClickListener(this);
|
||||
v.findViewById(R.id.btn_accept).setOnClickListener(this);
|
||||
ImgLoader.display(mContext, u.getAvatar(), avatar);
|
||||
name.setText(u.getUserNiceName());
|
||||
sex.setImageResource(CommonIconUtil.getSexIcon(u.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(u.getLevelAnchor());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), level);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
int anchorLevel = 0;
|
||||
anchorLevel = u.getLevelAnchor();
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
level.setText(anchorLevel + "");
|
||||
ImgLoader.display(mContext, imgUrl, contribute);
|
||||
mLinkMicWaitCount = LINK_MIC_COUNT_MAX;
|
||||
mLinkMicWaitText.setText(mLinkMicWaitString + "(" + mLinkMicWaitCount + ")...");
|
||||
mLinkMicPopWindow = new PopupWindow(v, DpUtil.dp2px(280), ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
@@ -279,7 +289,7 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
*/
|
||||
private void acceptLinkMic() {
|
||||
if (((LiveAnchorActivity) mContext).isBgmPlaying()) {
|
||||
DialogUitl.showSimpleDialog(mContext,mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() {
|
||||
DialogUitl.showSimpleDialog(mContext, mContext.getString(R.string.link_mic_close_bgm), new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
((LiveAnchorActivity) mContext).stopBgm();
|
||||
@@ -493,10 +503,10 @@ public class LiveLinkMicAnchorPresenter implements View.OnClickListener {
|
||||
*/
|
||||
public void onlinkMicPlayGaming() {
|
||||
mLastApplyLinkMicTime = 0;
|
||||
DialogUitl.showSimpleTipDialog(mContext,mContext.getString(R.string.link_mic_play_game));
|
||||
DialogUitl.showSimpleTipDialog(mContext, mContext.getString(R.string.link_mic_play_game));
|
||||
}
|
||||
|
||||
public void setLiveSdk(int mLiveSDK) {
|
||||
this.mLiveSdk=mLiveSDK;
|
||||
this.mLiveSdk = mLiveSDK;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.app.Activity;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
@@ -53,6 +54,7 @@ import com.yunbao.live.interfaces.ILiveLinkMicViewHolder;
|
||||
import com.yunbao.live.interfaces.LivePushListener;
|
||||
import com.yunbao.live.socket.SocketClient;
|
||||
import com.yunbao.live.socket.SocketLinkMicUtil;
|
||||
import com.yunbao.live.utils.LiveTextRender;
|
||||
import com.yunbao.live.views.AbsLiveLinkMicPlayViewHolder;
|
||||
import com.yunbao.live.views.AbsLiveLinkMicPushViewHolder;
|
||||
import com.yunbao.live.views.LiveLinkMicPlayTxViewHolder;
|
||||
@@ -631,10 +633,17 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
|
||||
ImgLoader.display(mContext, u.getAvatar(), avatar);
|
||||
name.setText(u.getUserNiceName());
|
||||
sex.setImageResource(CommonIconUtil.getSexIcon(u.getSex()));
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(u.getLevel());
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display(mContext, levelBean.getThumb(), level);
|
||||
}
|
||||
new LiveTextRender().getLevelImage(mContext, u.getLevel(), new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
ImgLoader.display2(mContext, drawable, level);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadFailed() {
|
||||
|
||||
}
|
||||
});
|
||||
mLinkMicWaitCount = LINK_MIC_COUNT_MAX;
|
||||
mLinkMicWaitText.setText(mLinkMicWaitString + "(" + mLinkMicWaitCount + ")...");
|
||||
mLinkMicPopWindow = new PopupWindow(v, DpUtil.dp2px(280), ViewGroup.LayoutParams.WRAP_CONTENT, true);
|
||||
|
||||
@@ -6,14 +6,17 @@ import android.util.Log;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.HttpCallbackModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.LiveHttpUtil;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
@@ -128,6 +131,18 @@ public class SocketRyChatUtil {
|
||||
if (SocketRyClient.mSocketHandler != null) {
|
||||
SocketRyClient.mSocketHandler.processBroadcast(msg.mResult.toString() + "");
|
||||
}
|
||||
LiveNetManager.get(CommonAppContext.sInstance)
|
||||
.addChatCount(LiveActivity.mStream,new com.yunbao.common.http.base.HttpCallback<HttpCallbackModel>() {
|
||||
@Override
|
||||
public void onSuccess(HttpCallbackModel data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -774,6 +774,21 @@ public class SocketRyClient {
|
||||
systemChatMessage2(stringBuffer.toString());
|
||||
Bus.get().post(new QuickGiftingEvent().setHotNum(sendQuickGiftModel.getHotNum()));
|
||||
break;
|
||||
case Constants.LIVE_PK_RANDOM_START:
|
||||
item = map.getJSONObject("ct");
|
||||
item.getString("text");
|
||||
item.getString("pktt_img");
|
||||
item.getString("uid_win_continuity");
|
||||
item.getString("pkuid_win_continuity");
|
||||
pkRankBean = new PkRankBean();
|
||||
pkRankBean.setBlueVal(item.getString("pkuid_win_continuity"));
|
||||
pkRankBean.setRedVal( item.getString("uid_win_continuity"));
|
||||
pkRankBean.setPkTopImgUrl(item.getString("pktt_img"));
|
||||
|
||||
EventBus.getDefault().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.PK_RANK_START)
|
||||
.setObject(pkRankBean));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,11 +31,9 @@ import androidx.core.content.ContextCompat;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.AiAutomaticSpeechModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.custom.VerticalImageSpan;
|
||||
@@ -762,11 +760,14 @@ public class LiveTextRender {
|
||||
}
|
||||
|
||||
private void renderEnterRoomTMP(Context context, final TextView textView, final LiveChatBean bean) {
|
||||
final LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean == null) {
|
||||
return;
|
||||
List<NewLevelModel> models = new NewLevelManager(context).getNewLevelModels();
|
||||
String imgUrl = "https://downs.yaoulive.com/level/user_lv1_bg.png";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getThumb();
|
||||
}
|
||||
}
|
||||
ImgLoader.displayDrawable(context, levelBean.getThumb(), new ImgLoader.DrawableCallback() {
|
||||
ImgLoader.displayDrawable(context, imgUrl, new ImgLoader.DrawableCallback() {
|
||||
@Override
|
||||
public void onLoadSuccess(Drawable drawable) {
|
||||
if (textView != null) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.NinePatchChunk;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
package com.yunbao.live.utils;
|
||||
|
||||
import android.graphics.Rect;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
public class NinePatchChunk {
|
||||
public static final int NO_COLOR = 0x00000001;
|
||||
public static final int TRANSPARENT_COLOR = 0x00000000;
|
||||
|
||||
public final Rect mPaddings = new Rect();
|
||||
|
||||
public int mDivX[];
|
||||
public int mDivY[];
|
||||
public int mColor[];
|
||||
|
||||
private static void readIntArray(final int[] data, final ByteBuffer buffer) {
|
||||
for (int i = 0, n = data.length; i < n; ++i)
|
||||
data[i] = buffer.getInt();
|
||||
}
|
||||
|
||||
private static void checkDivCount(final int length) {
|
||||
if (length == 0 || (length & 0x01) != 0)
|
||||
throw new RuntimeException("invalid nine-patch: " + length);
|
||||
}
|
||||
|
||||
public static NinePatchChunk deserialize(final byte[] data, int position) {
|
||||
final ByteBuffer byteBuffer =
|
||||
ByteBuffer.wrap(data).order(ByteOrder.nativeOrder());
|
||||
|
||||
if (byteBuffer.get() == 0) return null; // is not serialized
|
||||
|
||||
final NinePatchChunk chunk = new NinePatchChunk();
|
||||
chunk.mDivX = new int[byteBuffer.get()];
|
||||
chunk.mDivY = new int[byteBuffer.get()];
|
||||
chunk.mColor = new int[byteBuffer.get()];
|
||||
|
||||
checkDivCount(chunk.mDivX.length);
|
||||
checkDivCount(chunk.mDivY.length);
|
||||
|
||||
// skip 8 bytes
|
||||
byteBuffer.getInt();
|
||||
byteBuffer.getInt();
|
||||
|
||||
chunk.mPaddings.left = byteBuffer.getInt();
|
||||
chunk.mPaddings.right = byteBuffer.getInt();
|
||||
chunk.mPaddings.top = byteBuffer.getInt();
|
||||
chunk.mPaddings.bottom = byteBuffer.getInt();
|
||||
|
||||
// skip 4 bytes
|
||||
byteBuffer.getInt();
|
||||
|
||||
readIntArray(chunk.mDivX, byteBuffer);
|
||||
readIntArray(chunk.mDivY, byteBuffer);
|
||||
readIntArray(chunk.mColor, byteBuffer);
|
||||
|
||||
if (position == 1) {
|
||||
chunk.mPaddings.left = 9;
|
||||
chunk.mPaddings.right = 15;
|
||||
chunk.mPaddings.top = 33;
|
||||
chunk.mPaddings.bottom = 9;
|
||||
} else if (position == 0) {
|
||||
chunk.mPaddings.left = 48;
|
||||
chunk.mPaddings.right = 18;
|
||||
chunk.mPaddings.top = 9;
|
||||
chunk.mPaddings.bottom = 12;
|
||||
}
|
||||
return chunk;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.ms.banner.holder.BannerViewHolder;
|
||||
import com.yunbao.common.bean.BannerBean;
|
||||
import com.yunbao.live.bean.SlideBean;
|
||||
|
||||
public class CustomMyViewHolder implements BannerViewHolder<SlideBean> {
|
||||
|
||||
@@ -10,9 +10,9 @@ import android.view.animation.LinearInterpolator;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
@@ -20,6 +20,8 @@ import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveDanMuBean;
|
||||
import com.yunbao.live.interfaces.IDanmuActionListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/25.
|
||||
* 弹幕
|
||||
@@ -87,12 +89,16 @@ public class DanmuViewHolder extends AbsViewHolder {
|
||||
|
||||
public void show(LiveDanMuBean bean, int lineNum) {
|
||||
mLineNum = lineNum;
|
||||
ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
|
||||
ImgLoader.display(mContext, bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName());
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
mName.setTextColor(Color.parseColor(levelBean.getColor()));
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
|
||||
String imgUrl = "#68F1F4";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getColour();
|
||||
}
|
||||
}
|
||||
mName.setTextColor(Color.parseColor(imgUrl));
|
||||
mContent.setText(bean.getContent());
|
||||
mCanNext = false;
|
||||
mContentView.measure(0, 0);
|
||||
|
||||
@@ -12,13 +12,17 @@ import android.widget.TextView;
|
||||
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ScreenDimenUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveDanMuBean;
|
||||
import com.yunbao.live.interfaces.IDanmuActionListener;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by cxf on 2017/8/25.
|
||||
* 弹幕
|
||||
@@ -89,10 +93,15 @@ public class FansDanmuViewHolder extends DanmuViewHolder {
|
||||
mLineNum = lineNum;
|
||||
ImgLoader.display(mContext,bean.getAvatar(), mAvatar);
|
||||
mName.setText(bean.getUserNiceName()+":");
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
|
||||
if (levelBean != null) {
|
||||
mName.setTextColor(Color.parseColor(levelBean.getColor()));
|
||||
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewLevelModels();
|
||||
String imgUrl = "#68F1F4";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= bean.getLevel() && bean.getLevel() <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getColour();
|
||||
}
|
||||
}
|
||||
mName.setTextColor(Color.parseColor(imgUrl));
|
||||
mContent.setText(bean.getContent());
|
||||
mCanNext = false;
|
||||
mContentView.measure(0, 0);
|
||||
|
||||
@@ -74,7 +74,6 @@ import com.yunbao.common.bean.GiftModel;
|
||||
import com.yunbao.common.bean.GuardUserModel;
|
||||
import com.yunbao.common.bean.HourRank;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LinkMicUserBean;
|
||||
import com.yunbao.common.bean.LiveAnchorCallMeModel;
|
||||
import com.yunbao.common.bean.LiveAnchorSayModel;
|
||||
@@ -85,6 +84,7 @@ import com.yunbao.common.bean.LiveRoomVoteModel;
|
||||
import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.LiveUserMailBoxModel;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.NewLevelModel;
|
||||
import com.yunbao.common.bean.NewPeopleTaskModel;
|
||||
import com.yunbao.common.bean.PkRankBean;
|
||||
import com.yunbao.common.bean.RankHourModel;
|
||||
@@ -114,6 +114,7 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.manager.NewLevelManager;
|
||||
import com.yunbao.common.manager.RandomPkManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
@@ -132,6 +133,7 @@ import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.utils.formatBigNum;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.common.views.TopGradual;
|
||||
import com.yunbao.common.views.weight.ClipPathCircleImage;
|
||||
import com.yunbao.common.views.weight.FullServiceNotificationView;
|
||||
import com.yunbao.common.views.weight.NobleNoticeView;
|
||||
@@ -159,7 +161,6 @@ import com.yunbao.live.bean.LiveWishlistBean;
|
||||
import com.yunbao.live.bean.WishlistItemModel;
|
||||
import com.yunbao.live.custom.LiveLightView;
|
||||
import com.yunbao.live.custom.RightGradual;
|
||||
import com.yunbao.live.custom.TopGradual;
|
||||
import com.yunbao.live.dialog.GiftWallDialog;
|
||||
import com.yunbao.live.dialog.LiveContactDetailsSendGiftDialog;
|
||||
import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
|
||||
@@ -878,7 +879,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
d_pk_view.setVisibility(View.VISIBLE);
|
||||
if (time != 0) {
|
||||
mPkTimeCount = time;
|
||||
mHandler.sendEmptyMessageAtTime(WHAT_PK_TIME, getNextSecondTime());
|
||||
mHandler.sendEmptyMessageDelayed(WHAT_PK_TIME, getNextSecondTime());
|
||||
}
|
||||
|
||||
|
||||
@@ -1202,11 +1203,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mAvatar = (ImageView) findViewById(R.id.avatar);
|
||||
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
|
||||
|
||||
mLevelAnchor = (ImageView) findViewById(R.id.level_anchor);
|
||||
mName = (TextView) findViewById(R.id.name);
|
||||
mID = (TextView) findViewById(R.id.id_val);
|
||||
mBtnFollow = findViewById(R.id.btn_follow);
|
||||
@@ -1826,7 +1823,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* 重置数据
|
||||
*/
|
||||
public void resetView() {
|
||||
countdownHandler.removeCallbacks(countdownRunnable);
|
||||
svgaImageViewHashMap.clear();
|
||||
pa_pao_layout.removeAllViews();
|
||||
timeHandler.removeCallbacks(timeRunnable);
|
||||
@@ -1948,6 +1944,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
BannerBean bean = mBannerList2.get(p);
|
||||
String type = "";
|
||||
if (bean.getLink().equals("BattlePass")) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
return;
|
||||
}
|
||||
StringBuffer htmlUrl = new StringBuffer();
|
||||
//判断是否是星级活动
|
||||
if (bean.isStart()) {
|
||||
@@ -2017,6 +2017,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
if (p >= 0 && p < mBannerList2.size()) {
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
BannerBean bean = mBannerList2.get(p);
|
||||
if (bean.getLink().equals("BattlePass")) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
return;
|
||||
}
|
||||
String type = "";
|
||||
StringBuffer htmlUrl = new StringBuffer();
|
||||
//判断是否是星级活动
|
||||
@@ -2208,6 +2212,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
BannerBean bean = mBannerList1.get(p);
|
||||
if (bean != null) {
|
||||
String link = bean.getLink();
|
||||
if (link.equals("BattlePass")) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
return;
|
||||
}
|
||||
if (link.equals("sc")) {
|
||||
String url;
|
||||
if (!"".equals(bean.getmIntoUrl()) && bean.getmIntoUrl() != null) {
|
||||
@@ -2437,8 +2445,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
|
||||
private String pkUidTmp = "";
|
||||
private String isLadders;
|
||||
|
||||
public void initPkRank(String isLadders) {
|
||||
this.isLadders = isLadders;
|
||||
//PK状态下,pkuid不能为空
|
||||
if (pkUidTmp.equals(pkUid) && !StringUtil.isEmpty(pkUid)) {
|
||||
return;
|
||||
@@ -2449,11 +2459,39 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
pkRankLayout.setTag(mLiveUid);
|
||||
pkUidTmp = pkUid;
|
||||
pkRankLayout.setVisibility(View.GONE);
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1);
|
||||
mRedVal.setVisibility(View.GONE);
|
||||
mBlueVal.setVisibility(View.GONE);
|
||||
mPkRankTopIcon.setVisibility(View.GONE);
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveRankPk2, "rectangle_new.png", 1);
|
||||
|
||||
}
|
||||
|
||||
public void updatePkRankInfo(PkRankBean bean) {
|
||||
pkRankLayout.setVisibility(View.VISIBLE);
|
||||
liveRankPk2.setVisibility(View.VISIBLE);
|
||||
if (Integer.parseInt(bean.getRedVal()) > 2) {
|
||||
mRedVal.setVisibility(View.VISIBLE);
|
||||
mRedVal.setText(bean.getRedVal() + (WordUtil.isNewZh() ? "連勝" : "Win"));
|
||||
}
|
||||
if (Integer.parseInt(bean.getBlueVal()) > 2) {
|
||||
mBlueVal.setVisibility(View.VISIBLE);
|
||||
mBlueVal.setText(bean.getBlueVal() + (WordUtil.isNewZh() ? "連勝" : "Win"));
|
||||
}
|
||||
mPkRankTopIcon.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getPkTopImgUrl(), mPkRankTopIcon);
|
||||
if (mRedVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams redValLayoutParams = (RelativeLayout.LayoutParams) mRedVal.getLayoutParams();
|
||||
redValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mRedVal.setLayoutParams(redValLayoutParams);
|
||||
}
|
||||
if (mBlueVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams blueValLayoutParams = (RelativeLayout.LayoutParams) mBlueVal.getLayoutParams();
|
||||
blueValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mBlueVal.setLayoutParams(blueValLayoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
public void initRankPKInfo(String mLiveUid) {
|
||||
LiveNetManager.get(mContext)
|
||||
.getRandomPk(mLiveUid, pkUid, new com.yunbao.common.http.base.HttpCallback<PkRankBean>() {
|
||||
@Override
|
||||
@@ -2515,6 +2553,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mPkRankTopIcon.setVisibility(View.VISIBLE);
|
||||
ImgLoader.display(mContext, bean.getPkTopImgUrl(), mPkRankTopIcon);
|
||||
}
|
||||
if (mRedVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams redValLayoutParams = (RelativeLayout.LayoutParams) mRedVal.getLayoutParams();
|
||||
redValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mRedVal.setLayoutParams(redValLayoutParams);
|
||||
}
|
||||
if (mBlueVal.getVisibility() == View.VISIBLE) {
|
||||
RelativeLayout.LayoutParams blueValLayoutParams = (RelativeLayout.LayoutParams) mBlueVal.getLayoutParams();
|
||||
blueValLayoutParams.bottomMargin = DpUtil.dp2px(10);
|
||||
mBlueVal.setLayoutParams(blueValLayoutParams);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2523,7 +2571,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
pkUidTmp = "";
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2818,12 +2865,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* 显示主播等级
|
||||
*/
|
||||
public void setAnchorLevel(int anchorLevel) {
|
||||
if (mLevelAnchor != null) {
|
||||
LevelBean levelBean = CommonAppConfig.getInstance().getAnchorLevel(anchorLevel);
|
||||
if (levelBean != null) {
|
||||
ImgLoader.display2(mContext, levelBean.getThumbIcon(), mLevelAnchor);
|
||||
List<NewLevelModel> models = new NewLevelManager(mContext).getNewAnchorLevelModels();
|
||||
|
||||
String imgUrl = "";
|
||||
for (NewLevelModel newLevelModel : models) {
|
||||
if (newLevelModel.getLeveMin() <= anchorLevel && anchorLevel <= newLevelModel.getLeveMax()) {
|
||||
imgUrl = newLevelModel.getIcon();
|
||||
}
|
||||
}
|
||||
ImgLoader.display(mContext, imgUrl, mLevelAnchor);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -4340,6 +4391,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
@Override
|
||||
public void onBannerClick(List datas, int p) {
|
||||
if (mBannerList3 != null) {
|
||||
if (mBannerList3.get(p).getLink().equals("BattlePass")) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
return;
|
||||
}
|
||||
if (mBannerList3.get(p).getLink().equals("0")) {
|
||||
if (p == 0) {
|
||||
((LiveAudienceActivity) mContext).openGiftWindow("" + bean1.getId(), "1");
|
||||
@@ -4375,6 +4430,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
@Override
|
||||
public void onBannerClick(List datas, int p) {
|
||||
if (mBannerList4.get(p).getLink().equals("BattlePass") || mBannerList4.get(p).getType() == 888) {
|
||||
RouteUtil.forwardBattlePass();
|
||||
return;
|
||||
}
|
||||
if (TextUtils.equals("特惠首冲", mBannerList4.get(p).getName())) {
|
||||
|
||||
Map<String, String> map_ekv = new HashMap<String, String>();
|
||||
@@ -4866,6 +4925,9 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
case UPDATE_FANS_TASK_STATUS:
|
||||
updateFansMessageRed();
|
||||
break;
|
||||
case PK_RANK_START:
|
||||
updatePkRankInfo((PkRankBean) event.getObject());
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5008,13 +5070,48 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
* PK倒计时
|
||||
*/
|
||||
private String userId2, userId3 = "", userId4;
|
||||
private int drPKtIME;
|
||||
|
||||
public void seisShowGif(boolean isShowGif) {
|
||||
this.isShowGif = isShowGif;
|
||||
}
|
||||
|
||||
public void upDataPkScore(JSONArray pkScores, int time) {
|
||||
private boolean removeRunnable = false;
|
||||
private boolean mShowLianBtn = false;
|
||||
|
||||
private Runnable countdownRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (removeRunnable) {
|
||||
countdownHandler.removeCallbacks(countdownRunnable);
|
||||
timeTitle.setVisibility(View.VISIBLE);
|
||||
Log.e("多人Pk", "countdownRunnable mPkTimeCount:" + mPkTimeCount);
|
||||
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||
textTime.setText(String.format(mContext.getString(R.string.pk_time), s1));
|
||||
Log.e("多人Pk", "countdownRunnable s1:" + s1);
|
||||
countdownHandler.postDelayed(countdownRunnable, 1000);
|
||||
removeRunnable = false;
|
||||
} else {
|
||||
mPkTimeCount--;
|
||||
if (mPkTimeCount == 0) {
|
||||
mShowLianBtn = false;
|
||||
timeTitle.setVisibility(View.GONE);
|
||||
countdownHandler.removeCallbacks(countdownRunnable);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT));
|
||||
} else {
|
||||
timeTitle.setVisibility(View.VISIBLE);
|
||||
Log.e("多人Pk", "countdownRunnable mPkTimeCount:" + mPkTimeCount);
|
||||
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||
textTime.setText(String.format(mContext.getString(R.string.pk_time), s1));
|
||||
Log.e("多人Pk", "countdownRunnable s1:" + s1);
|
||||
countdownHandler.postDelayed(countdownRunnable, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void upDataPkScore(JSONArray pkScores, int time) {
|
||||
isShowGif = true;
|
||||
if (detailsView == null) {
|
||||
detailsView = LayoutInflater.from(mContext).inflate(R.layout.view_live_pk_details, null);
|
||||
@@ -5055,14 +5152,20 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
});
|
||||
|
||||
countdownHandler.removeCallbacks(countdownRunnable);
|
||||
if (time > 0) {
|
||||
mPkTimeCount = time;
|
||||
timeTitle.setVisibility(View.VISIBLE);
|
||||
countdownHandler.post(countdownRunnable);
|
||||
if (mShowLianBtn) {
|
||||
removeRunnable = true;
|
||||
} else {
|
||||
countdownHandler.postDelayed(countdownRunnable, 1000);
|
||||
mShowLianBtn = true;
|
||||
drPKtIME = time;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Log.e("多人Pk", "upDataPkScore mPkTimeCount:" +mPkTimeCount);
|
||||
Log.e("多人Pk", "upDataPkScore mPkTimeCount:" + mPkTimeCount);
|
||||
for (int i = 0; i < pkScores.size(); i++) {
|
||||
JSONObject score = pkScores.getJSONObject(i);
|
||||
String userNiceName = score.getString("user_nicename");
|
||||
@@ -5148,25 +5251,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
}
|
||||
|
||||
private Runnable countdownRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mPkTimeCount--;
|
||||
if (mPkTimeCount > 0) {//
|
||||
Log.e("多人Pk", "countdownRunnable mPkTimeCount:" +mPkTimeCount);
|
||||
String s1 = StringUtil.getDurationText(mPkTimeCount * 1000);
|
||||
textTime.setText(String.format(mContext.getString(R.string.pk_time), s1));
|
||||
Log.e("多人Pk", "countdownRunnable s1:" +s1);
|
||||
countdownHandler.postAtTime(countdownRunnable, getNextSecondTime());
|
||||
} else {
|
||||
mPkTimeCount = 0;
|
||||
timeTitle.setVisibility(View.GONE);
|
||||
countdownHandler.removeCallbacks(countdownRunnable);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.PK_TIME_COUNT));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void removeDetailView() {
|
||||
|
||||
@@ -5179,6 +5263,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
if (mHandler != null) {
|
||||
mHandler.removeMessages(WHAT_PK_TIME);
|
||||
}
|
||||
if (countdownHandler != null) {
|
||||
removeRunnable = true;
|
||||
mPkTimeCount = 0;
|
||||
}
|
||||
isShowGif = false;
|
||||
if (voteManager != null) {
|
||||
voteManager.hide();
|
||||
@@ -5697,25 +5785,32 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
});
|
||||
}
|
||||
|
||||
private void checkNewLetter() {
|
||||
LiveNetManager.get(mContext).getContactMsg(new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
|
||||
private synchronized void checkNewLetter() {
|
||||
|
||||
LiveNetManager.get(mContext).getContactMsg(1, new com.yunbao.common.http.base.HttpCallback<List<LiveUserMailBoxModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<LiveUserMailBoxModel> data) {
|
||||
for (LiveUserMailBoxModel model : data) {
|
||||
if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).showMsgRed(0);
|
||||
return;
|
||||
if (data.size() > 0 && data != null) {
|
||||
for (LiveUserMailBoxModel model : data) {
|
||||
if (model.getIsRead() == 0 && mContext instanceof LiveAudienceActivity) {
|
||||
((LiveAudienceActivity) mContext).showMsgRed(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
((LiveAudienceActivity) mContext).showMsgRed(-1);
|
||||
}
|
||||
((LiveAudienceActivity) mContext).showMsgRed(-1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void blindBoxAllServerNotify(AllServerNotifyEvent event) {
|
||||
|
||||
@@ -501,6 +501,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.setUserList(data.getEnterRoomInfo().getUserlists());
|
||||
//设置靓号
|
||||
mLiveRoomViewHolder.setAnchorGoodNumber(data.getLiveInfo().getGoodnum());
|
||||
//初始化天梯赛信息
|
||||
mLiveRoomViewHolder.initRankPKInfo(String.valueOf(data.getLiveInfo().getUid()));
|
||||
if (!StringUtil.isEmpty(mLiveBean.getGiftId())) {
|
||||
mLiveRoomViewHolder.openGiftDialog(mLiveBean.getGiftId());
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.lxj.xpopup.enums.PopupPosition;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
@@ -54,9 +56,15 @@ import com.yunbao.common.bean.ImageEntity;
|
||||
import com.yunbao.common.custom.CommonRefreshView;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.interfaces.OnItemLongClickListener;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.AbsViewHolder;
|
||||
import com.yunbao.common.views.MsgSysDelPopupView;
|
||||
import com.yunbao.common.views.PlaySettingPopupView;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.EditNameRemarksActivity;
|
||||
import com.yunbao.live.activity.SystemMessageActivity;
|
||||
@@ -190,8 +198,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
}
|
||||
InputMethodManager methodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (methodManager != null) {
|
||||
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(),
|
||||
InputMethodManager.HIDE_NOT_ALWAYS);
|
||||
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||
}
|
||||
feedback_edittext.clearFocus();
|
||||
}
|
||||
@@ -244,6 +251,11 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
EventBus.getDefault().register(SystemMessageViewHolder.this);
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void refreshStatus(SystemMessageBean systemMessageBean) {
|
||||
mRefreshView.initData();
|
||||
}
|
||||
|
||||
//点击加号等各类事件
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -259,8 +271,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
if (lt_controls.getVisibility() == View.GONE) {
|
||||
InputMethodManager methodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (methodManager != null) {
|
||||
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(),
|
||||
InputMethodManager.HIDE_NOT_ALWAYS);
|
||||
methodManager.hideSoftInputFromWindow(feedback_edittext.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
|
||||
}
|
||||
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@@ -285,62 +296,88 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
oldestMessageId = -1;
|
||||
}
|
||||
Conversation.ConversationType conversationType = Conversation.ConversationType.PRIVATE;
|
||||
RongIMClient.getInstance().getHistoryMessages(conversationType, SystemMessageActivity.nowUid, oldestMessageId, 20,
|
||||
new RongIMClient.ResultCallback<List<Message>>() {
|
||||
/**
|
||||
* 成功时回调
|
||||
* @param messages 获取的消息列表
|
||||
*/
|
||||
@Override
|
||||
public void onSuccess(List<Message> messages) {
|
||||
Collections.reverse(messages);
|
||||
EventBus.getDefault().post(messages);
|
||||
if (messages.size() > 0) {
|
||||
if (messages.size() < 20) {
|
||||
moretext = false;
|
||||
} else {
|
||||
moretext = true;
|
||||
}
|
||||
oldestMessageId = messages.get(0).getMessageId();
|
||||
Log.i("chatlist", "oldestMessageId = " + oldestMessageId);
|
||||
if (messagesList.size() == 0) {
|
||||
Message messageNo = new Message();
|
||||
messageNo.setSenderUserId("-1");
|
||||
messagesList.add(messageNo);
|
||||
RongIMClient.getInstance().getHistoryMessages(conversationType, SystemMessageActivity.nowUid, oldestMessageId, 20, new RongIMClient.ResultCallback<List<Message>>() {
|
||||
/**
|
||||
* 成功时回调
|
||||
* @param messages 获取的消息列表
|
||||
*/
|
||||
@Override
|
||||
public void onSuccess(List<Message> messages) {
|
||||
Collections.reverse(messages);
|
||||
EventBus.getDefault().post(messages);
|
||||
if (messages.size() > 0) {
|
||||
if (messages.size() < 20) {
|
||||
moretext = false;
|
||||
} else {
|
||||
moretext = true;
|
||||
}
|
||||
oldestMessageId = messages.get(0).getMessageId();
|
||||
Log.i("chatlist", "oldestMessageId = " + oldestMessageId);
|
||||
if (messagesList.size() == 0) {
|
||||
Message messageNo = new Message();
|
||||
messageNo.setSenderUserId("-1");
|
||||
messagesList.add(messageNo);
|
||||
|
||||
messagesList.addAll(messages);
|
||||
} else {
|
||||
if (moretext) {
|
||||
messagesList.get(0).setSenderUserId("-1");
|
||||
} else {
|
||||
messagesList.get(0).setSenderUserId("-2");
|
||||
}
|
||||
messagesList.addAll(1, messages);
|
||||
}
|
||||
mHandler.sendEmptyMessageAtTime(1, 0);
|
||||
messagesList.addAll(messages);
|
||||
} else {
|
||||
if (moretext) {
|
||||
messagesList.get(0).setSenderUserId("-1");
|
||||
} else {
|
||||
moretext = false;
|
||||
if (messagesList.size() == 0) {
|
||||
Message messageNo = new Message();
|
||||
messageNo.setSenderUserId("-1");
|
||||
messagesList.add(messageNo);
|
||||
messagesList.addAll(messages);
|
||||
}
|
||||
messagesList.get(0).setSenderUserId("-2");
|
||||
mHandler.sendEmptyMessageAtTime(1, 0);
|
||||
}
|
||||
messagesList.addAll(1, messages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误时回调。
|
||||
* @param e 错误码
|
||||
*/
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
ToastUtil.show("消息获取失败");
|
||||
mHandler.sendEmptyMessageAtTime(1, 0);
|
||||
} else {
|
||||
moretext = false;
|
||||
if (messagesList.size() == 0) {
|
||||
Message messageNo = new Message();
|
||||
messageNo.setSenderUserId("-1");
|
||||
messagesList.add(messageNo);
|
||||
messagesList.addAll(messages);
|
||||
}
|
||||
});
|
||||
messagesList.get(0).setSenderUserId("-2");
|
||||
mHandler.sendEmptyMessageAtTime(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 错误时回调。
|
||||
* @param e 错误码
|
||||
*/
|
||||
@Override
|
||||
public void onError(RongIMClient.ErrorCode e) {
|
||||
ToastUtil.show("消息获取失败");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除消息
|
||||
*
|
||||
* @param msgId
|
||||
* @param position
|
||||
* @param size
|
||||
*/
|
||||
public void delMsg(String msgId, int position, int size) {
|
||||
ImHttpUtil.delMsg(msgId, new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
ToastUtil.show(R.string.del_suc);
|
||||
}
|
||||
List<SystemMessageBean> systemMessageBeanList = mAdapter.getList();
|
||||
systemMessageBeanList.remove(position);
|
||||
if (position == 0 && size == 1) {
|
||||
mRefreshView.initData();
|
||||
} else if (position == 0) {
|
||||
mAdapter.notifyDataSetChanged();
|
||||
} else {
|
||||
mAdapter.notifyItemRemoved(position);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//非单聊列表适配
|
||||
@@ -357,12 +394,42 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<SystemMessageBean>() {
|
||||
@Override
|
||||
public RefreshAdapter<SystemMessageBean> getAdapter() {
|
||||
if (mAdapter == null && (SystemMessageActivity.type.equals("1"))) { //官方通知
|
||||
if (mAdapter == null && (SystemMessageActivity.type.equals("1"))) {//官方通知
|
||||
mAdapter = new SystemMessageAdapter(mContext);
|
||||
} else if (mAdapter == null && SystemMessageActivity.type.equals("2")) {
|
||||
mAdapter = new InteractionMessageAdapter(mContext, SystemMessageViewHolder.this);
|
||||
} else if (mAdapter == null && SystemMessageActivity.type.equals("4")) { //系统消息
|
||||
mAdapter = new SystemMessageNewAdapter(mContext);
|
||||
} else if (mAdapter == null && SystemMessageActivity.type.equals("4")) {//系统消息
|
||||
mAdapter = new SystemMessageNewAdapter(mContext, new SystemMessageNewAdapter.ItemLongListener() {
|
||||
@Override
|
||||
public void onItemLong(SystemMessageBean bean, int position, View view) {
|
||||
XPopup.Builder builder = new XPopup.Builder(mContext).atView(view);
|
||||
builder.hasShadowBg(false).isDestroyOnDismiss(true).isLightStatusBar(false).popupPosition(PopupPosition.Top).asCustom(new MsgSysDelPopupView(mContext, new MsgSysDelPopupView.ItemDelListener() {
|
||||
@Override
|
||||
public void onItemDel() {
|
||||
if (bean.getSystem_message_type() == 2 && bean.getGet_status() == 2) {//礼包消息并且未领取
|
||||
DialogUitl.showDelSysMsg(mContext, mContext.getString(com.yunbao.common.R.string.msg_del_sys01), new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
delMsg(bean.getId(), position, mAdapter.getList().size());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
if (!SpUtil.getInstance().getBooleanValue(SpUtil.MESSAGE_SYS_DEL)) {
|
||||
DialogUitl.showDelSysMsg(mContext, mContext.getString(com.yunbao.common.R.string.msg_del_sys02), new DialogUitl.SimpleCallback() {
|
||||
@Override
|
||||
public void onConfirmClick(Dialog dialog, String content) {
|
||||
delMsg(bean.getId(), position, mAdapter.getList().size());
|
||||
}
|
||||
});
|
||||
} else {
|
||||
delMsg(bean.getId(), position, mAdapter.getList().size());
|
||||
}
|
||||
SpUtil.getInstance().setBooleanValue(SpUtil.MESSAGE_SYS_DEL, true);
|
||||
}
|
||||
}
|
||||
})).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
return mAdapter;
|
||||
}
|
||||
@@ -582,8 +649,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
try {
|
||||
MediaMetadataRetriever mmr = new MediaMetadataRetriever();
|
||||
mmr.setDataSource(url);
|
||||
duration = Integer.parseInt(mmr.extractMetadata
|
||||
(MediaMetadataRetriever.METADATA_KEY_DURATION)) / 1000;//除以 1000 返回是秒
|
||||
duration = Integer.parseInt(mmr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION)) / 1000;//除以 1000 返回是秒
|
||||
//时长(毫秒)
|
||||
// String duration = mmr.extractMetadata(android.media.MediaMetadataRetriever.METADATA_KEY_DURATION);
|
||||
// //宽
|
||||
@@ -683,11 +749,11 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
//intoIndex 1=调用相机,2=照片选取,3=视频选取
|
||||
public void choosePic(int intoIndex) {
|
||||
//选择图片
|
||||
String permission1=Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2= Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
permission1=Manifest.permission.READ_MEDIA_IMAGES;
|
||||
permission2=Manifest.permission.READ_MEDIA_VIDEO;
|
||||
permission1 = Manifest.permission.READ_MEDIA_IMAGES;
|
||||
permission2 = Manifest.permission.READ_MEDIA_VIDEO;
|
||||
}
|
||||
int isPermission1 = ContextCompat.checkSelfPermission(mContext, permission1);
|
||||
int isPermission2 = ContextCompat.checkSelfPermission(mContext, permission2);
|
||||
@@ -695,8 +761,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
startActivity(intoIndex);
|
||||
} else {
|
||||
//申请权限
|
||||
ActivityCompat.requestPermissions(nowActivity, new String[]{permission1,
|
||||
permission2}, PERMISSION_REQUEST_CODE);
|
||||
ActivityCompat.requestPermissions(nowActivity, new String[]{permission1, permission2}, PERMISSION_REQUEST_CODE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1050,8 +1115,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
*/
|
||||
@Override
|
||||
public ImMessageAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
|
||||
View view = mInflater.inflate(R.layout.item_chat_one,
|
||||
viewGroup, false);
|
||||
View view = mInflater.inflate(R.layout.item_chat_one, viewGroup, false);
|
||||
|
||||
ImMessageAdapter.ViewHolder viewHolder = new ImMessageAdapter.ViewHolder(view);
|
||||
return viewHolder;
|
||||
@@ -1207,9 +1271,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
viewHolder.cv_chatcontent_img1.setVisibility(View.VISIBLE);
|
||||
viewHolder.rt_video_left.setVisibility(View.GONE);
|
||||
|
||||
Glide.with(mContext)
|
||||
.load(imageMessage.getThumUri())
|
||||
.into(viewHolder.chatcontent_img1);
|
||||
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img1);
|
||||
viewHolder.chatcontent_img1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -1225,9 +1287,7 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
viewHolder.cv_chatcontent_img.setVisibility(View.VISIBLE);
|
||||
viewHolder.rt_video_right.setVisibility(View.GONE);
|
||||
if (mDatas.get(position).getReceivedTime() == 0) {
|
||||
Glide.with(mContext)
|
||||
.load(imageMessage.getThumUri())
|
||||
.into(viewHolder.chatcontent_img);
|
||||
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
|
||||
viewHolder.view_feed_suc.setVisibility(View.VISIBLE);
|
||||
viewHolder.view_feed_suc.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -1238,14 +1298,10 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
});
|
||||
} else if (mDatas.get(position).getReceivedTime() < 100) {
|
||||
viewHolder.view_feed_suc.setVisibility(View.GONE);
|
||||
Glide.with(mContext)
|
||||
.load(imageMessage.getThumUri())
|
||||
.into(viewHolder.chatcontent_img);
|
||||
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
|
||||
} else {
|
||||
viewHolder.view_feed_suc.setVisibility(View.GONE);
|
||||
Glide.with(mContext)
|
||||
.load(imageMessage.getThumUri())
|
||||
.into(viewHolder.chatcontent_img);
|
||||
Glide.with(mContext).load(imageMessage.getThumUri()).into(viewHolder.chatcontent_img);
|
||||
|
||||
viewHolder.chatcontent_img.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -1412,16 +1468,9 @@ public class SystemMessageViewHolder extends AbsViewHolder implements View.OnCli
|
||||
*/
|
||||
public static void loadCover(ImageView imageView, Uri uri, Context context) {
|
||||
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
Glide.with(context)
|
||||
.setDefaultRequestOptions(
|
||||
new RequestOptions()
|
||||
.frame(1000000)
|
||||
.centerCrop()
|
||||
.error(R.drawable.anim_loading)//可以忽略
|
||||
.placeholder(R.drawable.anim_loading)//可以忽略
|
||||
)
|
||||
.load(uri)
|
||||
.into(imageView);
|
||||
Glide.with(context).setDefaultRequestOptions(new RequestOptions().frame(1000000).centerCrop().error(R.drawable.anim_loading)//可以忽略
|
||||
.placeholder(R.drawable.anim_loading)//可以忽略
|
||||
).load(uri).into(imageView);
|
||||
}
|
||||
|
||||
//互动消息回复
|
||||
|
||||
5
live/src/main/res/drawable/bg_gray_del.xml
Normal file
5
live/src/main/res/drawable/bg_gray_del.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="133dp" />
|
||||
<solid android:color="#9FAAB7" />
|
||||
</shape>
|
||||
5
live/src/main/res/drawable/bg_gray_time.xml
Normal file
5
live/src/main/res/drawable/bg_gray_time.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:radius="5dp"/>
|
||||
<solid android:color="#E7E7E7"/>
|
||||
</shape>
|
||||
9
live/src/main/res/drawable/bg_war_order.xml
Normal file
9
live/src/main/res/drawable/bg_war_order.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners android:radius="24dp" />
|
||||
<gradient
|
||||
android:angle="270"
|
||||
android:endColor="#3A27CA"
|
||||
android:startColor="#E79EFB" />
|
||||
</shape>
|
||||
124
live/src/main/res/layout/activity_compensate.xml
Normal file
124
live/src/main/res/layout/activity_compensate.xml
Normal file
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/ft_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="65dp"
|
||||
android:background="@color/white"
|
||||
android:paddingTop="19dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/btn_back"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:onClick="backClick"
|
||||
android:padding="9dp"
|
||||
android:src="@mipmap/icon_back"
|
||||
app:tint="@color/textColor" />
|
||||
|
||||
</RelativeLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginLeft="50dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginRight="50dp"
|
||||
android:background="@drawable/bg_gray_time"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="2024年1月4号 10:05" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lt_advertisement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="115dp"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginRight="15dp">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_chatcontent_img1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardBackgroundColor="@color/transparent"
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="87dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/hor_recycler"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="120dp"
|
||||
android:layout_gravity="center"
|
||||
android:scrollbars="none" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/submit"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
android:background="@mipmap/icon_sys_receive"
|
||||
android:paddingBottom="3dp"
|
||||
android:text="@string/receive1"
|
||||
android:textColor="@color/yellow_ff6c00"
|
||||
android:textSize="18dp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,13 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_dialog_2"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
@@ -15,8 +13,7 @@
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true"
|
||||
/>
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
@@ -24,48 +21,56 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="15dp"
|
||||
/>
|
||||
android:layout_height="15dp" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="55dp"
|
||||
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:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="28dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/wait_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="@color/textColor2"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
style="@style/line2"
|
||||
/>
|
||||
<View style="@style/line2" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
>
|
||||
android:layout_height="40dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_refuse"
|
||||
@@ -75,14 +80,12 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/refuse"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray2"
|
||||
/>
|
||||
android:background="@color/gray2" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_accept"
|
||||
@@ -92,8 +95,7 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/accept"
|
||||
android:textColor="@color/global"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -237,7 +237,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:visibility="gone">
|
||||
android:visibility="visible">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="100dp"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
<com.yunbao.common.custom.CommonRefreshView
|
||||
android:id="@+id/mailbox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="328dp"
|
||||
@@ -40,7 +40,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/bg_top"
|
||||
tools:listitem="@layout/item_live_user_mailbox">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</com.yunbao.common.custom.CommonRefreshView>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/ic_empty"
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:paddingRight="12dp"
|
||||
>
|
||||
android:paddingRight="12dp">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
@@ -14,8 +12,7 @@
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true"
|
||||
/>
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
@@ -25,8 +22,7 @@
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_toRightOf="@id/avatar"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/sex"
|
||||
@@ -34,17 +30,32 @@
|
||||
android:layout_height="15dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_toRightOf="@id/name"
|
||||
/>
|
||||
android:layout_toRightOf="@id/name" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="15dp"
|
||||
<FrameLayout
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_toRightOf="@id/sex"
|
||||
/>
|
||||
android:layout_toRightOf="@id/sex">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/level"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="19dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/leave"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="28dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_invite"
|
||||
@@ -55,11 +66,9 @@
|
||||
android:background="@drawable/bg_btn_live_pk"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/fg_btn_live_pk"
|
||||
android:textSize="10sp"
|
||||
/>
|
||||
android:textSize="10sp" />
|
||||
|
||||
<View
|
||||
style="@style/line2"
|
||||
android:layout_alignParentBottom="true"
|
||||
/>
|
||||
android:layout_alignParentBottom="true" />
|
||||
</RelativeLayout>
|
||||
37
live/src/main/res/layout/item_msg_sys_gift.xml
Normal file
37
live/src/main/res/layout/item_msg_sys_gift.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="135dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="道具名称"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name_remarks"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:ellipsize="end"
|
||||
android:singleLine="true"
|
||||
android:text="使用期限"
|
||||
android:textColor="@color/gray1"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -91,6 +91,18 @@
|
||||
android:src="@mipmap/icon_more_live_menu" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/radius"
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
app:cardBackgroundColor="#FF0000"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="20dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/bodyLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
@@ -17,11 +18,13 @@
|
||||
android:textSize="11sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/itemLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
<!--通知小喇叭-->
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="37dp"
|
||||
android:layout_height="37dp"
|
||||
android:layout_marginStart="11dp"
|
||||
@@ -32,60 +35,138 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="42dp"
|
||||
android:clickable="false"
|
||||
app:cardBackgroundColor="#fff"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<LinearLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_context"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="11dp"
|
||||
android:text="親愛的用戶昵稱,恭喜你獲得23年7月1日-23年7月31日的xx禮物冠名權,冠名生效期間您可使用專屬禮物冠名皮膚。小PD已給您佩戴了專屬送禮特效,也可在個性裝扮中取消佩戴。"
|
||||
android:textColor="#040404"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_more"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:visibility="visible">
|
||||
|
||||
<View
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1.2dp"
|
||||
android:layout_marginStart="11dp"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:background="#F6F6F6" />
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="11dp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:layout_weight="1"
|
||||
android:maxLines="2"
|
||||
android:text="標題"
|
||||
android:textColor="#000000"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/del"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/bg_gray_del"
|
||||
android:gravity="center"
|
||||
android:text="@string/delete"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/cv_img_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="0dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="87dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="centerCrop" />
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:id="@+id/message_context"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="11dp"
|
||||
android:text="@string/live_user_mailbox_more_text"
|
||||
android:textColor="#838383"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginStart="11dp"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:src="@mipmap/icon_arrow_right" />
|
||||
</FrameLayout>
|
||||
android:layout_marginBottom="11dp"
|
||||
android:text="親愛的用戶昵稱,恭喜你獲得23年7月1日-23年7月31日的xx禮物冠名權,冠名生效期間您可使用專屬禮物冠名皮膚。小PD已給您佩戴了專屬送禮特效,也可在個性裝扮中取消佩戴。"
|
||||
android:textColor="#040404"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_more"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1.2dp"
|
||||
android:layout_marginStart="11dp"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:background="#F6F6F6" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="11dp"
|
||||
android:text="@string/live_user_mailbox_more_text"
|
||||
android:textColor="#838383"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="11dp"
|
||||
android:src="@mipmap/icon_arrow_right" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:id="@+id/radius"
|
||||
android:layout_width="7dp"
|
||||
android:layout_height="7dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="#FF0000"
|
||||
app:cardCornerRadius="20dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
android:id="@+id/level_anchor"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
BIN
live/src/main/res/mipmap-mdpi/icon_msg_sys_gift.png
Normal file
BIN
live/src/main/res/mipmap-mdpi/icon_msg_sys_gift.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
live/src/main/res/mipmap-mdpi/icon_msg_sys_gifted.png
Normal file
BIN
live/src/main/res/mipmap-mdpi/icon_msg_sys_gifted.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
live/src/main/res/mipmap-mdpi/icon_sys_receive.png
Normal file
BIN
live/src/main/res/mipmap-mdpi/icon_sys_receive.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
BIN
live/src/main/res/mipmap-mdpi/icon_sys_received.png
Normal file
BIN
live/src/main/res/mipmap-mdpi/icon_sys_received.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Reference in New Issue
Block a user