fix [一直存在草稿的问题]

fix [聊天通知改为可点击]
This commit is contained in:
zlzw 2024-03-25 16:38:47 +08:00
parent 57333cdae8
commit 9a7054ce76
5 changed files with 68 additions and 5 deletions

View File

@ -21,7 +21,7 @@ buildscript {
classpath 'com.android.tools.build:gradle:4.0.2' classpath 'com.android.tools.build:gradle:4.0.2'
//png工具 //png工具
classpath 'com.chenenyu:img-optimizer:1.3.0' classpath 'com.chenenyu:img-optimizer:1.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3' classpath 'com.google.gms:google-services:4.3.3'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath "com.alibaba:arouter-register:1.0.2" classpath "com.alibaba:arouter-register:1.0.2"

View File

@ -60,7 +60,8 @@ public class MessageSayHiNotifyDialog extends AbsDialogCenterPopupWindow {
@Override @Override
public void buildDialog(XPopup.Builder builder) { public void buildDialog(XPopup.Builder builder) {
builder.isClickThrough(true);
builder.isTouchThrough(true);
} }
@Override @Override

View File

@ -233,7 +233,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
//丢包率 //丢包率
long lossRate = statusBean.packetLostRate; long lossRate = statusBean.packetLostRate;
//带宽 //带宽
String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth; //String googAvailableSendBandwidth = statusReport.googAvailableSendBandwidth;
// Log.e("网速和内存", "获取视频:" + resolution + " 丢包率:" + lossRate + " 带宽:" + googAvailableSendBandwidth); // Log.e("网速和内存", "获取视频:" + resolution + " 丢包率:" + lossRate + " 带宽:" + googAvailableSendBandwidth);
} }
} }

View File

@ -2,6 +2,10 @@ package com.yunbao.live.views;
import android.graphics.Color; import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
@ -13,16 +17,23 @@ import com.yunbao.common.event.PDChatInputModeEvent;
import com.yunbao.common.http.base.HttpCallback; import com.yunbao.common.http.base.HttpCallback;
import com.yunbao.common.http.live.LiveNetManager; import com.yunbao.common.http.live.LiveNetManager;
import com.yunbao.common.manager.IMLoginManager; import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ToastUtil;
import com.yunbao.live.R;
import com.yunbao.live.dialog.PDLiveMessageListAdapter; import com.yunbao.live.dialog.PDLiveMessageListAdapter;
import com.yunbao.live.event.InputPanelViewHolderEvent;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import java.lang.reflect.Field;
import java.util.List; import java.util.List;
import io.rong.imkit.conversation.ConversationFragment; import io.rong.imkit.conversation.ConversationFragment;
import io.rong.imkit.conversation.MessageListAdapter; import io.rong.imkit.conversation.MessageListAdapter;
import io.rong.imkit.conversation.extension.InputMode; import io.rong.imkit.conversation.extension.InputMode;
import io.rong.imkit.conversation.extension.RongExtensionViewModel; import io.rong.imkit.conversation.extension.RongExtensionViewModel;
import io.rong.imkit.conversation.extension.component.inputpanel.InputPanel;
import io.rong.imlib.RongIMClient;
import io.rong.imlib.model.Conversation;
/** /**
* 聊天详情页面 * 聊天详情页面
@ -30,6 +41,7 @@ import io.rong.imkit.conversation.extension.RongExtensionViewModel;
public class PDLiveConversationFragment extends ConversationFragment { public class PDLiveConversationFragment extends ConversationFragment {
PDLiveMessageListAdapter adapter; PDLiveMessageListAdapter adapter;
private String targetId = ""; private String targetId = "";
private String editString = null;
public PDLiveConversationFragment(String targetId) { public PDLiveConversationFragment(String targetId) {
this.targetId = targetId; this.targetId = targetId;
@ -42,6 +54,36 @@ public class PDLiveConversationFragment extends ConversationFragment {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
view.setBackgroundColor(Color.parseColor("#00000000")); view.setBackgroundColor(Color.parseColor("#00000000"));
//TODO 下面片段是尝试修复模拟器emoji无法唤起的bug后续版本解决该问题
//TODO 模拟器聊天框无法切换emoji表情复现步骤 1.点开语音 2.+ 直到弹出插件栏 3.点emoji
/* View emoji = mRongExtension.getInputPanel().getRootView().findViewById(R.id.input_panel_emoji_btn);
emoji.setOnClickListener(click -> {
mRongExtension.getInputPanel().getEditText().clearFocus();
if (mRongExtensionViewModel.getInputModeLiveData().getValue() != null && ((InputMode) mRongExtensionViewModel.getInputModeLiveData().getValue()).equals(InputMode.EmoticonMode)) {
mRongExtension.getInputPanel().getEditText().requestFocus();
mRongExtensionViewModel.getInputModeLiveData().postValue(InputMode.TextInput);
} else {
ToastUtil.showDebug("切换到恶魔及");
try {
Field mBoardContainerField = mRongExtension.getClass().getDeclaredField("mBoardContainer");
mBoardContainerField.setAccessible(true);
View mBoardContainer = (View) mBoardContainerField.get(mRongExtension);
assert mBoardContainer != null;
if (mBoardContainer.getVisibility() == View.VISIBLE) {
mRongExtensionViewModel.getInputModeLiveData().postValue(InputMode.EmoticonMode);
} else {
mRongExtensionViewModel.getInputModeLiveData().postValue(InputMode.PluginMode);
new Handler(Looper.getMainLooper())
.postDelayed(() -> mRongExtensionViewModel.getInputModeLiveData().postValue(InputMode.EmoticonMode), 100L);
}
} catch (Exception e) {
e.printStackTrace();
}
//EventBus.getDefault().post(new InputPanelViewHolderEvent());
}
});
*/
mRongExtensionViewModel.getInputModeLiveData().observe(getViewLifecycleOwner(), new Observer<InputMode>() { mRongExtensionViewModel.getInputModeLiveData().observe(getViewLifecycleOwner(), new Observer<InputMode>() {
@Override @Override
@ -60,6 +102,22 @@ public class PDLiveConversationFragment extends ConversationFragment {
EventBus.getDefault().post(new PDChatInputModeEvent(InputMode.TextInput)); EventBus.getDefault().post(new PDChatInputModeEvent(InputMode.TextInput));
} }
}); });
mRongExtension.getInputPanel().getEditText().addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void afterTextChanged(Editable editable) {
editString = editable.toString();
}
});
} }
@Override @Override
@ -70,7 +128,7 @@ public class PDLiveConversationFragment extends ConversationFragment {
.getUserLiveStatus(ids, new HttpCallback<List<Integer>>() { .getUserLiveStatus(ids, new HttpCallback<List<Integer>>() {
@Override @Override
public void onSuccess(List<Integer> data) { public void onSuccess(List<Integer> data) {
if(data.isEmpty()){ if (data.isEmpty()) {
adapter.setLeftLive(false); adapter.setLeftLive(false);
adapter.setRightLive(false); adapter.setRightLive(false);
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
@ -98,4 +156,8 @@ public class PDLiveConversationFragment extends ConversationFragment {
public RongExtensionViewModel getRongExtensionViewModel() { public RongExtensionViewModel getRongExtensionViewModel() {
return mRongExtensionViewModel; return mRongExtensionViewModel;
} }
public String getEditString() {
return editString;
}
} }

View File

@ -473,7 +473,7 @@ public class PDLiveConversationActivity extends AbsActivity implements View.OnCl
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
//获取输入框信息存进输入框 //获取输入框信息存进输入框
String content = inputPanel.getPresetInformation(); String content = conversationFragment.getEditString();
if (!TextUtils.isEmpty(content)) { if (!TextUtils.isEmpty(content)) {
IMCenter.getInstance().saveTextMessageDraft(Conversation.ConversationType.PRIVATE, targetId, content, null); IMCenter.getInstance().saveTextMessageDraft(Conversation.ConversationType.PRIVATE, targetId, content, null);
} }