111
This commit is contained in:
parent
0cb1ed9b71
commit
41f07f2e3d
@ -30,31 +30,34 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
|
|
||||||
|
|
||||||
//根据用户信息
|
//根据用户信息
|
||||||
private Handler netHandler = new Handler();
|
private Handler netHandler = null;
|
||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
private IMLoginManager(Context context) {
|
private IMLoginManager(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
this.context = context;
|
this.context = context;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//新用戶是否送了禮物
|
//新用戶是否送了禮物
|
||||||
public boolean isNewUserGif(){
|
public boolean isNewUserGif() {
|
||||||
return getBoolean(isNewUserGif,false);
|
return getBoolean(isNewUserGif, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//是否是新用戶還沒有送禮物
|
//是否是新用戶還沒有送禮物
|
||||||
public void setNewUserGif(boolean t){
|
public void setNewUserGif(boolean t) {
|
||||||
put(isNewUserGif,t);
|
put(isNewUserGif, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否新用户第一次進直播間
|
// 是否新用户第一次進直播間
|
||||||
public boolean isisNewUserOne(){
|
public boolean isisNewUserOne() {
|
||||||
return getBoolean(isNewUserOne,false);
|
return getBoolean(isNewUserOne, false);
|
||||||
}
|
|
||||||
//新用戶是否送了禮物
|
|
||||||
public void setisNewUserOne(boolean t){
|
|
||||||
put(isNewUserOne,t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//新用戶是否送了禮物
|
||||||
|
public void setisNewUserOne(boolean t) {
|
||||||
|
put(isNewUserOne, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,6 +85,16 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断是否已登录
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static boolean isLogin(Context context) {
|
||||||
|
return null != get(context).getUserInfo();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置已登录的用户信息
|
* 设置已登录的用户信息
|
||||||
*
|
*
|
||||||
@ -89,6 +102,19 @@ public class IMLoginManager extends BaseCacheManager {
|
|||||||
*/
|
*/
|
||||||
public void setupLoginUser(@NonNull IMLoginModel model) {
|
public void setupLoginUser(@NonNull IMLoginModel model) {
|
||||||
this.userInfo = model;
|
this.userInfo = model;
|
||||||
|
if (netHandler == null) {
|
||||||
|
netHandler = new Handler();
|
||||||
|
}
|
||||||
|
netHandler.post(isInstructorRunnable);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重新请求管理员身份信息
|
||||||
|
*/
|
||||||
|
public void checkInstructor() {
|
||||||
|
if (netHandler == null) {
|
||||||
|
netHandler = new Handler();
|
||||||
|
}
|
||||||
netHandler.post(isInstructorRunnable);
|
netHandler.post(isInstructorRunnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import android.app.Activity;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
@ -136,6 +137,7 @@ public class MessageIMManager {
|
|||||||
if ((message.getConversationType() == Conversation.ConversationType.SYSTEM) && (message.getContent() instanceof TextMessage)) {
|
if ((message.getConversationType() == Conversation.ConversationType.SYSTEM) && (message.getContent() instanceof TextMessage)) {
|
||||||
TextMessage content = (TextMessage) message.getContent();
|
TextMessage content = (TextMessage) message.getContent();
|
||||||
String json = content.getContent();
|
String json = content.getContent();
|
||||||
|
Log.e("getSystemForRongcloud", json);
|
||||||
model = new Gson().fromJson(json, ImUserInfoModel.class);
|
model = new Gson().fromJson(json, ImUserInfoModel.class);
|
||||||
}
|
}
|
||||||
if (message.getConversationType() == Conversation.ConversationType.SYSTEM && model != null && TextUtils.equals(model.getMethod(), "LivePK_UnreadCount")) {
|
if (message.getConversationType() == Conversation.ConversationType.SYSTEM && model != null && TextUtils.equals(model.getMethod(), "LivePK_UnreadCount")) {
|
||||||
|
@ -4,8 +4,8 @@ ext {
|
|||||||
buildToolsVersion: "28.0.3",
|
buildToolsVersion: "28.0.3",
|
||||||
minSdkVersion : 21,
|
minSdkVersion : 21,
|
||||||
targetSdkVersion : 30,
|
targetSdkVersion : 30,
|
||||||
versionCode : 200,
|
versionCode : 201,
|
||||||
versionName : "6.3.6"
|
versionName : "6.3.7"
|
||||||
]
|
]
|
||||||
manifestPlaceholders = [
|
manifestPlaceholders = [
|
||||||
//正式
|
//正式
|
||||||
|
@ -23,6 +23,7 @@ import com.blankj.utilcode.util.GsonUtils;
|
|||||||
import com.yunbao.common.activity.AbsActivity;
|
import com.yunbao.common.activity.AbsActivity;
|
||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.adapter.SystemChatMessageAdapter;
|
import com.yunbao.live.adapter.SystemChatMessageAdapter;
|
||||||
@ -89,6 +90,7 @@ public class PDLIiveChatActivity extends FragmentActivity {
|
|||||||
* 初始化数据
|
* 初始化数据
|
||||||
*/
|
*/
|
||||||
private void initData() {
|
private void initData() {
|
||||||
|
IMLoginManager.get(mContext).checkInstructor();
|
||||||
//获取系统消息列表
|
//获取系统消息列表
|
||||||
ImHttpUtil.getImUserInfo("", new HttpCallback() {
|
ImHttpUtil.getImUserInfo("", new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -65,22 +65,22 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
|
|||||||
window.setAttributes(params);
|
window.setAttributes(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void onStart() {
|
// public void onStart() {
|
||||||
super.onStart();
|
// super.onStart();
|
||||||
Window window = getDialog().getWindow();
|
//// Window window = getDialog().getWindow();
|
||||||
window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
//// window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
WindowManager.LayoutParams windowParams = window.getAttributes();
|
//// WindowManager.LayoutParams windowParams = window.getAttributes();
|
||||||
windowParams.dimAmount = 0.0f;
|
//// windowParams.dimAmount = 0.0f;
|
||||||
windowParams.y = 100;
|
//// windowParams.y = 100;
|
||||||
window.setAttributes(windowParams);
|
//// window.setAttributes(windowParams);
|
||||||
Dialog dialog = getDialog();
|
//// Dialog dialog = getDialog();
|
||||||
if (dialog != null) {
|
//// if (dialog != null) {
|
||||||
DisplayMetrics dm = new DisplayMetrics();
|
//// DisplayMetrics dm = new DisplayMetrics();
|
||||||
getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
|
//// getActivity().getWindowManager().getDefaultDisplay().getMetrics(dm);
|
||||||
dialog.getWindow().setLayout((int) (dm.widthPixels), (int) (dm.heightPixels * (showType == 0 ? 0.5 : 1)));
|
//// dialog.getWindow().setLayout((int) (dm.widthPixels), (int) (dm.heightPixels * (showType == 0 ? 0.5 : 1)));
|
||||||
}
|
//// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
|
@ -130,6 +130,9 @@ public class SocketRyClient {
|
|||||||
mListener.onSuperCloseLive();//超管关闭房间
|
mListener.onSuperCloseLive();//超管关闭房间
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(socketMsg.contains("LivePK_UnreadCount")){
|
||||||
|
return;
|
||||||
|
}
|
||||||
SocketReceiveBean received = JSON.parseObject(socketMsg, SocketReceiveBean.class);
|
SocketReceiveBean received = JSON.parseObject(socketMsg, SocketReceiveBean.class);
|
||||||
Log.i("tag", "1" + "礼物");
|
Log.i("tag", "1" + "礼物");
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@ -25,6 +26,7 @@ import com.yunbao.common.event.UpdateTablePoint;
|
|||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.http.HttpClient;
|
import com.yunbao.common.http.HttpClient;
|
||||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||||
|
import com.yunbao.common.utils.DpUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.LiveActivity;
|
import com.yunbao.live.activity.LiveActivity;
|
||||||
@ -42,6 +44,8 @@ import org.greenrobot.eventbus.ThreadMode;
|
|||||||
import java.net.MalformedURLException;
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
|
import static com.yunbao.live.views.LiveRoomViewHolder.mNameText;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by cxf on 2018/10/9.
|
* Created by cxf on 2018/10/9.
|
||||||
* 观众直播间逻辑
|
* 观众直播间逻辑
|
||||||
@ -83,6 +87,16 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
svga_new_user_gif.setVisibility(View.GONE);
|
svga_new_user_gif.setVisibility(View.GONE);
|
||||||
svga_new_user_gif.stopAnimation();
|
svga_new_user_gif.stopAnimation();
|
||||||
svga_new_user_gif.clear();
|
svga_new_user_gif.clear();
|
||||||
|
}else if("name_true".equals(str)){
|
||||||
|
if(LiveRoomViewHolder.mName.getText().length()<=4){
|
||||||
|
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(DpUtil.dp2px(116),DpUtil.dp2px(40));
|
||||||
|
layoutParams.setMargins(DpUtil.dp2px(80),DpUtil.dp2px(80),0,0);
|
||||||
|
svga_new_user_follow.setLayoutParams(layoutParams);
|
||||||
|
}else{
|
||||||
|
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(DpUtil.dp2px(116),DpUtil.dp2px(40));
|
||||||
|
layoutParams.setMargins(DpUtil.dp2px(100),DpUtil.dp2px(80),0,0);
|
||||||
|
svga_new_user_follow.setLayoutParams(layoutParams);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -152,6 +166,8 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
|||||||
svga_new_user_gif = (SVGAImageView)findViewById(R.id.svga_new_user_gif);
|
svga_new_user_gif = (SVGAImageView)findViewById(R.id.svga_new_user_gif);
|
||||||
svga_new_user_double = (SVGAImageView)findViewById(R.id.svga_new_user_double);
|
svga_new_user_double = (SVGAImageView)findViewById(R.id.svga_new_user_double);
|
||||||
svga_new_user_follow = (SVGAImageView)findViewById(R.id.svga_new_user_follow);
|
svga_new_user_follow = (SVGAImageView)findViewById(R.id.svga_new_user_follow);
|
||||||
|
|
||||||
|
|
||||||
svga_new_user_double.setOnClickListener(new View.OnClickListener() {
|
svga_new_user_double.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
@ -975,6 +975,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
if (mName != null) {
|
if (mName != null) {
|
||||||
mNameText = name;
|
mNameText = name;
|
||||||
mName.setText(name);
|
mName.setText(name);
|
||||||
|
EventBus.getDefault().post("name_true");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
<WebView
|
<WebView
|
||||||
android:id="@+id/rlWebview"
|
android:id="@+id/rlWebview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="wrap_content"/>
|
||||||
android:layout_weight="1"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
@ -465,7 +465,6 @@
|
|||||||
android:layout_width="116dp"
|
android:layout_width="116dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:layout_marginTop="80dp"
|
android:layout_marginTop="80dp"
|
||||||
android:layout_marginLeft="100dp"
|
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
app:autoPlay="true" />
|
app:autoPlay="true" />
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@ import com.yunbao.common.custom.TabButtonGroup;
|
|||||||
import com.yunbao.common.event.MessageIMEvent;
|
import com.yunbao.common.event.MessageIMEvent;
|
||||||
import com.yunbao.common.event.UpdateTablePointMe;
|
import com.yunbao.common.event.UpdateTablePointMe;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
|
||||||
import com.yunbao.common.utils.ProcessResultUtil;
|
import com.yunbao.common.utils.ProcessResultUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
@ -114,6 +115,7 @@ public class PDLiveConversationListActivity extends AbsActivity {
|
|||||||
* 初始化数据
|
* 初始化数据
|
||||||
*/
|
*/
|
||||||
private void initData() {
|
private void initData() {
|
||||||
|
IMLoginManager.get(mContext).checkInstructor();
|
||||||
mProcessResultUtil = new ProcessResultUtil(this);
|
mProcessResultUtil = new ProcessResultUtil(this);
|
||||||
//获取系统消息列表
|
//获取系统消息列表
|
||||||
ImHttpUtil.getImUserInfo("", new HttpCallback() {
|
ImHttpUtil.getImUserInfo("", new HttpCallback() {
|
||||||
|
@ -84,10 +84,11 @@ public class MainHomeLiveWeekItemViewHolder<T> extends RecyclerView.ViewHolder {
|
|||||||
List<WeekListBean> mWeekList = bean.getmWeekList();
|
List<WeekListBean> mWeekList = bean.getmWeekList();
|
||||||
if (mWeekList != null && mWeekList.size() > 0) {
|
if (mWeekList != null && mWeekList.size() > 0) {
|
||||||
viewflipperBanner.removeAllViews();
|
viewflipperBanner.removeAllViews();
|
||||||
|
weekList.clear();
|
||||||
|
weekList.addAll(mWeekList);
|
||||||
|
itemView.setTag(position);
|
||||||
}
|
}
|
||||||
weekList.clear();
|
|
||||||
weekList.addAll(mWeekList);
|
|
||||||
itemView.setTag(position);
|
|
||||||
try {
|
try {
|
||||||
upSvga();
|
upSvga();
|
||||||
//设置周榜边框动图
|
//设置周榜边框动图
|
||||||
@ -115,7 +116,7 @@ public class MainHomeLiveWeekItemViewHolder<T> extends RecyclerView.ViewHolder {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (listener != null) {
|
if (listener != null) {
|
||||||
WeekListBean model = mWeekList.get(viewflipperBanner.getDisplayedChild());
|
WeekListBean model = weekList.get(viewflipperBanner.getDisplayedChild());
|
||||||
bean.setUid(model.getAnchor_id());
|
bean.setUid(model.getAnchor_id());
|
||||||
listener.onItemClick(bean, position);
|
listener.onItemClick(bean, position);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
<bool name="rc_enable_send_combine_message">false</bool>
|
<bool name="rc_enable_send_combine_message">false</bool>
|
||||||
|
|
||||||
<!--在前台非会话页面时,接收到新消息是否响铃 -->
|
<!--在前台非会话页面时,接收到新消息是否响铃 -->
|
||||||
<bool name="rc_sound_in_foreground">true</bool>
|
<bool name="rc_sound_in_foreground">false</bool>
|
||||||
|
|
||||||
<!--会话页面右上角的未读 @ 消息数提示,当收到的消息中有 @ 消息时,进入会话之后,是否在右上角提示未读 @ 消息数-->
|
<!--会话页面右上角的未读 @ 消息数提示,当收到的消息中有 @ 消息时,进入会话之后,是否在右上角提示未读 @ 消息数-->
|
||||||
<bool name="rc_enable_unread_mention">true</bool>
|
<bool name="rc_enable_unread_mention">true</bool>
|
||||||
|
Loading…
Reference in New Issue
Block a user