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