Commit 8c95cdc8 by konghaorui

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3
parents c798c1f7 42e6db02
...@@ -8,6 +8,7 @@ import android.os.Build; ...@@ -8,6 +8,7 @@ import android.os.Build;
import android.os.Process; import android.os.Process;
import android.support.annotation.RequiresApi; import android.support.annotation.RequiresApi;
import com.facebook.stetho.Stetho;
import com.meituan.android.walle.WalleChannelReader; import com.meituan.android.walle.WalleChannelReader;
import com.netease.nimlib.sdk.util.NIMUtil; import com.netease.nimlib.sdk.util.NIMUtil;
import com.tencent.bugly.crashreport.CrashReport; import com.tencent.bugly.crashreport.CrashReport;
...@@ -60,6 +61,8 @@ public class DemoAppLifecycles implements IAppLifecycles { ...@@ -60,6 +61,8 @@ public class DemoAppLifecycles implements IAppLifecycles {
Intent intent = new Intent(application, PlayService.class); Intent intent = new Intent(application, PlayService.class);
application.startService(intent); application.startService(intent);
application.registerActivityLifecycleCallbacks(new CoursePlayLifecycle()); application.registerActivityLifecycleCallbacks(new CoursePlayLifecycle());
Stetho.initializeWithDefaults(application);
} }
} }
......
...@@ -20,7 +20,7 @@ import java.util.List; ...@@ -20,7 +20,7 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST; // public static String appEnv = YDLConstants.ENV_AUTO_TEST;
public static String appEnv = YDLConstants.ENV_PROD; public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_TEST; // public static String appEnv = YDLConstants.ENV_TEST;
@Override @Override
......
...@@ -3,6 +3,7 @@ package com.ydl.component.service.web; ...@@ -3,6 +3,7 @@ package com.ydl.component.service.web;
import android.app.Activity; import android.app.Activity;
import com.ydl.webview.H5JsBean; import com.ydl.webview.H5JsBean;
import com.ydl.webview.NewH5Activity;
/** /**
* webview 点击事件监听 抽象类 * webview 点击事件监听 抽象类
...@@ -395,4 +396,19 @@ public class WVClickAbstractListener implements WebViewClientClickListener { ...@@ -395,4 +396,19 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
public void goHome(H5JsBean.H5JsCmd.Params params) { public void goHome(H5JsBean.H5JsCmd.Params params) {
} }
@Override
public void sendUnReadNum(String callbackFuncName, String uid) {
final StringBuffer sb = new StringBuffer();
sb.append(callbackFuncName);
sb.append("('");
sb.append("333");
sb.append("')");
if (mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).callJSFunc(sb.toString());
}
}
} }
...@@ -364,6 +364,9 @@ class WebJavascriptHandler : IJavascriptHandler{ ...@@ -364,6 +364,9 @@ class WebJavascriptHandler : IJavascriptHandler{
"goHome" -> { "goHome" -> {
wvEnventPro?.goHome(jsData.cmd?.params) wvEnventPro?.goHome(jsData.cmd?.params)
} }
"chatUnread" -> {
wvEnventPro?.sendUnReadNum(jsData.cmd!!.callBack, jsData.cmd!!.params?.uid.toString())
}
} }
} }
} }
...@@ -173,4 +173,6 @@ public interface WebViewClientClickListener { ...@@ -173,4 +173,6 @@ public interface WebViewClientClickListener {
void goHome(H5JsBean.H5JsCmd.Params params); void goHome(H5JsBean.H5JsCmd.Params params);
//保存图片 //保存图片
// void storePic(); // void storePic();
void sendUnReadNum(String callbackFuncName, String uid);
} }
...@@ -5,8 +5,8 @@ ext { ...@@ -5,8 +5,8 @@ ext {
ydl_app = [ ydl_app = [
appName : "心理咨询壹点灵", appName : "心理咨询壹点灵",
applicationId: "com.cxzapp.yidianling", applicationId: "com.cxzapp.yidianling",
versionName : "4.0.00", versionName : "4.0.31",
versionCode : 4000, versionCode : 4031,
] ]
xlzx_app = [ xlzx_app = [
...@@ -47,7 +47,7 @@ ext { ...@@ -47,7 +47,7 @@ ext {
"m-consultant" : "0.0.51.3", "m-consultant" : "0.0.51.3",
"m-fm" : "0.0.23.3", "m-fm" : "0.0.23.3",
"m-user" : "0.0.40.3", "m-user" : "0.0.40.3",
"m-home" : "0.0.6.18", "m-home" : "0.0.6.19",
"m-muse" : "0.0.20.3", "m-muse" : "0.0.20.3",
"m-tests" : "0.0.15.2", "m-tests" : "0.0.15.2",
...@@ -66,7 +66,7 @@ ext { ...@@ -66,7 +66,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9", "m-user-api" : "0.0.9",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.3", "m-im-api" : "0.0.4",
"m-dynamic-api" : "0.0.1", "m-dynamic-api" : "0.0.1",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -74,7 +74,7 @@ ext { ...@@ -74,7 +74,7 @@ ext {
"ydl-platform" : "0.0.29.1", "ydl-platform" : "0.0.29.1",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.28.4", "ydl-webview" : "0.0.28.5",
"ydl-media" : "0.0.14.3", "ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4", "ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3", "m-audioim" : "0.0.40.3",
...@@ -111,7 +111,7 @@ ext { ...@@ -111,7 +111,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9", "m-user-api" : "0.0.9",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.3", "m-im-api" : "0.0.4",
"m-dynamic-api" : "0.0.1", "m-dynamic-api" : "0.0.1",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -119,7 +119,7 @@ ext { ...@@ -119,7 +119,7 @@ ext {
"ydl-platform" : "0.0.29.1", "ydl-platform" : "0.0.29.1",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.28.3", "ydl-webview" : "0.0.28.5",
"ydl-media" : "0.0.14.3", "ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4", "ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3", "m-audioim" : "0.0.40.3",
...@@ -228,8 +228,8 @@ ext { ...@@ -228,8 +228,8 @@ ext {
"ydl-ijkplayer-jjdxm" : "com.ydl:jjdxm-ijkplayer:0.0.3", "ydl-ijkplayer-jjdxm" : "com.ydl:jjdxm-ijkplayer:0.0.3",
"robust" : "com.meituan.robust:robust:0.4.87", "robust" : "com.meituan.robust:robust:0.4.87",
"walle" : "com.meituan.android.walle:library:1.1.5", "walle" : "com.meituan.android.walle:library:1.1.5",
"jpush" : "cn.jiguang.sdk:jpush:3.2.0", "jpush" : "cn.jiguang.sdk:jpush:3.3.6",
"jcore" : "cn.jiguang.sdk:jcore:1.2.7", "jcore" : "cn.jiguang.sdk:jcore:2.1.4",
"eventbus" : "de.greenrobot:eventbus:2.4.0", "eventbus" : "de.greenrobot:eventbus:2.4.0",
"BaseRecyclerViewAdapterHelper": "com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34", "BaseRecyclerViewAdapterHelper": "com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34",
"flowlayout" : "cn.lankton:flowlayout:3.1.0", "flowlayout" : "cn.lankton:flowlayout:3.1.0",
......
...@@ -72,8 +72,7 @@ public class TrendsDetailInfoBean { ...@@ -72,8 +72,7 @@ public class TrendsDetailInfoBean {
public ArrayList<IMage> bigAttach;//大图 public ArrayList<IMage> bigAttach;//大图
public int topicId;//话题id public int topicId;//话题id
public String topicTitle;//话题标题 public String topicTitle;//话题标题
@SerializedName(value = "isFocused",alternate = "is_focused") public int isFocused;//1已关注,2未关注
public int is_focused;//1已关注,2未关注
public String uid; public String uid;
public String multitextType;//动态类型 public String multitextType;//动态类型
public ExtAd ext; public ExtAd ext;
......
...@@ -300,7 +300,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -300,7 +300,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
@NotNull @NotNull
@Override @Override
public StatusBarOptions getStatusViewOptions() { public StatusBarOptions getStatusViewOptions() {
return new StatusBarOptions(true,true); return new StatusBarOptions(true, true);
} }
public static Intent newIntent(Activity activity, int trendId, boolean isScrollToZan) { public static Intent newIntent(Activity activity, int trendId, boolean isScrollToZan) {
...@@ -407,8 +407,8 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -407,8 +407,8 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
/** /**
* 获取路由传递的参数 * 获取路由传递的参数
*/ */
private void getParam(){ private void getParam() {
if (null == getIntent() || !getIntent().hasExtra(ROUTER_PARAMS)){ if (null == getIntent() || !getIntent().hasExtra(ROUTER_PARAMS)) {
return; return;
} }
//路由传递的入参 //路由传递的入参
...@@ -421,6 +421,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -421,6 +421,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
e.printStackTrace(); e.printStackTrace();
} }
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
...@@ -432,7 +433,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -432,7 +433,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
dismissProgressDialog(); dismissProgressDialog();
if (isFirstLoad) { if (isFirstLoad) {
vLoading.setViewType(LogoLoadingView.TYPE_LOADING, null); vLoading.setViewType(LogoLoadingView.TYPE_LOADING, null);
}else { } else {
showProgressDialog(message); showProgressDialog(message);
} }
} }
...@@ -492,7 +493,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -492,7 +493,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
.setLeftOnclick(TrendsDetailActivity.this.getString(R.string.dynamic_details), new View.OnClickListener() { .setLeftOnclick(TrendsDetailActivity.this.getString(R.string.dynamic_details), new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
String realUrl = TextUtils.isEmpty(url) ? DynamicConstants.HELP_URL : url; String realUrl = TextUtils.isEmpty(url) ? DynamicConstants.HELP_URL : url;
H5Params params = new H5Params(realUrl, ""); H5Params params = new H5Params(realUrl, "");
NewH5Activity.start(TrendsDetailActivity.this, params); NewH5Activity.start(TrendsDetailActivity.this, params);
} }
...@@ -875,7 +876,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -875,7 +876,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
comments = new ArrayList<>(); comments = new ArrayList<>();
Bundle bundle = getIntent().getBundleExtra(YDLConstants.BUNDLE); Bundle bundle = getIntent().getBundleExtra(YDLConstants.BUNDLE);
if (null != bundle){ if (null != bundle) {
lastId = bundle.getInt(KEY_LAST_ID, 0); lastId = bundle.getInt(KEY_LAST_ID, 0);
isFromSplash = bundle.getBoolean(KEY_IS_SPLASH, false); isFromSplash = bundle.getBoolean(KEY_IS_SPLASH, false);
trendId = bundle.getInt(KEY_TREND_ID, 0); trendId = bundle.getInt(KEY_TREND_ID, 0);
...@@ -1179,7 +1180,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1179,7 +1180,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
.setRightClick("果断绑定", v -> { .setRightClick("果断绑定", v -> {
startActivity(DynamicIn.INSTANCE.inputPhoneIntent(this, DynamicConstants.BIND_PHONE_ACTION)); startActivity(DynamicIn.INSTANCE.inputPhoneIntent(this, DynamicConstants.BIND_PHONE_ACTION));
}) })
.setMessage("\n" + DynamicConstants.Companion.getBIND_PHONE()+ "\n") .setMessage("\n" + DynamicConstants.Companion.getBIND_PHONE() + "\n")
.show(); .show();
return; return;
} }
...@@ -1388,7 +1389,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1388,7 +1389,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
linContent.setVisibility(View.VISIBLE); linContent.setVisibility(View.VISIBLE);
relNotExist.setVisibility(View.GONE); relNotExist.setVisibility(View.GONE);
linNullTip.setVisibility(mTrendBody.replyCounter > 0 ? GONE : VISIBLE); linNullTip.setVisibility(mTrendBody.replyCounter > 0 ? GONE : VISIBLE);
tvGuanzhu.setVisibility(mTrendBody.is_focused == 1 || mTrendBody.uid.equals("0") || TextUtils.equals(mTrendBody.uid, DynamicIn.INSTANCE.getUserInfo().getUid()) ? View.GONE : View.VISIBLE); tvGuanzhu.setVisibility(mTrendBody.isFocused == 1 || mTrendBody.uid.equals("0") || TextUtils.equals(mTrendBody.uid, DynamicIn.INSTANCE.getUserInfo().getUid()) ? View.GONE : View.VISIBLE);
ivLike.setImageResource(mTrendBody.isZan == 1 ? R.drawable.dynamic_newsfeed_like_sel : R.drawable.dynamic_newsfeed_like); ivLike.setImageResource(mTrendBody.isZan == 1 ? R.drawable.dynamic_newsfeed_like_sel : R.drawable.dynamic_newsfeed_like);
if (!TextUtils.isEmpty(mTrendBody.content)) { if (!TextUtils.isEmpty(mTrendBody.content)) {
MoonUtil.identifyFaceExpression(this, tvContent, mTrendBody.content, ImageSpan.ALIGN_BOTTOM); MoonUtil.identifyFaceExpression(this, tvContent, mTrendBody.content, ImageSpan.ALIGN_BOTTOM);
...@@ -1614,7 +1615,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1614,7 +1615,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
// //删除 // //删除
// deleteDialog(2, mTrendBody.id, 0);// // deleteDialog(2, mTrendBody.id, 0);//
// })); // }));
YDLShareDialog dialog = YDLShareDialog.Companion.style2(this, mTrendBody.title, DynamicConstants.Companion.getTRENF_INFO_SHARE_H5()+ trendId, mTrendBody.content, "http://static.ydlcdn.com/v1/images/logo320.png"); YDLShareDialog dialog = YDLShareDialog.Companion.style2(this, mTrendBody.title, DynamicConstants.Companion.getTRENF_INFO_SHARE_H5() + trendId, mTrendBody.content, "http://static.ydlcdn.com/v1/images/logo320.png");
dialog.setCallBack(type -> { dialog.setCallBack(type -> {
if (2 == type) { if (2 == type) {
//删除 //删除
...@@ -1626,7 +1627,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1626,7 +1627,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
dialog.show(getFragmentManager(), "lose"); dialog.show(getFragmentManager(), "lose");
} else { } else {
//别人帖子 //别人帖子
YDLShareDialog dialog = YDLShareDialog.Companion.style3(this, mTrendBody.title, DynamicConstants.Companion.getTRENF_INFO_SHARE_H5()+ trendId, mTrendBody.content, "http://static.ydlcdn.com/v1/images/logo320.png"); YDLShareDialog dialog = YDLShareDialog.Companion.style3(this, mTrendBody.title, DynamicConstants.Companion.getTRENF_INFO_SHARE_H5() + trendId, mTrendBody.content, "http://static.ydlcdn.com/v1/images/logo320.png");
dialog.setCallBack(type -> { dialog.setCallBack(type -> {
if (3 == type) { if (3 == type) {
if (!DynamicIn.INSTANCE.isLogin()) { if (!DynamicIn.INSTANCE.isLogin()) {
...@@ -1672,7 +1673,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1672,7 +1673,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
} }
private void backHome() { private void backHome() {
DynamicIn.INSTANCE.mainIntent(this,0); DynamicIn.INSTANCE.mainIntent(this, 0);
} }
/** /**
......
...@@ -253,7 +253,6 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -253,7 +253,6 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
.burryPoint("topTabClick"); .burryPoint("topTabClick");
if (!DynamicIn.INSTANCE.isLogin()) { if (!DynamicIn.INSTANCE.isLogin()) {
startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity())); startActivity(DynamicIn.INSTANCE.loginWayIntent(getActivity()));
// startActivity(new Intent(getActivity(), ChooseLoginWayActivity.class));
return; return;
} }
BuryPointUtils.getInstance().trackViewScreen(getActivity(), "动态-关注", "com.cxzapp.yidianling.trends.trendList.TrendsListFragment"); BuryPointUtils.getInstance().trackViewScreen(getActivity(), "动态-关注", "com.cxzapp.yidianling.trends.trendList.TrendsListFragment");
......
...@@ -104,73 +104,71 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() { ...@@ -104,73 +104,71 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
if (mCurrentPosition != manager.findFirstVisibleItemPosition() && manager.findFirstVisibleItemPosition() != -1) { if (mCurrentPosition != manager.findFirstVisibleItemPosition() && manager.findFirstVisibleItemPosition() != -1) {
mCurrentPosition = manager.findFirstVisibleItemPosition() mCurrentPosition = manager.findFirstVisibleItemPosition()
} }
if (adapter!!.itemCount > mCurrentPosition && mCurrentPosition != 0) { if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONFIDE_VIEW) {
if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONFIDE_VIEW) { val view = manager.findViewByPosition(mCurrentPosition)
val view = manager.findViewByPosition(mCurrentPosition) if (view != null) {
if (view != null) { if (view is ViewGroup) {
if (view is ViewGroup) { if (view.childCount > 1 && view.getChildAt(1) is TabLayout) {
if (view.childCount > 1 && view.getChildAt(1) is TabLayout) { val tabLayout = view.getChildAt(1)
val tabLayout = view.getChildAt(1) val location = IntArray(2)
val location = IntArray(2) tabLayout.getLocationOnScreen(location)
tabLayout.getLocationOnScreen(location) if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) { confideFilterView!!.visibility = View.VISIBLE
confideFilterView!!.visibility = View.VISIBLE } else {
} else { confideFilterView!!.visibility = View.INVISIBLE
confideFilterView!!.visibility = View.INVISIBLE
}
} }
} }
} }
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1) val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) { if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) { if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
confideFilterView!!.visibility = View.INVISIBLE confideFilterView!!.visibility = View.INVISIBLE
}
} }
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONSULT_VIEW) { }
val view = manager.findViewByPosition(mCurrentPosition) } else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONSULT_VIEW) {
if (view != null) { val view = manager.findViewByPosition(mCurrentPosition)
if (view is ViewGroup) { if (view != null) {
if (view.getChildAt(1) is TabLayout) { if (view is ViewGroup) {
val tabLayout = view.getChildAt(1) if (view.getChildAt(1) is TabLayout) {
val location = IntArray(2) val tabLayout = view.getChildAt(1)
tabLayout.getLocationOnScreen(location) val location = IntArray(2)
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) { tabLayout.getLocationOnScreen(location)
consultFilterView?.visibility = View.VISIBLE if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
} else { consultFilterView?.visibility = View.VISIBLE
consultFilterView?.visibility = View.INVISIBLE } else {
} consultFilterView?.visibility = View.INVISIBLE
} }
} }
} }
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1) val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) { if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) { if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
consultFilterView!!.visibility = View.INVISIBLE consultFilterView!!.visibility = View.INVISIBLE
}
} }
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW) {
if (excuteStartAnim) {
mHomeView?.startAnim()
excuteStartAnim = false
excuteEndAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.PAGER_BANNER_VIEW) {
if (excuteEndAnim) {
mHomeView?.endAnim()
excuteEndAnim = false
excuteStartAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else {
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} }
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW) {
if (excuteStartAnim) {
mHomeView?.startAnim()
excuteStartAnim = false
excuteEndAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.PAGER_BANNER_VIEW) {
if (excuteEndAnim) {
mHomeView?.endAnim()
excuteEndAnim = false
excuteStartAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else {
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} }
} }
......
package com.yidianling.im.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/10
*/
class UserTypeBean(var userType: String,//用户类型 1 用户 2 专家 3 助理
var chatEvent: Boolean,//私聊常用语弹窗
var collectEvent: Boolean)//收集信息
\ No newline at end of file
package com.yidianling.im.event;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/13
*/
public class MsgPushEvent {
public String toUid;
public String headUrl;
public String content;
public String name;
@Override
public String toString() {
return "MsgPushEvent{" +
"toUid='" + toUid + '\'' +
", headUrl='" + headUrl + '\'' +
", content='" + content + '\'' +
", name='" + name + '\'' +
'}';
}
}
package com.yidianling.im.helper; package com.yidianling.im.helper;
import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
...@@ -17,6 +18,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog; ...@@ -17,6 +18,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.LogUtil; import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.api.bean.IMExpertBuild;
import com.yidianling.im.bean.DoctorAssistantRespDtoBean; import com.yidianling.im.bean.DoctorAssistantRespDtoBean;
import com.yidianling.im.bean.GetExpert; import com.yidianling.im.bean.GetExpert;
import com.yidianling.im.bridge.P2PCustomActionHandlerImpl; import com.yidianling.im.bridge.P2PCustomActionHandlerImpl;
...@@ -24,7 +26,7 @@ import com.yidianling.im.config.constants.ImConstants; ...@@ -24,7 +26,7 @@ import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.http.ImRetrofitApi; import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.router.ImIn; import com.yidianling.im.router.ImIn;
import com.yidianling.im.session.SessionHelper; import com.yidianling.im.session.SessionHelper;
import com.yidianling.im.api.bean.IMExpertBuild; import com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
...@@ -64,9 +66,10 @@ public class IMUtil { ...@@ -64,9 +66,10 @@ public class IMUtil {
* @param flag * @param flag
* @param canTalk * @param canTalk
* @param listener * @param listener
* @param isFromQingShu 用于判断是否从倾诉流程跳转私聊:1:是 其他:不是 从倾述流程跳转私聊,需要发送自定义消息 * @param isFromQingShu 用于判断是否从倾诉流程跳转私聊:1:是 其他:不是 从倾述流程跳转私聊,需要发送自定义消息
* @param isFromMessageList 用于判断是否来自于聊天列表点击进入 true 是 false,不是 * @param isFromMessageList 用于判断是否来自于聊天列表点击进入 true 是 false,不是
*/ */
@SuppressLint("CheckResult")
public static void startChat(AppCompatActivity context, String toUid, int flag, int canTalk, ExpertDataFetchListener listener, int isFromQingShu, boolean isFromMessageList) { public static void startChat(AppCompatActivity context, String toUid, int flag, int canTalk, ExpertDataFetchListener listener, int isFromQingShu, boolean isFromMessageList) {
if (!ImIn.INSTANCE.isLogin(context, true)) { if (!ImIn.INSTANCE.isLogin(context, true)) {
return; return;
...@@ -77,63 +80,171 @@ public class IMUtil { ...@@ -77,63 +80,171 @@ public class IMUtil {
LogUtil.d("isSaveUserInfo: " + isSaveUserInfo + " isUseUm: " + isUseUm); LogUtil.d("isSaveUserInfo: " + isSaveUserInfo + " isUseUm: " + isUseUm);
LoadingDialogFragment dialog = LoadingDialogFragment.Companion.newInstance(null); LoadingDialogFragment dialog = LoadingDialogFragment.Companion.newInstance(null);
if(context.getSupportFragmentManager() != null && !context.isDestroyed()) { if (context.getSupportFragmentManager() != null && !context.isDestroyed()) {
dialog.show(context.getSupportFragmentManager(), null); dialog.show(context.getSupportFragmentManager(), null);
} }
GetExpert cmd = new GetExpert(Integer.parseInt(toUid), canTalk); GetExpert cmd = new GetExpert(Integer.parseInt(toUid), canTalk);
if (isFromMessageList) {
//先根据uid判断用户类型:专家调一个接口,非专家调另外的接口
ImRetrofitApi.Companion.getImJavaApi().getUserType(toUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(res -> {
if (res.code == 200 && res.data != null) {
if (res.data.getChatEvent()) {//和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data.getChatEvent());
}
if (res.data.getCollectEvent()) {//和助理私聊需要打开信息采集弹窗
ChatStatusCacheHelper.setStatusCache("collectEvent", res.data.getCollectEvent());
}
//先根据uid判断用户类型:专家调一个接口,非专家调另外的接口 if (TextUtils.equals(res.data.getUserType(), "2")) {//专家 java 接口
Disposable disposable = ImRetrofitApi.Companion.getImJavaApi().getUserType(toUid) //如果是从消息列表点击进来的,那么专家还是专家,助理还是助理,不走其他所有逻辑(比如销售代运营)
.subscribeOn(Schedulers.io()) if (isFromMessageList) {
.observeOn(AndroidSchedulers.mainThread()) startExpertChat(context, toUid, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
.subscribe(res -> { return;
if (res.code == 200) { }
if (TextUtils.equals(res.data, "2")) {//专家 java 接口
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
//如果是从消息列表点击进来的,那么专家还是专家,助理还是助理,不走其他所有逻辑(比如销售代运营) ImRetrofitApi.Companion.getImJavaApi().getChatUid((toUid))
if (isFromMessageList) { .subscribeOn(Schedulers.io())
startExpertChat(context, toUid, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu); .observeOn(AndroidSchedulers.mainThread())
return ; .subscribe(resp -> {
DoctorAssistantRespDtoBean bean = resp.data;
if (bean.getRole() == 1) {
//接口返回值是专家,java接口
startExpertChat(context, bean.getChatUid(), dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
} else {
GetExpert cmd1 = new GetExpert(Integer.parseInt(bean.getChatUid()), canTalk);
//接口返回值是助理,php接口
startAssistantChat(context, bean.getChatUid(), cmd1, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
}
}, t -> {
HttpErrorUtils.Companion.handleError(context, t);
});
} else {//非专家 php接口
startAssistantChat(context, toUid, cmd, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
}
} else {
if (dialog.isVisible()) {
dialog.dismissAllowingStateLoss();
} }
ToastUtil.toastShort(res.msg);
}
}, throwable -> {
if (dialog.isVisible()) {
dialog.dismissAllowingStateLoss();
}
HttpErrorUtils.Companion.handleError(context, throwable);
});
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊 } else {
Disposable disposa = ImRetrofitApi.Companion.getImJavaApi().getChatUid((toUid)) ImRetrofitApi.Companion.getImJavaApi().getChatUid(toUid)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(resp -> { .subscribe(getChatUidResp -> {
DoctorAssistantRespDtoBean bean = resp.data; DoctorAssistantRespDtoBean bean = getChatUidResp.data;
if (bean.getRole() == 1) { ImRetrofitApi.Companion.getImJavaApi().getUserType(bean.chatUid)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(userTypeResp -> {
if (userTypeResp.code == 200 && userTypeResp.data != null) {
if (userTypeResp.data.getChatEvent()) {//和助理私聊需要打开常用语弹窗
ChatStatusCacheHelper.setStatusCache("chatEvent", userTypeResp.data.getChatEvent());
}
if (userTypeResp.data.getCollectEvent()) {//和助理私聊需要打开信息采集弹窗
ChatStatusCacheHelper.setStatusCache("collectEvent", userTypeResp.data.getCollectEvent());
}
if (TextUtils.equals(userTypeResp.data.getUserType(), "2")) {//专家 java 接口
//接口返回值是专家,java接口 //接口返回值是专家,java接口
startExpertChat(context, bean.getChatUid(), dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu); startExpertChat(context, bean.chatUid, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
}else { } else {
//非专家 php接口
GetExpert cmd1 = new GetExpert(Integer.parseInt(bean.getChatUid()), canTalk); GetExpert cmd1 = new GetExpert(Integer.parseInt(bean.chatUid), canTalk);
//接口返回值是助理,php接口 startAssistantChat(context, bean.chatUid, cmd1, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
startAssistantChat(context, bean.getChatUid(), cmd1, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
} }
},t->{ } else {
HttpErrorUtils.Companion.handleError(context, t); if (dialog.isVisible()) {
}); dialog.dismissAllowingStateLoss();
} else {//非专家 php接口 }
startAssistantChat(context, toUid, cmd, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu); ToastUtil.toastShort(userTypeResp.msg);
} }
} else { }, throwable -> {
if (dialog.isVisible()) {
dialog.dismissAllowingStateLoss();
}
HttpErrorUtils.Companion.handleError(context, throwable);
});
}, t -> {
if (dialog.isVisible()) { if (dialog.isVisible()) {
dialog.dismissAllowingStateLoss(); dialog.dismissAllowingStateLoss();
} }
ToastUtil.toastShort(res.msg); HttpErrorUtils.Companion.handleError(context, t);
} });
}, throwable -> {
if (dialog.isVisible()) { }
dialog.dismissAllowingStateLoss();
}
HttpErrorUtils.Companion.handleError(context, throwable); // //先根据uid判断用户类型:专家调一个接口,非专家调另外的接口
}); // Disposable disposable = ImRetrofitApi.Companion.getImJavaApi().getUserType(toUid)
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(res -> {
// if (res.code == 200) {
// if (TextUtils.equals(res.data, "2")) {//专家 java 接口
//
// //如果是从消息列表点击进来的,那么专家还是专家,助理还是助理,不走其他所有逻辑(比如销售代运营)
// if (isFromMessageList) {
// startExpertChat(context, toUid, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// return ;
// }
//
// //在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
// Disposable disposa = ImRetrofitApi.Companion.getImJavaApi().getChatUid((toUid))
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(resp -> {
//
// DoctorAssistantRespDtoBean bean = resp.data;
// if (bean.getRole() == 1) {
// //接口返回值是专家,java接口
// startExpertChat(context, bean.getChatUid(), dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// }else {
//
// GetExpert cmd1 = new GetExpert(Integer.parseInt(bean.getChatUid()), canTalk);
// //接口返回值是助理,php接口
// startAssistantChat(context, bean.getChatUid(), cmd1, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// }
//
// },t->{
// HttpErrorUtils.Companion.handleError(context, t);
// });
// } else {//非专家 php接口
// startAssistantChat(context, toUid, cmd, dialog, listener, isUseUm, isSaveUserInfo, isFromQingShu);
// }
// } else {
// if (dialog.isVisible()) {
// dialog.dismissAllowingStateLoss();
// }
// ToastUtil.toastShort(res.msg);
// }
// }, throwable -> {
// if (dialog.isVisible()) {
// dialog.dismissAllowingStateLoss();
// }
// HttpErrorUtils.Companion.handleError(context, throwable);
// });
} }
/** /**
......
...@@ -17,6 +17,7 @@ import com.netease.nimlib.sdk.msg.model.RevokeMsgNotification ...@@ -17,6 +17,7 @@ import com.netease.nimlib.sdk.msg.model.RevokeMsgNotification
import com.netease.nimlib.sdk.team.TeamServiceObserver import com.netease.nimlib.sdk.team.TeamServiceObserver
import com.netease.nimlib.sdk.team.model.Team import com.netease.nimlib.sdk.team.model.Team
import com.yidianling.im.api.event.AccountChangeEvent import com.yidianling.im.api.event.AccountChangeEvent
import com.yidianling.im.event.MsgPushEvent
import com.yidianling.im.event.TeamRemoveEvent import com.yidianling.im.event.TeamRemoveEvent
import com.yidianling.im.preference.IMCache import com.yidianling.im.preference.IMCache
import com.yidianling.im.preference.ImTempData import com.yidianling.im.preference.ImTempData
...@@ -30,6 +31,7 @@ import com.yidianling.uikit.api.wrapper.NimMessageRevokeObserver ...@@ -30,6 +31,7 @@ import com.yidianling.uikit.api.wrapper.NimMessageRevokeObserver
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper import com.yidianling.uikit.business.session.helper.MessageListPanelHelper
import com.yidianling.uikit.business.team.helper.TeamMemberAitHelper import com.yidianling.uikit.business.team.helper.TeamMemberAitHelper
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
import java.util.concurrent.Executors
/** /**
* Created by haorui on 2019/5/17. * Created by haorui on 2019/5/17.
...@@ -49,16 +51,20 @@ class ImObserversHelper { ...@@ -49,16 +51,20 @@ class ImObserversHelper {
fun registerObserver(register: Boolean) { fun registerObserver(register: Boolean) {
//注册`在线状态变化`观察者 //注册`在线状态变化`观察者
NIMClient.getService(AuthServiceObserver::class.java).observeOnlineStatus(userStatusObserver, register) NIMClient.getService(AuthServiceObserver::class.java)
.observeOnlineStatus(userStatusObserver, register)
//注册`消息撤回`观察者 //注册`消息撤回`观察者
NIMClient.getService(MsgServiceObserve::class.java).observeRevokeMessage(messageRevokeObserver, register) NIMClient.getService(MsgServiceObserve::class.java)
.observeRevokeMessage(messageRevokeObserver, register)
//注册`消息接收`观察者 //注册`消息接收`观察者
NIMClient.getService(MsgServiceObserve::class.java).observeReceiveMessage(incomingMessageObserver, register) NIMClient.getService(MsgServiceObserve::class.java)
.observeReceiveMessage(incomingMessageObserver, register)
//注册`移出群`观察者通知 //注册`移出群`观察者通知
NIMClient.getService(TeamServiceObserver::class.java).observeTeamRemove(teamObserver, register) NIMClient.getService(TeamServiceObserver::class.java)
.observeTeamRemove(teamObserver, register)
//注册`未读消息改变数量`观察者 //注册`未读消息改变数量`观察者
registerMsgUnreadInfoObserver(register) registerMsgUnreadInfoObserver(register)
if (register){ if (register) {
//注册`消息转发`过滤器 //注册`消息转发`过滤器
NimUIKit.setMsgForwardFilter(msgForwardFilter) NimUIKit.setMsgForwardFilter(msgForwardFilter)
//注册`消息撤回`过滤器 //注册`消息撤回`过滤器
...@@ -70,13 +76,15 @@ class ImObserversHelper { ...@@ -70,13 +76,15 @@ class ImObserversHelper {
if (register) { if (register) {
ReminderManager.getInstance().registerUnreadNumChangedCallback(unreadNumChangedCallback) ReminderManager.getInstance().registerUnreadNumChangedCallback(unreadNumChangedCallback)
} else { } else {
ReminderManager.getInstance().unregisterUnreadNumChangedCallback(unreadNumChangedCallback) ReminderManager.getInstance()
.unregisterUnreadNumChangedCallback(unreadNumChangedCallback)
} }
} }
private var unreadNumChangedCallback: ReminderManager.UnreadNumChangedCallback = ReminderManager.UnreadNumChangedCallback() { private var unreadNumChangedCallback: ReminderManager.UnreadNumChangedCallback =
MsgReceiveHelper.onMessageReceived() ReminderManager.UnreadNumChangedCallback() {
} MsgReceiveHelper.onMessageReceived()
}
private var userStatusObserver: Observer<StatusCode> = Observer { code -> private var userStatusObserver: Observer<StatusCode> = Observer { code ->
if (code.wontAutoLoginForever()) { if (code.wontAutoLoginForever()) {
...@@ -86,9 +94,11 @@ class ImObserversHelper { ...@@ -86,9 +94,11 @@ class ImObserversHelper {
private var messageRevokeObserver: Observer<RevokeMsgNotification> = NimMessageRevokeObserver() private var messageRevokeObserver: Observer<RevokeMsgNotification> = NimMessageRevokeObserver()
private var teamObserver: Observer<Team> = Observer<Team> { t -> EventBus.getDefault().post( private var teamObserver: Observer<Team> = Observer<Team> { t ->
TeamRemoveEvent(1, t.id) EventBus.getDefault().post(
) } TeamRemoveEvent(1, t.id)
)
}
private var incomingMessageObserver = Observer<List<IMMessage>> { messages -> private var incomingMessageObserver = Observer<List<IMMessage>> { messages ->
// 处理新收到的消息,为了上传处理方便,SDK 保证参数 messages 全部来自同一个聊天对象。 // 处理新收到的消息,为了上传处理方便,SDK 保证参数 messages 全部来自同一个聊天对象。
...@@ -96,9 +106,9 @@ class ImObserversHelper { ...@@ -96,9 +106,9 @@ class ImObserversHelper {
if (messages == null || messages.isEmpty()) { if (messages == null || messages.isEmpty()) {
return@Observer return@Observer
} }
if (messages.size > 1){ if (messages.size > 1) {
//漫游消息 nothing //漫游消息 nothing
}else{ } else {
//单/群聊消息 //单/群聊消息
for (m in messages) { for (m in messages) {
//监听在线消息中是否有@我 //监听在线消息中是否有@我
...@@ -112,12 +122,44 @@ class ImObserversHelper { ...@@ -112,12 +122,44 @@ class ImObserversHelper {
flushReceivedMoney(m) flushReceivedMoney(m)
} else { } else {
MsgReceiveHelper.onMessageReceived() MsgReceiveHelper.onMessageReceived()
if (System.currentTimeMillis() - m.time <= 5000) {
Executors.newSingleThreadExecutor().execute {
val userInfo = NimUIKit.getUserInfoProvider().getUserInfo(m.fromAccount)
val event = MsgPushEvent()
event.toUid = m.fromAccount
when (m.msgType) {
MsgTypeEnum.text -> {
event.content = m.content
}
MsgTypeEnum.image -> {
event.content = "[图片]"
}
MsgTypeEnum.audio -> {
event.content = "[语音]"
}
MsgTypeEnum.video -> {
event.content = "[视频]"
}
else -> {
event.content = "[链接]"
}
}
if (userInfo != null) {
event.name = userInfo.name
event.headUrl = userInfo.avatar
}
// LogUtil.e("发送事件:$event")
EventBus.getDefault().post(event)
}
}
} }
} }
} }
} }
private var msgForwardFilter = MsgForwardFilter { message -> private var msgForwardFilter = MsgForwardFilter { message ->
if (message.direct == MsgDirectionEnum.In && (message.attachStatus == AttachStatusEnum.transferring || message.attachStatus == AttachStatusEnum.fail)) { if (message.direct == MsgDirectionEnum.In && (message.attachStatus == AttachStatusEnum.transferring || message.attachStatus == AttachStatusEnum.fail)) {
// 接收到的消息,附件没有下载成功,不允许转发 // 接收到的消息,附件没有下载成功,不允许转发
return@MsgForwardFilter true return@MsgForwardFilter true
...@@ -131,8 +173,9 @@ class ImObserversHelper { ...@@ -131,8 +173,9 @@ class ImObserversHelper {
private var msgRevokeFilter = MsgRevokeFilter { message -> private var msgRevokeFilter = MsgRevokeFilter { message ->
if (message.attachment != null if (message.attachment != null
&& message.attachment is AVChatAttachment && message.attachment is AVChatAttachment
&& message.attachment is CustomAttachRedPacket) { && message.attachment is CustomAttachRedPacket
) {
// 视频通话消息和白板消息 不允许撤回 // 视频通话消息和白板消息 不允许撤回
return@MsgRevokeFilter true return@MsgRevokeFilter true
} else if (IMCache.getAccount() != null && IMCache.getAccount() == message.sessionId) { } else if (IMCache.getAccount() != null && IMCache.getAccount() == message.sessionId) {
...@@ -145,36 +188,39 @@ class ImObserversHelper { ...@@ -145,36 +188,39 @@ class ImObserversHelper {
//如果是收款提醒消息 则更新历史收款消息的状态 //如果是收款提醒消息 则更新历史收款消息的状态
fun flushReceivedMoney(m: IMMessage) { fun flushReceivedMoney(m: IMMessage) {
//跟新收款消息 //跟新收款消息
NIMClient.getService(MsgService::class.java).queryMessageListByType(MsgTypeEnum.custom, m, 100).setCallback(object : RequestCallback<List<IMMessage>> { NIMClient.getService(MsgService::class.java)
override fun onSuccess(imMessages: List<IMMessage>) { .queryMessageListByType(MsgTypeEnum.custom, m, 100)
for (im in imMessages) { .setCallback(object : RequestCallback<List<IMMessage>> {
if (im.attachment is CustomAttachReceivedMoney) { override fun onSuccess(imMessages: List<IMMessage>) {
val money = im.attachment as CustomAttachReceivedMoney for (im in imMessages) {
if (im.attachment is CustomAttachReceivedMoney) {
if (money.orPay == 1) return val money = im.attachment as CustomAttachReceivedMoney
val status = m.attachment as CustomAttachmentReceivedSuccess
if (money.orderId == null || status.orderid == null) return if (money.orPay == 1) return
if (money.orderId == status.orderid) { val status = m.attachment as CustomAttachmentReceivedSuccess
if (money.orderId == null || status.orderid == null) return
money.orPay = 1//设置为已支付 if (money.orderId == status.orderid) {
im.attachment = money
//更新此消息到sdk money.orPay = 1//设置为已支付
NIMClient.getService(MsgService::class.java).updateIMMessageStatus(im) im.attachment = money
//更新私聊界面聊天信息 //更新此消息到sdk
MessageListPanelHelper.getInstance().notifyModifyMessage(im) NIMClient.getService(MsgService::class.java)
return .updateIMMessageStatus(im)
//更新私聊界面聊天信息
MessageListPanelHelper.getInstance().notifyModifyMessage(im)
return
}
} }
} }
} }
}
override fun onFailed(i: Int) { override fun onFailed(i: Int) {
// Log.e("hzs","跟新收款消息失败"); // Log.e("hzs","跟新收款消息失败");
} }
override fun onException(throwable: Throwable) { override fun onException(throwable: Throwable) {
// Log.e("hzs","跟新收款消息异常:"+throwable); // Log.e("hzs","跟新收款消息异常:"+throwable);
} }
}) })
} }
} }
...@@ -5,11 +5,8 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA ...@@ -5,11 +5,8 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.bean.CourseStatusBean
import com.yidianling.im.bean.DoctorAssistantRespDtoBean
import com.yidianling.im.bean.PushConfideStatusBean
import com.yidianling.im.bean.RedPacketDetailBean
import com.yidianling.im.api.bean.IMExpertBuild import com.yidianling.im.api.bean.IMExpertBuild
import com.yidianling.im.bean.*
import io.reactivex.Observable import io.reactivex.Observable
import retrofit2.http.* import retrofit2.http.*
...@@ -43,7 +40,7 @@ interface ImRetrofitApi { ...@@ -43,7 +40,7 @@ interface ImRetrofitApi {
//获取用户的状态(用户、专家、助理) //获取用户的状态(用户、专家、助理)
@GET("user/userType") @GET("user/userType")
@Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN+ YDL_DOMAIN_JAVA)
fun getUserType(@Query("targetUid") uid: String): Observable<BaseResponse<String>> fun getUserType(@Query("targetUid") uid: String): Observable<BaseResponse<UserTypeBean>>
//根据专家uid获取私聊的目标uid(有可能是专家uid,有可能是助理uid) //根据专家uid获取私聊的目标uid(有可能是专家uid,有可能是助理uid)
@GET("doctor/chat-user") @GET("doctor/chat-user")
......
...@@ -197,4 +197,8 @@ class IMServiceImpl : IImService { ...@@ -197,4 +197,8 @@ class IMServiceImpl : IImService {
//这里虽然是倾述流程进入私聊,但不需要发送自定义消息 //这里虽然是倾述流程进入私聊,但不需要发送自定义消息
IMUtil.startChat(context as AppCompatActivity, toUid, 0x001, canTalk, null, 0, false) IMUtil.startChat(context as AppCompatActivity, toUid, 0x001, canTalk, null, 0, false)
} }
override fun getUnReadByUid(uid: String): Int {
return MsgReceiveHelper.getUnNum(uid)
}
} }
\ No newline at end of file
...@@ -47,7 +47,7 @@ public class OrderAction extends BaseAction { ...@@ -47,7 +47,7 @@ public class OrderAction extends BaseAction {
.subscribe(res -> { .subscribe(res -> {
if (res.code == 200) { if (res.code == 200) {
Observable<BaseResponse<IMExpertBuild>> observable; Observable<BaseResponse<IMExpertBuild>> observable;
if (TextUtils.equals(res.data, "2")) {//专家 if (TextUtils.equals(res.data.getUserType(), "2")) {//专家
observable = ImRetrofitApi.Companion.getImJavaApi().getPersonalChat(getAccount()); observable = ImRetrofitApi.Companion.getImJavaApi().getPersonalChat(getAccount());
} else { } else {
observable = ImHttpImpl.Companion.getInstance().getExpert(new ExpertParam(Integer.valueOf(getAccount()), 0)); observable = ImHttpImpl.Companion.getInstance().getExpert(new ExpertParam(Integer.valueOf(getAccount()), 0));
......
...@@ -21,6 +21,7 @@ import android.widget.LinearLayout; ...@@ -21,6 +21,7 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.Observer;
import com.netease.nimlib.sdk.RequestCallback; import com.netease.nimlib.sdk.RequestCallback;
...@@ -42,6 +43,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper; ...@@ -42,6 +43,7 @@ import com.ydl.ydlcommon.utils.log.LogHelper;
import com.ydl.ydlcommon.view.CircleImageView; import com.ydl.ydlcommon.view.CircleImageView;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.router.ImIn;
import com.yidianling.nimbase.api.UIKitOptions; import com.yidianling.nimbase.api.UIKitOptions;
import com.yidianling.nimbase.api.model.main.CustomPushContentProvider; import com.yidianling.nimbase.api.model.main.CustomPushContentProvider;
import com.yidianling.nimbase.api.model.session.ModuleProxy; import com.yidianling.nimbase.api.model.session.ModuleProxy;
...@@ -54,22 +56,34 @@ import com.yidianling.nimbase.common.fragment.TFragment; ...@@ -54,22 +56,34 @@ import com.yidianling.nimbase.common.fragment.TFragment;
import com.yidianling.nimbase.impl.cache.NimUserInfoCache; import com.yidianling.nimbase.impl.cache.NimUserInfoCache;
import com.yidianling.uikit.api.NimUIKitImpl; import com.yidianling.uikit.api.NimUIKitImpl;
import com.yidianling.uikit.business.ait.AitManager; import com.yidianling.uikit.business.ait.AitManager;
import com.yidianling.uikit.business.session.helper.ChatStatusCacheHelper;
import com.yidianling.uikit.business.session.module.input.InputPanel; import com.yidianling.uikit.business.session.module.input.InputPanel;
import com.yidianling.uikit.business.session.module.list.MessageListPanelEx; import com.yidianling.uikit.business.session.module.list.MessageListPanelEx;
import com.yidianling.uikit.business.session.view.ChatPrivateTips; import com.yidianling.uikit.business.session.view.ChatPrivateTips;
import com.yidianling.uikit.business.session.view.CollectInfoPopupWindow;
import com.yidianling.uikit.business.session.view.CommonQuestionView;
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage; import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler; import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.uikit.custom.http.ServiceImpl;
import com.yidianling.uikit.custom.http.response.CommonQuestionBean;
import com.yidianling.uikit.custom.http.response.SubmitUserInfoBean;
import com.yidianling.uikit.custom.http.response.UserQuestInfoBean;
import com.yidianling.uikit.custom.widget.ConfideOrderInfoView; import com.yidianling.uikit.custom.widget.ConfideOrderInfoView;
import com.yidianling.uikit.custom.widget.HalfCircleDrawable; import com.yidianling.uikit.custom.widget.HalfCircleDrawable;
import com.yidianling.user.api.service.IUserService; import com.yidianling.user.api.service.IUserService;
import org.jetbrains.annotations.NotNull;
import org.json.JSONException; import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/** /**
* 聊天界面基类 * 聊天界面基类
...@@ -114,6 +128,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -114,6 +128,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private int timeCount = 0; private int timeCount = 0;
protected AitManager aitManager; protected AitManager aitManager;
private CollectInfoPopupWindow collectInfoPopupWindow;
private CircleImageView small_head_img; //小头像 private CircleImageView small_head_img; //小头像
private TextView help_num_tv; //帮助人数 private TextView help_num_tv; //帮助人数
...@@ -126,6 +141,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -126,6 +141,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private ImageView qingshuImg; //预约咨询 private ImageView qingshuImg; //预约咨询
private ConstraintLayout top_expert_info_cl; private ConstraintLayout top_expert_info_cl;
private RelativeLayout rl_common_question_enter;
private FrameLayout fl_question_content;
private List<CommonQuestionBean> commonQuestionBeanList;
@SuppressLint("HandlerLeak") @SuppressLint("HandlerLeak")
private Handler mHandler = new Handler() { private Handler mHandler = new Handler() {
...@@ -157,6 +175,51 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -157,6 +175,51 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
qingshu = rootView.findViewById(R.id.action_qingshu); qingshu = rootView.findViewById(R.id.action_qingshu);
qingshuImg = rootView.findViewById(R.id.action_qingshu_img); qingshuImg = rootView.findViewById(R.id.action_qingshu_img);
//和助理私聊时的常用语逻辑
rl_common_question_enter = rootView.findViewById(R.id.rl_common_question);
fl_question_content = rootView.findViewById(R.id.fl_question_content);
rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3) {
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 {
getCommonQuestionListData();
}
ChatStatusCacheHelper.clearDataByKey("chatEvent");
}
if (ChatStatusCacheHelper.getStatusCache("collectEvent")) {
String time = Calendar.getInstance().get(Calendar.YEAR) + "-" + Calendar.getInstance().get(Calendar.MONTH) + Calendar.getInstance().get(Calendar.DAY_OF_MONTH);
// if (!TextUtils.equals(time, SharedPreferencesEditor.getString("skip_time_" + YdlCommonRouterManager.INSTANCE.getYdlCommonRoute().getUid()))) {
if (!TextUtils.equals(time, SharedPreferencesEditor.getString("skip_time_" + ImIn.INSTANCE.getUserInfo().getUid()))) {
collectInfoPopupWindow = new CollectInfoPopupWindow(getActivity(), (content, result) -> {
if (TextUtils.isEmpty(content)) {//点击跳过后当天不再显示此弹窗
SharedPreferencesEditor.putString("skip_time_" + ImIn.INSTANCE.getUserInfo().getUid()
, time);
} else {
IMMessage textMessage = MessageBuilder.createTextMessage(sessionId, sessionType, content);
if (sendMessage(textMessage)) {
openOrCloseCommonQuestionLayout(false);
}
submitUserCollect(result);
}
});
getUserInfoCollect();
collectInfoPopupWindow.show(top_expert_info_cl);
}
ChatStatusCacheHelper.clearDataByKey("collectEvent");
}
}
// 初始化顶部专家信息栏 // 初始化顶部专家信息栏
if (ActionHandlerStorage.getL(sessionId).getUserType() == 2) { if (ActionHandlerStorage.getL(sessionId).getUserType() == 2) {
top_expert_info_cl.setVisibility(View.VISIBLE); top_expert_info_cl.setVisibility(View.VISIBLE);
...@@ -214,32 +277,30 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -214,32 +277,30 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
* 初始化顶部专家信息栏 * 初始化顶部专家信息栏
*/ */
private void initTopCustomBar() { private void initTopCustomBar() {
if (ActionHandlerStorage.getL(sessionId) != null) { // 头像
// 头像 String headUrl = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoSmallImage;
String headUrl = ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoSmallImage; if (!TextUtils.isEmpty(headUrl)) {
if (!TextUtils.isEmpty(headUrl)) { GlideApp.with(getActivity()).load(headUrl).into(small_head_img);
GlideApp.with(getActivity()).load(headUrl).into(small_head_img); }
} // 帮助人数
// 帮助人数 String help_num = String.valueOf(ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoOrderNum);
String help_num = String.valueOf(ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoOrderNum); if (TextUtils.isEmpty(help_num)) help_num = "0";
if (TextUtils.isEmpty(help_num)) help_num = "0"; help_num_tv.setText(help_num);
help_num_tv.setText(help_num); // 服务时长
// 服务时长 String server_num = String.valueOf((int) Math.ceil((double) ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoHelpLong / 60.0));
String server_num = String.valueOf((int) Math.ceil((double) ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoHelpLong / 60.0)); if (TextUtils.isEmpty(server_num)) server_num = "0";
if (TextUtils.isEmpty(server_num)) server_num = "0"; server_num_tv.setText(server_num);
server_num_tv.setText(server_num); // 好评率
// 好评率 String good_num = String.format("%.2f", ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoFeedbackRate * 20);
String good_num = String.format("%.2f", ActionHandlerStorage.getL(sessionId).getInfo().doctorBriefInfoFeedbackRate * 20); if (TextUtils.isEmpty(good_num)) good_num = "0.00";
if (TextUtils.isEmpty(good_num)) good_num = "0.00"; good_num_tv.setText(good_num + "%");
good_num_tv.setText(good_num + "%");
if (!TextUtils.isEmpty(headUrl)) {
if (!TextUtils.isEmpty(headUrl)) { IP2PCustomActionHandler.DocInfo info = ActionHandlerStorage.getL(sessionId).getInfo();
IP2PCustomActionHandler.DocInfo info = ActionHandlerStorage.getL(sessionId).getInfo(); if (null != info) {
if (null != info) { NimUserInfo user = NimUserInfoCache.getInstance().getUserInfo(info.toUid);
NimUserInfo user = NimUserInfoCache.getInstance().getUserInfo(info.toUid); if (null != user && null != user.getAvatar() && headUrl.equals(user.getAvatar())) {
if (null != user && null != user.getAvatar() && headUrl.equals(user.getAvatar())) { NimUserInfoCache.getInstance().getUserInfoFromRemote(info.toUid, null);
NimUserInfoCache.getInstance().getUserInfoFromRemote(info.toUid, null);
}
} }
} }
} }
...@@ -349,7 +410,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -349,7 +410,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击常见问题"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击常见问题");
if (ActionHandlerStorage.getL(sessionId) != null) { if (null != ActionHandlerStorage.getL(sessionId)) {
ActionHandlerStorage.getL(sessionId).startHelp(getActivity()); ActionHandlerStorage.getL(sessionId).startHelp(getActivity());
} }
} }
...@@ -358,7 +419,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -358,7 +419,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击投诉与反馈"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击投诉与反馈");
if (ActionHandlerStorage.getL(sessionId) != null) { if (null != ActionHandlerStorage.getL(sessionId)) {
ActionHandlerStorage.getL(sessionId).startFeedback(getActivity()); ActionHandlerStorage.getL(sessionId).startFeedback(getActivity());
} }
} }
...@@ -368,7 +429,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -368,7 +429,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
LogHelper.Companion.getInstance().writeLogSync("聊天界面点击免费热线"); LogHelper.Companion.getInstance().writeLogSync("聊天界面点击免费热线");
if (ActionHandlerStorage.getL(sessionId) != null) { if (null != ActionHandlerStorage.getL(sessionId)) {
ActionHandlerStorage.getL(sessionId).popCallDialog(getActivity()); ActionHandlerStorage.getL(sessionId).popCallDialog(getActivity());
} }
} }
...@@ -402,6 +463,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -402,6 +463,9 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
NIMClient.getService(MsgService.class).setChattingAccount(sessionId, sessionType); NIMClient.getService(MsgService.class).setChattingAccount(sessionId, sessionType);
getActivity().setVolumeControlStream(AudioManager.STREAM_VOICE_CALL); // 默认使用听筒播放 getActivity().setVolumeControlStream(AudioManager.STREAM_VOICE_CALL); // 默认使用听筒播放
messageListPanel.scrollToBottom();
} }
@Override @Override
...@@ -418,7 +482,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -418,7 +482,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
public boolean onBackPressed() { public boolean onBackPressed() {
return inputPanel.collapse(true) || messageListPanel.onBackPressed(); return inputPanel.collapse(true) || messageListPanel.onBackPressed() || openOrCloseCommonQuestionLayout(false);
} }
//刷新消息列表 //刷新消息列表
...@@ -640,11 +704,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -640,11 +704,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
@Override @Override
public void onInputPanelExpand() { public void onInputPanelExpand() {
messageListPanel.scrollToBottom(); messageListPanel.scrollToBottom();
openOrCloseCommonQuestionLayout(false);
} }
@Override @Override
public void shouldCollapseInputPanel() { public void shouldCollapseInputPanel() {
inputPanel.collapse(false); inputPanel.collapse(false);
openOrCloseCommonQuestionLayout(false);
} }
@Override @Override
...@@ -677,4 +745,108 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -677,4 +745,108 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
return actions; return actions;
} }
} private boolean openOrCloseCommonQuestionLayout(boolean open) {
boolean result = false;
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3) {
if (open) {
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 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 -> {
});
}
@SuppressLint("CheckResult")
private void getUserInfoCollect() {
ServiceImpl.Companion.getInstance().userCollectList()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(resp -> {
if (resp.data != null && resp.data.size() > 0) {
collectInfoPopupWindow.setData(resp.data);
} else {
collectInfoPopupWindow.dismiss();
}
}, throwable -> {
collectInfoPopupWindow.dismiss();
});
}
@SuppressLint("CheckResult")
private void submitUserCollect(List<UserQuestInfoBean> result) {
SubmitUserInfoBean submitUserInfoBean = new SubmitUserInfoBean();
submitUserInfoBean.userInfoList = result;
ServiceImpl.Companion.getInstance().submitUserCollect(JSON.toJSONString(submitUserInfoBean))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(resp -> {
}, throwable -> {
});
}}
package com.yidianling.uikit.business.session.helper;
import java.util.HashMap;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/11
*/
public class ChatStatusCacheHelper {
private static final HashMap<String, Boolean> statusCache = new HashMap<>();
public static void setStatusCache(String key, boolean value) {
statusCache.put(key, value);
}
public static boolean getStatusCache(String key) {
if (statusCache.containsKey(key)) {
return statusCache.get(key);
}
return false;
}
public static void clearDataByKey(String key) {
if (statusCache.containsKey(key)) {
statusCache.remove(key);
}
}
}
...@@ -213,7 +213,7 @@ public class MessageListPanelEx { ...@@ -213,7 +213,7 @@ public class MessageListPanelEx {
private OnItemClickListener listener = new OnItemClickListener() { private OnItemClickListener listener = new OnItemClickListener() {
@Override @Override
public void onItemClick(IRecyclerView adapter, View view, int position) { public void onItemClick(IRecyclerView adapter, View view, int position) {
container.proxy.shouldCollapseInputPanel();
} }
@Override @Override
......
package com.yidianling.uikit.business.session.view
import android.content.Context
import android.graphics.drawable.BitmapDrawable
import android.view.Gravity
import android.view.KeyEvent
import android.view.View
import android.view.ViewGroup
import android.widget.PopupWindow
import com.yidianling.common.tools.ToastUtil
import com.yidianling.uikit.custom.http.response.UserQuestInfoBean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/10
*/
class CollectInfoPopupWindow(var mContext: Context, var listener: OnSendMsgListener) : PopupWindow(mContext) {
private var collectUserInformationView: CollectUserInformationView
private var isFromBack = true
init {
height = ViewGroup.LayoutParams.MATCH_PARENT
width = ViewGroup.LayoutParams.MATCH_PARENT
setBackgroundDrawable(BitmapDrawable())
collectUserInformationView = CollectUserInformationView(mContext, {
listener.sendMsg("", ArrayList())
isFromBack = false
dismiss()
}, { _content, _list ->
listener.sendMsg(_content, _list)
isFromBack = false
dismiss()
})
collectUserInformationView.isFocusableInTouchMode = true
collectUserInformationView.setOnKeyListener { v, keyCode, event ->
if (keyCode == KeyEvent.KEYCODE_BACK) {
showSkipDialog()
true
}
false
}
contentView = collectUserInformationView
isFocusable = true
isTouchable = true
isOutsideTouchable = false
}
fun setData(list: List<UserQuestInfoBean>) {
if (list.isEmpty()) {
ToastUtil.toastShort("数据异常,请稍后重试")
return
}
collectUserInformationView.setData(list)
}
override fun dismiss() {
if (isFromBack) {
showSkipDialog()
isFromBack = false
} else {
super.dismiss()
}
}
private fun showSkipDialog() {
collectUserInformationView.showSkipDialog()
}
fun show(v: View) {
v.post { showAtLocation(v, Gravity.BOTTOM, 0, 0) }
}
interface OnSendMsgListener {
fun sendMsg(content: String, result: List<UserQuestInfoBean>)
}
}
\ No newline at end of file
package com.yidianling.uikit.business.session.view
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.yidianling.im.R
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/11
*/
class CollectInfoStyleAdapter(var list: List<String>, var event: (title: String) -> Unit) : RecyclerView.Adapter<CollectInfoStyleAdapter.InfoStyleHolder>() {
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): InfoStyleHolder {
return InfoStyleHolder(LayoutInflater.from(parent!!.context).inflate(R.layout.im_item_collect_info_question_style, parent, false))
}
override fun getItemCount(): Int {
return if (list.size > 9) 9 else list.size
}
override fun onBindViewHolder(holder: InfoStyleHolder?, position: Int) {
holder!!.bindData(list[position])
holder.itemView.setOnClickListener {
event(list[position])
}
}
inner class InfoStyleHolder(var view: View) : RecyclerView.ViewHolder(view) {
private var textView: TextView = view.findViewById(R.id.tv_title)
fun bindData(title: String) {
textView!!.text = title
}
}
}
\ No newline at end of file
package com.yidianling.uikit.business.session.view
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.support.v7.widget.GridLayoutManager
import android.text.Spannable
import android.text.SpannableString
import android.text.TextUtils
import android.text.style.AbsoluteSizeSpan
import android.text.style.ForegroundColorSpan
import android.util.TypedValue
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.EditText
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.TextView
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.R
import com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import kotlinx.android.synthetic.main.im_view_collect_user_infomation.view.*
import java.util.*
import kotlin.collections.ArrayList
/**
* @author jiucheng
* @描述:用户信息采集view
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/10
*/
@SuppressLint("ViewConstructor")
class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Unit, var sendMsgEvent: (content: String, list: List<UserQuestInfoBean>) -> Unit) : LinearLayout(mContext) {
private var resultInfoList = ArrayList<UserQuestInfoBean>()
private var currentIndex = 0
private var year =1994
//todo CommonDialog的样式要改
private var dialog: CommonDialog? = null
private var ageStr = ""
private var genderStr = ""
private var questionStr = ""
private var questionStyleStr = ""
init {
val params = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
layoutParams = params
View.inflate(mContext, R.layout.im_view_collect_user_infomation, this)
orientation = VERTICAL
tv_skip.setOnClickListener {
showSkipDialog()
}
}
fun setData(list: List<UserQuestInfoBean>) {
resultInfoList.clear()
resultInfoList.addAll(list)
addContentView(resultInfoList[0].question!!, true)
proceedNext(list)
}
private fun proceedNext(list: List<UserQuestInfoBean>) {
tv_start.setOnClickListener {
addContentView(resultInfoList[1].question!!, true)
tv_start.visibility = View.GONE
ll_gender.visibility = View.VISIBLE
}
tv_gender_male.setOnClickListener {
addContentView(tv_gender_male.text.toString(), false)
tv_gender_male.postDelayed({
genderStr = "性别:男"
addContentView(resultInfoList[currentIndex].question!!, true)
ll_gender.visibility = View.GONE
rl_age.visibility = View.VISIBLE
}, 300)
}
tv_gender_fomale.setOnClickListener {
addContentView(tv_gender_fomale.text.toString(), false)
tv_gender_fomale.postDelayed({
genderStr = "性别:女"
addContentView(resultInfoList[currentIndex].question!!, true)
ll_gender.visibility = View.GONE
rl_age.visibility = View.VISIBLE
}, 300)
}
((date_pick.getChildAt(0) as ViewGroup).getChildAt(0) as ViewGroup).getChildAt(2).visibility = View.GONE
((date_pick.getChildAt(0) as ViewGroup).getChildAt(0) as ViewGroup).getChildAt(1).visibility = View.GONE
date_pick.init(
year,
Calendar.getInstance().get(Calendar.MONTH),
Calendar.getInstance().get(Calendar.DAY_OF_MONTH)
) { _, year, _, _ ->
this.year = year
}
date_pick.maxDate = Calendar.getInstance().timeInMillis
tv_age_ensure.setOnClickListener {
ageStr = "年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
addContentView("${year}年", false)
tv_age_ensure.postDelayed({
addContentView(resultInfoList[currentIndex].question!!, true)
rl_age.visibility = View.GONE
rl_question_style.visibility = View.VISIBLE
}, 300)
}
val adapter = CollectInfoStyleAdapter(list[3].answerList!!) {
addContentView(it, false)
rl_question_style.postDelayed({
questionStyleStr = "咨询类型:${it}"
addContentView(resultInfoList[currentIndex].question!!, true, resultInfoList[currentIndex].answerList!![0])
rl_question_style.visibility = View.GONE
ll_input.visibility = View.VISIBLE
rl_question_style.postDelayed({ showInputMethod(et_input) }, 100)
scrollView.postDelayed({
scrollView.fullScroll(ScrollView.FOCUS_DOWN)
}, 300)
}, 300)
}
val layoutManager = GridLayoutManager(mContext, 3)
rl_question_style.layoutManager = layoutManager
rl_question_style.adapter = adapter
tv_send.setOnClickListener {
val content = et_input.text.trim().toString()
if (TextUtils.isEmpty(content)) {
ToastUtil.toastShort("请输入内容")
} else {
questionStr = "问题描述:${content}"
addContentView(content, false)
tv_send.postDelayed({
addContentView(resultInfoList[currentIndex].question!!, true)
ll_input.visibility = View.GONE
tv_finish.visibility = View.VISIBLE
hideInputMethod(et_input)
}, 300)
}
}
tv_finish.setOnClickListener {
val resultContent = ageStr + "\n" + genderStr + "\n" + questionStyleStr + "\n" + questionStr
val genderBean = UserQuestInfoBean(list[1].userInfoType, "", ArrayList(), genderStr.split(":")[1])
val ageBean = UserQuestInfoBean(list[2].userInfoType, "", ArrayList(),"${year}")
val questionStyleBean = UserQuestInfoBean(list[3].userInfoType, "", ArrayList(), questionStyleStr.split(":")[1])
val questionBean = UserQuestInfoBean(list[4].userInfoType, "", ArrayList(), questionStr.split(":")[1])
val resultList = ArrayList<UserQuestInfoBean>()
resultList.add(genderBean)
resultList.add(ageBean)
resultList.add(questionStyleBean)
resultList.add(questionBean)
sendMsgEvent(resultContent, resultList)
}
}
@SuppressLint("RtlHardcoded")
private fun addContentView(title: String, send: Boolean, subtitle: String = "") {
val textView = TextView(mContext)
val params = LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
params.topMargin = RxImageTool.dp2px(18f)
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 17f)
textView.setTextColor(Color.parseColor("#242424"))
textView.setPadding(RxImageTool.dp2px(13f), RxImageTool.dp2px(9f), RxImageTool.dp2px(13f), RxImageTool.dp2px(9f))
if (send) {
textView.setBackgroundResource(R.drawable.im_background_collect_info_left)
params.gravity = Gravity.LEFT
} else {
textView.setBackgroundResource(R.drawable.im_background_collect_info_right)
params.gravity = Gravity.RIGHT
}
if (!TextUtils.isEmpty(subtitle)) {
val resultText = "$title\n参考:\n$subtitle"
val sbString = SpannableString(resultText)
sbString.setSpan(ForegroundColorSpan(Color.parseColor("#999999")), title.length + 3, resultText.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
sbString.setSpan(AbsoluteSizeSpan(12, true), title.length, resultText.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
textView.text = sbString
textView.setLineSpacing(4f, 1f)
} else {
textView.text = title
}
textView.maxWidth = RxImageTool.dp2px(255f)
textView.layoutParams = params
ll_content.addView(textView)
if (send) {
currentIndex++
}
}
// 隐藏键盘布局
private fun hideInputMethod(et: EditText) {
val imm = mContext.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(et.windowToken, 0)
et.clearFocus()
}
// 显示键盘布局
private fun showInputMethod(editTextMessage: EditText) {
editTextMessage.requestFocus()
val imm = mContext.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.showSoftInput(editTextMessage, 0)
}
fun showSkipDialog() {
if (dialog == null) {
dialog = CommonDialog.create(mContext)
.setLeftOnclick("下次吧") {
skipEvent()
}
.setRightClick("继续填写") {
dialog!!.dismiss()
}
.setMessage("这个过程可以帮助您更快地改变当前的现状,确定要跳过吗?")
.setTitle_color(R.color.im_color_242424)
.setCancelAble(true)
}
if (!dialog!!.isShowing) {
dialog!!.show()
}
}
}
\ No newline at end of file
package com.yidianling.uikit.business.session.view
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.ViewGroup
import com.yidianling.uikit.custom.http.response.CommonQuestionBean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class CommonQuestionAdapter(var mContext: Context, var list: List<CommonQuestionBean>, var event: (title: String, id: String) -> Unit) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder {
return CommonQuestionViewHolder(CommonQuestionItemView(mContext))
}
override fun getItemCount(): Int {
return list.size
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder?, position: Int) {
((holder as CommonQuestionViewHolder).itemView as CommonQuestionItemView).setData(list[position].title, list[position].keyword, position == list.size - 1)
holder.itemView.setOnClickListener {
event(list[position].title, list[position].id)
}
}
inner class CommonQuestionViewHolder(view: CommonQuestionItemView) : RecyclerView.ViewHolder(view)
}
\ No newline at end of file
package com.yidianling.uikit.business.session.view
import android.content.Context
import android.graphics.Color
import android.text.Spannable
import android.text.SpannableString
import android.text.TextUtils
import android.text.style.ForegroundColorSpan
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.im.R
import kotlinx.android.synthetic.main.im_item_view_common_question.view.*
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class CommonQuestionItemView(var mContext: Context) : LinearLayout(mContext) {
init {
var parmas = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = parmas
View.inflate(mContext, R.layout.im_item_view_common_question, this)
orientation = VERTICAL
}
fun setData(title: String, keyWords: String?, isLast: Boolean) {
if (TextUtils.isEmpty(keyWords)) {
tv_title.text = title
} else {
if (title.contains(keyWords!!)) {
val temp = title.split(keyWords)
val spanString = SpannableString(temp[0] + keyWords + temp[1])
spanString.setSpan(ForegroundColorSpan(Color.parseColor("#1da1f2")), temp[0].length, (temp[0] + keyWords).length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
tv_title.text = spanString
} else {
tv_title.text = title
}
}
if (isLast) {
view_line.visibility = View.GONE
} else {
view_line.visibility = View.VISIBLE
}
}
}
package com.yidianling.uikit.business.session.view
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.im.R
import com.yidianling.uikit.custom.http.response.CommonQuestionBean
import kotlinx.android.synthetic.main.im_view_common_question.view.*
/**
* @author jiucheng
* @描述:私聊常见问题view
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class CommonQuestionView(var mContext: Context) : LinearLayout(mContext) {
var listener: OnSelectItemListener? = null
init {
var parmas = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = parmas
View.inflate(mContext, R.layout.im_view_common_question, this)
orientation = VERTICAL
}
fun setData(list: List<CommonQuestionBean>) {
if (list.isEmpty()) {
visibility = View.GONE
return
}
if (list.size > 4) {
var parmas = LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dp2px(214f))
content_view.layoutParams = parmas
}
val adapter = CommonQuestionAdapter(mContext, list) { title, id ->
listener!!.onSelect(title, id)
listener!!.close()
}
var layoutManager = WrapContentLinearLayoutManager(mContext)
content_view.layoutManager = layoutManager as RecyclerView.LayoutManager?
content_view.adapter = adapter
rl_close.setOnClickListener {
listener!!.close()
}
}
fun show() {
visibility = View.VISIBLE
}
fun hide() {
visibility = View.GONE
}
interface OnSelectItemListener {
fun onSelect(title: String, id: String)
fun close()
}
}
\ No newline at end of file
...@@ -4,11 +4,12 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN ...@@ -4,11 +4,12 @@ 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
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.uikit.custom.http.response.ChatStatusBean import com.yidianling.uikit.custom.http.response.ChatStatusBean
import com.yidianling.uikit.custom.http.response.CommonQuestionBean
import com.yidianling.uikit.custom.http.response.RecommendExpertBean import com.yidianling.uikit.custom.http.response.RecommendExpertBean
import com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import io.reactivex.Observable import io.reactivex.Observable
import retrofit2.http.GET import okhttp3.RequestBody
import retrofit2.http.Headers import retrofit2.http.*
import retrofit2.http.Query
/** /**
* Created by xj on 2019/6/26. * Created by xj on 2019/6/26.
...@@ -29,4 +30,25 @@ interface ServiceApi{ ...@@ -29,4 +30,25 @@ interface ServiceApi{
@GET("doctor/recommendSimilarListeners") @GET("doctor/recommendSimilarListeners")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA) @Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getRecommendExpertList(@Query("doctorUid") doctorUid: Long, @Query("catName") catName: String, @Query("limit") limit: Int): Observable<BaseAPIResponse<ArrayList<RecommendExpertBean>>> fun getRecommendExpertList(@Query("doctorUid") doctorUid: Long, @Query("catName") catName: String, @Query("limit") limit: Int): Observable<BaseAPIResponse<ArrayList<RecommendExpertBean>>>
//获取常用语
@POST("phrase/list")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun getCommonQuestionList(): Observable<BaseAPIResponse<List<CommonQuestionBean>>>
//常用语的点击
@GET("phrase/count")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun sendCommonQuestionCount(@Query("id") id: String): Observable<BaseAPIResponse<Any>>
//信息采集的问题
@GET("user/collect/list")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun userCollectList(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>>
//信息采集的问题
@POST("user/collect/submit")
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA)
fun submitUserCollect(@Body body: RequestBody): Observable<BaseAPIResponse<Any>>
} }
\ No newline at end of file
...@@ -3,8 +3,12 @@ package com.yidianling.uikit.custom.http ...@@ -3,8 +3,12 @@ package com.yidianling.uikit.custom.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.uikit.custom.http.response.ChatStatusBean import com.yidianling.uikit.custom.http.response.ChatStatusBean
import com.yidianling.uikit.custom.http.response.CommonQuestionBean
import com.yidianling.uikit.custom.http.response.RecommendExpertBean import com.yidianling.uikit.custom.http.response.RecommendExpertBean
import com.yidianling.uikit.custom.http.response.UserQuestInfoBean
import io.reactivex.Observable import io.reactivex.Observable
import okhttp3.MediaType
import okhttp3.RequestBody
/** /**
* Created by xj on 2019/6/26. * Created by xj on 2019/6/26.
...@@ -35,4 +39,33 @@ class ServiceImpl private constructor(){ ...@@ -35,4 +39,33 @@ class ServiceImpl private constructor(){
fun getRecommendExpertList(doctorUid: Long, catName: String, limit: Int): Observable<BaseAPIResponse<ArrayList<RecommendExpertBean>>> { fun getRecommendExpertList(doctorUid: Long, catName: String, limit: Int): Observable<BaseAPIResponse<ArrayList<RecommendExpertBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getRecommendExpertList(doctorUid, catName, limit) return YDLHttpUtils.obtainApi(ServiceApi::class.java).getRecommendExpertList(doctorUid, catName, limit)
} }
/**
* 获取常用语
*/
fun getCommonQuestionList(): Observable<BaseAPIResponse<List<CommonQuestionBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).getCommonQuestionList()
}
/**
* 常用语的点击
*/
fun sendCommonQuestionCount(id: String): Observable<BaseAPIResponse<Any>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).sendCommonQuestionCount(id)
}
/**
* 信息采集的问题
*/
fun userCollectList(): Observable<BaseAPIResponse<List<UserQuestInfoBean>>> {
return YDLHttpUtils.obtainApi(ServiceApi::class.java).userCollectList()
}
/**
* 上传采集的问题
*/
fun submitUserCollect(params: String): Observable<BaseAPIResponse<Any>> {
val body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), params) as RequestBody
return YDLHttpUtils.obtainApi(ServiceApi::class.java).submitUserCollect(body)
}
} }
\ No newline at end of file
package com.yidianling.uikit.custom.http.response
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/9
*/
class CommonQuestionBean(var title: String,var id: String, var keyword: String)
\ No newline at end of file
package com.yidianling.uikit.custom.http.response;
import java.util.List;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/13
*/
public class SubmitUserInfoBean {
public List<UserQuestInfoBean> userInfoList;
}
package com.yidianling.uikit.custom.http.response
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/12/12
*/
class UserQuestInfoBean(var userInfoType: String, var question: String?, var answerList: List<String>?, var content: String?)
\ No newline at end of file
...@@ -51,4 +51,9 @@ interface IImService : IProvider { ...@@ -51,4 +51,9 @@ interface IImService : IProvider {
fun sendTestResultMessage(uid: String, content: String, title: String?, head: String?, url: String?, id: Int, share_url: String?, callback: IMRequestCallback<Void>) fun sendTestResultMessage(uid: String, content: String, title: String?, head: String?, url: String?, id: Int, share_url: String?, callback: IMRequestCallback<Void>)
fun startChat(context : Activity ,toUid : String ,flag : Int , canTalk : Int) fun startChat(context : Activity ,toUid : String ,flag : Int , canTalk : Int)
/**
* 根据uid获取未读数
*/
fun getUnReadByUid(uid: String): Int
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners android:radius="17dp" />
<solid android:color="#1A1DA1F2"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners android:radius="6dp" />
<solid android:color="@color/platform_color_1DA1F2"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners android:topRightRadius="6dp" />
<solid android:color="#EBffffff" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners android:radius="20dp" />
<solid android:color="#1F1DA1F2" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners
android:radius="20dp" />
<gradient
android:endColor="@color/platform_color_1DA1F2"
android:startColor="#23B2FA" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners
android:bottomLeftRadius="6dp"
android:bottomRightRadius="6dp"
android:topRightRadius="6dp" />
<solid android:color="#ffffff" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<corners
android:bottomLeftRadius="6dp"
android:bottomRightRadius="6dp"
android:topLeftRadius="6dp" />
<solid android:color="#CCEBFF" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:background="@drawable/im_background_chat_collect_info_question_style"
android:gravity="center"
android:paddingTop="7dp"
android:layout_marginTop="14dp"
android:paddingBottom="7dp"
android:textColor="@color/platform_color_1DA1F2"
android:textSize="15sp"
tools:text="恋爱情感" />
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
tools:parentTag="android.widget.LinearLayout">
<TextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="11dp"
android:layout_marginEnd="17dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="2"
android:minHeight="44dp"
android:paddingTop="11dp"
android:paddingBottom="11dp"
android:textColor="#242424"
android:textSize="16sp"
tools:text="咨询顾问的服咨询顾问的服咨询顾问的服务收费吗务收费吗咨询顾问的服务收费吗务收费吗?" />
<View
android:id="@+id/view_line"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginStart="11dp"
android:layout_marginEnd="17dp"
android:background="#EBEBEB" />
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:parentTag="android.widget.LinearLayout">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="44dp"
android:background="@color/white">
<ImageView
android:id="@+id/iv_close"
android:layout_width="26dp"
android:layout_height="30dp"
android:layout_marginRight="6dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/tv_title"
android:src="@drawable/im_ico_default_avatar" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:gravity="center_vertical"
android:text="咨询前评估"
android:textColor="@color/im_color_242424"
android:textSize="17sp" />
<TextView
android:id="@+id/tv_skip"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="跳过"
android:textColor="@color/im_color_grey_999999"
android:textSize="14sp" />
</RelativeLayout>
<ScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/platform_color_F0F0F0">
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingLeft="18dp"
android:paddingRight="18dp"
android:paddingBottom="28dp">
</LinearLayout>
</ScrollView>
<RelativeLayout
android:id="@+id/rl_choose_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:minHeight="56dp">
<!-- 开始-->
<TextView
android:id="@+id/tv_start"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="14dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="14dp"
android:background="@drawable/im_background_collect_info_bottom_start"
android:gravity="center"
android:text="好的"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="visible"
tools:visibility="gone" />
<!-- 性别-->
<LinearLayout
android:id="@+id/ll_gender"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="14dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="14dp"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:id="@+id/tv_gender_male"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_weight="1"
android:background="@drawable/im_background_collect_info_bottom_gender"
android:gravity="center"
android:text="男"
android:textColor="@color/platform_color_1DA1F2"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_gender_fomale"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="15dp"
android:layout_weight="1"
android:background="@drawable/im_background_collect_info_bottom_gender"
android:gravity="center"
android:text="女"
android:textColor="@color/platform_color_1DA1F2"
android:textSize="16sp" />
</LinearLayout>
<!-- 年龄-->
<RelativeLayout
android:id="@+id/rl_age"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_centerHorizontal="true"
android:gravity="center"
android:text="请选择出生年份"
android:textColor="@color/im_color_242424"
android:textSize="17sp" />
<TextView
android:id="@+id/tv_age_ensure"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_alignParentRight="true"
android:gravity="center"
android:paddingRight="20dp"
android:text="确定"
android:textColor="@color/platform_color_1DA1F2"
android:textSize="17sp" />
<DatePicker
android:id="@+id/date_pick"
android:layout_width="match_parent"
android:layout_height="205dp"
android:layout_below="@+id/title"
android:calendarViewShown="false"
android:datePickerMode="spinner" />
</RelativeLayout>
<!-- 问题类型?-->
<android.support.v7.widget.RecyclerView
android:id="@+id/rl_question_style"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingTop="6dp"
android:paddingRight="20dp"
android:paddingBottom="20dp"
android:visibility="gone"
tools:layout_height="160dp" />
<!-- 问题输入-->
<LinearLayout
android:id="@+id/ll_input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/platform_color_F7F7F7"
android:orientation="horizontal"
android:paddingRight="20dp"
android:visibility="gone"
tools:visibility="visible">
<EditText
android:id="@+id/et_input"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@drawable/im_nim_chat_input_edit_background"
android:hint="放心咨询,信息保密"
android:minHeight="37dp"
android:paddingStart="10dp"
android:paddingTop="5dp"
android:paddingRight="10dp"
android:paddingBottom="5dp"
android:textColor="@color/im_color_242424"
android:textColorHint="@color/platform_color_BFBFBF"
android:textSize="14sp"
tools:text="放心咨询,信放心咨询,信息保密放心咨询,信息保密放心咨询,信息保密放心咨询,信息保密放心咨询,信息保密息保密" />
<TextView
android:id="@+id/tv_send"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="12dp"
android:background="@drawable/im_background_chat_collect_info_send"
android:gravity="center"
android:padding="5dp"
android:text="@string/send"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- 开始-->
<TextView
android:id="@+id/tv_finish"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="30dp"
android:layout_marginTop="14dp"
android:layout_marginRight="30dp"
android:layout_marginBottom="14dp"
android:background="@drawable/im_background_collect_info_bottom_start"
android:gravity="center"
android:text="去沟通"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="gone" />
</RelativeLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
tools:parentTag="android.widget.LinearLayout">
<android.support.v7.widget.RecyclerView
android:id="@+id/content_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:layout_height="200dp" />
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="#EBEBEB" />
<RelativeLayout
android:id="@+id/rl_close"
android:layout_width="match_parent"
android:layout_height="42dp">
<TextView
android:id="@+id/tv_common"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="11dp"
android:layout_marginRight="13dp"
android:gravity="center_vertical"
android:text="常见问题"
android:textColor="#242424"
android:textStyle="bold" />
</RelativeLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/platform_color_F0F0F0" android:background="@color/platform_color_F0F0F0"
android:orientation="vertical"> android:orientation="vertical">
<FrameLayout <FrameLayout
android:id="@+id/message_activity_list_view_container" android:id="@+id/message_activity_list_view_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dip" android:layout_height="0dip"
android:layout_weight="1"> android:layout_weight="1">
<com.yidianling.uikit.business.session.helper.MsgBkImageView <com.yidianling.uikit.business.session.helper.MsgBkImageView
android:id="@+id/message_activity_background" android:id="@+id/message_activity_background"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<android.support.design.widget.CoordinatorLayout <android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout <android.support.design.widget.AppBarLayout
android:id="@+id/appbar" android:id="@+id/appbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:elevation="0dp"> app:elevation="0dp">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"> app:layout_scrollFlags="scroll|enterAlways">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/line" android:layout_below="@+id/line"
android:background="#ffffff" android:background="#ffffff"
android:visibility="gone"> android:visibility="gone">
<com.yidianling.nimbase.common.ui.imageview.CircleImageView <com.yidianling.nimbase.common.ui.imageview.CircleImageView
android:id="@+id/info_head" android:id="@+id/info_head"
android:layout_width="30dp" android:layout_width="30dp"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_margin="10dp" /> android:layout_margin="10dp" />
<TextView <TextView
android:id="@+id/info_name" android:id="@+id/info_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="6dp" android:layout_marginTop="6dp"
android:layout_toRightOf="@+id/info_head" android:layout_toRightOf="@+id/info_head"
android:text="预约咨询" /> android:text="预约咨询" />
<TextView <TextView
android:id="@+id/info_money" android:id="@+id/info_money"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/info_name" android:layout_below="@+id/info_name"
android:layout_toRightOf="@+id/info_head" android:layout_toRightOf="@+id/info_head"
android:text="200" android:text="200"
android:textColor="#ff8800" android:textColor="#ff8800"
android:textSize="16sp" /> android:textSize="16sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/info_name" android:layout_below="@+id/info_name"
android:layout_alignBaseline="@+id/info_money" android:layout_alignBaseline="@+id/info_money"
android:layout_toRightOf="@+id/info_money" android:layout_toRightOf="@+id/info_money"
android:text="元/次" android:text="元/次"
android:textSize="12sp" /> android:textSize="12sp" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:background="@drawable/im_shape_green_bg" android:background="@drawable/im_shape_green_bg"
android:padding="5dp" android:padding="5dp"
android:text="立即预约" android:text="立即预约"
android:textColor="#3fca69" /> android:textColor="#3fca69" />
<ImageView <ImageView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="1dp" android:layout_height="1dp"
android:layout_below="@+id/info_head" android:layout_below="@+id/info_head"
android:background="#EDEDED" /> android:background="#EDEDED" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/top_expert_info_ll" android:id="@+id/top_expert_info_ll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<android.support.constraint.ConstraintLayout <android.support.constraint.ConstraintLayout
android:id="@+id/top_expert_info_cl" android:id="@+id/top_expert_info_cl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="56dp" android:layout_height="56dp"
android:paddingTop="@dimen/platform_dp_8" android:paddingTop="@dimen/platform_dp_8"
android:paddingBottom="@dimen/platform_dp_10" android:paddingBottom="@dimen/platform_dp_10"
android:paddingLeft="@dimen/platform_dp_10" android:paddingLeft="@dimen/platform_dp_10"
android:background="@color/im_white" android:background="@color/im_white"
android:visibility="gone"> android:visibility="gone">
<com.ydl.ydlcommon.view.CircleImageView <com.ydl.ydlcommon.view.CircleImageView
android:id="@+id/small_head_img" android:id="@+id/small_head_img"
android:layout_width="@dimen/platform_dp_36" android:layout_width="@dimen/platform_dp_36"
android:layout_height="@dimen/platform_dp_36" android:layout_height="@dimen/platform_dp_36"
android:background="@drawable/platform_head_place_hold_pic"> android:background="@drawable/platform_head_place_hold_pic">
</com.ydl.ydlcommon.view.CircleImageView> </com.ydl.ydlcommon.view.CircleImageView>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_help" android:id="@+id/rl_help"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_constraintLeft_toRightOf="@+id/small_head_img" app:layout_constraintLeft_toRightOf="@+id/small_head_img"
android:layout_marginLeft="30dp"> android:layout_marginLeft="30dp">
<TextView <TextView
android:id="@+id/help_num_tv" android:id="@+id/help_num_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="2648" tools:text="2648"
android:fontFamily="@font/platform_dincond_bold" android:fontFamily="@font/platform_dincond_bold"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textSize="@dimen/platform_dp_20" android:textSize="@dimen/platform_dp_20"
/> />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="帮助人数" android:text="帮助人数"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_10" android:textSize="@dimen/platform_dp_10"
/> />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_good" android:id="@+id/rl_good"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_constraintRight_toRightOf="parent" app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="30dp"> android:layout_marginRight="30dp">
<TextView <TextView
android:id="@+id/good_num_tv" android:id="@+id/good_num_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="99.9%" tools:text="99.9%"
android:fontFamily="@font/platform_dincond_bold" android:fontFamily="@font/platform_dincond_bold"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textSize="@dimen/platform_dp_20" android:textSize="@dimen/platform_dp_20"
/> />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="好评率" android:text="好评率"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_10" android:textSize="@dimen/platform_dp_10"
/> />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_server" android:id="@+id/rl_server"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_constraintLeft_toRightOf="@+id/rl_help" app:layout_constraintLeft_toRightOf="@+id/rl_help"
app:layout_constraintRight_toLeftOf="@+id/rl_good"> app:layout_constraintRight_toLeftOf="@+id/rl_good">
<TextView <TextView
android:id="@+id/server_num_tv" android:id="@+id/server_num_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="1634" tools:text="1634"
android:fontFamily="@font/platform_dincond_bold" android:fontFamily="@font/platform_dincond_bold"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textSize="@dimen/platform_dp_20" android:textSize="@dimen/platform_dp_20"
/> />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="服务时长 (小时)" android:text="服务时长 (小时)"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_10" android:textSize="@dimen/platform_dp_10"
/> />
</RelativeLayout> </RelativeLayout>
</android.support.constraint.ConstraintLayout> </android.support.constraint.ConstraintLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.design.widget.AppBarLayout> </android.support.design.widget.AppBarLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior">
<!--快捷按钮--> <!--快捷按钮-->
<FrameLayout <FrameLayout
android:id="@+id/quick_fl" android:id="@+id/quick_fl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingTop="10dp" android:paddingTop="10dp"
android:paddingRight="10dp"> android:paddingRight="10dp">
<LinearLayout <LinearLayout
android:id="@+id/ll_actions_yi" android:id="@+id/ll_actions_yi"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="53dp" android:layout_height="53dp"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="gone"> android:visibility="gone">
<LinearLayout <LinearLayout
android:id="@+id/action_help" android:id="@+id/action_help"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action" android:background="@drawable/im_bg_im_confide_action"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:layout_width="17dp" android:layout_width="17dp"
android:layout_height="17dp" android:layout_height="17dp"
android:src="@drawable/im_chat_ico_help" /> android:src="@drawable/im_chat_ico_help" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:gravity="center" android:gravity="center"
android:text="常见问题" android:text="常见问题"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/action_feedback" android:id="@+id/action_feedback"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action" android:background="@drawable/im_bg_im_confide_action"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:layout_width="17dp" android:layout_width="17dp"
android:layout_height="17dp" android:layout_height="17dp"
android:src="@drawable/im_chat_ico_feedback" /> android:src="@drawable/im_chat_ico_feedback" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:gravity="center" android:gravity="center"
android:text="投诉反馈" android:text="投诉反馈"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/action_call" android:id="@+id/action_call"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/im_bg_im_confide_action" android:background="@drawable/im_bg_im_confide_action"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:layout_width="17dp" android:layout_width="17dp"
android:layout_height="17dp" android:layout_height="17dp"
android:src="@drawable/im_chat_free_call" /> android:src="@drawable/im_chat_free_call" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:gravity="center" android:gravity="center"
android:text="免费热线" android:text="免费热线"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:textSize="15sp" android:textSize="15sp"
android:textStyle="bold" /> android:textStyle="bold" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_contain" android:id="@+id/rl_contain"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:layout_height="50dp" tools:layout_height="50dp"
android:layout_below="@+id/quick_fl"> android:layout_below="@+id/quick_fl">
</RelativeLayout> </RelativeLayout>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/messageListView" android:id="@+id/messageListView"
style="@style/list_view" style="@style/list_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:cacheColorHint="@android:color/transparent" android:cacheColorHint="@android:color/transparent"
android:divider="@null" android:divider="@null"
android:fadingEdge="none" android:fadingEdge="none"
android:focusable="false" android:focusable="false"
android:layout_below="@+id/rl_contain" android:layout_below="@+id/rl_contain"
android:listSelector="@android:color/transparent" android:listSelector="@android:color/transparent"
android:scrollbars="vertical"/> android:scrollbars="vertical"/>
<RelativeLayout <RelativeLayout
android:id="@+id/lin_actions" android:id="@+id/lin_actions"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="right" android:layout_gravity="right"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_alignTop="@+id/messageListView" android:layout_alignTop="@+id/messageListView"
android:layout_marginRight="@dimen/platform_dp_10" android:layout_marginRight="@dimen/platform_dp_10"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:visibility="visible"> android:visibility="visible">
<RelativeLayout <RelativeLayout
android:id="@+id/rela_qingsu" android:id="@+id/rela_qingsu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="36dp" android:layout_height="36dp"
android:paddingLeft="14dp" android:paddingLeft="14dp"
android:paddingRight="17dp" android:paddingRight="17dp"
android:gravity="center" android:gravity="center"
android:background="@drawable/im_bg_im_confide_action"> android:background="@drawable/im_bg_im_confide_action">
<ImageView <ImageView
android:id="@+id/action_qingshu_img" android:id="@+id/action_qingshu_img"
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@mipmap/im_chat_ico_call" /> android:src="@mipmap/im_chat_ico_call" />
<TextView <TextView
android:id="@+id/action_qingshu" android:id="@+id/action_qingshu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:text="即时倾诉" android:text="即时倾诉"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:layout_toRightOf="@+id/action_qingshu_img" android:layout_toRightOf="@+id/action_qingshu_img"
android:textColor="@color/platform_google_blue" android:textColor="@color/platform_google_blue"
android:textSize="12dp" android:textSize="12dp"
android:textStyle="bold" /> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/rela_zixun" android:id="@+id/rela_zixun"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="36dp" android:layout_height="36dp"
android:paddingLeft="17dp" android:paddingLeft="17dp"
android:paddingRight="14dp" android:paddingRight="14dp"
android:layout_toRightOf="@+id/rela_qingsu" android:layout_toRightOf="@+id/rela_qingsu"
android:layout_marginLeft="-4dp" android:layout_marginLeft="-4dp"
android:gravity="center" android:gravity="center"
android:background="@drawable/im_bg_im_confide_action"> android:background="@drawable/im_bg_im_confide_action">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/im_bg_im_confide_top_tips" android:background="@drawable/im_bg_im_confide_top_tips"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:paddingTop="1dp" android:paddingTop="1dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:paddingBottom="1dp" android:paddingBottom="1dp"
android:text="立减20元" android:text="立减20元"
android:textColor="@color/im_white" android:textColor="@color/im_white"
android:textSize="9sp" android:textSize="9sp"
android:visibility="gone" /> android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/img_zixun" android:id="@+id/img_zixun"
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:src="@mipmap/im_chat_pre_zixun" /> android:src="@mipmap/im_chat_pre_zixun" />
<TextView <TextView
android:id="@+id/action_yuyue" android:id="@+id/action_yuyue"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:text="预约咨询" android:text="预约咨询"
android:paddingLeft="5dp" android:paddingLeft="5dp"
android:layout_toRightOf="@+id/img_zixun" android:layout_toRightOf="@+id/img_zixun"
android:textColor="@color/platform_google_green" android:textColor="@color/platform_google_green"
android:textSize="12dp" android:textSize="12dp"
android:textStyle="bold" /> android:textStyle="bold" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
</android.support.design.widget.CoordinatorLayout> </android.support.design.widget.CoordinatorLayout>
<FrameLayout <FrameLayout
android:id="@+id/layoutPlayAudio" android:id="@+id/layoutPlayAudio"
android:layout_width="128dp" android:layout_width="128dp"
android:layout_height="128dp" android:layout_height="128dp"
android:layout_gravity="center" android:layout_gravity="center"
android:background="@drawable/im_nim_audio_record_toast_bg" android:background="@drawable/im_nim_audio_record_toast_bg"
android:visibility="gone" android:visibility="gone"
tools:visibility="visible"> tools:visibility="visible">
<ImageView <ImageView
android:id="@+id/img_antation" android:id="@+id/img_antation"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:src="@mipmap/im_voice_search_feedback001" /> android:src="@mipmap/im_voice_search_feedback001" />
<ImageView <ImageView
android:id="@+id/img_cancel" android:id="@+id/img_cancel"
android:layout_width="60dp" android:layout_width="60dp"
android:layout_height="60dp" android:layout_height="60dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:src="@mipmap/im_icon_audio_cancel" android:src="@mipmap/im_icon_audio_cancel"
android:visibility="gone" /> android:visibility="gone" />
<Chronometer <Chronometer
android:id="@+id/timer" android:id="@+id/timer"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:text="@string/im_timer_default" android:text="@string/im_timer_default"
android:textColor="@color/im_white" android:textColor="@color/im_white"
android:textSize="45sp" android:textSize="45sp"
android:visibility="gone" /> android:visibility="gone" />
<LinearLayout <LinearLayout
android:id="@+id/timer_tip_container" android:id="@+id/timer_tip_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_margin="6dp" android:layout_margin="6dp"
android:gravity="center"> android:gravity="center">
<TextView <TextView
android:id="@+id/timer_tip" android:id="@+id/timer_tip"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:gravity="center" android:gravity="center"
android:text="@string/im_recording_cancel" android:text="@string/im_recording_cancel"
android:textColor="@color/im_white" android:textColor="@color/im_white"
android:textSize="12sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
<com.yidianling.uikit.business.session.view.ChatPrivateTips <com.yidianling.uikit.business.session.view.ChatPrivateTips
android:id="@+id/v_chattips" android:id="@+id/v_chattips"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginTop="58dp" android:layout_marginTop="58dp"
android:visibility="gone" /> android:visibility="gone" />
</FrameLayout>
<!-- 快捷回复-->
<include layout="@layout/im_nim_message_activity_bottom_layout" /> <RelativeLayout
android:id="@+id/rl_common_question"
</LinearLayout> android:layout_width="wrap_content"
android:layout_height="42dp"
android:paddingRight="13dp"
android:layout_gravity="bottom"
android:background="@drawable/im_background_chat_common_question">
<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_color_1DA1F2"
android:textStyle="bold" />
</RelativeLayout>
</FrameLayout>
<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" />
</LinearLayout>
...@@ -10,21 +10,22 @@ import com.ydl.ydlcommon.modular.ModularServiceManager ...@@ -10,21 +10,22 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
* Created by Dog on 2015/5/8. * Created by Dog on 2015/5/8.
*/ */
open class BaseCommand { open class BaseCommand {
@JvmField
var uid = "0" var uid = "0"
@JvmField
var accessToken = "" var accessToken = ""
@JvmField
var ts: String var ts: String
@JvmField
var version: String var version: String
@JvmField
var osBuild = var osBuild =
RxDeviceTool.getBuildMANUFACTURER() + "," + RxDeviceTool.getBuildBrandModel() + "," + RxDeviceTool.getOsBuileVersion() + "," + RxDeviceTool.getAppVersionName( RxDeviceTool.getBuildMANUFACTURER() + "," + RxDeviceTool.getBuildBrandModel() + "," + RxDeviceTool.getOsBuileVersion() + "," + RxDeviceTool.getAppVersionName(
BaseApp.getApp() BaseApp.getApp()
) )
@JvmField
var isFromApp = "1"//2表示专家版1表示用户版 var isFromApp = "1"//2表示专家版1表示用户版
@JvmField
var ffrom = PlatformDataManager.getRam().getChannelName()//渠Y道来源 var ffrom = PlatformDataManager.getRam().getChannelName()//渠Y道来源
init { init {
......
...@@ -51,6 +51,8 @@ dependencies { ...@@ -51,6 +51,8 @@ dependencies {
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
api fileTree(dir: 'libs', include: ['*.jar']) api fileTree(dir: 'libs', include: ['*.jar'])
api 'com.tencent.tbs.tbssdk:sdk:43697'
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
......
...@@ -17,6 +17,7 @@ class H5JsBean { ...@@ -17,6 +17,7 @@ class H5JsBean {
var params: Params? = null var params: Params? = null
var action_name: String? = null var action_name: String? = null
var callBack: String = ""
class Params { class Params {
......
...@@ -247,6 +247,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -247,6 +247,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
* 15秒后发送一条消息通知展示无网络页面 * 15秒后发送一条消息通知展示无网络页面
*/ */
private void sendNetLossMessage() { private void sendNetLossMessage() {
if (null != mTimeOutHandler)
mTimeOutHandler.sendEmptyMessageDelayed(TIME_OUT_TYPE, timeOutLong); mTimeOutHandler.sendEmptyMessageDelayed(TIME_OUT_TYPE, timeOutLong);
} }
...@@ -254,7 +255,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler { ...@@ -254,7 +255,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
* 取消预定15秒后发送的消息 * 取消预定15秒后发送的消息
*/ */
private void cancelSendNetLossMessage() { private void cancelSendNetLossMessage() {
mTimeOutHandler.removeMessages(TIME_OUT_TYPE); if (null != mTimeOutHandler) {
mTimeOutHandler.removeMessages(TIME_OUT_TYPE);
}
} }
private void initLoadingView() { private void initLoadingView() {
......
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