Commit fbdaf7f7 by 刘鹏

feat : 消息未读未更新、通知未接入

parent eed55690
......@@ -198,6 +198,7 @@ dependencies {
api project(':m-home')
api project(':m-confide')
api project(':ydl-medical-pay')
implementation project(':ydl-flutter-base')
......@@ -222,6 +223,7 @@ dependencies {
implementation project(':m-fm')
implementation modularPublication('com.ydl:m-fm-api')
} else {
api project(':ydl-medical-pay')
//发布模式
api 'com.ydl:m-user-module-ydl:0.0.6'
......
......@@ -71,10 +71,24 @@
</activity>
<activity android:name=".TestAppActivity" />
<activity
android:name=".home.HomeActivity"
android:launchMode="singleTask"
android:noHistory="true"></activity>
<!-- 微信配置相关 开始-->
<activity
android:name="${APPLICATIONID}.wxapi.WXEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
<activity
android:name="${APPLICATIONID}.wxapi.WXPayEntryActivity"
android:exported="true"
android:launchMode="singleTop" />
<!-- 微信配置相关 结束-->
</application>
</manifest>
\ No newline at end of file
......@@ -92,10 +92,20 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
tv_user.setOnClickListener {
reLoadData()
}
test_ts.setOnClickListener {
// val alipay: PayTask = PayTask(this@MainActivity)
// val orderInfo = "{\n" +
// " \"code\": \"200\",\n" +
// " \"msg\": \"success\",\n" +
// " \"data\": \"创建支付成功,壹点灵支付系统返回:{\\\"msg\\\":\\\"成功\\\",\\\"code\\\":\\\"200\\\",\\\"data\\\":{\\\"payParams\\\":\\\"alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_id=2021002115687047&biz_content=%7B%22body%22%3A%22%7B%5C%22inquiryOrderId%5C%22%3A11.0%2C%5C%22appId%5C%22%3A%5C%22654020792723443712%5C%22%7D%22%2C%22business_params%22%3A%22%7B%5C%22inquiryOrderId%5C%22%3A11.0%2C%5C%22appId%5C%22%3A%5C%22654020792723443712%5C%22%7D%22%2C%22out_trade_no%22%3A%2221110318491022%22%2C%22product_code%22%3A%22QUICK_MSECURITY_PAY%22%2C%22subject%22%3A%22%E5%9C%A8%E7%BA%BF%E9%97%AE%E8%AF%8A%22%2C%22total_amount%22%3A%22300.00%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&notify_url=https%3A%2F%2Ftestapi.ydl.com%2Fapi%2Fauth%2FcashierV2%2FaliPay%2FpayNotify&return_url=xxxx&sign=G5Fju0Ja%2F%2BS6ceRttIGM3VQc0stRCo5W%2FAQ%2FWbHypCJHRdkKARWFI18eNolQzWBDhA2dvU9vZqqExYaKYx8rGhSHUdbYH8Dy6PjjFAdGXVFmDy0IZv9TxsEDl04hasKdi%2Blxou%2F6GNWg3sxpwKlBxEi8RKvwG7%2F9wQJlz4T1i7ZGm%2FcA2GfcTulHs4istr7Fay5UFJXUsy3CjczqYwS7gee8lQdNjSgh71ms6stM%2FcGP3YlnoPw%2BM2ZPnvYqQ31PnBnTAQwThUtePjOY7%2FRUtrd5DWDERk9av8DZW69HCLf%2BgOuBwXmK%2FmodE3HYtCC0dcTUOuGaNqfJ491ZwbUMvA%3D%3D&sign_type=RSA2&timestamp=2021-11-09+16%3A34%3A18&version=1.0\\\"},\\\"errMsg\\\":\\\"\\\"},壹点灵入参:{\\\"appId\\\":\\\"654020792723443712\\\",\\\"description\\\":\\\"在线问诊\\\",\\\"expend\\\":{\\\"inquiryOrderId\\\":11},\\\"goodsDesc\\\":\\\"在线问诊\\\",\\\"goodsTitle\\\":\\\"在线问诊\\\",\\\"orderNo\\\":\\\"21110318491022\\\",\\\"payAmount\\\":\\\"300.00\\\",\\\"payChannel\\\":1,\\\"sign\\\":\\\"NxaohUfCZOQXCYUeEdV27A==\\\"}\"\n" +
// "}"
// val result: Map<String, String> = alipay.payV2(orderInfo, true)
}
yl_twwz.setOnClickListener {
//医疗图文问诊
GraphicConsultationFlow1Activity.start(this@MainActivity)
GraphicConsultationFlow1Activity.start(this@MainActivity,"10586")
}
yl_yhdangan_list.setOnClickListener {
......@@ -130,6 +140,9 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_im.setOnClickListener {
FragmentContainerActivity.start(this, "NewMultiMessageFragment")
}
test_im.setOnClickListener {
FragmentContainerActivity.start(this, "MeidicalChatFragment")
}
bt_to_dynamic.setOnClickListener {
FragmentContainerActivity.start(this, "TrendsHomeFragment")
}
......
......@@ -14,6 +14,7 @@ import com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.home.ui.fragment.YdlHomeFragment
import com.yidianling.im.ui.page.NewMultiMessageFragment
import com.yidianling.medical.im.MeidicalChatFragment
import com.yidianling.tests.home.NewTestHomeFragment
import com.yidianling.user.mine.MineFragment
......@@ -84,6 +85,9 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContrac
if ("NewTestHomeFragment" == fragmentName) {
return NewTestHomeFragment()
}
if ("MeidicalChatFragment" == fragmentName) {
return MeidicalChatFragment()
}
return PlayFragment()
}
}
......@@ -376,7 +376,8 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
@Override
public void back() {
//h5中实现
mContext.finish();
}
@Override
......
package com.ydl.component.wxapi;
import com.umeng.socialize.weixin.view.WXCallbackActivity;
public class WXEntryActivity extends WXCallbackActivity {
}
package com.ydl.component.wxapi;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import androidx.annotation.Nullable;
import com.medical.ydl.medical.pay.bean.MedicalPayStatus;
import com.medical.ydl.medical.pay.bean.MedicalWXPayEvent;
import com.tencent.mm.opensdk.modelbase.BaseReq;
import com.tencent.mm.opensdk.modelbase.BaseResp;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
import com.yidianling.ydl_pay.common.bean.WeiXinPayStatusEvent;
import de.greenrobot.event.EventBus;
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/04/18
*/
public class WXPayEntryActivity extends Activity implements IWXAPIEventHandler {
private IWXAPI api;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
api = WXAPIFactory.createWXAPI(this, null);
api.handleIntent(getIntent(), this);
}
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
api.handleIntent(intent, this);
}
@Override
public void onReq(BaseReq baseReq) {
finish();
}
@Override
public void onResp(BaseResp baseResp) {
Log.e("WXPayEntryActivity","onPayFinish, errCode = " + baseResp.errCode);
EventBus.getDefault().post(new WeiXinPayStatusEvent(baseResp.errCode == 0, baseResp.errStr));
EventBus.getDefault().post(new MedicalWXPayEvent(new MedicalPayStatus(baseResp.errCode == 0)));
finish();
}
}
......@@ -230,7 +230,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="医疗 图文问诊流程" />
android:text="问诊流程" />
<Button
android:id="@+id/yl_yhdangan_list"
......@@ -238,7 +238,23 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="医疗 用户档案列表" />
android:text="档案列表" />
<Button
android:id="@+id/test_ts"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="测试开关" />
<Button
android:id="@+id/test_im"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="im" />
</LinearLayout>
......
......@@ -10,7 +10,7 @@ ext {
"m-fm" : "0.0.30.03",
"m-user" : "0.0.61.84",
"m-home" : "0.0.22.70",
"m-im" : "0.0.20.13",
"m-im" : "0.0.20.25",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.10",
......@@ -33,12 +33,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.51",
"ydl-platform" : "0.0.40.52",
//第二步 若干
"ydl-webview" : "0.0.38.52",
"ydl-webview" : "0.0.38.53",
"ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.06",
"m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26",
......@@ -93,7 +94,7 @@ ext {
"m-fm" : "0.0.30.01",
"m-user" : "0.0.61.84",
"m-home" : "0.0.22.70",
"m-im" : "0.0.20.13",
"m-im" : "0.0.20.25",
"m-dynamic" : "0.0.7.28",
"m-article" : "0.0.0.8",
......@@ -115,12 +116,13 @@ ext {
//-------------- 功能组件 --------------
//第一步
"ydl-platform" : "0.0.40.51",
"ydl-platform" : "0.0.40.52",
//第二步 若干
"ydl-webview" : "0.0.38.52",
"ydl-webview" : "0.0.38.53",
"ydl-media" : "0.0.21.10",
"ydl-pay" : "0.0.18.19",
"ydl-medical-pay" : "0.0.01.06",
"m-audioim" : "0.0.49.29.37",
"ydl-flutter-base": "0.0.14.26",
......@@ -138,7 +140,7 @@ ext {
"cardview-v7" : 'androidx.cardview:cardview:1.0.0',
"annotations" : "androidx.annotation:annotation:1.0.0",
"recyclerview-v7" : "androidx.recyclerview:recyclerview:1.0.0",
"constraint-layout" : 'androidx.constraintlayout:constraintlayout:1.1.3',
"constraint-layout" : 'androidx.constraintlayout:constraintlayout:2.0.1',
//network
"retrofit" : "com.squareup.retrofit2:retrofit:${version["retrofitSdkVersion"]}",
......@@ -199,7 +201,7 @@ ext {
"androideventbus" : "org.simple:androideventbus:1.0.5.1",
"otto" : "com.squareup:otto:1.3.8",
"gson" : "com.google.code.gson:gson:2.8.5",
"aliyun" : "com.aliyun.openservices:aliyun-log-android-sdk:2.5.13",
"aliyun" : "com.aliyun.openservices:aliyun-log-android-sdk:2.5.13",
"javax.annotation" : "javax.annotation:jsr250-api:1.0",
"arouter" : "com.alibaba:arouter-api:1.4.1",
"progressmanager" : "me.jessyan:progressmanager:1.5.0",
......@@ -231,7 +233,7 @@ ext {
"androidanimations" : "com.daimajia.androidanimations:library:2.3@aar",
//友盟统计
"umeng-common" : "com.umeng.umsdk:common:9.3.8",
"umeng-asms" :"com.umeng.umsdk:asms:1.2.2",
"umeng-asms" : "com.umeng.umsdk:asms:1.2.2",
//友盟社会化分享
"umeng-share-core" : "com.umeng.umsdk:share-core:7.1.4",
"umeng-share-qq" : "com.umeng.umsdk:share-qq:7.1.4",
......@@ -280,6 +282,7 @@ ext {
"ydl-webview" : "com.ydl:ydl-webview:${ydlCompileVersion["ydl-webview"]}@aar",
"ydl-media" : "com.ydl:ydl-media:${ydlCompileVersion["ydl-media"]}@aar",
"ydl-pay" : "com.ydl:ydl-pay:${ydlCompileVersion["ydl-pay"]}@aar",
"ydl-medical-pay" : "com.ydl:ydl-medical-pay:${ydlCompileVersion["ydl-medical-pay"]}@aar",
"m-audioim" : "com.ydl:m-audioim:${ydlCompileVersion["m-audioim"]}@aar",
//业务组件 <<--- 最后发这些(只发改过的)
......
......@@ -95,6 +95,7 @@ dependencies {
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
implementation modularPublication('com.ydl:ydl-medical-pay')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
......@@ -102,6 +103,8 @@ dependencies {
implementation modularPublication('com.ydl:m-confide-api')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-medical-pay"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
......
package com.yidianling.im.bean
data class DoctorInquIryIngInfoBean(
//问诊订单ID
val inquiryOrderId: String,
//问诊订单状态: 10:待支付、 20:待接诊、 30:待诊断(已接诊、问诊中)、40:已完成、50:已结束、60:已关闭
val status: Int,
//当前用户是否和医生在问诊中0不在问诊中、1在问诊中(问诊中状态包括待诊断和已完成)
val inquiryIng: Int,
//医生ID
val doctorId: String,
//用户ID
val userId: String
)
......@@ -2,6 +2,7 @@ package com.yidianling.im.http
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA_URL
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils
......@@ -159,4 +160,14 @@ interface ImRetrofitApi {
@Query("ffrom_2") ffrom: String?,
@Query("naviType") naviType: String = "1"
): Observable<BaseAPIResponse<Long>>
//获取医生问诊状态
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL, "Content-Type:application/json")
@GET("ydl-yiliao-api/api/client/inquiry/v1/getInquIryIngInfo")
fun getInquIryIngInfo(
@Query("doctorUid") doctorId: String,
@Query("userUid") userUid: String
): Observable<BaseAPIResponse<DoctorInquIryIngInfoBean>>
}
\ No newline at end of file
......@@ -60,6 +60,9 @@ import com.yidianling.im.session.extension.CustomAttachmentBusinessCard;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.im.session.extension.CustomAttachmentEvaluate;
import com.yidianling.im.session.extension.CustomAttachmentFilter;
import com.yidianling.im.session.extension.CustomAttachmentInquiryEnd;
import com.yidianling.im.session.extension.CustomAttachmentInquiryReceive;
import com.yidianling.im.session.extension.CustomAttachmentInquiryStart;
import com.yidianling.im.session.extension.CustomAttachmentJumpToDaoYi;
import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone;
import com.yidianling.im.session.extension.CustomAttachmentOrderStatus;
......@@ -89,6 +92,9 @@ import com.yidianling.im.session.viewholder.MsgViewHolderCustomTip;
import com.yidianling.im.session.viewholder.MsgViewHolderCustomerServiceCard;
import com.yidianling.im.session.viewholder.MsgViewHolderDefCustom;
import com.yidianling.im.session.viewholder.MsgViewHolderEvaluate;
import com.yidianling.im.session.viewholder.MsgViewHolderInquiryEnd;
import com.yidianling.im.session.viewholder.MsgViewHolderInquiryStart;
import com.yidianling.im.session.viewholder.MsgViewHolderInquiryreceive;
import com.yidianling.im.session.viewholder.MsgViewHolderJumpToDaoYi;
import com.yidianling.im.session.viewholder.MsgViewHolderLingXiJumpConfideList;
import com.yidianling.im.session.viewholder.MsgViewHolderLingxiAnswerQuestion;
......@@ -287,9 +293,9 @@ public class SessionHelper {
actions.add(new OrderAction());
}
//跟ios同步,助理也不展示帮助按钮
if (ImIn.INSTANCE.getUserInfo().getUser_type() != 3) {
actions.add(new HelpAction());
}
// if (ImIn.INSTANCE.getUserInfo().getUser_type() != 3) {
// actions.add(new HelpAction());
// }
if (user_type == 2) {
actions.add(new RedPacketAction());
......@@ -477,7 +483,9 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomAttachLingxiAnswerQuestion.class, MsgViewHolderLingxiAnswerQuestion.class);//灵犀2.0-回答问题
NimUIKit.registerMsgItemViewHolder(CustomAttachLingxiFirstQuestion.class, MsgViewHolderLingxiFirstQuestion.class);//灵犀2.0-首问语
NimUIKit.registerMsgItemViewHolder(CustomAttachLingXiJumpConfideList.class, MsgViewHolderLingXiJumpConfideList.class);//灵犀2.0-倾诉列表
NimUIKit.registerMsgItemViewHolder(CustomAttachmentInquiryReceive.class, MsgViewHolderInquiryreceive.class);//接诊通知
NimUIKit.registerMsgItemViewHolder(CustomAttachmentInquiryStart.class, MsgViewHolderInquiryStart.class);//问诊订单接诊通知消息提醒类型
NimUIKit.registerMsgItemViewHolder(CustomAttachmentInquiryEnd.class, MsgViewHolderInquiryEnd.class);//问诊订单结束通知消息提醒类型
}
......
......@@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachmentParser;
import com.ydl.ydlcommon.utils.LogUtil;
/**
* Created by zhoujianghua on 2015/4/9.
......@@ -21,12 +20,22 @@ public class CustomAttachParser implements MsgAttachmentParser {
JSONObject object = JSON.parseObject(json);
int type = object.getInteger(KEY_TYPE);
JSONObject data = object.getJSONObject(KEY_DATA);
// switch (type) {
// case CustomAttachmentType.Guess:
//// attachment = new GuessAttachment();
// break;
attachment = new CustomAttachmentFilter();
switch (type) {
//接诊通知
case CustomAttachmentType.TYPE_INQUIRY_RECEIVE:
attachment = new CustomAttachmentInquiryReceive();
break;
case CustomAttachmentType.TYPE_INQUIRY_START:
attachment = new CustomAttachmentInquiryStart();
break;
case CustomAttachmentType.TYPE_INQUIRY_END:
attachment = new CustomAttachmentInquiryEnd();
break;
//// case CustomAttachmentType.SnapChat:
//// return new SnapChatAttachment(data);
// return new SnapChatAttachment(data);
//// case CustomAttachmentType.Sticker:
//// attachment = new StickerAttachment();
//// break;
......@@ -159,16 +168,16 @@ public class CustomAttachParser implements MsgAttachmentParser {
// case CustomAttachmentType.TYPE_LINGXI_FIRST_QUESTION: //首问语
// attachment = new CustomAttachLingxiFirstQuestion();
// break;
// default:
// attachment = new DefaultCustomAttachment();
// break;
// }
attachment = new CustomAttachmentFilter();
default:
// attachment = new CustomAttachmentFilter();
break;
}
if (attachment != null) {
attachment.fromJson(data);
}
} catch (Exception e) {
e.printStackTrace();
}
return attachment;
......
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* 问诊结束通知 消息bean
*/
public class CustomAttachmentInquiryEnd extends CustomAttachment {
private static final String KEY_FROM_ORDERID = "inquiryOrderId";
private static final String KEY_FROM_CONTENT = "userContent";
private String from_orderid = "";
private String from_content = "";
public CustomAttachmentInquiryEnd() {
super(CustomAttachmentType.TYPE_INQUIRY_END);
}
@Override
protected void parseData(JSONObject data) {
from_orderid = data.getString(KEY_FROM_ORDERID);
from_content = data.getString(KEY_FROM_CONTENT);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(KEY_FROM_ORDERID, from_orderid);
data.put(KEY_FROM_CONTENT, from_content);
return data;
}
public String getFromOrderid() {
return from_orderid;
}
public String getFromContent() {
return from_content;
}
}
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* 接诊通知 消息bean
*/
public class CustomAttachmentInquiryReceive extends CustomAttachment {
private static final String KEY_FROM_ORDERID = "inquiryOrderId";
private static final String KEY_FROM_MAINSUIT = "mainSuit";
private static final String KEY_FROM_NAME = "name";
private static final String KEY_FROM_GENDERNAME = "genderName";
private static final String KEY_FROM_AGE = "age";
private String from_orderid = "";
private String from_mainSuit = "";
private String from_name = "";
private String from_genderName = "";
private String from_age = "";
public CustomAttachmentInquiryReceive() {
super(CustomAttachmentType.TYPE_INQUIRY_RECEIVE);
}
@Override
protected void parseData(JSONObject data) {
from_orderid = data.getString(KEY_FROM_ORDERID);
from_mainSuit = data.getString(KEY_FROM_MAINSUIT);
from_name = data.getString(KEY_FROM_NAME);
from_genderName = data.getString(KEY_FROM_GENDERNAME);
from_age = data.getString(KEY_FROM_AGE);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(KEY_FROM_ORDERID, from_orderid);
data.put(KEY_FROM_MAINSUIT, from_mainSuit);
data.put(KEY_FROM_NAME, from_name);
data.put(KEY_FROM_GENDERNAME, from_genderName);
data.put(KEY_FROM_AGE, from_age);
return data;
}
public String getKeyFromOrderid() {
return from_orderid;
}
public String getKeyFromMainsuit() {
return from_mainSuit;
}
public String getKeyFromName() {
return from_name;
}
public String getFrom_genderName() {
return from_genderName;
}
public String getKeyFromAge() {
return from_age;
}
}
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* 问诊结束通知 消息bean
*/
public class CustomAttachmentInquiryStart extends CustomAttachment {
private static final String KEY_FROM_ORDERID = "inquiryOrderId";
private static final String KEY_FROM_CONTENT = "content";
private String from_orderid = "";
private String from_content = "";
public CustomAttachmentInquiryStart() {
super(CustomAttachmentType.TYPE_INQUIRY_START);
}
@Override
protected void parseData(JSONObject data) {
from_orderid = data.getString(KEY_FROM_ORDERID);
from_content = data.getString(KEY_FROM_CONTENT);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(KEY_FROM_ORDERID, from_orderid);
data.put(KEY_FROM_CONTENT, from_content);
return data;
}
public String getFromOrderid() {
return from_orderid;
}
public String getFromContent() {
return from_content;
}
}
......@@ -35,26 +35,30 @@ public interface CustomAttachmentType {
int TYPE_CUSTOMER_SERVICE = 31; //客服名片
int TYPE_CUSTOMER_CONSULT_CALL_STATUS = 32; //咨询的声网拨打状态的自定义消息
int ASSISTANT_RECEIVEDMONEY = 33;//发起收款
int TYPE_EXPERT_DETAIL_CARD=34;//专家名片
int TYPE_JUMPTO_DAOYI=35;//跳转导医聊天界面
int TYPE_SWITCH_KEFU_TIPS=40;//客服切换第一次提示语
int TYPE_EXPERT_DETAIL_CARD = 34;//专家名片
int TYPE_JUMPTO_DAOYI = 35;//跳转导医聊天界面
int TYPE_SWITCH_KEFU_TIPS = 40;//客服切换第一次提示语
int TYPE_CONFIRM_ORDER=38;//确认订单
int TYPE_ORDER_ALREADY_DONE=39;//已完成订单
int TYPE_CONFIRM_ORDER = 38;//确认订单
int TYPE_ORDER_ALREADY_DONE = 39;//已完成订单
//需要过滤掉的消息
int TYPE_FILTER_41=41;//客服切换过滤41
int TYPE_FILTER_42=42;//客服切换过滤42
int TYPE_FILTER_61=61;
int TYPE_FILTER_70=70;
int TYPE_FILTER_71=71;
int TYPE_FILTER_80=80;//隐藏80的消息
int TYPE_FILTER_41 = 41;//客服切换过滤41
int TYPE_FILTER_42 = 42;//客服切换过滤42
int TYPE_FILTER_61 = 61;
int TYPE_FILTER_70 = 70;
int TYPE_FILTER_71 = 71;
int TYPE_FILTER_80 = 80;//隐藏80的消息
//灵犀2.0问诊数据
int TYPE_LINGXI_FIRST_QUESTION=50;//首问语
int TYPE_LINGXI_WHICH_QUESTION=55;//试卷消息
int TYPE_LINGXI_ANSWER_QUESTION=56;//回答消息
int TYPE_LINGXI_TEST_QUESTION=60;//测评结果
int TYPE_LINGXI_FIRST_QUESTION = 50;//首问语
int TYPE_LINGXI_WHICH_QUESTION = 55;//试卷消息
int TYPE_LINGXI_ANSWER_QUESTION = 56;//回答消息
int TYPE_LINGXI_TEST_QUESTION = 60;//测评结果
int TYPE_LINGXI_JUMP_CONFIDE_LIST = 73; // 跳转倾诉列表
//医疗 消息类型
int TYPE_INQUIRY_RECEIVE = 81;//接诊通知
int TYPE_INQUIRY_START = 82;//问诊订单接诊通知消息提醒类型
int TYPE_INQUIRY_END = 83;//问诊订单结束通知消息提醒类型
}
package com.yidianling.im.session.viewholder
import android.widget.TextView
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachmentInquiryEnd
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
/**
* 接诊通知 消息 页面
*/
class MsgViewHolderInquiryEnd(adapter: BaseMultiItemFetchLoadAdapter<*, *>?) :
MsgViewHolderBase(adapter) {
private var content: TextView? = null
var itemBean: CustomAttachmentInquiryEnd? = null
override fun getContentResId(): Int {
return R.layout.im_nim_inquiry_end_layout
}
override fun inflateContentView() {
content = findViewById(R.id.content)
}
override fun bindContentView() {
itemBean = message.attachment as CustomAttachmentInquiryEnd
content?.text = itemBean!!.fromContent
hideItemBg()
setAvatarRightInVisibity()
setAvatarLeftInVisibity()
}
}
\ No newline at end of file
package com.yidianling.im.session.viewholder
import android.widget.TextView
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachmentInquiryEnd
import com.yidianling.im.session.extension.CustomAttachmentInquiryStart
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
/**
* 接诊通知 消息 页面
*/
class MsgViewHolderInquiryStart(adapter: BaseMultiItemFetchLoadAdapter<*, *>?) :
MsgViewHolderBase(adapter) {
private var content: TextView? = null
var itemBean: CustomAttachmentInquiryStart? = null
override fun getContentResId(): Int {
return R.layout.im_nim_inquiry_end_layout
}
override fun inflateContentView() {
content = findViewById(R.id.content)
}
override fun bindContentView() {
itemBean = message.attachment as CustomAttachmentInquiryStart
content?.text = itemBean!!.fromContent
hideItemBg()
setAvatarRightInVisibity()
setAvatarLeftInVisibity()
}
}
\ No newline at end of file
package com.yidianling.im.session.viewholder
import android.view.View
import android.widget.TextView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.config.HttpConfig
import com.yidianling.im.R
import com.yidianling.im.session.extension.CustomAttachmentInquiryReceive
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
/**
* 接诊结束 消息 页面
*/
class MsgViewHolderInquiryreceive(adapter: BaseMultiItemFetchLoadAdapter<*, *>?) :
MsgViewHolderBase(adapter) {
private var name: TextView? = null
private var gender_name: TextView? = null
private var age: TextView? = null
private var mainSuit: TextView? = null
private var item: View? = null
var itemBean: CustomAttachmentInquiryReceive? = null
override fun getContentResId(): Int {
return R.layout.im_nim_inquiry_receive_layout
}
override fun inflateContentView() {
name = findViewById(R.id.name)
gender_name = findViewById(R.id.gender_name)
age = findViewById(R.id.age)
mainSuit = findViewById(R.id.mainSuit)
item = findViewById(R.id.item)
}
override fun bindContentView() {
itemBean = message.attachment as CustomAttachmentInquiryReceive
name?.text = itemBean!!.keyFromName
gender_name?.text = itemBean!!.from_genderName
age?.text = itemBean!!.keyFromAge
mainSuit?.text = itemBean!!.keyFromMainsuit
item?.setOnClickListener { view: View? ->
NewH5Activity.start(
view!!.context, H5Params(
"${HttpConfig.MEDICAL_H5URL}ct/orderDetails?orderId=${itemBean?.keyFromOrderid}&hideNavBar=1",
null
)
)
}
hideItemBg()
}
}
\ No newline at end of file
......@@ -14,15 +14,28 @@ import com.luck.picture.lib.listener.OnResultCallbackListener
import com.ydl.ydlcommon.actions.imagepicker.YDLImagePicker.startPicker
import com.ydl.ydlcommon.adapter.custom.PublishImageAdapter
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.router.YdlCommonOut.Companion.showToast
import com.ydl.ydlcommon.ui.ParcelableImage
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.medical.pic.MedicalBrowsePicturesActivity
import com.yidianling.medical.pic.MedicalDynamicConstants
import com.yidianling.uikit.custom.http.ServiceImpl
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.im_ui_system_msg_item.*
import kotlinx.android.synthetic.main.medical_graphic_consultation_flow1.*
import kotlinx.coroutines.*
import okhttp3.MediaType
import okhttp3.RequestBody
import java.io.File
import java.lang.Runnable
import java.util.*
/**
......@@ -42,12 +55,15 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
private var publishTrendImgBrows = ArrayList<ParcelableImage>()
private var PUBLISH_PIC_BROW = 21009
private lateinit var mDoctorId: String
private lateinit var mDoctorUid: String
private lateinit var imageAdapter: PublishImageAdapter
private var imgFiles: ArrayList<File>? = null
@JvmStatic
fun start(context: Context, doctorId: String) {
fun start(context: Context, doctorId: String,doctorUid:String) {
val starter = Intent(context, GraphicConsultationFlow1Activity::class.java)
.putExtra("doctorId", doctorId)
.putExtra("doctorUid", doctorUid)
context.startActivity(starter)
}
}
......@@ -59,6 +75,7 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
override fun initDataAndEvent() {
initStatus()
mDoctorId = intent.getStringExtra("doctorId")
mDoctorUid = intent.getStringExtra("doctorUid")
imageAdapter =
PublishImageAdapter(publishTrendImgs, this@GraphicConsultationFlow1Activity);
......@@ -81,16 +98,36 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
}
}
text_service.setOnClickListener {
if (edit_input.text.length < 10) {
ToastUtil.toastShort("请最少填写10个字")
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
} else {
//下一步
GraphicConsulttionFlow2Activity.start(
this@GraphicConsultationFlow1Activity,
edit_input.text.toString(), "", mDoctorId
)
}
if (edit_input.text.length < 10) {
ToastUtil.toastShort("请最少填写10个字")
return@setOnClickListener
} else {
if (publishTrendImgs.size > 0) {
var scope = CoroutineScope(Dispatchers.Default + Job())
scope.launch {
val publishImgs: MutableList<ParcelableImage> = ArrayList()
publishImgs.addAll(publishTrendImgs)
if (publishTrendImgs.size > 0) {
if ("default" == publishTrendImgs[0].image_url) {
publishImgs.removeAt(0)
}
}
upFile(publishImgs)
}
} else {
//下一步
GraphicConsulttionFlow2Activity.start(
this@GraphicConsultationFlow1Activity,
edit_input.text.toString(), "", mDoctorId, mDoctorUid
)
}
}
}
edit_input.addTextChangedListener(object : TextWatcher {
......@@ -123,6 +160,121 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
}
@SuppressLint("CheckResult")
private fun upFile(publishTrendImgs: MutableList<ParcelableImage>) {
imgFiles = ArrayList<File>()
Observable.fromIterable(publishTrendImgs)
.subscribeOn(Schedulers.io())
.map<File> { parcelableImage: ParcelableImage ->
LogUtil.d("url: " + parcelableImage.image_url)
DealFile2(parcelableImage.image_url, 1500 / publishTrendImgs.size)
}.subscribe { file ->
if (file != null) {
LogUtil.d(
"xyutest",
"图片压缩后大小: ==>" + file.length() + " file path: " + file.absolutePath
)
imgFiles?.add(file);
if (imgFiles!!.size == publishTrendImgs.size) {
upFileByNet(imgFiles)
}
} else {
runOnUiThread(Runnable() {
kotlin.run {
YdlCommonOut.Companion.showToast("有图片已被删除");
}
})
}
};
}
@SuppressLint("CheckResult")
private fun upFileByNet(imgFiles: ArrayList<File>?) {
val scope = CoroutineScope(Dispatchers.Default + Job())
scope.launch {
var files: Array<File?>? = null
if (imgFiles != null) {
files = arrayOfNulls(imgFiles.size)
for (i in imgFiles.indices) {
files[i] = imgFiles[i]
}
}
var map = TreeMap<String, RequestBody>()
if (files != null && files.isNotEmpty()) {
if (files.size == 1) {
if (files[0] != null) {
val fileBody =
RequestBody.create(MediaType.parse("multipart/form-data"), files[0]);
map["FILE" + "\"; filename=\"" + files[0]?.name + ""] = fileBody;
}
} else {
for (index in files.indices) {
if (files[index] != null) {
val fileBody = RequestBody.create(
MediaType.parse("multipart/form-data"),
files[index]
)
map["FILE" + index + "\"; filename=\"" + files[index]?.name + ""] =
fileBody
}
}
}
}
ServiceImpl.instance.uploadBatch(map)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
if ("200" == response.code) {
val scope = CoroutineScope(Dispatchers.Default + Job())
scope.launch {
var fileStr = StringBuilder("")
for (file in response.data) {
if (file.upload) {
if (fileStr.isEmpty()) {
fileStr.append(file.url)
} else {
fileStr.append(",${file.url}")
}
}
}
//下一步
GraphicConsulttionFlow2Activity.start(
this@GraphicConsultationFlow1Activity,
edit_input.text.toString(), fileStr.toString(), mDoctorId,mDoctorUid
)
}
ToastUtil.toastShort("成功")
} else {
ToastUtil.toastShort(response.msg)
}
}, { e ->
ToastUtil.toastShort(e.message)
e.printStackTrace()
})
}
}
@Synchronized
private fun DealFile2(path: String, size: Int): File? {
var deal_file: File? = null
deal_file = MedicalImageCompress.scal(this@GraphicConsultationFlow1Activity, path, size)
try {
Thread.sleep(100)
} catch (e: InterruptedException) {
e.printStackTrace()
}
return deal_file
}
private fun backCheck() {
val builder = NormalDialog.Builder(this@GraphicConsultationFlow1Activity, "center", true)
builder.setTitle("")
......@@ -323,4 +475,5 @@ class GraphicConsultationFlow1Activity : BaseActivity() {
StatusBarUtils.setTransparentForImageView(this@GraphicConsultationFlow1Activity, null)
StatusBarUtils.statusBarLightMode(this@GraphicConsultationFlow1Activity)
}
}
\ No newline at end of file
......@@ -5,13 +5,17 @@ import android.content.Context
import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.medical.ydl.medical.pay.MedicalPayActivity
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.medical.archives.MedicalAddNewArchivesActivity
import com.yidianling.medical.archives.adapter.MedicalUserArchivesFlow2Adapter
import com.yidianling.medical.archives.bean.MedicalArchivesListBean
import com.yidianling.medical.popwindow.InformedConsentPopupWindow
import com.yidianling.uikit.custom.http.ServiceImpl
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
......@@ -31,9 +35,11 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
lateinit var stringExtra: String
lateinit var fileStrExtra: String
lateinit var doctorIdStrExtra: String
lateinit var doctorUidStrExtra: String
private lateinit var mAdapter: MedicalUserArchivesFlow2Adapter
private var mList = ArrayList<MedicalArchivesListBean>()
private var isFirstLoadData = true
private var mFlow1Activity: BaseActivity? = null
//是否是首次问诊
private var isFirst = -1
......@@ -44,11 +50,13 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
* @param fileStr 图片拼接字符串
* */
@JvmStatic
fun start(context: Context, inputText: String, fileStr: String, doctorId: String) {
fun start(context: Context, inputText: String, fileStr: String, doctorId: String,doctorUid:String) {
mFlow1Activity = context as BaseActivity
val starter = Intent(context, GraphicConsulttionFlow2Activity::class.java)
.putExtra("inputText", inputText)
.putExtra("fileStr", fileStr)
.putExtra("doctorId", doctorId)
.putExtra("doctorUid", doctorUid)
context.startActivity(starter)
}
}
......@@ -62,6 +70,7 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
stringExtra = intent.getStringExtra("inputText")
fileStrExtra = intent.getStringExtra("fileStr")
doctorIdStrExtra = intent.getStringExtra("doctorId")
doctorUidStrExtra = intent.getStringExtra("doctorUid")
mAdapter = MedicalUserArchivesFlow2Adapter()
rv_people_list.layoutManager = GridLayoutManager(this@GraphicConsulttionFlow2Activity, 3)
......@@ -104,18 +113,61 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
}
text_service.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
//保存
toSave()
}
iv_back_flow2.setOnClickListener {
backCheck()
}
iv_back_flow2.setOnClickListener { finish() }
informed_consent_text.setOnClickListener {
//协议内容
var collectOutPop = InformedConsentPopupWindow(this)
collectOutPop?.contentView!!.measure(
View.MeasureSpec.UNSPECIFIED,
View.MeasureSpec.UNSPECIFIED
); //这句代码必须要才能获得正确的popupwindow的宽度
val popupWindowWidth = collectOutPop?.contentView!!.measuredWidth
collectOutPop?.showAsDropDown(
toolbar,
-(popupWindowWidth - toolbar.measuredWidth + 20),
0
)
}
getList()
}
private fun backCheck() {
val builder = NormalDialog.Builder(this@GraphicConsulttionFlow2Activity, "center", true)
builder.setTitle("")
builder.setMessage("\n仅剩一步就可抢到医生的问诊名额,确认放弃吗?\n")
builder.setPositiveButton(
"继续填写"
) { dialog, which ->
dialog.dismiss()
}.setNegativeButton(
"放弃填写"
) { dialog, which ->
//关闭页面
finish()
dialog.dismiss()
}
builder.setRight_color("#3464EC")
builder.setLeft_color("#8595A9")
builder.setContent_color("#10233A")
builder.create().show()
}
/**
* 生成图文订单
* */
......@@ -160,14 +212,23 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
.subscribe({ response ->
mList.clear()
if ("200" == response.code) {
ToastUtil.toastShort("成功")
MedicalPayActivity.start(
this@GraphicConsulttionFlow2Activity,
response.data.payAmountStr,
response.data.inquiryOrderId,
doctorUidStrExtra
)
mFlow1Activity?.finish()
finish()
} else {
ToastUtil.toastShort("创建订单失败")
ToastUtil.toastShort(response.msg)
}
}, { e ->
e.printStackTrace()
ToastUtil.toastShort("创建订单失败")
e.printStackTrace()
})
}
}
......@@ -188,8 +249,8 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ response ->
mList.clear()
if ("200" == response.code) {
mList.clear()
var data = response.data
if (data.size < 8) {
mList = data as ArrayList<MedicalArchivesListBean>
......@@ -214,4 +275,8 @@ class GraphicConsulttionFlow2Activity : BaseActivity() {
StatusBarUtils.statusBarLightMode(this@GraphicConsulttionFlow2Activity)
}
override fun onBackPressed() {
backCheck()
}
}
\ No newline at end of file
package com.yidianling.medical
data class MedicalFileBeanRespose(
var index: Int,
var upload: Boolean,
var url: String
)
package com.yidianling.medical;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Environment;
import android.util.Log;
import androidx.fragment.app.FragmentActivity;
import com.miracle.view.imageeditor.utils.FileUtils;
import com.yidianling.common.tools.RxFileTool;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MedicalImageCompress {
public static File createImageFile() throws IOException {
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES);
File image = File.createTempFile(imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
return image;
}
public static File scal(FragmentActivity activity, String path, int size) {
// String path = fileUri.getPath();
File outputFile = FileUtils.INSTANCE.getFileByUri(activity,path);
if (!outputFile.exists()){
return null;
}
long fileSize = outputFile.length();
final long fileMaxSize = size * 1024;
if (fileSize >= fileMaxSize) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(path, options);
int height = options.outHeight;
int width = options.outWidth;
double scale = Math.sqrt((float) fileSize / fileMaxSize);
options.outHeight = (int) (height / scale);
options.outWidth = (int) (width / scale);
options.inSampleSize = (int) (scale + 0.5);
options.inJustDecodeBounds = false;
Bitmap bitmap = BitmapFactory.decodeFile(path, options);
outputFile = new File(MedicalPhotoUtil.createImageFile().getPath());
FileOutputStream fos = null;
try {
fos = new FileOutputStream(outputFile);
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, fos);
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
Log.d("", "sss ok " + outputFile.length());
if (!bitmap.isRecycled()) {
bitmap.recycle();
} else {
File tempFile = outputFile;
outputFile = new File(MedicalPhotoUtil.createImageFile().getPath());
MedicalPhotoUtil.copyFileUsingFileChannels(tempFile, outputFile);
}
}
return outputFile;
}
public static File scaln(String path, int size) {
// String path = fileUri.getPath();
File outputFile = new File(path);
// long fileSize = outputFile.length();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Bitmap imagebm = BitmapFactory.decodeFile(path);
imagebm.compress(Bitmap.CompressFormat.JPEG, 100, baos);
// final long fileMaxSize = size * 1024;
// 质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中
int options = 100;
while (baos.toByteArray().length / 1024 > size) {
// 循环判断如果压缩后图片是否大于100kb,大于继续压缩
baos.reset();// 重置baos即清空baos
imagebm.compress(Bitmap.CompressFormat.JPEG, options, baos);
// 这里压缩options%,把压缩后的数据存放到baos中
options -= 10;// 每次都减少10
if (options <= 0) {
break;
}
}
ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());
// 把压缩后的数据baos存放到ByteArrayInputStream中
// 把ByteArrayInputStream数据生成图片
imagebm = BitmapFactory.decodeStream(isBm, null, null);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(outputFile);
imagebm.compress(Bitmap.CompressFormat.JPEG, 50, fos);
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
if (!imagebm.isRecycled()) {
imagebm.recycle();
} else {
File tempFile = outputFile;
outputFile = new File(MedicalPhotoUtil.createImageFile().getPath());
MedicalPhotoUtil.copyFileUsingFileChannels(tempFile, outputFile);
}
return outputFile;
}
public static File scaln2(String path, int size) {
Bitmap bm = BitmapFactory.decodeFile(path);
bm=cQuality(bm,size);
File outputFile = null;
try {
outputFile = SaveBitmap(bm,path);
} catch (IOException e) {
e.printStackTrace();
}
return outputFile;
}
public static File SaveBitmap(Bitmap mBitmap, String path) throws IOException {
File file;
RxFileTool.fileExists(path);
File f = new File(path);
try {
f.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
FileOutputStream fOut = null;
try {
fOut = new FileOutputStream(f);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
fOut.flush();
fOut.close();
file=new File(path);
return file;
}
/**
* 根据bitmap压缩图片质量
*
* @param bitmap 未压缩的bitmap
* @return 压缩后的bitmap
*/
public static Bitmap cQuality(Bitmap bitmap,int size) {
ByteArrayOutputStream bOut = new ByteArrayOutputStream();
int beginRate = 100;
//第一个参数 :图片格式 ,第二个参数: 图片质量,100为最高,0为最差 ,第三个参数:保存压缩后的数据的流
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bOut);
while (bOut.size() / 1024 / 1024 > size) { //如果压缩后大于100Kb,则提高压缩率,重新压缩
beginRate -= 10;
bOut.reset();
bitmap.compress(Bitmap.CompressFormat.JPEG, beginRate, bOut);
}
ByteArrayInputStream bInt = new ByteArrayInputStream(bOut.toByteArray());
Bitmap newBitmap = BitmapFactory.decodeStream(bInt);
if (newBitmap != null) {
return newBitmap;
} else {
return bitmap;
}
}
}
package com.yidianling.medical;
import android.net.Uri;
import android.os.Environment;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import java.util.Date;
public class MedicalPhotoUtil {
/**
* 一切都操作uri
* @return
*/
public static Uri createImageFile(){
// Create an image file name
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String imageFileName = "JPEG_" + timeStamp + "_";
File storageDir = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES);
File image = null;
try {
image = File.createTempFile(
imageFileName, /* prefix */
".jpg", /* suffix */
storageDir /* directory */
);
} catch (IOException e) {
e.printStackTrace();
}
// Save a file: path for use with ACTION_VIEW intents
return Uri.fromFile(image);
}
public static void copyFileUsingFileChannels(File source, File dest){
FileChannel inputChannel = null;
FileChannel outputChannel = null;
try {
try {
inputChannel = new FileInputStream(source).getChannel();
outputChannel = new FileOutputStream(dest).getChannel();
outputChannel.transferFrom(inputChannel, 0, inputChannel.size());
} catch (IOException e) {
e.printStackTrace();
}
} finally {
try {
inputChannel.close();
outputChannel.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
package com.yidianling.medical.archives.bean
data class CreateArchivesRespose(
var inquiryOrderId: String,
var inquiryOrderNo: String,
var orderAmount: Int,
var orderAmountStr: String,
var payAmount: String,
var payAmountStr: String
)
......@@ -3,25 +3,33 @@ package com.yidianling.medical.im
import android.content.Context
import android.os.Build
import android.view.View
import android.view.WindowManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.jcodecraeer.xrecyclerview.CustomFooterViewCallBack
import com.jcodecraeer.xrecyclerview.XRecyclerView
import com.ydl.ydlcommon.base.BaseFragment
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.im.api.event.UpdateBottomBarUnreadNumEvent
import com.yidianling.im.event.MessageListRefreshEvent
import com.yidianling.im.helper.MsgReceiveHelper
import com.yidianling.im.http.ImHttpImpl
import com.yidianling.im.router.ImIn
import com.yidianling.im.ui.page.dialog.MessageChatSettingDialog
import com.yidianling.im.ui.page.fragment.bean.ChatItemBean
import com.yidianling.im.ui.page.fragment.bean.ChatModelBean
import com.yidianling.im.ui.page.fragment.bean.UnreadMessageBean
import com.yidianling.im.ui.page.fragment.view.ChatFooterItemView
import com.yidianling.im.ui.page.widget.ChatUnusualView
import com.yidianling.im.ui.param.ChatParam
import com.yidianling.im.ui.param.ClearMessageParam
import com.yidianling.im.ui.param.UnreadParam
import com.yidianling.medical.NotificationsUtils
import com.yidianling.medical.im.adapter.MedicalChatAdapter
import com.yidianling.medical.popwindow.MedicalChatSettingPopupWindow
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.medical_im_chat_fragment_layout.*
......@@ -36,6 +44,8 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
private var chatAdapter: MedicalChatAdapter? = null
private var allChatData: ChatModelBean = ChatModelBean() //全部数据
private var showData: ArrayList<ChatItemBean> = ArrayList() // 最终展示的数据
private var chatSettingPopupWindow: MedicalChatSettingPopupWindow? = null //右上角弹框
private var messageChatSettingtDialog: MessageChatSettingDialog? = null //全部已读弹框
private var threeWeekItem: ChatItemBean =
ChatItemBean(0, 0, "", 0, 0, "", 0, 0, 0, 0, 0, "", 0, "", "", 0, 0, 0, "", 1, "", true)
......@@ -50,9 +60,6 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
}
}
//当前未读item下标
private var curItem = 0
override fun layoutResId(): Int {
return R.layout.medical_im_chat_fragment_layout
}
......@@ -65,8 +72,58 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
initListData()
notifiVisible()
ll_more.setOnClickListener {
if (!ImIn.isLogin()) {
ToastUtil.toastShort("请登录后再试")
} else {
chatSettingPopupWindow = MedicalChatSettingPopupWindow(mContext,
object : MedicalChatSettingPopupWindow.OnChatSettingClickListener {
override fun onAllReadClick() {
messageChatSettingtDialog = MessageChatSettingDialog(
mContext,
object : MessageChatSettingDialog.OnMessageChatSettingDialog {
override fun onSure() {
markAllMessageRead()
messageChatSettingtDialog?.dismiss()
}
override fun onCancel() {
messageChatSettingtDialog?.dismiss()
}
})
messageChatSettingtDialog?.show()
}
override fun onChatSettingClick() {
ARouter.getInstance().build("/user/notifysetting").navigation()
}
override fun onDismissAction() {
setWindowBg(1f)
}
})
chatSettingPopupWindow?.contentView!!.measure(
View.MeasureSpec.UNSPECIFIED,
View.MeasureSpec.UNSPECIFIED
); //这句代码必须要才能获得正确的popupwindow的宽度
val popupWindowWidth = chatSettingPopupWindow?.contentView!!.measuredWidth
setWindowBg(0.4f)
chatSettingPopupWindow?.showAsDropDown(
ll_more,
-(popupWindowWidth - ll_more.measuredWidth + 20),
0
)
}
}
}
/**
* 系统通知开关
* */
private fun notifiVisible() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (NotificationsUtils.isNotificationOpen(mContext)) {
......@@ -110,32 +167,6 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
}
fun nextUnReadItem() {
if (showData == null) return
for (i in curItem + 1 until showData.size) {
var num = 0
try {
num = Integer.parseInt(showData[i].unReadNum.toString())
} catch (e: NumberFormatException) {
e.printStackTrace()
}
if (num > 0 || MsgReceiveHelper.getUnNum(showData[i].toUid.toString()) > 0) {
if (chat_recyclerview != null) {
chat_recyclerview.smoothScrollToPosition(i)
}
curItem = i
break
}
if (i == showData.size - 1) {
curItem = 0
if (chat_recyclerview != null) {
chat_recyclerview.smoothScrollToPosition(0)
}
}
}
}
override fun onLoadMore() {
chat_recyclerview.setNoMore(true)
......@@ -165,15 +196,12 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
// 全部
showData.addAll(allChatData.topData.data.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.is_top == 0 }
.sortedWith(mCompare))
showData.addAll(allChatData.nomal.data.filter { it.is_top == 0 }.sortedWith(mCompare))
if (allChatData.before.data.any { it.is_top == 0 }) {
showData.add(threeWeekItem)
showData.addAll(allChatData.before.data.filter { it.is_top == 0 }
.sortedWith(mCompare))
showData.addAll(allChatData.before.data.filter { it.is_top == 0 }.sortedWith(mCompare))
}
// 重置消息未读数
MsgReceiveHelper.reQueryUnreadNumber {
showData.forEachIndexed { index, _ ->
......@@ -217,6 +245,7 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
override fun onLoadMoreComplete(p0: View?) {
}
})
getChatMessageData()
}
override fun onResume() {
......@@ -285,4 +314,88 @@ class MeidicalChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
resetPageShow()
}
/**
* 全部已读(私聊是单独处理的)
*/
fun markAllMessageRead() {
var dis = ImHttpImpl.getInstance().clearMessage(
ClearMessageParam(
"${ImIn.getUserInfo()?.uid}",
"1"
)
)
.compose(RxUtils.applySchedulers(this))
.subscribe({ it ->
if (it.data) {
//清除私聊群聊未读数
MsgReceiveHelper.markAllRead()
getMsgData()
ToastUtil.toastShort("已全部标记为已读")
} else {
ToastUtil.toastShort("标记失败")
}
}, { t ->
ToastUtil.toastShort("您的网络出现了问题")
})
}
/**
* 刷新当前展示的消息列表的数据,刷新顶部三个消息未读数,刷新底部消息未读数
*/
fun getMsgData() {
/**
* 登录状态
*/
if (ImIn.isLogin()) {
getChatMessageData()
}
requestTopUnReadNumber()
}
/**
* 刷新顶部未读数量(接口返回成功后调用的方法中会触发事件刷新底部导航栏的角标)
*/
fun requestTopUnReadNumber() {
if (ImIn.getUserInfo()?.uid != "0") {
var dis =
ImHttpImpl.getInstance().getUnreadMessage(UnreadParam("${ImIn.getUserInfo()?.uid}"))
.compose<UnreadMessageBean>(RxUtils.resultJavaData())
.compose(RxUtils.applySchedulers(this))
.subscribe({ it ->
resetTopUnReadNumber(it)
}, { t ->
ToastUtil.toastShort("您的网络出现了问题")
})
} else {
//退出登录情况下,全部不显示
EventBus.getDefault().post(UpdateBottomBarUnreadNumEvent(0))
}
}
/**
* 重置顶部未读数量
*/
private fun resetTopUnReadNumber(bean: UnreadMessageBean) {
val chatUnreadNum = ImIn.getInUnreadNum()//私聊未读数移动端自己读取云信
MsgReceiveHelper.isHasUnread = chatUnreadNum > 0
// 同步底部导航栏的角标数量
EventBus.getDefault().post(
UpdateBottomBarUnreadNumEvent(chatUnreadNum)
)
}
/**
* 设置页面背景色
*/
private fun setWindowBg(alpha: Float) {
val lp = activity?.window!!.attributes
lp.alpha = alpha
activity?.window!!.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
activity?.window!!.attributes = lp
}
}
\ No newline at end of file
......@@ -3,15 +3,12 @@ package com.yidianling.medical.im.view
import android.content.Context
import android.text.Html
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.RelativeLayout
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.im.R
import com.yidianling.im.helper.MsgReceiveHelper
import com.yidianling.im.preference.ImTempData
import com.yidianling.im.ui.page.fragment.bean.ChatItemBean
import kotlinx.android.synthetic.main.im_chat_item_view.view.*
import kotlinx.android.synthetic.main.medical_im_chat_item_view.view.*
/**
* 互动列表普通itemView
......@@ -41,26 +38,6 @@ class MedicalChatItemView(mContext: Context) : LinearLayout(mContext) {
chat_message_tab.visibility = View.GONE
}
// 咨询优先显示 再倾诉
when {
bean.orderStatus == 1 -> {
chat_message_sub_desc.visibility = View.VISIBLE
chat_message_sub_desc.text = "咨询服务中"
}
bean.listenOrderStatus == 1 -> {
chat_message_sub_desc.visibility = View.VISIBLE
chat_message_sub_desc.text = "倾诉服务中"
}
bean.orderCount != 0 -> {
chat_message_sub_desc.visibility = View.VISIBLE
chat_message_sub_desc.text = "已咨询${bean.orderCount}次"
}
bean.listenOrderCount != 0 -> {
chat_message_sub_desc.visibility = View.VISIBLE
chat_message_sub_desc.text = "已倾诉${bean.listenOrderCount}次"
}
else -> chat_message_sub_desc.visibility = View.GONE
}
chat_message_time.text = bean.timeStr
if (ImTempData.getInstance().getTempMsg(bean.toUid.toString()) != null && ImTempData.getInstance().getTempMsg(
......
package com.yidianling.medical.popwindow
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.PopupWindow
import com.yidianling.im.R
import kotlinx.android.synthetic.main.medical_informed_dialog_layout.view.*
/**
* Created by xj on 2019/10/14.
*/
class InformedConsentPopupWindow(context: Context) :
PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) {
init {
val view =
LayoutInflater.from(context).inflate(R.layout.medical_informed_dialog_layout, null)
this.contentView = view
this.isFocusable = true
this.isOutsideTouchable = true
view.close.setOnClickListener {
dismiss()
}
}
}
\ No newline at end of file
package com.yidianling.medical.popwindow
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.PopupWindow
import com.yidianling.im.R
import kotlinx.android.synthetic.main.medical_im_chat_popup_window.view.*
/**
* Created by xj on 2019/10/14.
*/
class MedicalChatSettingPopupWindow(
context: Context,
chatSettingClickListener: OnChatSettingClickListener?
) : PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
init {
val view = LayoutInflater.from(context).inflate(R.layout.medical_im_chat_popup_window, null)
this.contentView = view
this.isFocusable = true
this.isOutsideTouchable = true
view.ll_all_read.setOnClickListener {
chatSettingClickListener?.onAllReadClick()
dismiss()
}
view.ll_chat_setting.setOnClickListener {
chatSettingClickListener?.onChatSettingClick()
dismiss()
}
setOnDismissListener {
chatSettingClickListener?.onDismissAction()
}
}
interface OnChatSettingClickListener {
fun onAllReadClick() //全部已读
fun onChatSettingClick() //消息设置
fun onDismissAction() //取消
}
}
\ No newline at end of file
package com.yidianling.uikit.business.session.fragment;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.graphics.Color;
import android.media.AudioManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.constraintlayout.widget.Group;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer;
......@@ -36,26 +26,19 @@ import com.netease.nimlib.sdk.ResponseCode;
import com.netease.nimlib.sdk.msg.MessageBuilder;
import com.netease.nimlib.sdk.msg.MsgService;
import com.netease.nimlib.sdk.msg.MsgServiceObserve;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;
import com.netease.nimlib.sdk.msg.constant.MsgStatusEnum;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.CustomMessageConfig;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.netease.nimlib.sdk.msg.model.MemberPushOption;
import com.netease.nimlib.sdk.msg.model.MessageReceipt;
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.AnimUtils;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.log.AliYunLogConfig;
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper;
import com.ydl.ydlcommon.utils.log.LogHelper;
import com.ydl.ydlcommon.view.CircleImageView;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
......@@ -67,8 +50,6 @@ import com.yidianling.im.router.ImIn;
import com.yidianling.im.session.viewholder.bean.AnswerBean;
import com.yidianling.im.session.viewholder.bean.AnswersItem;
import com.yidianling.im.session.viewholder.bean.LingxiAnswerBean;
import com.yidianling.im.session.viewholder.bean.UserIsIn;
import com.yidianling.im.session.viewholder.bean.UserIsInPageData;
import com.yidianling.nimbase.api.UIKitOptions;
import com.yidianling.nimbase.api.model.main.CustomPushContentProvider;
import com.yidianling.nimbase.api.model.session.ModuleProxy;
......@@ -79,32 +60,21 @@ import com.yidianling.nimbase.business.session.constant.Extras;
import com.yidianling.nimbase.business.session.module.Container;
import com.yidianling.nimbase.common.CommonUtil;
import com.yidianling.nimbase.common.fragment.TFragment;
import com.yidianling.nimbase.impl.cache.NimUserInfoCache;
import com.yidianling.uikit.api.NimUIKitImpl;
import com.yidianling.uikit.business.ait.AitManager;
import com.yidianling.uikit.business.session.activity.YDLBaseMessageActivity;
import com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper;
import com.yidianling.uikit.business.session.module.input.InputPanel;
import com.yidianling.uikit.business.session.module.list.MessageListPanelEx;
import com.yidianling.uikit.business.session.view.ChatPrivateTips;
import com.yidianling.uikit.business.session.view.CommonQuestionView;
import com.yidianling.uikit.business.session.view.ImCommentBannerView;
import com.yidianling.uikit.business.session.view.ImRedStarGradeView;
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.uikit.custom.http.ServiceImpl;
import com.yidianling.uikit.custom.http.response.CommonQuestionBean;
import com.yidianling.uikit.custom.http.response.NewUserMesBean;
import com.yidianling.uikit.custom.http.response.UserQuestInfoBean;
import com.yidianling.uikit.custom.widget.ConfideOrderInfoView;
import com.yidianling.uikit.custom.widget.ExpertInfoDialog;
import com.yidianling.uikit.custom.widget.TitleBarBottom;
import com.yidianling.uikit.custom.widget.UserInfoDialog;
import com.yidianling.uikit.custom.widget.expertConsultService.view.ExpertConsultServiceListDialog;
import com.yidianling.user.api.service.IUserService;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
......@@ -137,18 +107,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
protected SessionTypeEnum sessionType;
//快捷菜单
protected RelativeLayout lin_actions;
protected RelativeLayout rl_doctor_name;
private LinearLayout ll_actions_yi;
private FrameLayout fl_container;
private ChatPrivateTips v_chattips;
// modules
protected InputPanel inputPanel;
private int rvPaddingTop;
private RelativeLayout rl_contain;
private boolean initHeightFinish;
public InputPanel getInputPanel() {
......@@ -167,52 +131,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
protected AitManager aitManager;
private CircleImageView small_head_img; //小头像
private TextView help_num_tv; //帮助人数
private TextView server_num_tv; //服务时长
private TextView good_num_tv; //好评率
private LinearLayout top_expert_info_ll;
private ConstraintLayout top_expert_info_ll;
private int expertInfoViewHeight = 0; // 专家信息栏高度
private RecyclerView messageListView;
private ConstraintLayout top_expert_info_cl;
// private RelativeLayout rl_common_question_enter;
private FrameLayout fl_question_content;
private List<CommonQuestionBean> commonQuestionBeanList;
private TextView question_multiple;
private LinearLayout comment_banner_view_ll;
private TextView tv_all_comment_desc;
private ImageView tv_all_comment_go;
private ImCommentBannerView comment_banner_view;
private ImRedStarGradeView good_num_icons;
private TextView im_focus_btn;
private TextView tv_from;
private TextView tv_doctor_name;
private LinearLayout top_view_container;
private RelativeLayout constraint_ll;
private LinearLayout ll_info_detail;
private RelativeLayout rela_zixun;
private ValueAnimator anim_out;
private ObjectAnimator sourceLayoutAnim;
private ValueAnimator anim_in;
private Boolean expertInfoViewIsIn = true;
private Boolean expertInfoViewIsAnimating = false;
private ExpertInfoDialog expertInfoDialog;
private ExpertConsultServiceListDialog expertConsultServiceListDialog;
private int IN_OUT_DURATION = 400;
private Boolean hasUpScroll = false;
private String help_num;// 帮助人数
private String server_num;// 服务时长
private String good_num;// 好评率
private RelativeLayout constraint_ll;
private Group receive_unstart, receive_undiagnosis, receive_end;
private int userInfoDialogAge = 0;
private String userInfoDialogSex = "";
......@@ -221,23 +145,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private String userInfoDialogSourceFrom = "";
private UserInfoDialog userInfoDialog = null;
private boolean isOthers;
private MultipleAnswerBean multipleAnswerBean;
private ArrayList<String> answersItemsMap = new ArrayList<>();
@SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
super.handleMessage(msg);
if (timeCount == 5) {
v_chattips.setVisibility(View.GONE);
} else {
timeCount++;
sendEmptyMessageDelayed(1, 1000);
}
}
};
@Override
public void onActivityCreated(Bundle savedInstanceState) {
......@@ -246,43 +156,19 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
TitleBarBottom titleBar = ((YDLBaseMessageActivity) getActivity()).getTitleBarBottom();
titleBar.setTitleLeftDraw(getResources().getDrawable(R.drawable.loading_01));
titleBar.setTitle("正在连接中...");
fl_container = rootView.findViewById(R.id.message_activity_list_view_container);
v_chattips = rootView.findViewById(R.id.v_chattips);
lin_actions = rootView.findViewById(R.id.lin_actions);
ll_actions_yi = rootView.findViewById(R.id.ll_actions_yi);
small_head_img = rootView.findViewById(R.id.small_head_img);
help_num_tv = rootView.findViewById(R.id.help_num_tv);
server_num_tv = rootView.findViewById(R.id.server_num_tv);
good_num_tv = rootView.findViewById(R.id.good_num_tv);
//顶部问诊状态 客服icon
top_expert_info_ll = rootView.findViewById(R.id.top_expert_info_ll);
top_expert_info_cl = rootView.findViewById(R.id.top_expert_info_cl);
comment_banner_view_ll = rootView.findViewById(R.id.comment_banner_view_ll);
tv_all_comment_desc = rootView.findViewById(R.id.tv_all_comment_desc);
tv_all_comment_go = rootView.findViewById(R.id.tv_all_comment_go);
comment_banner_view = rootView.findViewById(R.id.comment_banner_view);
messageListView = rootView.findViewById(R.id.messageListView); // 消息列表
top_view_container = rootView.findViewById(R.id.top_view_container); // 消息列表
// 消息列表
messageListView = rootView.findViewById(R.id.messageListView);
constraint_ll = rootView.findViewById(R.id.constraint_ll);
im_focus_btn = rootView.findViewById(R.id.im_focus_btn);
good_num_icons = rootView.findViewById(R.id.good_num_icons);
rela_zixun = rootView.findViewById(R.id.rela_zixun);
rl_doctor_name = rootView.findViewById(R.id.rl_doctor_name);
tv_from = rootView.findViewById(R.id.tv_from);
ll_info_detail = rootView.findViewById(R.id.ll_info_detail);
tv_doctor_name = rootView.findViewById(R.id.tv_doctor_name);
rl_contain = rootView.findViewById(R.id.rl_contain);
//待接诊
receive_unstart = rootView.findViewById(R.id.receive_unstart);
//待诊断
receive_undiagnosis = rootView.findViewById(R.id.receive_undiagnosis);
//诊断结束
receive_end = rootView.findViewById(R.id.receive_end);
messageListView.setItemAnimator(null);
//和助理私聊时的常用语逻辑
// rl_common_question_enter = rootView.findViewById(R.id.rl_common_question);
fl_question_content = rootView.findViewById(R.id.fl_question_content);
question_multiple = rootView.findViewById(R.id.question_multiple);
//做灵犀2.0 去掉常用语逻辑
//rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if (ActionHandlerStorage.getL(sessionId).getUserType() != 2) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
if (ActionHandlerStorage.getL(sessionId).isNotPrepare()) {
IMChatUtil.INSTANCE.prepareChatData((AppCompatActivity) getActivity(), sessionId, (expertInfo) -> {
......@@ -305,39 +191,11 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private void initView() {
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3) {
//助理
/*rl_common_question_enter.setOnClickListener(v -> {
rl_common_question_enter.setOnClickListener(v -> {
if (commonQuestionBeanList != null && commonQuestionBeanList.size() > 0) {
openOrCloseCommonQuestionLayout(true);
} else {
getCommonQuestionListData();
}
});*/
if (ChatStatusCacheHelper.getStatusCache("chatEvent")) {
if (commonQuestionBeanList != null && commonQuestionBeanList.size() > 0) {
// rl_common_question_enter.postDelayed(() -> openOrCloseCommonQuestionLayout(true), 300);
} else {
try {
} catch (Exception e) {
e.printStackTrace();
}
getCommonQuestionListData();
}
ChatStatusCacheHelper.clearDataByKey("chatEvent");
}
}
//有未完成订单或者有未评价订单时,显示订单布局
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
if (ActionHandlerStorage.getL(sessionId).getInfo().hasAvailableListenOrder == 2 || ActionHandlerStorage.getL(sessionId).getInfo().listenOrderCommentStatus == 1) {
//2专家 1用户
ConfideOrderInfoView confideOrderInfoView = new ConfideOrderInfoView(getContext(), sessionId);
confideOrderInfoView.setData(ActionHandlerStorage.getL(sessionId).getInfo());
rl_contain.addView(confideOrderInfoView);
AnimUtils.Companion.slideToDown(rl_contain);
}
}
TitleBarBottom titleBar = ((YDLBaseMessageActivity) getActivity()).getTitleBarBottom();
if (!UserPreferences.isEarPhoneModeEnable()) {
titleBar.setTitleLeftDraw(null);
......@@ -347,15 +205,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
titleBar.setTitle(ActionHandlerStorage.getL(sessionId).getInfo().name);
// 初始化顶部专家信息栏
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 2) {
top_expert_info_cl.setVisibility(View.VISIBLE);
AnimUtils.Companion.slideToDown(top_expert_info_cl);
initTopCustomBar();
comment_banner_view_ll.setVisibility(View.VISIBLE);
AnimUtils.Companion.slideToDown(comment_banner_view_ll);
initCommentBanner();
initAnimation(); // 初始化顶部布局的动画
initTopViewHeight(); //设置顶部专家信息栏高度
addScrollListener();
IMChatUtil.INSTANCE.initChatOnlineState(titleBar, getContext(), sessionId, this);
}
......@@ -363,17 +213,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
int type = ActionHandlerStorage.getL(sessionId).getUserType();
int sType = ActionHandlerStorage.getL(sessionId).getSelfUserType();
if (type == 2 && sType == 1) {
lin_actions.setVisibility(View.VISIBLE);
ll_actions_yi.setVisibility(View.GONE);
AnimUtils.Companion.slideToDown(lin_actions);
initMenu();
} else if (type == -1 && sType == 1) {
ll_actions_yi.setVisibility(View.VISIBLE);
lin_actions.setVisibility(View.GONE);
initYiMenu();
} else {
ll_actions_yi.setVisibility(View.GONE);
lin_actions.setVisibility(View.GONE);
}
}
......@@ -407,33 +252,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
getInputPanel().setInputHintContent(res.data.getInputBoxReminder());
}
}
if ("200".equals(res.code) && res.data != null) {
if (res.data.getStatus() == 0) {
if (null != getActivity() && null != rela_zixun) {
rela_zixun.setVisibility(View.GONE);
}
}
}
}, throwable -> {
});
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 1 && ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUser_type() == 3) {
//获取来源的专家
ServiceImpl.Companion.getInstance().getSourceDoctor(ActionHandlerStorage.getL(sessionId).getInfo().toUid, ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUid())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if (TextUtils.equals(res.code, "200") && res.data != null && !TextUtils.isEmpty(res.data.name)) {
addSourceLayoutScrollListener();
rl_doctor_name.setVisibility(View.VISIBLE);
tv_doctor_name.setText(res.data.name);
} else {
rl_doctor_name.setVisibility(View.GONE);
}
}, throwable -> {
rl_doctor_name.setVisibility(View.GONE);
});
}
String targetUid = "";
if (ModularServiceManager.INSTANCE.provide(IUserService.class).getUserInfo().getUser_type() == 1) {
......@@ -463,7 +284,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
......@@ -530,71 +351,8 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
userInfoDialog.show();
}
private void addScrollListener() {
messageListView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
if (dy < 0 && Math.abs(dy) > 15) {
hasUpScroll = true;
// 下滑
if (!expertInfoViewIsIn && !expertInfoViewIsAnimating) {
expertInfoViewIsAnimating = true;
anim_in.start();
}
} else if (dy > 0 && Math.abs(dy) > 15) {
if (expertInfoViewIsIn && !expertInfoViewIsAnimating && hasUpScroll) {
expertInfoViewIsAnimating = true;
anim_out.start();
}
}
}
});
}
private void addSourceLayoutScrollListener() {
messageListView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
sourceDoctorLayoutIn();
} else {
sourceDoctorLayoutOut();
}
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
});
}
private void initTopViewHeight() {
rl_contain.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (initHeightFinish) {
rvPaddingTop += rl_contain.getHeight();
messageListView.setPadding(0, rvPaddingTop, 0, 0);
} else {
rvPaddingTop += rl_contain.getHeight();
}
initHeightFinish = true;
rl_contain.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
top_expert_info_ll.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
......@@ -626,338 +384,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
public void onGlobalLayout() {
int rvPaddingTop = ll_actions_yi.getHeight();
messageListView.setPadding(0, rvPaddingTop, 0, 0);
rl_contain.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}
});
}
private void initAnimation() {
anim_out = newAnimation(0f, 1f);
anim_out.setDuration(IN_OUT_DURATION);
anim_in = newAnimation(1f, 0f);
anim_in.setDuration(IN_OUT_DURATION);
anim_in.addUpdateListener(animation -> {
if (expertInfoViewHeight != 0 && constraint_ll != null) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) constraint_ll.getLayoutParams();
params.topMargin = (int) (-expertInfoViewHeight * Float.valueOf(animation.getAnimatedValue().toString()));
constraint_ll.setLayoutParams(params);
}
});
anim_in.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
expertInfoViewIsIn = true;
expertInfoViewIsAnimating = false;
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
anim_out.addUpdateListener(animation -> {
if (expertInfoViewHeight != 0 && constraint_ll != null) {
ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) constraint_ll.getLayoutParams();
params.topMargin = (int) (-expertInfoViewHeight * Float.valueOf(animation.getAnimatedValue().toString()));
constraint_ll.setLayoutParams(params);
}
});
anim_out.addListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
expertInfoViewIsIn = false;
expertInfoViewIsAnimating = false;
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
});
}
private ValueAnimator newAnimation(float fromYValue, float toYValue) {
ValueAnimator anim = ValueAnimator.ofFloat(fromYValue, toYValue);
return anim;
}
private void sourceDoctorLayoutIn() {
if (rl_doctor_name.getVisibility() == View.VISIBLE) {
if (sourceLayoutAnim == null) {
sourceLayoutAnim = ObjectAnimator.ofFloat(ll_info_detail, "translationX", 0.0f, -tv_from.getMeasuredWidth());
sourceLayoutAnim.setDuration(250);
}
sourceLayoutAnim.reverse();
}
}
private void sourceDoctorLayoutOut() {
if (rl_doctor_name.getVisibility() == View.VISIBLE) {
if (sourceLayoutAnim == null) {
sourceLayoutAnim = ObjectAnimator.ofFloat(ll_info_detail, "translationX", 0.0f, -tv_from.getMeasuredWidth());
sourceLayoutAnim.setDuration(250);
}
sourceLayoutAnim.start();
}
}
/**
* 初始化顶部专家信息栏
*/
private void initTopCustomBar() {
// 头像
String headUrl = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoSmallImage;
if (!TextUtils.isEmpty(headUrl)) {
GlideApp.with(getActivity()).load(headUrl).into(small_head_img);
small_head_img.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (ActionHandlerStorage.getL(sessionId) != null) {//
int userType = ActionHandlerStorage.getL(sessionId).getUserType();//1普通用户2专家3助理
if (userType == 1 || userType == 3) {
//跳转用户主页
ActionHandlerStorage.getL(sessionId).showUserHome();
} else if (userType == 2) {
//跳转专家主页
ActionHandlerStorage.getL(sessionId).showZhuanjPage();
}
}
}
});
}
// 帮助人数
help_num = String.valueOf(ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoOrderNum);
if (TextUtils.isEmpty(help_num)) {
help_num = "0";
}
help_num_tv.setText(help_num);
// 服务时长
server_num = String.valueOf((int) Math.ceil((double) ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoHelpLong / 60.0));
if (TextUtils.isEmpty(server_num)) {
server_num = "0";
}
server_num_tv.setText(server_num);
// 好评率
good_num = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoFeedbackRateForShow;
if (TextUtils.isEmpty(good_num)) {
good_num = "0.0";
}
good_num_tv.setText(good_num);
try {
good_num_icons.setGrade(Float.parseFloat(good_num));
} catch (Exception e) {
LogUtil.i(e.toString());
}
if (!TextUtils.isEmpty(headUrl)) {
IP2PCustomActionHandler.DocInfo info = ActionHandlerStorage.getL(sessionId).getInfo();
if (null != info) {
NimUserInfo user = NimUserInfoCache.getInstance().getUserInfo(info.toUid);
if (null != user && null != user.getAvatar() && headUrl.equals(user.getAvatar())) {
NimUserInfoCache.getInstance().getUserInfoFromRemote(info.toUid, null);
}
}
}
top_expert_info_cl.setOnClickListener(v -> {
if (null != getActivity()) {
if (expertInfoDialog == null) {
expertInfoDialog = new ExpertInfoDialog(getActivity(), help_num, server_num, good_num);
}
expertInfoDialog.show();
}
});
}
/**
* 初始化顶部专家信息栏下面的评论view
*/
private void initCommentBanner() {
if (ActionHandlerStorage.getL(sessionId).getInfo().commentList.size() == 0) {
comment_banner_view_ll.setVisibility(View.GONE);
return;
}
int commentCounter = ActionHandlerStorage.getL(sessionId).getInfo().commentCounter;
tv_all_comment_desc.setText(String.valueOf(commentCounter));
H5Params params = new H5Params(ActionHandlerStorage.getL(sessionId).getInfo().commentCounterUrl, "");
View.OnClickListener onClickListener = v -> NewH5Activity.start(getActivity(), params);
tv_all_comment_desc.setOnClickListener(onClickListener);
tv_all_comment_go.setOnClickListener(onClickListener);
comment_banner_view.initData(ActionHandlerStorage.getL(sessionId).getInfo().commentList);
if (ActionHandlerStorage.getL(sessionId).getInfo().isFollowed) {
im_focus_btn.setText("已关注");
im_focus_btn.setTextColor(Color.parseColor("#999999"));
im_focus_btn.setBackgroundResource(R.drawable.im_unfocus_btn_bg);
} else {
im_focus_btn.setText("关注");
im_focus_btn.setTextColor(getResources().getColor(R.color.platform_main_theme));
im_focus_btn.setBackgroundResource(R.drawable.im_focus_btn_bg);
im_focus_btn.setOnClickListener(v -> {
focus();
});
}
}
//关注
@SuppressLint("CheckResult")
private void focus() {
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
// 未关注才能进行关注
if (ActionHandlerStorage.getL(sessionId).getInfo().isFollowed == false) {
ActionHandlerStorage.getL(sessionId).getInfo().isFollowed = true;
ServiceImpl.Companion.getInstance().focus(ActionHandlerStorage.getL(sessionId).getInfo().doctorId, "1")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if ("200".equals(res.code) && null != getActivity()) {
ToastUtil.toastShort("关注成功");
im_focus_btn.setText("已关注");
im_focus_btn.setTextColor(Color.parseColor("#999999"));
im_focus_btn.setBackgroundResource(R.drawable.im_unfocus_btn_bg);
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
ActionHandlerStorage.getL(sessionId).getInfo().isFollowed = true;
}
}
}, throwable -> {
if (null != getActivity()) {
ActionHandlerStorage.getL(sessionId).getInfo().isFollowed = false;
// ToastUtil.toastShort(throwable.toString());
}
});
}
}
}
private void showTips() {
mHandler.sendEmptyMessageDelayed(1, 1000);
}
//初始化聊天顶部快捷菜单
@SuppressLint("CheckResult")
private void initMenu() {
rela_zixun.setOnClickListener(view -> {
if (sessionId != null && ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo() != null) {
if (expertConsultServiceListDialog == null) {
ServiceImpl.Companion.getInstance().serviceList(ActionHandlerStorage.getL(sessionId).getInfo().doctorId)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if (res.data != null && res.data.size() > 0) {
if (getActivity() != null && expertConsultServiceListDialog == null) {
expertConsultServiceListDialog = new ExpertConsultServiceListDialog(getActivity(), res.data);
expertConsultServiceListDialog.show();
}
} else {
ToastUtil.toastShort("咨询师暂未发布服务");
}
}, throwable -> {
});
} else {
expertConsultServiceListDialog.show();
}
} else {
ToastUtil.toastShort("请退出聊天重试");
}
});
//倾诉,不确定是否还要使用,暂留
// RelativeLayout rela_qingsu = rootView.findViewById(R.id.rela_qingsu);
// StateListDrawable confideDrawable = new StateListDrawable();
// confideDrawable.addState(new int[]{android.R.attr.state_pressed}, new HalfCircleDrawable(getContext(), true, ContextCompat.getColor(getContext(), R.color.platform_color_F7F7F7)));
// confideDrawable.addState(new int[]{}, new HalfCircleDrawable(getContext(), true, Color.WHITE));
// rela_qingsu.setBackground(confideDrawable);
//
// if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getInfo().listenerIsOpen == 1) {//开通倾诉
// int status = ActionHandlerStorage.getL(sessionId).getInfo().isChatOnline;
// if (status == 5) {
// qingshu.setText("倾诉通话中...");
// qingshu.setTextColor(Color.parseColor("#BFBFBF"));
// qingshuImg.setImageResource(R.mipmap.im_chat_ico_calling);
// canConsultBtnClick = false;
// } else if (status == 3 || status == 4 || status == 6) {
// qingshu.setText("即时倾诉");
// qingshu.setTextColor(Color.parseColor("#BFBFBF"));
// qingshuImg.setImageResource(R.mipmap.im_chat_ico_calling);
// canConsultBtnClick = false;
// } else {
// qingshu.setText("即时倾诉");
// qingshu.setTextColor(Color.parseColor("#242424"));
// qingshuImg.setImageResource(R.mipmap.im_chat_ico_can_call);
// canConsultBtnClick = true;
// }
// if (ActionHandlerStorage.getL(sessionId).getInfo().hasAvailableListenOrder == 2) {//有未完成订单
// qingshu.setText("继续倾诉");
// qingshu.setTextColor(Color.parseColor("#242424"));
// qingshuImg.setImageResource(R.mipmap.im_chat_ico_calling);
// canConsultBtnClick = true;
// }
// } else {
// qingshu.setText("即时倾诉");
// qingshu.setTextColor(Color.parseColor("#242424"));
// qingshuImg.setImageResource(R.mipmap.im_chat_ico_can_call);
// canConsultBtnClick = true;
// }
//
//
// rela_qingsu.setOnClickListener(new View.OnClickListener() {
// @Override
// public void onClick(View view) {
// if (canConsultBtnClick) {
// LogHelper.Companion.getInstance().writeLogSync("聊天界面点击电话倾诉");
// if (ActionHandlerStorage.getL(sessionId) != null) {
// try {
// JSONObject jsb = new JSONObject();
// jsb.put("button_name", "电话倾诉");
// ActionHandlerStorage.getL(sessionId).buryPoint("messageClick", jsb);
//
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("expert_id", ActionHandlerStorage.getL(sessionId).getInfo().doctorId);
// jsonObject.put("expert_name", ActionHandlerStorage.getL(sessionId).getInfo().name);
// jsonObject.put("listen_entrance", "私聊窗口");
// ActionHandlerStorage.getL(sessionId).buryPoint("Listen_expert", jsonObject);
// } catch (JSONException e) {
// e.printStackTrace();
// }
// ActionHandlerStorage.getL(sessionId).confide();
// } else {
// ToastUtil.toastShort("请退出聊天重试");
// }
// }
// }
// });
}
private void initYiMenu() {
initYiViewTopHeight();
......@@ -999,14 +429,12 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
/**
* ***************************** life cycle *******************************
*/
@Override
public void onPause() {
super.onPause();
userIsInPage("67","用户离开当前页面",sessionId,ImIn.INSTANCE.getUserInfo().getUid());
NIMClient.getService(MsgService.class).setChattingAccount(MsgService.MSG_CHATTING_ACCOUNT_NONE, SessionTypeEnum.None);
inputPanel.onPause();
messageListPanel.onPause();
......@@ -1019,14 +447,64 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
messageListPanel.onResume();
NIMClient.getService(MsgService.class).setChattingAccount(sessionId, sessionType);
getActivity().setVolumeControlStream(AudioManager.STREAM_VOICE_CALL); // 默认使用听筒播放
userIsInPage("66","用户在当前页面",sessionId,ImIn.INSTANCE.getUserInfo().getUid());
messageListPanel.scrollToBottom();
inputPanel.setVisible(false);
getInquIryIngInfo();
}
@SuppressLint("CheckResult")
private void getInquIryIngInfo() {
ImRetrofitApi.Companion.getImJavaApi()
.getInquIryIngInfo(ActionHandlerStorage.getL(sessionId).getInfo().toUid, ImIn.INSTANCE.getUserInfo().getUid())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if ("200".equals(response.code)) {
if (response.data.getStatus() == 30) {
// 30:待诊断(已接诊、问诊中)
inputPanel.setVisible(true);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.VISIBLE);
receive_unstart.setVisibility(View.GONE);
receive_end.setVisibility(View.GONE);
} else if (response.data.getStatus() == 20) {
//待接诊
inputPanel.setVisible(false);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.GONE);
receive_unstart.setVisibility(View.VISIBLE);
receive_end.setVisibility(View.GONE);
} else if (response.data.getStatus() == 40) {
//已完成
inputPanel.setVisible(false);
top_expert_info_ll.setVisibility(View.VISIBLE);
receive_undiagnosis.setVisibility(View.GONE);
receive_unstart.setVisibility(View.GONE);
receive_end.setVisibility(View.VISIBLE);
} else {
top_expert_info_ll.setVisibility(View.GONE);
inputPanel.setVisible(false);
}
} else {
ToastUtil.toastShort(response.msg);
inputPanel.setVisible(false);
}
}, throwable -> {
inputPanel.setVisible(false);
LogUtil.e(throwable.getMessage());
}
);
}
@Override
public void onDestroy() {
comment_banner_view.onDestory();
EventBus.getDefault().unregister(this);
super.onDestroy();
messageListPanel.onDestroy();
......@@ -1045,109 +523,99 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
ArrayList<AnswersItem> answersItems = new ArrayList<>();
public void onEvent(MultipleSelectedEvent event){
if (event.getOthersState()!=null){
answersItems=event.getMultipleAnswerBean().getAnswersItems();
multipleAnswerBean=event.getMultipleAnswerBean();
public void onEvent(MultipleSelectedEvent event) {
if (event.getOthersState() != null) {
answersItems = event.getMultipleAnswerBean().getAnswersItems();
multipleAnswerBean = event.getMultipleAnswerBean();
multipleAnswerBean.setAnswersItems(answersItems);
if (event.getRecoverInput()){
question_multiple.setVisibility(View.GONE);
if (event.getRecoverInput()) {
inputPanel.onlyShowTextEnd();
return;
}
if (event.getOthersState().isOthers()){
if (event.getOthersState().isOthers()) {
//用户点击了其他事件
if (event.getOthersState().getOthersSelect()){
if (event.getOthersState().getOthersSelect()) {
//其他是选中状态
isOthers=event.getOthersState().getOthersSelect();
rootView.postDelayed(new Runnable() {
@Override
public void run() {
inputPanel.onlyShowTextStart();
}
}, 500);
}else{
} else {
//其他是未选中状态
question_multiple.setVisibility(View.GONE);
isOthers=event.getOthersState().getOthersSelect();
inputPanel.onlyShowTextEnd();
}
if (event.getStrSelected().contains("其他")){
question_multiple.setVisibility(View.VISIBLE);
question_multiple.setText(event.getStrSelected().replace("、","#"));
}
}else{
if (event.getStrSelected().contains("其他")){
question_multiple.setVisibility(View.VISIBLE);
question_multiple.setText(event.getStrSelected().replace("、","#"));
}
}
}else if (event.isFromInputPanel()){
for (int i=0;i<answersItems.size();i++){
if (answersItems.get(i).getName().contains("其他")){
} else if (event.isFromInputPanel()) {
for (int i = 0; i < answersItems.size(); i++) {
if (answersItems.get(i).getName().contains("其他")) {
answersItems.get(i).setOther(inputPanel.getInputContent());
break;
}
}
multipleAnswerBean.setAnswersItems(answersItems);
for (int i=0;i<answersItems.size();i++){
answersItemsMap.add(i,answersItems.get(i).getName());
for (int i = 0; i < answersItems.size(); i++) {
answersItemsMap.add(i, answersItems.get(i).getName());
}
updateLocalMsg(null,answersItemsMap);
updateLocalMsg(null, answersItemsMap);
answerMultipleQuestion(multipleAnswerBean);
}else{
} else {
//请求接口发送消息为56的答案
answersItems=event.getMultipleAnswerBean().getAnswersItems();
for (int i=0;i<answersItems.size();i++){
if (answersItems.get(i).getName().contains("其他")){
answersItems = event.getMultipleAnswerBean().getAnswersItems();
for (int i = 0; i < answersItems.size(); i++) {
if (answersItems.get(i).getName().contains("其他")) {
answersItems.get(i).setOther(inputPanel.getInputContent());
break;
}
}
multipleAnswerBean=event.getMultipleAnswerBean();
multipleAnswerBean = event.getMultipleAnswerBean();
multipleAnswerBean.setAnswersItems(answersItems);
for (int i=0;i<answersItems.size();i++){
answersItemsMap.add(i,answersItems.get(i).getName());
for (int i = 0; i < answersItems.size(); i++) {
answersItemsMap.add(i, answersItems.get(i).getName());
}
updateLocalMsg(null,answersItemsMap);
updateLocalMsg(null, answersItemsMap);
answerMultipleQuestion(multipleAnswerBean);
}
}
private void updateLocalMsg(Integer position,ArrayList<String> selectedPosition) {
IMMessage message=ImIn.INSTANCE.getImMessage();
private void updateLocalMsg(Integer position, ArrayList<String> selectedPosition) {
IMMessage message = ImIn.INSTANCE.getImMessage();
//更新本地消息
Map<String, Object> map = message.getLocalExtension();
if (map == null) {
map = new HashMap();
}
map.put("isSure", true);
if (position!=null){
if (position != null) {
map.put("position", position);
}
if (selectedPosition!=null){
if (selectedPosition != null) {
map.put("multiple", selectedPosition);
}
message.setLocalExtension(map);
NIMClient.getService(MsgService.class).updateIMMessage(message);
}
/*
* 用户回答问题接口
* */
private void answerMultipleQuestion(MultipleAnswerBean multipleAnswerBean){
private void answerMultipleQuestion(MultipleAnswerBean multipleAnswerBean) {
inputPanel.setInputContent("");
question_multiple.setText("");
question_multiple.setVisibility(View.GONE);
inputPanel.onlyShowTextEnd();
answerLingxiQuestion(multipleAnswerBean.getExamId(),multipleAnswerBean.getQuestionPaperId(),
multipleAnswerBean.getUid(),multipleAnswerBean.getQuestionId(),multipleAnswerBean.getAnswersItems(),
answerLingxiQuestion(multipleAnswerBean.getExamId(), multipleAnswerBean.getQuestionPaperId(),
multipleAnswerBean.getUid(), multipleAnswerBean.getQuestionId(), multipleAnswerBean.getAnswersItems(),
multipleAnswerBean.getFromUid());
}
/*
* 用户回答问题接口
* */
private void answerLingxiQuestion(String examID, String questionPaperId, String uid, String questionId, ArrayList<AnswersItem> answersItems,String fromUID) {
private void answerLingxiQuestion(String examID, String questionPaperId, String uid, String questionId, ArrayList<AnswersItem> answersItems, String fromUID) {
String str = new Gson().toJson(new LingxiAnswerBean(new AnswerBean(examID, questionPaperId, uid, questionId, answersItems), uid, "56", fromUID));
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str);
Disposable subscribe = ImRetrofitApi.Companion.getImRetrofitApi().lingxiAnswerQuestion(body)
......@@ -1160,6 +628,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
com.yidianling.common.tools.LogUtil.e(throwable.getMessage())
);
}
public boolean onBackPressed() {
return inputPanel.collapse(true) || messageListPanel.onBackPressed() || openOrCloseCommonQuestionLayout(false);
}
......@@ -1438,92 +907,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
inputPanel.collapse(true);
messageListPanel.scrollToBottom();
}
/*if (rl_common_question_enter != null) {
rl_common_question_enter.setVisibility(open ? View.GONE : View.VISIBLE);
}*/
if (fl_question_content != null) {
if (fl_question_content.getVisibility() == View.VISIBLE) {
result = true;
}
fl_question_content.setVisibility(open ? View.VISIBLE : View.GONE);
}
}
return result;
}
@SuppressLint("CheckResult")
private void getCommonQuestionListData() {
ServiceImpl.Companion.getInstance().getCommonQuestionList()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if (res.data != null && res.data.size() > 0) {
if (commonQuestionBeanList == null) {
commonQuestionBeanList = new ArrayList<>();
} else {
commonQuestionBeanList.clear();
}
commonQuestionBeanList.addAll(res.data);
// initCommonQuestionLayout();
}
}, throwable -> {
ToastUtil.toastShort(throwable.toString());
});
}
/*
* 用户是否在当前页面
*
* */
private void userIsInPage(String noticeType,String content,String fromUid,String toUid) {
String str = new Gson().toJson(new UserIsIn(new UserIsInPageData(content),toUid,noticeType,fromUid));
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), str);
Disposable subscribe = ImRetrofitApi.Companion.getImRetrofitApi().lingxiSendNotice(body)
.compose(RxUtils.INSTANCE.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(it -> {
LogUtil.e(it.toString()+content);
}, throwable ->
com.yidianling.common.tools.LogUtil.e(throwable.getMessage())
);
}
private void initCommonQuestionLayout() {
CommonQuestionView commonQuestionView = new CommonQuestionView(getActivity());
commonQuestionView.setData(commonQuestionBeanList);
commonQuestionView.setListener(new CommonQuestionView.OnSelectItemListener() {
@Override
public void close() {
openOrCloseCommonQuestionLayout(false);
}
@Override
public void onSelect(@NotNull String title, String id) {
IMMessage textMessage = MessageBuilder.createTextMessage(sessionId, sessionType, title);
if (sendMessage(textMessage)) {
openOrCloseCommonQuestionLayout(false);
}
commonQuestionClickCount(id);
}
});
fl_question_content.addView(commonQuestionView);
openOrCloseCommonQuestionLayout(true);
}
@SuppressLint("CheckResult")
private void commonQuestionClickCount(String id) {
ServiceImpl.Companion.getInstance().sendCommonQuestionCount(id)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(objectBaseAPIResponse -> {
}, throwable -> {
});
}
private void showCheckAgeDialog() {
CommonDialog.create(getActivity())
.setLeftOnclick("返回", v -> {
......
......@@ -4,6 +4,8 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA_URL
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.medical.MedicalFileBeanRespose
import com.yidianling.medical.archives.bean.CreateArchivesRespose
import com.yidianling.medical.archives.bean.MedicalArchivesListBean
import com.yidianling.medical.archives.bean.MedicalUserArchivesBean
import com.yidianling.uikit.custom.http.response.*
......@@ -11,6 +13,8 @@ import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*
import java.util.*
import kotlin.collections.ArrayList
/**
* Created by xj on 2019/6/26.
......@@ -136,10 +140,11 @@ interface ServiceApi {
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun createArchives(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
//医疗 创建问诊
//医疗 创建问诊订单
@POST("ydl-yiliao-api/api/client/inquiry/v1/create")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun createArchivesOrder(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
fun createArchivesOrder(@Body body: RequestBody): Observable<BaseAPIResponse<CreateArchivesRespose>>
//医疗 删除问诊人
@POST("ydl-yiliao-api/api/client/user/patient/v1/delete")
......@@ -147,4 +152,17 @@ interface ServiceApi {
fun deleteArchives(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
//上传文件,多文件批量上传
@POST("ydl-yiliao-api/api/client/common/v1/uploadBatch")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
@Multipart
fun uploadBatch(@PartMap params: TreeMap<String, RequestBody>): Observable<BaseAPIResponse<List<MedicalFileBeanRespose>>>
//上传文件,单文件上传
@POST("ydl-yiliao-api/api/client/common/v1/upload")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA_URL)
fun upload(@PartMap params: TreeMap<String, RequestBody>): Observable<BaseAPIResponse<MedicalFileBeanRespose>>
}
\ No newline at end of file
......@@ -4,12 +4,19 @@ import com.alibaba.fastjson.JSON
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.http.ImRetrofitApi
import com.yidianling.medical.MedicalFileBeanRespose
import com.yidianling.medical.archives.bean.*
import com.yidianling.uikit.custom.http.response.*
import com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
import io.reactivex.Observable
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import okhttp3.MediaType
import okhttp3.RequestBody
import java.io.File
import java.util.*
/**
* Created by xj on 2019/6/26.
......@@ -233,7 +240,7 @@ class ServiceImpl private constructor() {
mainSuitDisease: String,
patientId: Int,
doctorId: String
): Observable<BaseAPIResponse<Any>> {
): Observable<BaseAPIResponse<CreateArchivesRespose>> {
val body = RequestBody.create(
MediaType.parse("application/json; charset=utf-8"),
JSON.toJSONString(
......@@ -244,7 +251,7 @@ class ServiceImpl private constructor() {
1,
mainSuitDisease,
mainSuit,
1
patientId
)
)
) as RequestBody
......@@ -268,4 +275,9 @@ class ServiceImpl private constructor() {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).deleteArchives(body)
}
fun uploadBatch( map :TreeMap<String, RequestBody>): Observable<BaseAPIResponse<List<MedicalFileBeanRespose>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).uploadBatch(map)
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginRight="8dp"
android:background="#80d7dfea"
android:elevation="0dp"
android:maxWidth="263dp"
android:minWidth="263dp"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_marginTop="8dp"
android:layout_marginRight="12dp"
android:layout_marginBottom="8dp"
android:text="本次诊断结束,如有问题可联系客服或再次向医生问诊"
android:textColor="#ff8595a9"
android:textSize="12sp" />
</androidx.cardview.widget.CardView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginRight="8dp"
android:background="@color/white"
android:maxWidth="263dp"
app:cardElevation="0dp"
android:elevation="0dp"
android:minWidth="263dp"
app:cardCornerRadius="8dp">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/platform_dp_12">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="图文问诊"
android:textColor="#ff0c1d31"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="基本信息:"
android:textColor="#ff8595a9"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_title" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:textColor="#ff0c1d31"
android:textSize="16sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_info"
app:layout_constraintLeft_toRightOf="@id/tv_info"
tools:text="何照" />
<View
android:id="@+id/name_right"
android:layout_width="1dp"
android:layout_height="12dp"
android:layout_marginStart="8dp"
android:background="@color/medical_color_c0c9d4"
app:layout_constraintBottom_toBottomOf="@id/name"
app:layout_constraintLeft_toRightOf="@id/name"
app:layout_constraintTop_toTopOf="@id/name" />
<TextView
android:id="@+id/gender_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="#ff0c1d31"
android:textSize="16sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_info"
app:layout_constraintLeft_toRightOf="@id/name_right"
tools:text="男" />
<View
android:id="@+id/gender_name_right"
android:layout_width="1dp"
android:layout_height="12dp"
android:layout_marginStart="8dp"
android:background="@color/medical_color_c0c9d4"
app:layout_constraintBottom_toBottomOf="@id/gender_name"
app:layout_constraintLeft_toRightOf="@id/gender_name"
app:layout_constraintTop_toTopOf="@id/gender_name" />
<TextView
android:id="@+id/age"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:textColor="#ff0c1d31"
android:textSize="16sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_info"
app:layout_constraintLeft_toRightOf="@id/gender_name_right"
tools:text="20岁" />
<TextView
android:id="@+id/tv_mainSuit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="问诊描述:"
android:textColor="#ff8595a9"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/tv_info" />
<TextView
android:id="@+id/mainSuit"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#ff0c1d31"
android:textSize="16sp"
app:layout_constraintBaseline_toBaselineOf="@id/tv_mainSuit"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toRightOf="@id/tv_mainSuit"
app:layout_constraintRight_toRightOf="parent"
tools:text="经常紧张,全身紧绷,食欲不振,消化不良" />
<View
android:id="@+id/line_center"
android:layout_width="0dp"
android:layout_height="1px"
android:layout_marginTop="12dp"
android:background="@color/medical_color_c0c9d4"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_mainSuit" />
<TextView
android:id="@+id/detail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="问诊详情"
android:textColor="#ff8595a9"
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="@id/tv_title"
app:layout_constraintTop_toBottomOf="@id/line_center" />
<ImageView
android:src="@mipmap/medical_icon_arrow_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@id/detail"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="@id/detail" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
......@@ -40,6 +40,7 @@
android:textStyle="bold" />
<ImageView
android:id="@+id/ll_more"
android:layout_width="wrap_content"
android:layout_height="56dp"
android:layout_alignParentRight="true"
......
......@@ -19,11 +19,11 @@
<androidx.cardview.widget.CardView
android:id="@+id/card_img"
android:layout_width="52dp"
android:layout_height="52dp"
android:layout_centerInParent="true"
app:cardCornerRadius="24dp"
app:cardElevation="0dp"
app:layout_constraintRight_toLeftOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
......@@ -125,23 +125,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_weight="0"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
android:orientation="horizontal">
</LinearLayout>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/im_chat_setting_popupwindow_bg"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_all_read"
android:layout_width="150dp"
android:layout_height="51dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginRight="9dp"
android:scaleType="fitXY"
android:src="@mipmap/medical_yidu_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="全部已读"
android:textColor="#242424"
android:textSize="16dp" />
</LinearLayout>
<View
android:layout_width="150dp"
android:layout_height="0.5dp"
android:background="#EBEBEB" />
<LinearLayout
android:id="@+id/ll_chat_setting"
android:layout_width="150dp"
android:layout_height="51dp"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_marginRight="9dp"
android:scaleType="fitXY"
android:src="@mipmap/medical_xiaoxi_icon" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="消息设置"
android:textColor="#242424"
android:textSize="16dp" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="96dp"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="知情同意书"
android:textColor="#ff0c1d31"
android:textSize="18sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/close"
android:layout_width="55dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:paddingLeft="20dp"
android:paddingTop="24dp"
android:paddingRight="20dp"
android:src="@mipmap/medical_close_black_icon" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:lineSpacingMultiplier="1.1"
android:text="@string/zhiqing"
android:textColor="#ff0c1d31"
android:textSize="16sp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
......@@ -246,5 +246,28 @@
<string name="im_chat_pivate_content">如系统检测到涉黄、涉爆、涉政等信息,可能会封号处理并追究法律责任!</string>
<string name="im_video_play">视频播放</string>
<string name="question_notes">注:描述中请包含问题持续时间、问题发生原因、当前的问题。如何描述?</string>
<string name="zhiqing">尊敬的用户(监护人): <br/>
欢迎您到壹点灵互联网医院就诊,我们愿意为您提供方便快捷的互联网医疗服务。为维护您的合法权益,请您仔细阅读以下内容。<br/>
接受互联网诊疗服务、私人医生服务、远程医疗服务可能出现潜在风险,有些不常见的风险未能一一列出,如果患者有疑问应与医生讨论。<br/>
1、受限于互联网诊疗本身的局限性(如医生不能面诊、触诊等,无法通过相关的诊查手段及检查、检验结果准确判断病情的进展),医生给出的本次诊疗方案、健康管理方案、远程医疗方案依赖于用户所上传的资料和描述的症状,以及既往的病例资料、临床诊断。如前述信息不准确或不全面,将对本次方案的合理制定产生一定的影响。如果您是初次就诊,请到实体医院就诊。<br/>
2、提供互联网诊疗服务、私人医生服务、远程医疗服务的医生,可能来自于实体医疗机构中的不同级别、性质的医院,执业年限及经验不一。互联网医院的分诊主要依赖于用户的需求尽力匹配适合用户的医生为患者进行服务。用户可以自行选择医生,但受限于医生的执业经验及背景,医生给出的方案的合理性和先进性可能存在差异。<br/>
3、由于精神心理疾病本身的特殊性和复杂性,患者本身的体质状况,及现有医疗水平条件的限制等,都存在可能发生各种并发症和危害自身生命健康的意外风险。<br/>
4、由于精神心理疾病本身的复杂性,以及诊疗措施疗效出现的延后性,诊疗方案、健康管理方案、远程医疗方案可能不会达到患者期许的效果,且有些疾病或并发症是不可根治的,需要患者积极配合,长期坚持治疗,才能延缓疾病的进展。医生已经尽力为患者制定合理的方案,致力减少药物治疗不良反应的发生,但不可能完全避免,且不可预测,需要在患者的配合下,并根据临床情况不断调整方案。<br/>
5、未成年人需由监护人陪同下就诊。<br/>
6、疾病的治愈需要患者谨遵医嘱、健康管理方案,并积极配合。如果患者未完全遵守和配合,则可能导致诊疗效果不理想,甚至出现病情反复、恶化等不良后果。<br/>
7、配送药品可能受到物流时效的影响,导致患者延时服用药物;或患者正在用药物或者手术等治疗其他疾病,也可能存在延时用药、联合用药等风险。<br/>
8、医生主要解决本专业领域的医疗问题,非本专业的疾病需要到其它专业科室进行诊治或接受远程医疗服务。<br/>
9、互联网+私人医生服务对持续维护健康具有必要性,如患者难以提供全部既往的诊疗资料,则可能导致健康档案在使用时因资料收集不全而存在潜在风险。<br/>
10、互联网医院对患者信息按要求采取了保密措施,但泄密的可能性依然不能完全消除。<br/>
11、经患者同意后产生的医疗文件和诊疗数据,独立属于医疗机构,匿名化后可能被用于科学研究(包括但不限于大数据研究),患者并不能从中直接受益。<br/>
用户或监护人知情知情同意并确认以下条款:<br/>
a、用户确认在互联网医院上问诊的疾病,已经在实体医疗机构明确诊断,患者已经填写或上传相关的病历资料,愿意互联网诊疗。<br/>
b、用户确认既往发生过与本次发病类似的常见病、慢性病病症,并曾经在实体医院诊疗,但现在无法提供与本次病症相关的检诊资料。<br/>
c、患者愿意接受互联网医院提供的“互联网+”私人医生签约服务,并协助医生完善健康档案,达成互联网诊疗。<br/>
d、用户确认愿意接受医生根据诊疗经验为患者安排的远程医疗服务。<br/>
e、用户确认已经知晓并同意以上1-11款的内容,理解相关的风险,愿意接受互联网医院的服务以及接受疾病诊疗服务,并签署知情同意书。<br/>
f、用户确认从未得到服务结果会百分之百成功的许诺。<br/>
g、用户同意您的诊疗内容在去除姓名、头像、出生日期等信息后将设置为默认展示,医生给您的指导建议同时也会帮助其他相似情况的用户。<br/>
如您对本同意书有任何疑问,可联系客服进行联系。</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f8f8f8"
android:orientation="vertical">
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_f8f8f8"
android:orientation="vertical">
<FrameLayout
android:id="@+id/message_activity_list_view_container"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
android:id="@+id/message_activity_list_view_container"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1">
<com.yidianling.uikit.business.session.helper.MsgBkImageView
android:id="@+id/message_activity_background"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:id="@+id/message_activity_background"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
android:id="@+id/constraint_ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:id="@+id/constraint_ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/messageListView"
style="@style/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="@android:color/transparent"
android:divider="@null"
android:fadingEdge="none"
android:listSelector="@android:color/transparent"
android:scrollbars="vertical" />
<!--和助理聊天时,显示关联的咨询师的信息-->
<RelativeLayout
android:id="@+id/rl_doctor_name"
android:layout_width="wrap_content"
android:layout_height="34dp"
android:layout_marginTop="15dp"
android:gravity="center_vertical"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:id="@+id/ll_info_detail"
android:layout_width="wrap_content"
android:layout_height="34dp"
android:layout_toRightOf="@+id/view_empty"
android:background="@drawable/im_background_chat_assistant_to_doctor_name"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingRight="12dp">
<TextView
android:id="@+id/tv_from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingRight="3dp"
android:text="来自"
android:textColor="@color/platform_color_242424"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_doctor_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:textColor="@color/platform_main_theme"
android:textSize="12sp"
tools:text="雷水寿" />
</LinearLayout>
android:id="@+id/messageListView"
style="@style/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:cacheColorHint="@android:color/transparent"
android:divider="@null"
android:fadingEdge="none"
android:listSelector="@android:color/transparent"
android:scrollbars="vertical" />
<View
android:id="@+id/view_empty"
android:layout_width="12dp"
android:layout_height="34dp"
android:background="@color/white" />
</RelativeLayout>
</RelativeLayout>
<LinearLayout
android:id="@+id/top_view_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="gone">
<!-- 专家信息 -->
<LinearLayout
android:id="@+id/top_expert_info_ll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/top_expert_info_cl"
android:layout_width="match_parent"
android:layout_height="56dp"
android:background="@color/im_white"
android:paddingLeft="@dimen/platform_dp_10"
android:visibility="gone"
tools:visibility="visible">
<com.ydl.ydlcommon.view.CircleImageView
android:id="@+id/small_head_img"
android:layout_width="@dimen/platform_dp_36"
android:layout_height="@dimen/platform_dp_36"
android:layout_marginTop="8dp"
android:layout_marginBottom="10dp"
android:background="@drawable/platform_head_place_hold_pic"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"></com.ydl.ydlcommon.view.CircleImageView>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_marginLeft="46dp"
android:layout_marginRight="10dp"
android:background="#F0F0F0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:layout_marginLeft="46dp"
android:background="#F0F0F0"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<RelativeLayout
android:id="@+id/rl_help"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="37dp"
android:paddingTop="13dp"
android:paddingBottom="10dp"
app:layout_constraintLeft_toRightOf="@+id/small_head_img">
<TextView
android:id="@+id/help_num_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textColor="@color/im_color_242424"
android:textSize="@dimen/platform_dp_16"
tools:text="2648" />
<TextView
android:id="@+id/help_num_tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="帮助人数"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_10" />
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="12dp"
android:layout_marginBottom="1.5dp"
android:layout_toRightOf="@+id/help_num_tv_desc"
android:scaleType="fitXY"
android:src="@drawable/im_more_info_icon" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_good"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="30dp"
android:paddingTop="13dp"
android:paddingBottom="10dp"
app:layout_constraintRight_toRightOf="parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<TextView
android:id="@+id/good_num_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textColor="@color/im_color_242424"
android:textSize="@dimen/platform_dp_16"
tools:text="4.7" />
<TextView
android:id="@+id/good_num_tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="分"
android:textColor="@color/im_color_242424"
android:textSize="@dimen/platform_dp_10" />
</LinearLayout>
<com.yidianling.uikit.business.session.view.ImRedStarGradeView
android:id="@+id/good_num_icons"
android:layout_width="wrap_content"
android:layout_height="11dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="1.5dp" />
android:id="@+id/top_view_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="2dp"
android:layout_marginBottom="1.5dp"
android:layout_toRightOf="@+id/good_num_icons"
android:scaleType="fitXY"
android:src="@drawable/im_more_info_icon" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_server"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingTop="13dp"
android:paddingBottom="10dp"
app:layout_constraintLeft_toRightOf="@+id/rl_help"
app:layout_constraintRight_toLeftOf="@+id/rl_good">
<!-- 问诊状态 -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/top_expert_info_ll"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/white"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:id="@+id/server_num_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:textColor="@color/im_color_242424"
android:textSize="@dimen/platform_dp_16"
tools:text="1634" />
<androidx.constraintlayout.widget.Group
android:id="@+id/receive_unstart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="iv_receive_unstart,tv_receive_unstart"
tools:visibility="gone" />
<androidx.constraintlayout.widget.Group
android:id="@+id/receive_undiagnosis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="iv_receive_undiagnosis,tv_receive_undiagnosis"
tools:visibility="gone" />
<TextView
android:id="@+id/server_num_tv_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="服务时长 (小时)"
android:textSize="@dimen/platform_dp_10" />
<androidx.constraintlayout.widget.Group
android:id="@+id/receive_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="iv_receive_end,tv_receive_end"
tools:visibility="visible" />
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="12dp"
android:layout_marginBottom="1.5dp"
android:layout_toRightOf="@+id/server_num_tv_desc"
android:scaleType="fitXY"
android:src="@drawable/im_more_info_icon" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!--用户评论banner-->
<LinearLayout
android:id="@+id/comment_banner_view_ll"
android:layout_width="match_parent"
android:layout_height="37dp"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="10dp"
android:visibility="gone">
<TextView
android:id="@+id/im_focus_btn"
android:layout_width="46dp"
android:layout_height="20dp"
android:background="@drawable/im_focus_btn_bg"
android:gravity="center"
android:textColor="@color/platform_main_theme"
android:textSize="12dp"
tools:text="关注" />
<View
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:background="#F0F0F0" />
<com.yidianling.uikit.business.session.view.ImCommentBannerView
android:id="@+id/comment_banner_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"></com.yidianling.uikit.business.session.view.ImCommentBannerView>
<ImageView
android:id="@+id/iv_receive_unstart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:src="@mipmap/medical_receive_unstart"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:lines="1"
android:text="评价"
android:textColor="@color/platform_main_theme"
android:textSize="12dp" />
<TextView
android:id="@+id/tv_receive_unstart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="待接诊"
android:textColor="#ffff7766"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_receive_unstart"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_receive_undiagnosis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:src="@mipmap/medical_receive_undiagnosis"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="1dp"
android:lines="1"
android:text="("
android:textColor="@color/platform_main_theme"
android:textSize="12dp" />
<TextView
android:id="@+id/tv_all_comment_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:lines="1"
android:textColor="@color/platform_main_theme"
android:textSize="12dp"
tools:text="18714" />
<TextView
android:id="@+id/tv_receive_undiagnosis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="待诊断"
android:textColor="#ff3464ec"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_receive_undiagnosis"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/iv_receive_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:src="@mipmap/medical_receive_end"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="1dp"
android:lines="1"
android:text=")"
android:textColor="@color/platform_main_theme"
android:textSize="12dp" />
<ImageView
android:id="@+id/tv_all_comment_go"
android:layout_width="18dp"
android:layout_height="18dp"
android:layout_gravity="center"
android:src="@drawable/platform_right_arrow" />
<TextView
android:id="@+id/tv_receive_end"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="诊断结束"
android:textColor="#ff8595a9"
android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toRightOf="@id/iv_receive_end"
app:layout_constraintTop_toTopOf="parent" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- 客服小壹 三个快捷按钮 -->
<FrameLayout
android:id="@+id/quick_fl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="10dp">
android:id="@+id/quick_fl"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="10dp">
<LinearLayout
android:id="@+id/ll_actions_yi"
android:layout_width="match_parent"
android:layout_height="53dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:visibility="gone">
android:id="@+id/ll_actions_yi"
android:layout_width="match_parent"
android:layout_height="53dp"
android:layout_marginTop="10dp"
android:orientation="horizontal"
android:visibility="gone">
<LinearLayout
android:id="@+id/action_help"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action"
android:gravity="center"
android:orientation="horizontal">
android:id="@+id/action_help"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="17dp"
android:layout_height="17dp"
android:src="@drawable/im_chat_ico_help" />
android:layout_width="17dp"
android:layout_height="17dp"
android:src="@drawable/im_chat_ico_help" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="center"
android:text="常见问题"
android:textColor="@color/im_color_242424"
android:textSize="15sp"
android:textStyle="bold" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="center"
android:text="常见问题"
android:textColor="@color/im_color_242424"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/action_feedback"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action"
android:gravity="center"
android:orientation="horizontal">
android:id="@+id/action_feedback"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="17dp"
android:layout_height="17dp"
android:src="@drawable/im_chat_ico_feedback" />
android:layout_width="17dp"
android:layout_height="17dp"
android:src="@drawable/im_chat_ico_feedback" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="center"
android:text="投诉反馈"
android:textColor="@color/im_color_242424"
android:textSize="15sp"
android:textStyle="bold" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="center"
android:text="投诉反馈"
android:textColor="@color/im_color_242424"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/action_call"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action"
android:gravity="center"
android:orientation="horizontal">
android:id="@+id/action_call"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="17dp"
android:layout_height="17dp"
android:src="@drawable/im_chat_free_call" />
android:layout_width="17dp"
android:layout_height="17dp"
android:src="@drawable/im_chat_free_call" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="center"
android:text="免费热线"
android:textColor="@color/im_color_242424"
android:textSize="15sp"
android:textStyle="bold" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="3dp"
android:gravity="center"
android:text="免费热线"
android:textColor="@color/im_color_242424"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
......@@ -462,162 +249,67 @@
</FrameLayout>
</LinearLayout>
<!-- 未支付订单提醒等 -->
<RelativeLayout
android:id="@+id/rl_contain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/top_view_container"
tools:layout_height="50dp" />
<!--右边的两个快捷回复按钮-->
<RelativeLayout
android:id="@+id/lin_actions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/rl_contain"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:layout_marginTop="14dp"
android:visibility="visible">
<RelativeLayout
android:id="@+id/rela_zixun"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:background="@drawable/im_bg_im_consult_action"
android:gravity="center"
android:paddingLeft="17dp"
android:paddingRight="11dp">
<TextView
android:id="@+id/action_yuyue"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:paddingLeft="5dp"
android:text="立即咨询"
android:textColor="#ffffff"
android:textSize="14dp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:id="@+id/layoutPlayAudio"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_gravity="center"
android:background="@drawable/im_nim_audio_record_toast_bg"
android:visibility="gone"
tools:visibility="visible">
android:id="@+id/layoutPlayAudio"
android:layout_width="128dp"
android:layout_height="128dp"
android:layout_gravity="center"
android:background="@drawable/im_nim_audio_record_toast_bg"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/img_antation"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp"
android:src="@mipmap/im_voice_search_feedback001" />
android:id="@+id/img_antation"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp"
android:src="@mipmap/im_voice_search_feedback001" />
<ImageView
android:id="@+id/img_cancel"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp"
android:src="@mipmap/im_icon_audio_cancel"
android:visibility="gone" />
android:id="@+id/img_cancel"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp"
android:src="@mipmap/im_icon_audio_cancel"
android:visibility="gone" />
<Chronometer
android:id="@+id/timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/im_timer_default"
android:textColor="@color/im_white"
android:textSize="45sp"
android:visibility="gone" />
android:id="@+id/timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/im_timer_default"
android:textColor="@color/im_white"
android:textSize="45sp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/timer_tip_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="6dp"
android:gravity="center">
android:id="@+id/timer_tip_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_margin="6dp"
android:gravity="center">
<TextView
android:id="@+id/timer_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/im_recording_cancel"
android:textColor="@color/im_white"
android:textSize="12sp" />
android:id="@+id/timer_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/im_recording_cancel"
android:textColor="@color/im_white"
android:textSize="12sp" />
</LinearLayout>
</FrameLayout>
<com.yidianling.uikit.business.session.view.ChatPrivateTips
android:id="@+id/v_chattips"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="58dp"
android:visibility="gone" />
<!-- 常见问题 快捷回复-->
<RelativeLayout
android:id="@+id/rl_common_question"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_gravity="bottom"
android:visibility="invisible"
android:background="@drawable/im_background_chat_common_question"
android:paddingRight="13dp">
<TextView
android:id="@+id/tv_open_common_question"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="11dp"
android:gravity="center_vertical"
android:text="常见问题"
android:textColor="@color/platform_main_theme"
android:textStyle="bold" />
</RelativeLayout>
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/im_sp_14"
android:maxHeight="@dimen/platform_dp_20"
android:textColor="@color/im_color_242424"
android:layout_gravity="bottom"
android:maxLines="3"
android:visibility="gone"
android:id="@+id/question_multiple"
tools:text="已选:#工作压力 #生活压力#其他"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginEnd="@dimen/platform_dp_12"
android:layout_marginBottom="@dimen/platform_dp_8"
>
</TextView>
<FrameLayout
android:id="@+id/fl_question_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:visibility="gone" />
<include
layout="@layout/im_nim_message_activity_bottom_layout" />
<include layout="@layout/im_nim_message_activity_bottom_layout" />
</LinearLayout>
......@@ -6,4 +6,4 @@ include ':app',
":m-im",":m-dynamic","m-article","m-audioim","m-user","m-confide"
include ':ydl_medical_pay'
include ':ydl-medical-pay'
......@@ -47,8 +47,12 @@ dependencies {
//开发时使用
api project(':ydl-platform')
implementation modularPublication('com.ydl:m-im-api')
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
}else {
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
//发布时使用
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
package com.medical.ydl.medical.dialog;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.Typeface;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ydl.ydlcommon.R;
import com.ydl.ydlcommon.view.dialog.NormalDialog;
/**
* 支付返回时间提示
*/
public class TimeBackDialog extends Dialog {
private Context mContext;
public TimeBackDialog(Context context) {
super(context);
mContext = context;
}
public TimeBackDialog(Context context, int theme) {
super(context, theme);
mContext = context;
}
public static class Builder {
//是否可以点击对话框外部
private Context context; //上下文对象
private String title; //对话框标题
private String message; //对话框内容
private String confirm_btnText; //按钮名称“确定”
private String cancel_btnText; //按钮名称“取消”
private View contentView; //对话框中间加载的其他布局界面
private String title_color;//标题颜色
private String content_color;//正文颜色
private String left_color;//左下角按钮颜色(确定)
private String right_color;//右下角按钮颜色(取消)
private Button left_btn;//左边取消按钮
private TextView message_tv;//内容
private NormalDialog dialog;
String dialog_type;
/*按钮坚挺事件*/
private OnClickListener confirm_btnClickListener;
private OnClickListener cancel_btnClickListener;
private boolean CanceledOnTouchOutside = true;
public Builder(Context context) {
this.context = context;
}
public Builder(Context context, String dialog_type, boolean canceledOnTouchOutside) {
this.context = context;
this.dialog_type = dialog_type;
CanceledOnTouchOutside = canceledOnTouchOutside;
}
public Builder(Context context, boolean canceledOnTouchOutside) {
this.context = context;
CanceledOnTouchOutside = canceledOnTouchOutside;
}
/**
* 设置取消按钮的隐藏与显示
*
* @return
*/
public Builder setCancleIsVisibility(int visibility) {
if (left_btn != null) {
left_btn.setVisibility(visibility);
}
return this;
}
/*设置对话框信息*/
public Builder setMessage(String message) {
this.message = message;
return this;
}
/**
* Set the Dialog message from resource
*
* @return
*/
public Builder setMessage(int message) {
this.message = (String) context.getText(message);
return this;
}
/**
* Set the Dialog title from resource
*
* @param title
* @return
*/
public Builder setTitle(int title) {
this.title = (String) context.getText(title);
return this;
}
/**
* Set the Dialog title from String
*
* @param title
* @return
*/
public Builder setTitle(String title) {
this.title = title;
return this;
}
public Builder setTitle_color(String title_color) {
this.title_color = title_color;
return this;
}
public Builder setContent_color(String content_color) {
this.content_color = content_color;
return this;
}
public Builder setLeft_color(String left_color) {
this.left_color = left_color;
return this;
}
public Builder setRight_color(String right_color) {
this.right_color = right_color;
return this;
}
/**
* 倒计时控件
*/
public void setMessageToTextView(String str) {
String strStart = "\n已为您锁定问诊名额,请在";
String strEnd = "内完成支付,超时名额自动取消\n";
SpannableString ss = new SpannableString(strStart + str + strEnd);
ss.setSpan(new ForegroundColorSpan(Color.parseColor("#FF7766")), strStart.length(), str.length() + strStart.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
if (message_tv != null) {
message_tv.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
message_tv.setText(ss);
}
}
/**
* 设置对话框界面
*
* @param v View
* @return
*/
public Builder setContentView(View v) {
this.contentView = v;
return this;
}
/**
* Set the positive button resource and it's listener
*
* @param confirm_btnText
* @return
*/
public Builder setPositiveButton(int confirm_btnText,
OnClickListener listener) {
this.confirm_btnText = (String) context
.getText(confirm_btnText);
this.confirm_btnClickListener = listener;
return this;
}
/**
* Set the positive button and it's listener
*
* @param confirm_btnText
* @return
*/
public Builder setPositiveButton(String confirm_btnText,
OnClickListener listener) {
this.confirm_btnText = confirm_btnText;
this.confirm_btnClickListener = listener;
return this;
}
/**
* Set the negative button resource and it's listener
*
* @return
*/
public Builder setNegativeButton(int cancel_btnText,
OnClickListener listener) {
this.cancel_btnText = (String) context
.getText(cancel_btnText);
this.cancel_btnClickListener = listener;
return this;
}
/**
* Set the negative button and it's listener
*
* @return
*/
public Builder setNegativeButton(String cancel_btnText,
OnClickListener listener) {
this.cancel_btnText = cancel_btnText;
this.cancel_btnClickListener = listener;
return this;
}
public void dismiss() {
if (dialog != null) {
dialog.dismiss();
}
}
@SuppressLint("WrongViewCast")
public NormalDialog create() {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// instantiate the dialog with the custom Theme
dialog = new NormalDialog(context, R.style.platform_normaldialog_style);
View layout;
layout = inflater.inflate(R.layout.dialog_normal_layout, null);
dialog.addContentView(layout, new LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
// set the dialog title
TextView title_tv = ((TextView) layout.findViewById(R.id.title));
message_tv = ((TextView) layout.findViewById(R.id.message));
left_btn = ((Button) layout.findViewById(R.id.cancel_btn));
Button right_btn = ((Button) layout.findViewById(R.id.confirm_btn));
if ("".equals(title) || title == null) {
title_tv.setVisibility(View.GONE);
} else {
title_tv.setVisibility(View.VISIBLE);
title_tv.setText(title);
title_tv.getPaint().setFakeBoldText(true);
if (title_color != null && !"".equals(title_color)) {
title_tv.setTextColor(Color.parseColor(title_color));
}
}
// set the confirm button
if (confirm_btnText != null) {
right_btn.setText(confirm_btnText);
if (confirm_btnClickListener != null) {
right_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
confirm_btnClickListener.onClick(dialog,
DialogInterface.BUTTON_POSITIVE);
}
});
}
if (right_color != null && !"".equals(right_color)) {
right_btn.setTextColor(Color.parseColor(right_color));
}
} else {
// if no confirm button just set the visibility to GONE
right_btn.setVisibility(View.GONE);
}
// set the cancel button
if (left_btn != null) {
if (cancel_btnText != null) {
left_btn.setText(cancel_btnText);
if (cancel_btnClickListener != null) {
left_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
cancel_btnClickListener.onClick(dialog,
DialogInterface.BUTTON_NEGATIVE);
}
});
}
if (left_color != null && !"".equals(left_color)) {
left_btn.setTextColor(Color.parseColor(left_color));
}
} else {
// if no confirm button just set the visibility to GONE
left_btn.setVisibility(View.GONE);
}
}
// set the content message
if (message != null) {
message_tv.setText(message);
if (content_color != null && !"".equals(content_color)) {
message_tv.setTextColor(Color.parseColor(content_color));
}
} else if (contentView != null) {
// if no message set
// add the lceContentView to the dialog body
((LinearLayout) layout.findViewById(R.id.message))
.removeAllViews();
((LinearLayout) layout.findViewById(R.id.message)).addView(
contentView, new LayoutParams(
LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
}
dialog.setContentView(layout);
dialog.setCanceledOnTouchOutside(CanceledOnTouchOutside);
dialog.setCancelable(CanceledOnTouchOutside);
return dialog;
}
}
@Override
public void show() {
if (null == mContext) {
return;
}
if (mContext instanceof Activity) {
if (((Activity) mContext).isFinishing()) {
return;
}
}
super.show();
}
}
package com.medical.ydl.medical.modular
import android.app.Activity
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.ydlcommon.bean.GlobalInfo
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.data.http.GsonProvider
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.im.api.bean.ReceiveRedPacketParam
import com.yidianling.im.api.service.IImService
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.service.IAppService
import com.yidianling.user.api.service.IUserService
/**
* 功能输入接口
* 暴漏给app模块使用
* Created by hgw on 2018/3/19.
*/
object MedicalPayIn {
fun getImService(): IImService {
return ModularServiceManager.provide(IImService::class.java)
}
fun getAppService(): IAppService {
return ModularServiceManager.provide(IAppService::class.java)
}
fun getUserService(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
/**
* 是否登录
*/
fun isLogin(activity: Context, flag: Boolean): Boolean {
if (!isLogin() && flag) {
getUserService().loginByOneKeyLogin(activity, true)
return false
} else {
return true
}
}
fun myRedPockIntent(activity: Activity) {
getAppService().myRedPockIntent(activity)
}
fun sendRedPacketIntent(activity: Activity, toUid: String, code: Int) {
ARouter.getInstance().build("/user/sendRedPacket").withString("to_uid", toUid)
.navigation(activity, code)
}
fun receiveRedPacketIntent(activity: Activity, param: ReceiveRedPacketParam) {
getAppService().receiverRedPacketIntent(activity, GsonProvider.getGson().toJson(param))
}
fun inputPhoneIntent(activity: Activity, smsAction: String): Intent? {
return getUserService().inputPhoneIntent(activity, smsAction)
}
fun isLogin(): Boolean {
return getUserService()?.isLogin() ?: false
}
fun getUserInfo(): UserResponseBean.UserInfo? {
return getUserService().getUserInfo()
}
fun getUserResponse(): UserResponseBean? {
return getUserService().getUserResponse()
}
fun getChatTeamHisShow(): Boolean {
return getUserService().getChatTeamHisShow() ?: false
}
fun loginWayIntent(context: Context): Intent? {
return getUserService().loginWayIntent(context)
}
fun mainIntent(context: Context, selectTab: Int) {
getAppService().mainIntent(context, selectTab, false)
}
fun mainIntentMessage(context: Context, docotrUid: String) {
val bundle = Bundle()
bundle.putInt("selectTab", 2)
bundle.putString("docotrUid", docotrUid)
ARouter.getInstance().build("/main/main")
.withBundle("bundle", bundle)
.navigation()
}
fun feedBackIntent(activity: Activity) {
getAppService().feedBackIntent(activity)
}
fun getGlobalInfo(): GlobalInfo? {
return PlatformDataManager.getRam().getGlobalInfo()
}
}
......@@ -11,7 +11,9 @@ import android.util.Log
import com.alipay.sdk.app.PayTask
import com.medical.ydl.medical.bean.CreatePayReqDtoBody
import com.medical.ydl.medical.bean.CreatePayRespose
import com.medical.ydl.medical.dialog.TimeBackDialog
import com.medical.ydl.medical.http.MedicalPayServiceImpl
import com.medical.ydl.medical.modular.MedicalPayIn
import com.medical.ydl.medical.pay.bean.MedicalPayResult
import com.medical.ydl.medical.pay.bean.MedicalPayStatus
import com.medical.ydl.medical.pay.bean.MedicalWXPayEvent
......@@ -22,7 +24,6 @@ import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.common.tools.ToastUtil
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
......@@ -38,8 +39,10 @@ class MedicalPayActivity : BaseActivity() {
companion object {
private const val PRICE_KEY = "price"
private const val ORDER_KEY = "orderId"
private const val DOCTORUID_KEY = "doctorUid"
private lateinit var mPrice: String
private lateinit var mOrderId: String
private lateinit var mDoctorUid: String
private var timer: CountDownTimer? = null
......@@ -59,10 +62,11 @@ class MedicalPayActivity : BaseActivity() {
* @param orderId 订单id
* */
@JvmStatic
fun start(context: Context, price: String, orderId: String) {
fun start(context: Context, price: String, orderId: String, doctorUid: String) {
val starter = Intent(context, MedicalPayActivity::class.java)
.putExtra(PRICE_KEY, price)
.putExtra(ORDER_KEY, orderId)
.putExtra(DOCTORUID_KEY, doctorUid)
context.startActivity(starter)
}
......@@ -107,6 +111,7 @@ class MedicalPayActivity : BaseActivity() {
initStatus()
mPrice = intent.getStringExtra(PRICE_KEY)
mOrderId = intent.getStringExtra(ORDER_KEY)
mDoctorUid = intent.getStringExtra(DOCTORUID_KEY)
price.text = mPrice
ll_alipay.setOnClickListener {
......@@ -159,7 +164,7 @@ class MedicalPayActivity : BaseActivity() {
}
private fun backCheck() {
val builder = NormalDialog.Builder(this@MedicalPayActivity, "center", true)
val builder = TimeBackDialog.Builder(this@MedicalPayActivity, "center", true)
builder.setTitle("")
builder.setMessage("\n已为您锁定问诊名额,请在24小时59分00秒内完成支付,超时名额自动取消\n")
builder.setPositiveButton(
......@@ -178,7 +183,8 @@ class MedicalPayActivity : BaseActivity() {
builder.setRight_color("#3464EC")
builder.setLeft_color("#8595A9")
builder.setContent_color("#10233A")
builder.create().show()
val dialog = builder.create()
dialog.show()
var timeStamp: Long = 86400000
timer = object : CountDownTimer(timeStamp, 1000) {
......@@ -192,9 +198,7 @@ class MedicalPayActivity : BaseActivity() {
var second =
(millisUntilFinished - hour * (1000 * 60 * 60) - minute * (1000 * 60)) / 1000
builder.setMessage(
"\n已为您锁定问诊名额,请在${hour}小时${minute}分${second}秒内完成支付,超时名额自动取消\n"
)
builder.setMessageToTextView("${hour}小时${minute}分${second}")
}
override fun onFinish() {
......@@ -251,10 +255,15 @@ class MedicalPayActivity : BaseActivity() {
fun onEvent(event: MedicalWXPayEvent) {
if (event.status.success) {
MedicalPayIn.mainIntentMessage(this@MedicalPayActivity, mDoctorUid)
ToastUtil.toastShort("支付成功")
finish()
} else {
ToastUtil.toastShort("支付失败")
}
}
override fun onBackPressed() {
backCheck()
}
}
\ No newline at end of file
......@@ -7,6 +7,8 @@ package com.ydl.ydlcommon.base.config
const val YDL_DOMAIN = "Domain-Name:"
//JAVA Api 地址
const val YDL_DOMAIN_JAVA = "JAVA_BASE_URL"
//网关地址
const val GET_GATEWAY_BASE_URL = "GET_GATEWAY_BASE_URL"
//JAVA 域名
const val YDL_DOMAIN_JAVA_URL = "YDL_DOMAIN_JAVA_URL"
// JAVA Api 登录注册地址
......
......@@ -110,6 +110,7 @@ class GlobalConfig private constructor(var builder: Builder) {
.config()
.setBaseUrl(appBaseURL ?: HttpConfig.PHP_BASE_URL)
.addUrl(YDL_DOMAIN_JAVA, HttpConfig.JAVA_BASE_URL)
.addUrl(GET_GATEWAY_BASE_URL, HttpConfig.GET_GATEWAY_BASE_URL)
.addUrl(YDL_DOMAIN_JAVA_URL, HttpConfig.JAVA_URL)
.addUrl(YDL_DOMAIN_LOGIN_BASE_URL, HttpConfig.JAVA_LOGIN_BASE_URL)
.setMultipleUrlMap(multipleUrl)
......
......@@ -59,6 +59,7 @@ class HttpConfig {
private const val VERSION = "version"
private const val TOKEN = "accessToken"
private val OS_TYPE = "osType"// 1.ios 2.android
private val USER_PORT = "userPort"// 端的类型:1用户端;2专家端
private val APP_NAME =
"appName"//用于标识 是哪个应用 yidianling:用户版 xinlizixun:心理咨询 haoshi:情感壹点灵 zhuanjia:专家版
......@@ -77,6 +78,11 @@ class HttpConfig {
var JAVA_BASE_URL = ""
/**
* 网关 地址
*/
var GET_GATEWAY_BASE_URL = ""
/**
* YDL H5 地址
*/
var YDL_H5 = ""
......@@ -92,6 +98,11 @@ class HttpConfig {
var MH5_URL = ""
/**
* 医疗 地址
*/
var MEDICAL_H5URL = ""
/**
* 新 H5 地址
*/
var WEB_URL = ""
......@@ -112,7 +123,7 @@ class HttpConfig {
var ENCRYPTION_APP_KEY = "" // 接口加密appKey
var ENCRYPTION_APP_SECRET = "" // 接口加密appSecret
var isEncryption = false
var appDebug:Boolean=false
var appDebug: Boolean = false
fun getInstance(): HttpConfig {
return Holder.INSTANCE
......@@ -189,7 +200,7 @@ class HttpConfig {
return Interceptor {
val request: Request = it.request()
val originalResponse: Response = it.proceed(request)
if (!appDebug){
if (!appDebug) {
val code = originalResponse.code()
// 接口返回错误的情况下,埋点告诉服务器原因
if (code != 200) {
......@@ -203,8 +214,11 @@ class HttpConfig {
val api = request.url().encodedPath()
// ActionCountUtils.baiDuCount("ydl_user_error_business","error_log",api,params,message)
//阿里云忽略埋点接口
if (!api.contains("maidian/writeMaiDianData")){
AliYunRichLogsHelper.getInstance().sendRichLog(AliYunLogConfig.API, "error_log---api:$api---params:$params ---- message:$message")
if (!api.contains("maidian/writeMaiDianData")) {
AliYunRichLogsHelper.getInstance().sendRichLog(
AliYunLogConfig.API,
"error_log---api:$api---params:$params ---- message:$message"
)
}
}
}
......@@ -313,13 +327,16 @@ class HttpConfig {
}
if (!paramsName.contains(OS_BUILD)) {
paramsValue[OS_BUILD] =
"""${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${RxAppTool.getAppVersionName(
BaseApp.getApp()
)}"""
"""${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${
RxAppTool.getAppVersionName(
BaseApp.getApp()
)
}"""
}
if (!paramsName.contains(TS)) {
paramsValue[TS] = (System.currentTimeMillis() / 1000).toString()
}
if (!paramsName.contains(VERSION)) {
paramsValue[VERSION] = RxAppTool.getAppVersionName(
BaseApp.getApp()
......@@ -409,6 +426,7 @@ class HttpConfig {
)
)
.addHeader(OS_TYPE, "2")
.addHeader(USER_PORT, "1")
.addHeader(APP_NAME, appName)
val loginBean = ModularServiceManager.getPlatformUserService()?.getUser()
if (loginBean != null) {
......@@ -420,18 +438,22 @@ class HttpConfig {
}
private fun getOldAuth(paramsString: StringBuilder): String {
return "$YDL ${EncryptUtils.encryptMD5ToString(
paramsString.toString() + SESSION_KEY
)}"
return "$YDL ${
EncryptUtils.encryptMD5ToString(
paramsString.toString() + SESSION_KEY
)
}"
}
private fun getNewAuth(paramsString: StringBuilder): String {
//md5({静态秘钥} + {参数} + md5{动态秘钥(明文)}
return "$YDL ${EncryptUtils.encryptMD5ToString(
SESSION_KEY + paramsString.toString() + EncryptUtils.encryptMD5ToString(
DYNAMIC_SESSION_KEY
return "$YDL ${
EncryptUtils.encryptMD5ToString(
SESSION_KEY + paramsString.toString() + EncryptUtils.encryptMD5ToString(
DYNAMIC_SESSION_KEY
)
)
)}"
}"
}
//初始化网络环境
......@@ -451,13 +473,16 @@ class HttpConfig {
PHP_BASE_URL = properties.getProperty("serverurl.$appEnv")
JAVA_BASE_URL = properties.getProperty("javaapi.$appEnv")
JAVA_LOGIN_BASE_URL = JAVA_BASE_URL
JAVA_LOGIN_BASE_URL = JAVA_BASE_URL.replace("api/", "")
GET_GATEWAY_BASE_URL = JAVA_BASE_URL
ENCRYPTION_APP_KEY = properties.getProperty("appKey.$appEnv")
ENCRYPTION_APP_SECRET = properties.getProperty("appSecret.$appEnv")
ACTION_URL = properties.getProperty("actionurl.$appEnv")
H5_URL = properties.getProperty("h5url.$appEnv")
MH5_URL = properties.getProperty("mh5url.$appEnv")
MEDICAL_H5URL = properties.getProperty("medicalh5url.$appEnv")
YDL_H5 = properties.getProperty("ydlh5url.$appEnv")
WEB_URL = properties.getProperty("weburl.$appEnv")
JAVA_URL = properties.getProperty("javaurl.$appEnv")
......@@ -509,6 +534,7 @@ class HttpConfig {
.subscribe({
if (it.baseUrlGatewayDTOList.isNotEmpty()) {
isEncryption = it.baseUrlGatewayDTOList[0].goGateway
GET_GATEWAY_BASE_URL = it.baseUrlGatewayDTOList[0].baseUrl
if (isEncryption) {
JAVA_LOGIN_BASE_URL = it.baseUrlGatewayDTOList[0].baseUrl + "/"
urlMap[YDL_DOMAIN_LOGIN_BASE_URL] = JAVA_LOGIN_BASE_URL
......
package com.ydl.ydlcommon.data.http
import com.ydl.ydlcommon.base.BaseApp
......@@ -16,23 +15,23 @@ import java.net.ConnectException
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
*/
*/
object RxUtils {
// 在子线程中把实体参数类转换成 map
@JvmStatic
fun <T> mapObservable(t: T): Observable<HashMap<String, String>> {
return Observable.just(t)
.compose(netCheck())
.subscribeOn(Schedulers.io())
.map { MapUtils.bean2Map(it) }
.compose(netCheck())
.subscribeOn(Schedulers.io())
.map { MapUtils.bean2Map(it) }
}
/**
* 若网络未连接,抛出未连接异常
*/
@JvmStatic
fun <T>netCheck(): ObservableTransformer<T, T> {
fun <T> netCheck(): ObservableTransformer<T, T> {
return ObservableTransformer {
if (RxNetTool.isConnected(BaseApp.getApp())) it
else Observable.error(ConnectException())
......@@ -60,7 +59,7 @@ object RxUtils {
fun <T> resultData(): ObservableTransformer<BaseResponse<T>, T> {
return ObservableTransformer {
it.flatMap {
if (it.code == 0) Observable.just(it.data)
if (it.code == 0 || it.code == 200) Observable.just(it.data)
else Observable.error(Throwable(it.msg, Throwable(it.code.toString())))
}
}
......@@ -120,8 +119,8 @@ object RxUtils {
}
@JvmStatic
fun <T> applySchedulers(iLifecycleable: ILifecycleable<*> ?= null): ObservableTransformer<T, T> {
if (iLifecycleable == null){
fun <T> applySchedulers(iLifecycleable: ILifecycleable<*>? = null): ObservableTransformer<T, T> {
if (iLifecycleable == null) {
return applySchedulers()
}
return ObservableTransformer { observable ->
......
......@@ -51,7 +51,7 @@ interface NetApiStore {
@GET("config/socket-config")
Observable<BaseAPIResponse<JavaGlobalInfo>> getJavaGlobalInfo();
@Headers({YDL_DOMAIN+ YDL_DOMAIN_JAVA,"userPort:1","Content-type:application/json;charset=UTF-8"})
@POST("systemconfig/get_gateway_base_url")
@Headers({YDL_DOMAIN+ YDL_DOMAIN_JAVA_URL,"userPort:1","Content-type:application/json;charset=UTF-8"})
@POST("ydl-yiliao-api/api/client/login/v1/get_gateway_base_url")
Observable<BaseAPIResponse<BaseUrlBean>> getBaseUrl(@Body Map<String, Object> map);
}
......@@ -39,6 +39,12 @@ mh5url.test = https://testnewm.ydl.com/
mh5url.auto_test = https://auto_testnewm.ydl.com/
mh5url.prod = https://m.ydl.com/
# 医疗 H5地址
medicalh5url.new_test = https://ydltestm.yidianling.cn/
medicalh5url.test = https://testnewm.yidianling.cn/
medicalh5url.auto_test = https://auto_testnewm.yidianling.cn/
medicalh5url.prod = https://m.yidianling.cn/
#java服务器域名
javaurl.new_test = https://ydltestapi.ydl.com/
javaurl.test = https://testapi.ydl.com/
......
......@@ -40,6 +40,7 @@ class H5JsBean {
var isFromQingShu = 0//是否是从专家倾述主页跳转私聊界面 0: 不是 1:是
var docHead: String? = null//聊天头像
var doctorId: Int = 0//医生id
var doctorUid: Int = 0//医生用户id
var listenerId: Int = 0
var orderStatus: Int = 0
var orderStatusDesc: String? = null
......
......@@ -102,6 +102,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private String rightText = "";
protected TitleBar tb_title;
protected View tb_topview;
protected View tb_title_cover_v;
protected ImageView backgroundView;
protected ProgressWebView wv_content;
......@@ -539,6 +540,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
private void initView() {
tb_title = (TitleBar) findViewById(R.id.tb_title);
tb_topview = findViewById(R.id.topview);
tb_title_cover_v = (View) findViewById(R.id.tb_title_cover_v);
tb_title.setPaddingLeft(10);
wv_content = (ProgressWebView) findViewById(R.id.wv_content);
......@@ -557,6 +559,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
public void hideJavaTitleBar() {
runOnUiThread(() -> {
tb_title.setVisibility(View.GONE);
tb_topview.setVisibility(VISIBLE);
if (null != getStatusView()) {
if (selfPageType == TEST_QUESTIONS_PAGE_TYPE) {
//测评题隐藏标题的时候,不隐藏状态栏
......@@ -576,6 +579,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
public void showTitleBar() {
runOnUiThread(() -> {
tb_title.setVisibility(VISIBLE);
tb_topview.setVisibility(GONE);
if (null != getStatusView()) {
getStatusView().setVisibility(VISIBLE);
}
......
......@@ -8,7 +8,7 @@
<com.ydl.ydlcommon.ui.LogoLoadingView
android:id="@+id/v_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/ll_web_view"
......@@ -16,22 +16,29 @@
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:id="@+id/topview"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:visibility="gone" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:background="@color/platform_white"
app:pa_title_text="加载中" />
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:background="@color/platform_white"
app:pa_title_text="加载中" />
<View
android:id="@+id/tb_title_cover_v"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="#ffffff"
android:visibility="gone"/>
android:visibility="gone" />
</RelativeLayout>
......@@ -51,7 +58,7 @@
android:id="@+id/wv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_transparent"/>
android:background="@color/platform_transparent" />
</in.srain.cube.views.ptr.PtrFrameLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.medical.ydl.medical.pay">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.YDLComponent">
<activity android:name=".MedicalPayMainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
package com.medical.ydl.medical.pay
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
class MedicalPayMainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MedicalPayMainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.YDLComponent" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_200</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/black</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_200</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Theme.YDLComponent" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
<!-- Primary brand color. -->
<item name="colorPrimary">@color/purple_500</item>
<item name="colorPrimaryVariant">@color/purple_700</item>
<item name="colorOnPrimary">@color/white</item>
<!-- Secondary brand color. -->
<item name="colorSecondary">@color/teal_200</item>
<item name="colorSecondaryVariant">@color/teal_700</item>
<item name="colorOnSecondary">@color/black</item>
<!-- Status bar color. -->
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
<!-- Customize your theme here. -->
</style>
</resources>
\ No newline at end of file
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