11111
This commit is contained in:
parent
47030425cd
commit
1007e2ab20
@ -73,6 +73,7 @@ dependencies {
|
||||
api "androidx.constraintlayout:constraintlayout:2.1.4"
|
||||
// To use constraintlayout in compose
|
||||
api "androidx.constraintlayout:constraintlayout-compose:1.0.1"
|
||||
implementation 'androidx.lifecycle:lifecycle-common-java8:2.4.0'
|
||||
api files('../libs/commons-io-1.4.jar')
|
||||
//okHttp网络请求
|
||||
api rootProject.ext.dependencies["okhttp"]
|
||||
@ -150,10 +151,10 @@ dependencies {
|
||||
//腾讯im
|
||||
api 'com.tencent.imsdk:imsdk-plus:5.4.666'
|
||||
api 'com.google.code.gson:gson:2.8.8'
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.0' // 音视频通话基础能力库
|
||||
api 'cn.rongcloud.sdk:rtc_lib:5.2.3.2' // 音视频通话基础能力库
|
||||
//此处以集成 5.1.2 版本为例
|
||||
api 'cn.rongcloud.sdk:im_lib:5.1.3.10' // 即时通讯基础能力库
|
||||
api 'cn.rongcloud.sdk:im_kit:5.1.3.10' // 即时通讯 UI 基础组件
|
||||
api 'cn.rongcloud.sdk:im_lib:5.2.3.2' // 即时通讯基础能力库
|
||||
api 'cn.rongcloud.sdk:im_kit:5.2.3.2' // 即时通讯 UI 基础组件
|
||||
api 'com.facebook.android:facebook-login:8.2.0'
|
||||
api 'com.facebook.android:facebook-android-sdk:[5,6)'
|
||||
|
||||
|
@ -83,6 +83,7 @@ public class MessageIMManager {
|
||||
* 获取系统消息(有未读数展示红点)
|
||||
*/
|
||||
public void getSystemMessages() {
|
||||
systemNumber=0;
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||
.params("uid", userInfo.getId())
|
||||
@ -102,12 +103,10 @@ public class MessageIMManager {
|
||||
//未读消息不为空并且大于0
|
||||
try {
|
||||
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
|
||||
systemNumber = Integer.parseInt(number);
|
||||
} else {
|
||||
systemNumber = 0;
|
||||
systemNumber = Integer.parseInt(number)+systemNumber;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
systemNumber = 0;
|
||||
systemNumber =systemNumber+ 0;
|
||||
}
|
||||
}
|
||||
//发送通知
|
||||
@ -146,6 +145,7 @@ public class MessageIMManager {
|
||||
* 获取系统消息(有未读数展示红点)
|
||||
*/
|
||||
public void getSystemMessages(SystemMessagesHttpCallback callback) {
|
||||
systemNumber=0;
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
HttpClient.getInstance().get("Message.getLists", "getImUserInfo")
|
||||
.params("uid", userInfo.getId())
|
||||
@ -168,12 +168,10 @@ public class MessageIMManager {
|
||||
//未读消息不为空并且大于0
|
||||
try {
|
||||
if (!TextUtils.isEmpty(number) && Integer.parseInt(number) > 0) {
|
||||
systemNumber = Integer.parseInt(number);
|
||||
} else {
|
||||
systemNumber = 0;
|
||||
systemNumber = Integer.parseInt(number)+systemNumber;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
systemNumber = 0;
|
||||
systemNumber = systemNumber+0;
|
||||
}
|
||||
}
|
||||
//发送通知
|
||||
|
@ -29,20 +29,21 @@ public class PDLiveMessageListAdapter extends MessageListAdapter {
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
super.onBindViewHolder(holder, position);
|
||||
Message.MessageDirection messageDirection = mDataList.get(position).getMessage().getMessageDirection();
|
||||
Message.SentStatus sentStatus = mDataList.get(position).getMessage().getSentStatus();
|
||||
ImageView readReceipt = holder.getConvertView().findViewById(R.id.rc_read_receipt);
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
ImageView readReceiptNew = holder.getConvertView().findViewById(R.id.rc_read_receipt_new);
|
||||
if (!mDataList.get(position).getMessage().getSenderUserId().equals(mDataList.get(position).getTargetId())) {
|
||||
if (sentStatus.equals(Message.SentStatus.READ)) {
|
||||
if (messageDirection==Message.MessageDirection.SEND){
|
||||
readReceiptNew.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
readReceiptNew.setVisibility(View.GONE);
|
||||
}
|
||||
if (readReceipt.getVisibility()==View.VISIBLE) {
|
||||
readReceiptNew.setBackgroundResource(R.mipmap.icon_message_read);
|
||||
} else {
|
||||
readReceiptNew.setBackgroundResource(R.mipmap.icon_message_unread);
|
||||
}
|
||||
} else {
|
||||
if (readReceipt!=null){
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
holder.getConvertView().setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
|
@ -78,24 +78,8 @@ public class InputPanelViewHolder extends LinearLayout implements View.OnClickLi
|
||||
inputPanelView.findViewById(R.id.lt_photo_button).setOnClickListener(this);
|
||||
inputPanelView.findViewById(R.id.lt_choospic_button).setOnClickListener(this);
|
||||
inputPanelView.findViewById(R.id.lt_video_button).setOnClickListener(this);
|
||||
// editBtn.setOnFocusChangeListener(focusChangeListener);
|
||||
}
|
||||
|
||||
// //输入框焦点监听事件
|
||||
// View.OnFocusChangeListener focusChangeListener = new OnFocusChangeListener() {
|
||||
// @Override
|
||||
// public void onFocusChange(View v, boolean hasFocus) {
|
||||
// if (!hasFocus&& pluginList.getVisibility()==GONE) {
|
||||
// //失去焦点
|
||||
// InputMethodManager imm = (InputMethodManager) getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
// imm.showSoftInput(editBtn, InputMethodManager.SHOW_FORCED);
|
||||
// imm.hideSoftInputFromWindow(editBtn.getWindowToken(), 0); //强制隐藏键盘
|
||||
// } else {
|
||||
// pluginList.setVisibility(GONE);
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
|
@ -16,6 +16,7 @@ import android.widget.TextView;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.event.MessageIMEvent;
|
||||
import com.yunbao.common.event.UpdateTablePoint;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
@ -355,11 +356,11 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
}
|
||||
|
||||
|
||||
//红点(直播页面)
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onUpdateFieldEvent(UpdateTablePoint updateTablePoint) {
|
||||
//消息中心
|
||||
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
|
||||
public void onMessageIMEvent(MessageIMEvent event) {
|
||||
//判断消息中心红点是否已经展示,如果已经展示并且未读消息大于0则不再执行之后的逻辑
|
||||
int number = updateTablePoint.getPoint();
|
||||
int number = event.getNumber();
|
||||
if (v_msg_redpoint.getVisibility() == View.VISIBLE && number > 0) return;
|
||||
if (number > 0) {
|
||||
v_msg_redpoint.setVisibility(View.VISIBLE);
|
||||
|
@ -62,12 +62,6 @@
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="4dp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/rc_margin"
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="1dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginStart="15dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/rc_conversation_content"
|
||||
|
@ -12,6 +12,7 @@ import android.text.TextUtils;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.EditText;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -214,8 +215,16 @@ public class LoginActivity extends AbsActivity {
|
||||
onLoginSuccess(code, msg, info);
|
||||
}
|
||||
});
|
||||
hideKeyboard(mEditPwd);
|
||||
}
|
||||
/**
|
||||
* 强隐键盘
|
||||
* @param view
|
||||
*/
|
||||
private void hideKeyboard(View view) {
|
||||
InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
|
||||
imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
|
||||
}
|
||||
|
||||
//登录即代表同意服务和隐私条款
|
||||
private void forwardTip() {
|
||||
WebViewActivity.forward(mContext, HtmlConfig.LOGIN_PRIVCAY);
|
||||
|
@ -18,6 +18,7 @@ import android.util.Log;
|
||||
import android.view.Display;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
@ -365,7 +366,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
//融云直播间聊天
|
||||
Message msg = Message.obtain();
|
||||
msg.what = Constants.SOCKET_WHAT_BROADCAST;
|
||||
if (!"".equals(message.getContent()) && message.getContent() != null) {
|
||||
if (message.getContent() instanceof TextMessage && !"".equals(message.getContent()) && message.getContent() != null) {
|
||||
TextMessage content = (TextMessage) message.getContent();
|
||||
if (content.getContent().contains("_method_")) {
|
||||
msg.obj = content.getContent();
|
||||
@ -377,7 +378,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ public class PDLiveConversationListActivity extends AbsActivity {
|
||||
EventBus.getDefault().register(this);
|
||||
mContext = this;
|
||||
initView();
|
||||
initData();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -175,6 +175,7 @@ public class PDLiveConversationListActivity extends AbsActivity {
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
initData();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -185,6 +186,8 @@ public class PDLiveConversationListActivity extends AbsActivity {
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
conversationListFragment.onStop();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -7,7 +7,6 @@ import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@ -15,7 +14,6 @@ import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.manager.InstructorRemarkManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.activity.PDLIiveChatActivity;
|
||||
import com.yunbao.live.activity.PDLiveConversationActivity;
|
||||
import com.yunbao.live.bean.SearchUserBean;
|
||||
@ -107,10 +105,9 @@ public class ConversationIMListManager {
|
||||
* @param targetId 用户id
|
||||
*/
|
||||
public void jumpConversation(Activity context, String targetId) {
|
||||
// RouteUtils.registerActivity(RouteUtils.RongActivityType.ConversationActivity, PDLiveConversationActivity.class);
|
||||
// Intent intent = new Intent(context, PDLiveConversationActivity.class);
|
||||
// intent.putExtra(RouteUtils.TARGET_ID, targetId);
|
||||
// context.startActivity(intent);
|
||||
if (context instanceof PDLIiveChatActivity) {
|
||||
context.finish();
|
||||
}
|
||||
Conversation.ConversationType type = Conversation.ConversationType.PRIVATE;
|
||||
RouteUtils.routeToConversationActivity(context, type, targetId, null);
|
||||
}
|
||||
@ -159,6 +156,9 @@ public class ConversationIMListManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 长按时间
|
||||
*/
|
||||
@Override
|
||||
public boolean onConversationLongClick(Context context, View view, BaseUiConversation baseUiConversation) {
|
||||
new ConversationPopuwWindow((Activity) context)
|
||||
@ -167,9 +167,14 @@ public class ConversationIMListManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean onConversationClick(Context context, View view, BaseUiConversation baseUiConversation) {
|
||||
return false;
|
||||
jumpConversation((Activity) context, baseUiConversation.mCore.getTargetId());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -38,23 +38,16 @@ public class PDLiveCustomConversationProvider extends BaseConversationProvider {
|
||||
public void bindViewHolder(ViewHolder holder, BaseUiConversation uiConversation, int position, List<BaseUiConversation> list, IViewProviderListener<BaseUiConversation> listener) {
|
||||
//根据业务需要,自定义处理
|
||||
super.bindViewHolder(holder, uiConversation, position, list, listener);
|
||||
if (list.size() > 0) {
|
||||
Message.SentStatus sentStatus = list.get(position).mCore.getSentStatus();
|
||||
ImageView readReceipt = holder.itemView.findViewById(com.yunbao.live.R.id.rc_read_receipt_new);
|
||||
View rcMargin = holder.itemView.findViewById(com.yunbao.live.R.id.rc_margin);
|
||||
if (TextUtils.equals(list.get(position).mCore.getSenderUserId(), list.get(position).mCore.getTargetId())) {
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
rcMargin.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (uiConversation.mCore.getLatestMessageDirection()==Message.MessageDirection.SEND) {
|
||||
Message.SentStatus sentStatus = uiConversation.mCore.getSentStatus();
|
||||
if (sentStatus == Message.SentStatus.READ) {
|
||||
readReceipt.setBackgroundResource(com.yunbao.live.R.mipmap.icon_messagelist_read);
|
||||
} else {
|
||||
readReceipt.setBackgroundResource(com.yunbao.live.R.mipmap.icon_messagelist_unread);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else {
|
||||
readReceipt.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -211,48 +211,6 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
}
|
||||
|
||||
return new_data;
|
||||
// if (select == 0) {
|
||||
// JSONObject obj = JSON.parseObject(info[0]);
|
||||
// mBannerList = JSON.parseArray(obj.getString("slide"), BannerBean.class);
|
||||
// List<LiveBean> old_data = JSON.parseArray(obj.getString("list"), LiveBean.class);
|
||||
// new_data = new ArrayList<>();
|
||||
// if (old_data != null) {
|
||||
// for (int j = 0; j < old_data.size(); j++) {
|
||||
// new_data.add(old_data.get(j));
|
||||
// if (j == 3) {
|
||||
// LiveBean liveBean = new LiveBean();
|
||||
// liveBean.setIsTop("1");
|
||||
// new_data.add(liveBean);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (!isHave) {
|
||||
// if (new_data.size() > 5) {
|
||||
// new_data.remove(5);
|
||||
// }
|
||||
// } else {
|
||||
// if (mWeekListBean != null) {
|
||||
// if (new_data.size() > 5) {
|
||||
// new_data.get(5).setmWeekList(mWeekListBean);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return new_data;
|
||||
// } else {
|
||||
// List<LiveBean> old_data = JSON.parseArray(Arrays.toString(info), LiveBean.class);
|
||||
// new_data = new ArrayList<>();
|
||||
// for (int j = 0; j < old_data.size(); j++) {
|
||||
// new_data.add(old_data.get(j));
|
||||
// if (j == 3) {
|
||||
// LiveBean liveBean = new LiveBean();
|
||||
// liveBean.setIsTop("1");
|
||||
// new_data.add(liveBean);
|
||||
// }
|
||||
// }
|
||||
// return new_data;
|
||||
// }
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -286,11 +244,9 @@ public class MainHomeLiveViewHolder extends AbsMainHomeChildViewHolder implement
|
||||
|
||||
}
|
||||
});
|
||||
// if (headView != null) {
|
||||
mClassRecyclerViewTop = (RecyclerView) findViewById(R.id.classRecyclerView_top);
|
||||
mClassRecyclerViewTop.setHasFixedSize(true);
|
||||
mClassRecyclerViewTop.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
|
||||
// }
|
||||
ConfigBean configBean = CommonAppConfig.getInstance().getConfig();
|
||||
if (configBean != null) {
|
||||
List<LiveClassBean> list = configBean.getLiveClass();
|
||||
|
@ -1,12 +1,10 @@
|
||||
package com.yunbao.main.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.yunbao.common.HtmlConfig;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.main.R;
|
||||
@ -59,15 +57,11 @@ public class MainHomeViewHolder extends AbsMainHomeParentViewHolder {
|
||||
} else if (position == 1) {
|
||||
mainHomeLiveViewHolder = new MainHomeLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeLiveViewHolder;
|
||||
}
|
||||
else if (position == 2) {
|
||||
} else if (position == 2) {
|
||||
mainHomeRecomLiveViewHolder = new MainHomeRecomLiveViewHolder(mContext, parent);
|
||||
vh = mainHomeRecomLiveViewHolder;
|
||||
}
|
||||
// else if (position == 3) {
|
||||
// mCsdViewHolder = new MainHomeCsdViewHolder(mContext, parent);
|
||||
// vh = mCsdViewHolder;
|
||||
// }
|
||||
|
||||
if (vh == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -45,7 +45,6 @@
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_30"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_selector_item_unread"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="10dp"
|
||||
android:gravity="center|left"
|
||||
@ -67,7 +66,6 @@
|
||||
android:layout_marginStart="3dp"
|
||||
android:layout_marginTop="@dimen/rc_margin_size_80"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:background="@drawable/rc_selector_item_unread"
|
||||
android:drawableStart="@drawable/rc_unread_msg_arrow"
|
||||
android:drawablePadding="10dp"
|
||||
android:gravity="center|left"
|
||||
|
Loading…
Reference in New Issue
Block a user