Commit 7d5a3b03 by 徐健

增加私聊默认文案获取接口

parent 4779cea0
...@@ -47,7 +47,7 @@ ext { ...@@ -47,7 +47,7 @@ ext {
"m-fm" : "0.0.24", "m-fm" : "0.0.24",
"m-user" : "0.0.42", "m-user" : "0.0.42",
"m-home" : "0.0.8.2", "m-home" : "0.0.8.2",
"m-im" : "0.0.4.1", "m-im" : "0.0.4.61",
"m-dynamic" : "0.0.2", "m-dynamic" : "0.0.2",
"m-muse" : "0.0.21", "m-muse" : "0.0.21",
...@@ -64,7 +64,7 @@ ext { ...@@ -64,7 +64,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9", "m-user-api" : "0.0.9",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.5", "m-im-api" : "0.0.6.1",
"m-dynamic-api" : "0.0.1", "m-dynamic-api" : "0.0.1",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -110,7 +110,7 @@ ext { ...@@ -110,7 +110,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9", "m-user-api" : "0.0.9",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.5", "m-im-api" : "0.0.6.1",
"m-dynamic-api" : "0.0.1", "m-dynamic-api" : "0.0.1",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
......
package com.yidianling.uikit.business.session.activity; package com.yidianling.uikit.business.session.activity;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Toast; import android.widget.Toast;
...@@ -26,9 +28,13 @@ import com.yidianling.uikit.api.NimUIKit; ...@@ -26,9 +28,13 @@ import com.yidianling.uikit.api.NimUIKit;
import com.yidianling.uikit.business.session.fragment.YDLMessageFragment; import com.yidianling.uikit.business.session.fragment.YDLMessageFragment;
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage; import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler; import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.uikit.custom.http.ServiceImpl;
import java.util.List; import java.util.List;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/** /**
* 点对点聊天界面 * 点对点聊天界面
* <p/> * <p/>
...@@ -84,6 +90,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -84,6 +90,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
registerObservers(true); registerObservers(true);
NIMClient.getService(MsgService.class).clearUnreadCount(sessionId, SessionTypeEnum.P2P); NIMClient.getService(MsgService.class).clearUnreadCount(sessionId, SessionTypeEnum.P2P);
//初始化输入框中的hint消息
initDefaultHintMessage();
} }
@Override @Override
...@@ -123,6 +132,21 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -123,6 +132,21 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
} }
} }
@SuppressLint("CheckResult")
private void initDefaultHintMessage() {
ServiceImpl.Companion.getInstance().getHintMessage()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if (res.data != null && !TextUtils.isEmpty(res.data.getValue1())) {
if (messageFragment.getInputPanel().getInputContent() == null || messageFragment.getInputPanel().getInputContent().equals("")) {
messageFragment.getInputPanel().setInputHintContent(res.data.getValue1());
}
}
}, throwable -> {
});
}
@Override @Override
protected void onStop() { protected void onStop() {
super.onStop(); super.onStop();
......
...@@ -137,6 +137,11 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -137,6 +137,11 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
messageEditText.setText(content == null ? "" : content); messageEditText.setText(content == null ? "" : content);
} }
//设置输入框hint内容
public void setInputHintContent(String content) {
messageEditText.setHint(content == null ? "" : content);
}
//获取当前聊天输入框内容 //获取当前聊天输入框内容
public String getInputContent() { public String getInputContent() {
return messageEditText.getText().toString(); return messageEditText.getText().toString();
...@@ -296,7 +301,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -296,7 +301,6 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
@Override @Override
public void onFocusChange(View v, boolean hasFocus) { public void onFocusChange(View v, boolean hasFocus) {
messageEditText.setHint("");
checkSendButtonEnable(messageEditText); checkSendButtonEnable(messageEditText);
} }
}); });
......
...@@ -59,4 +59,9 @@ interface ServiceApi{ ...@@ -59,4 +59,9 @@ interface ServiceApi{
@GET("consult/expert-page/products") @GET("consult/expert-page/products")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun serviceList(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<List<ServiceItemBean>>> fun serviceList(@Query("doctorId") doctorId: String): Observable<BaseAPIResponse<List<ServiceItemBean>>>
//获取输入框的hint内容
@GET("systemconfig/get-chat-remind-config")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getHintMessage(): Observable<BaseAPIResponse<SystemInfoBean>>
} }
\ No newline at end of file
...@@ -83,4 +83,10 @@ class ServiceImpl private constructor(){ ...@@ -83,4 +83,10 @@ class ServiceImpl private constructor(){
fun serviceList(doctorId: String): Observable<BaseAPIResponse<List<ServiceItemBean>>> { fun serviceList(doctorId: String): Observable<BaseAPIResponse<List<ServiceItemBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).serviceList(doctorId) return YDLHttpUtils.obtainApi(ServiceApi::class.java).serviceList(doctorId)
} }
/**
* 获取输入框的hint内容
*/
fun getHintMessage(): Observable<BaseAPIResponse<SystemInfoBean>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getHintMessage()
}
} }
\ No newline at end of file
package com.yidianling.uikit.custom.http.response
class SystemInfoBean(
var value1: String = ""
)
\ No newline at end of file
...@@ -78,10 +78,9 @@ ...@@ -78,10 +78,9 @@
android:layout_weight="1" android:layout_weight="1"
android:autoLink="all" android:autoLink="all"
android:background="#ffffff" android:background="#ffffff"
android:hint="隐私保密,安心咨询"
android:maxHeight="72dp" android:maxHeight="72dp"
android:maxLines="4" android:maxLines="4"
android:textColorHint="#999999" android:textColorHint="#CCCCCC"
android:textSize="15sp" /> android:textSize="15sp" />
</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