Commit 7d5a3b03 by 徐健

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

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