Commit 11ddfd12 by 霍志良

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

parent 6b09caef
package com.yidianling.im.event package com.yidianling.im.event
public class MultipleSelectedEvent ( 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 ...@@ -117,6 +117,7 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen
break; break;
} }
} }
questionList.get(0).setName("其他");
if (customAttachLingxiWhichQuestion.type!=null){ if (customAttachLingxiWhichQuestion.type!=null){
switch (customAttachLingxiWhichQuestion.type){ switch (customAttachLingxiWhichQuestion.type){
case "radio"://您想要咨询下列哪类的问题?(单选) case "radio"://您想要咨询下列哪类的问题?(单选)
...@@ -230,13 +231,17 @@ public class MsgViewHolderLingxiWhichQuestion extends MsgViewHolderBase implemen ...@@ -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()); stringBuffer.delete(2,stringBuffer.length());
for (int i=0;i<selectedStr.size();i++){ for (int i=0;i<selectedStr.size();i++){
stringBuffer.append("#").append(selectedStr.get(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); adapterLingxiMultipleChoice.setTagData(questionList);
if (questionList.get(position).getName().contains("其他")){
//唤起输入键盘,隐藏标签、图片等其他布局
EventBus.getDefault().post(new MultipleSelectedEvent(stringBuffer.toString(),true));
}
} }
private void updateLocalMsg(Integer position) { private void updateLocalMsg(Integer position) {
//更新本地消息 //更新本地消息
......
...@@ -223,11 +223,11 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -223,11 +223,11 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
try { try {
JSONObject json = JSON.parseObject(content); JSONObject json = JSON.parseObject(content);
int id = json.getIntValue("id"); int id = json.getIntValue("id");
String oldName=tb.getTitle();
if (id == 1) { if (id == 1) {
// 正在输入 tb.setTitle("对方正在输入...");
ToastUtil.toastShort(this, "对方正在输入..."); } else if (id==2){
} else { tb.setTitle(oldName);
// ToastUtil.toastShort(this, "command: " + content);
} }
} catch (Exception e) { } catch (Exception e) {
......
...@@ -1079,7 +1079,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1079,7 +1079,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
public void onEvent(MultipleSelectedEvent event){ public void onEvent(MultipleSelectedEvent event){
question_multiple.setText(event.getStrSelected()); if (event.isOthers()){
//用户点击了其他事件
inputPanel.onlyShowTextStart();
}else{
question_multiple.setText(event.getStrSelected());
}
} }
public boolean onBackPressed() { public boolean onBackPressed() {
return inputPanel.collapse(true) || messageListPanel.onBackPressed() || openOrCloseCommonQuestionLayout(false); return inputPanel.collapse(true) || messageListPanel.onBackPressed() || openOrCloseCommonQuestionLayout(false);
...@@ -1129,6 +1134,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -1129,6 +1134,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
messageListPanel.setChattingBackground(customization.backgroundUri, customization.backgroundColor); messageListPanel.setChattingBackground(customization.backgroundUri, customization.backgroundColor);
} }
userIsInPage("66","用户在当前页面",sessionId,ImIn.INSTANCE.getUserInfo().getUid()); userIsInPage("66","用户在当前页面",sessionId,ImIn.INSTANCE.getUserInfo().getUid());
} }
private void initAitManager() { private void initAitManager() {
......
...@@ -144,6 +144,8 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -144,6 +144,8 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
private String sendText = ""; private String sendText = "";
private Boolean onlyShowInputTest=false;
/***设置输入框内容*/ /***设置输入框内容*/
public void setInputContent(String content) { public void setInputContent(String content) {
messageEditText.setText(content == null ? "" : content); messageEditText.setText(content == null ? "" : content);
...@@ -654,6 +656,29 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -654,6 +656,29 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
imm.hideSoftInputFromWindow(messageEditText.getWindowToken(), 0); imm.hideSoftInputFromWindow(messageEditText.getWindowToken(), 0);
messageEditText.clearFocus(); 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 ...@@ -713,7 +738,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
container.proxy.onInputPanelExpand(); container.proxy.onInputPanelExpand();
} }
/** /**
* 显示更多布局 * 显示更多布局
*/ */
...@@ -766,7 +790,9 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -766,7 +790,9 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
sendMessageButtonInInputBar.setVisibility(View.VISIBLE); sendMessageButtonInInputBar.setVisibility(View.VISIBLE);
} else { } else {
sendMessageButtonInInputBar.setVisibility(View.GONE); sendMessageButtonInInputBar.setVisibility(View.GONE);
moreFuntionButtonInInputBar.setVisibility(View.VISIBLE); if (!onlyShowInputTest){
moreFuntionButtonInInputBar.setVisibility(View.VISIBLE);
}
} }
} }
......
...@@ -146,7 +146,14 @@ public class TitleBarBottom extends RelativeLayout { ...@@ -146,7 +146,14 @@ public class TitleBarBottom extends RelativeLayout {
setmMinTitleVisiable(GONE); setmMinTitleVisiable(GONE);
} }
} }
/**
* 获得头部的内容
*
*
*/
public String getTitle( ) {
return tv_center_title.getText().toString();
}
/** /**
* 设置小标题文字 * 设置小标题文字
*/ */
......
...@@ -614,6 +614,7 @@ ...@@ -614,6 +614,7 @@
android:visibility="gone" /> android:visibility="gone" />
<include layout="@layout/im_nim_message_activity_bottom_layout" /> <include
layout="@layout/im_nim_message_activity_bottom_layout" />
</LinearLayout> </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