Commit 11ddfd12 by 霍志良

feat:im-灵犀2.0-用户显示灵犀的正在输入中

parent 6b09caef
package com.yidianling.im.event
public class MultipleSelectedEvent (
val strSelected:String
val strSelected:String,
var isOthers:Boolean
)
\ No newline at end of file
......@@ -117,6 +117,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
break;
}
}
questionList.get(0).setName("其他");
if (customAttachLingxiWhichQuestion.type!=null){
switch (customAttachLingxiWhichQuestion.type){
case "radio"://您想要咨询下列哪类的问题?(单选)
......@@ -230,13 +231,17 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
}
}
}
confirm_multiple_choice.setText(selectedStr.size());
confirm_multiple_choice.setText(String.format("确定(%d)", selectedStr.size()));
stringBuffer.delete(2,stringBuffer.length());
for (int i=0;i<selectedStr.size();i++){
stringBuffer.append("#").append(selectedStr.get(i));
}
EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString()));
EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(),false));
adapterLingxiMultipleChoice.setTagData(questionList);
if (questionList.get(position).getName().contains("其他")){
//唤起输入键盘,隐藏标签、图片等其他布局
EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(),true));
}
}
private void updateLocalMsg(Integer position) {
//更新本地消息
......
......@@ -223,11 +223,11 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
try {
JSONObject json = JSON.parseObject(content);
int id = json.getIntValue("id");
String oldName=tb.getTitle();
if (id == 1) {
// 正在输入
ToastUtil.toastShort(this, "对方正在输入...");
} else {
// ToastUtil.toastShort(this, "command: " + content);
tb.setTitle("对方正在输入...");
} else if (id==2){
tb.setTitle(oldName);
}
} catch (Exception e) {
......
......@@ -1079,8 +1079,13 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
public void onEvent(MultipleSelectedEvent event){
if (event.isOthers()){
//用户点击了其他事件
inputPanel.onlyShowTextStart();
}else{
question_multiple.setText(event.getStrSelected());
}
}
public boolean onBackPressed() {
return inputPanel.collapse(true) || messageListPanel.onBackPressed() || openOrCloseCommonQuestionLayout(false);
}
......@@ -1129,6 +1134,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
messageListPanel.setChattingBackground(customization.backgroundUri, customization.backgroundColor);
}
userIsInPage("66","用户在当前页面",sessionId,ImIn.INSTANCE.getUserInfo().getUid());
}
private void initAitManager() {
......
......@@ -144,6 +144,8 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
private String sendText = "";
private Boolean onlyShowInputTest=false;
/***设置输入框内容*/
public void setInputContent(String content) {
messageEditText.setText(content == null ? "" : content);
......@@ -654,6 +656,29 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
imm.hideSoftInputFromWindow(messageEditText.getWindowToken(), 0);
messageEditText.clearFocus();
}
/**
* 灵犀-点击其他时候-只显示输入框,不显示其他选项
*/
public void onlyShowTextStart() {
showInputMethod(messageEditText);
onlyShowInputTest=true;
//隐藏左边语音布局
textAudioSwitchLayout.setVisibility(View.INVISIBLE);
//隐藏右边表情和加号布局
emojiButtonInInputBar.setVisibility(View.GONE);
moreFuntionButtonInInputBar.setVisibility(View.GONE);
}
/**
* 灵犀-点击其他时候-只显示输入框,不显示其他选项
*/
public void onlyShowTextEnd() {
onlyShowInputTest=false;
//隐藏左边语音布局
textAudioSwitchLayout.setVisibility(View.VISIBLE);
//隐藏右边表情和加号布局
emojiButtonInInputBar.setVisibility(View.VISIBLE);
moreFuntionButtonInInputBar.setVisibility(View.VISIBLE);
}
/**
* 隐藏语音布局
......@@ -713,7 +738,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
container.proxy.onInputPanelExpand();
}
/**
* 显示更多布局
*/
......@@ -766,9 +790,11 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
sendMessageButtonInInputBar.setVisibility(View.VISIBLE);
} else {
sendMessageButtonInInputBar.setVisibility(View.GONE);
if (!onlyShowInputTest){
moreFuntionButtonInInputBar.setVisibility(View.VISIBLE);
}
}
}
/**
* *************** IEmojiSelectedListener ***************
......
......@@ -146,7 +146,14 @@ public class TitleBarBottom extends RelativeLayout {
setmMinTitleVisiable(GONE);
}
}
/**
* 获得头部的内容
*
*
*/
public String getTitle( ) {
return tv_center_title.getText().toString();
}
/**
* 设置小标题文字
*/
......
......@@ -614,6 +614,7 @@
android:visibility="gone" />
<include layout="@layout/im_nim_message_activity_bottom_layout" />
<include
layout="@layout/im_nim_message_activity_bottom_layout" />
</LinearLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment