Commit 42cadc97 by 严久程

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3
parents 5f353dff c5e2b42b
...@@ -20,8 +20,8 @@ import java.util.List; ...@@ -20,8 +20,8 @@ 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_TEST;
// public static String appEnv = YDLConstants.ENV_TEST; // public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_TEST;
@Override @Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) { public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
......
...@@ -44,15 +44,15 @@ ext { ...@@ -44,15 +44,15 @@ ext {
//第三步 若干 //第三步 若干
"m-confide" : "0.0.41.2", "m-confide" : "0.0.41.2",
"m-consultant" : "0.0.51.4", "m-consultant" : "0.0.51.11",
"m-fm" : "0.0.23.4", "m-fm" : "0.0.23.4",
"m-user" : "0.0.41.1", "m-user" : "0.0.41.1",
"m-home" : "0.0.6.20", "m-home" : "0.0.6.25",
"m-muse" : "0.0.20.4", "m-muse" : "0.0.20.4",
"m-tests" : "0.0.15.3", "m-tests" : "0.0.15.3",
"m-course" : "0.0.34.4", "m-course" : "0.0.34.4",
"m-im" : "0.0.3.3", "m-im" : "0.0.3.7",
"m-dynamic" : "0.0.1.2", "m-dynamic" : "0.0.1.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.4", "m-im-api" : "0.0.5",
"m-dynamic-api" : "0.0.1", "m-dynamic-api" : "0.0.1",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -74,14 +74,14 @@ ext { ...@@ -74,14 +74,14 @@ ext {
"ydl-platform" : "0.0.29.3", "ydl-platform" : "0.0.29.3",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.28.9", "ydl-webview" : "0.0.28.11",
"ydl-media" : "0.0.14.4", "ydl-media" : "0.0.14.4",
"ydl-pay" : "0.0.11.5", "ydl-pay" : "0.0.11.5",
"m-audioim" : "0.0.40.4", "m-audioim" : "0.0.40.4",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3", "ydl-net" : "0.0.3.1",
"ydl-utils" : "0.0.3", "ydl-utils" : "0.0.3",
"ydl-flutter-base": "0.0.5.17", "ydl-flutter-base": "0.0.5.17",
] ]
...@@ -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.4", "m-im-api" : "0.0.5",
"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.3", "ydl-platform" : "0.0.29.3",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.28.6", "ydl-webview" : "0.0.28.9",
"ydl-media" : "0.0.14.4", "ydl-media" : "0.0.14.4",
"ydl-pay" : "0.0.11.5", "ydl-pay" : "0.0.11.5",
"m-audioim" : "0.0.40.4", "m-audioim" : "0.0.40.4",
...@@ -127,7 +127,7 @@ ext { ...@@ -127,7 +127,7 @@ ext {
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3", "ydl-net" : "0.0.3.1",
"ydl-utils" : "0.0.3", "ydl-utils" : "0.0.3",
"ydl-flutter-base": "0.0.5.17", "ydl-flutter-base": "0.0.5.17",
] ]
......
...@@ -1341,6 +1341,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres ...@@ -1341,6 +1341,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override fun onRefresh() { override fun onRefresh() {
refresh(false) refresh(false)
recommendListView.requestData()
} }
//刷新列表 //刷新列表
......
...@@ -1278,6 +1278,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1278,6 +1278,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
override fun onRefresh() { override fun onRefresh() {
refresh(false) refresh(false)
recommendListView.requestData()
} }
//刷新列表 //刷新列表
......
...@@ -19,18 +19,18 @@ public class ExpertSearchBigShotBean { ...@@ -19,18 +19,18 @@ public class ExpertSearchBigShotBean {
* topicImages : [{"id":88,"parentId":62,"iamgeType":2,"isShow":1,"createTime":"Dec 13, 2019 9:35:45 PM","updateTime":"Dec 16, 2019 4:31:42 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":133,"parentId":62,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:23:00 PM","updateTime":"Dec 16, 2019 4:34:48 PM","createrId":0,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":134,"parentId":62,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:28:03 PM","updateTime":"Dec 16, 2019 4:29:58 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":146,"parentId":62,"iamgeType":3,"isShow":1,"createTime":"Dec 16, 2019 4:32:15 PM","updateTime":"Dec 16, 2019 4:34:01 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"}] * topicImages : [{"id":88,"parentId":62,"iamgeType":2,"isShow":1,"createTime":"Dec 13, 2019 9:35:45 PM","updateTime":"Dec 16, 2019 4:31:42 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":133,"parentId":62,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:23:00 PM","updateTime":"Dec 16, 2019 4:34:48 PM","createrId":0,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":134,"parentId":62,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:28:03 PM","updateTime":"Dec 16, 2019 4:29:58 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":146,"parentId":62,"iamgeType":3,"isShow":1,"createTime":"Dec 16, 2019 4:32:15 PM","updateTime":"Dec 16, 2019 4:34:01 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"}]
*/ */
private int id; private int id = 0;
private String specialTopicName; private String specialTopicName = "";
private int specialTopicType; private int specialTopicType = 0;
private String specialTopicTitle; private String specialTopicTitle = "";
private String specialTopicSubhead; private String specialTopicSubhead = "";
private int status; private int status = 0;
private int weight; private int weight = 0;
private int jumpWay; private int jumpWay = 0;
private String createTime; private String createTime = "";
private String updateTime; private String updateTime = "";
private int createrId; private int createrId = 0;
private String specialTopicUrl; private String specialTopicUrl = "";
private List<TopicImagesBean> topicImages; private List<TopicImagesBean> topicImages;
public int getId() { public int getId() {
...@@ -149,14 +149,14 @@ public class ExpertSearchBigShotBean { ...@@ -149,14 +149,14 @@ public class ExpertSearchBigShotBean {
* imageUrl : https://pic.ydlcdn.com/6n5AcChhYa.png * imageUrl : https://pic.ydlcdn.com/6n5AcChhYa.png
*/ */
private int id; private int id = 0;
private int parentId; private int parentId = 0;
private int imageType; private int imageType = 0;
private int isShow; private int isShow = 0;
private String createTime; private String createTime = "";
private String updateTime; private String updateTime = "";
private int createrId; private int createrId = 0;
private String imageUrl; private String imageUrl = "";
public int getId() { public int getId() {
return id; return id;
......
...@@ -20,18 +20,18 @@ public class ExpertSearchRecommandBean { ...@@ -20,18 +20,18 @@ public class ExpertSearchRecommandBean {
* topicImages : [{"id":103,"parentId":68,"iamgeType":2,"isShow":1,"createTime":"Dec 13, 2019 9:35:47 PM","updateTime":"Dec 16, 2019 4:31:55 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":140,"parentId":68,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:28:05 PM","updateTime":"Dec 16, 2019 4:30:13 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":152,"parentId":68,"iamgeType":3,"isShow":1,"createTime":"Dec 16, 2019 4:32:18 PM","updateTime":"Dec 16, 2019 4:34:15 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"}] * topicImages : [{"id":103,"parentId":68,"iamgeType":2,"isShow":1,"createTime":"Dec 13, 2019 9:35:47 PM","updateTime":"Dec 16, 2019 4:31:55 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":140,"parentId":68,"iamgeType":1,"isShow":1,"createTime":"Dec 16, 2019 4:28:05 PM","updateTime":"Dec 16, 2019 4:30:13 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"},{"id":152,"parentId":68,"iamgeType":3,"isShow":1,"createTime":"Dec 16, 2019 4:32:18 PM","updateTime":"Dec 16, 2019 4:34:15 PM","createrId":1,"imageUrl":"https://pic.ydlcdn.com/6n5AcChhYa.png"}]
*/ */
private int id; private int id = 0;
private String specialTopicName; private String specialTopicName = "";
private int specialTopicType; private int specialTopicType = 0;
private String specialTopicTitle; private String specialTopicTitle = "";
private String specialTopicSubhead; private String specialTopicSubhead = "";
private int status; private int status = 0;
private int weight; private int weight = 0;
private int jumpWay; private int jumpWay = 0;
private String createTime; private String createTime = "";
private String updateTime; private String updateTime = "";
private int createrId; private int createrId = 0;
private String specialTopicUrl; private String specialTopicUrl = "";
private List<TopicImagesBean> topicImages; private List<TopicImagesBean> topicImages;
public int getId() { public int getId() {
...@@ -150,14 +150,14 @@ public class ExpertSearchRecommandBean { ...@@ -150,14 +150,14 @@ public class ExpertSearchRecommandBean {
* imageUrl : https://pic.ydlcdn.com/6n5AcChhYa.png * imageUrl : https://pic.ydlcdn.com/6n5AcChhYa.png
*/ */
private int id; private int id = 0;
private int parentId; private int parentId = 0;
private int imageType; private int imageType = 0;
private int isShow; private int isShow = 0;
private String createTime; private String createTime = "";
private String updateTime; private String updateTime = "";
private int createrId; private int createrId = 0;
private String imageUrl; private String imageUrl = "";
public int getId() { public int getId() {
return id; return id;
......
...@@ -54,7 +54,6 @@ class RecommendItemView : LinearLayout { ...@@ -54,7 +54,6 @@ class RecommendItemView : LinearLayout {
layoutParams = params layoutParams = params
orientation = HORIZONTAL orientation = HORIZONTAL
setPadding(RxImageTool.dp2px(15f), RxImageTool.dp2px(9f), 0, RxImageTool.dp2px(11f))
View.inflate(mContext, R.layout.consultant_expert_search_top_item_view, this) View.inflate(mContext, R.layout.consultant_expert_search_top_item_view, this)
} }
......
...@@ -47,7 +47,8 @@ class RecommendListView : LinearLayout { ...@@ -47,7 +47,8 @@ class RecommendListView : LinearLayout {
} }
private var mContext: Context? = null private var mContext: Context? = null
private var mSceneSpecialTopicList = ArrayList<ExpertSearchRecommandBean>() // viewPager的所有item数据 private var mSceneSpecialTopicList =
ArrayList<ExpertSearchRecommandBean>() // viewPager的所有item数据
private var mViewPagerList = ArrayList<LinearLayout>() //viewPager的数据 private var mViewPagerList = ArrayList<LinearLayout>() //viewPager的数据
private var mDoctorSpecialTopicsList = ArrayList<ExpertSearchBigShotBean>() //viewPager的数据 private var mDoctorSpecialTopicsList = ArrayList<ExpertSearchBigShotBean>() //viewPager的数据
private var minHeight: Int = 0 // viewPager最小高度 private var minHeight: Int = 0 // viewPager最小高度
...@@ -84,18 +85,21 @@ class RecommendListView : LinearLayout { ...@@ -84,18 +85,21 @@ class RecommendListView : LinearLayout {
.filter { true } .filter { true }
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
mSceneSpecialTopicList.clear()
mDoctorSpecialTopicsList.clear()
itemListView.removeAllViews()
if (null != mContext) { if (null != mContext) {
if (it.sceneSpecialTopics == null || it.sceneSpecialTopics.size == 0) { if (it.sceneSpecialTopics == null || it.sceneSpecialTopics.size == 0) {
recommendViewPager.visibility = View.GONE recommendViewPager.visibility = View.GONE
recommendViewPagerIndicator.visibility = View.GONE recommendViewPagerIndicator.visibility = View.GONE
}else { } else {
mSceneSpecialTopicList.addAll(it.sceneSpecialTopics) mSceneSpecialTopicList.addAll(it.sceneSpecialTopics)
recommendViewPager.visibility = View.VISIBLE recommendViewPager.visibility = View.VISIBLE
recommendViewPagerIndicator.visibility = View.VISIBLE recommendViewPagerIndicator.visibility = View.VISIBLE
} }
if (it.doctorSpecialTopics == null || it.doctorSpecialTopics.size == 0) { if (it.doctorSpecialTopics == null || it.doctorSpecialTopics.size == 0) {
itemListView.visibility = View.GONE itemListView.visibility = View.GONE
}else { } else {
mDoctorSpecialTopicsList.addAll(it.doctorSpecialTopics) mDoctorSpecialTopicsList.addAll(it.doctorSpecialTopics)
itemListView.visibility = View.VISIBLE itemListView.visibility = View.VISIBLE
} }
...@@ -129,10 +133,12 @@ class RecommendListView : LinearLayout { ...@@ -129,10 +133,12 @@ class RecommendListView : LinearLayout {
private fun initViewPager() { private fun initViewPager() {
mContext?.let { mContext?.let {
mViewPagerList.clear()
/** /**
* 渲染第一页数据 * 渲染第一页数据
*/ */
val firstPagerHeight = RxImageTool.dp2px(60f * (getMinData(mSceneSpecialTopicList.size + 1, 4 + 1) / 2)) val firstPagerHeight =
RxImageTool.dp2px(60f * (getMinData(mSceneSpecialTopicList.size + 1, 4 + 1) / 2))
val firstPager = getLinearLayout( val firstPager = getLinearLayout(
mContext!!, mContext!!,
firstPagerHeight, VERTICAL firstPagerHeight, VERTICAL
...@@ -141,11 +147,17 @@ class RecommendListView : LinearLayout { ...@@ -141,11 +147,17 @@ class RecommendListView : LinearLayout {
val ll = getLinearLayout(mContext!!, RxImageTool.dp2px(60f), HORIZONTAL) val ll = getLinearLayout(mContext!!, RxImageTool.dp2px(60f), HORIZONTAL)
val item = RecommendItemView(mContext!!) val item = RecommendItemView(mContext!!)
item.setPadding(RxImageTool.dp2px(15f), RxImageTool.dp2px(9f), RxImageTool.dp2px(15f), RxImageTool.dp2px(11f))
item.setData(mSceneSpecialTopicList[index]) item.setData(mSceneSpecialTopicList[index])
ll.addView(item) ll.addView(item)
if (index + 1 < mSceneSpecialTopicList.size) { if (index + 1 < mSceneSpecialTopicList.size) {
val item1 = RecommendItemView(mContext!!) val item1 = RecommendItemView(mContext!!)
item1.setData(mSceneSpecialTopicList[index])
item1.setPadding(0, RxImageTool.dp2px(9f), RxImageTool.dp2px(15f), RxImageTool.dp2px(11f))
item1.setData(mSceneSpecialTopicList[index + 1])
ll.addView(item1) ll.addView(item1)
} }
firstPager.addView(ll) firstPager.addView(ll)
...@@ -155,7 +167,8 @@ class RecommendListView : LinearLayout { ...@@ -155,7 +167,8 @@ class RecommendListView : LinearLayout {
/** /**
* 渲染第二页数据 * 渲染第二页数据
*/ */
val secondPagerHeight = RxImageTool.dp2px(60f * ((mSceneSpecialTopicList.size - 4 + 1) / 2)) val secondPagerHeight =
RxImageTool.dp2px(60f * ((mSceneSpecialTopicList.size - 4 + 1) / 2))
maxHeight = secondPagerHeight + RxImageTool.dp2px(11f) maxHeight = secondPagerHeight + RxImageTool.dp2px(11f)
if (mSceneSpecialTopicList.size > 4) { if (mSceneSpecialTopicList.size > 4) {
val secondPager = getLinearLayout( val secondPager = getLinearLayout(
...@@ -166,11 +179,17 @@ class RecommendListView : LinearLayout { ...@@ -166,11 +179,17 @@ class RecommendListView : LinearLayout {
val ll = getLinearLayout(mContext!!, RxImageTool.dp2px(60f), HORIZONTAL) val ll = getLinearLayout(mContext!!, RxImageTool.dp2px(60f), HORIZONTAL)
val item = RecommendItemView(mContext!!) val item = RecommendItemView(mContext!!)
item.setPadding(RxImageTool.dp2px(15f), RxImageTool.dp2px(9f), RxImageTool.dp2px(15f), RxImageTool.dp2px(11f))
item.setData(mSceneSpecialTopicList[index]) item.setData(mSceneSpecialTopicList[index])
ll.addView(item) ll.addView(item)
if (index + 1 < mSceneSpecialTopicList.size) { if (index + 1 < mSceneSpecialTopicList.size) {
val item1 = RecommendItemView(mContext!!) val item1 = RecommendItemView(mContext!!)
item1.setData(mSceneSpecialTopicList[index])
item1.setPadding(0, RxImageTool.dp2px(9f), RxImageTool.dp2px(15f), RxImageTool.dp2px(11f))
item1.setData(mSceneSpecialTopicList[index + 1])
ll.addView(item1) ll.addView(item1)
} }
secondPager.addView(ll) secondPager.addView(ll)
...@@ -180,7 +199,12 @@ class RecommendListView : LinearLayout { ...@@ -180,7 +199,12 @@ class RecommendListView : LinearLayout {
recommendViewPager.adapter = RecommendViewPagerAdapter() recommendViewPager.adapter = RecommendViewPagerAdapter()
recommendViewPager.currentItem = 0 recommendViewPager.currentItem = 0
if (mSceneSpecialTopicList.size < 4) {
recommendViewPagerIndicator.visibility = View.GONE
} else {
setSelectedIndex(0) // 默认为左边选中 setSelectedIndex(0) // 默认为左边选中
}
addListener() addListener()
} }
...@@ -313,7 +337,11 @@ class RecommendListView : LinearLayout { ...@@ -313,7 +337,11 @@ class RecommendListView : LinearLayout {
} }
mDoctorSpecialTopicsList.size == 3 -> { mDoctorSpecialTopicsList.size == 3 -> {
val mView = BigShotThreeView(mContext!!) val mView = BigShotThreeView(mContext!!)
mView.setUrl(mDoctorSpecialTopicsList[0], mDoctorSpecialTopicsList[1], mDoctorSpecialTopicsList[2]) mView.setUrl(
mDoctorSpecialTopicsList[0],
mDoctorSpecialTopicsList[1],
mDoctorSpecialTopicsList[2]
)
itemListView.addView(mView) itemListView.addView(mView)
} }
mDoctorSpecialTopicsList.size == 4 -> { mDoctorSpecialTopicsList.size == 4 -> {
...@@ -335,7 +363,11 @@ class RecommendListView : LinearLayout { ...@@ -335,7 +363,11 @@ class RecommendListView : LinearLayout {
mView.layoutParams = params mView.layoutParams = params
val mView1 = BigShotTwoView(mContext!!) val mView1 = BigShotTwoView(mContext!!)
mView.setUrl(mDoctorSpecialTopicsList[0], mDoctorSpecialTopicsList[1], mDoctorSpecialTopicsList[2]) mView.setUrl(
mDoctorSpecialTopicsList[0],
mDoctorSpecialTopicsList[1],
mDoctorSpecialTopicsList[2]
)
mView1.setUrl(mDoctorSpecialTopicsList[3], mDoctorSpecialTopicsList[4]) mView1.setUrl(mDoctorSpecialTopicsList[3], mDoctorSpecialTopicsList[4])
itemListView.addView(mView) itemListView.addView(mView)
itemListView.addView(mView1) itemListView.addView(mView1)
...@@ -347,8 +379,16 @@ class RecommendListView : LinearLayout { ...@@ -347,8 +379,16 @@ class RecommendListView : LinearLayout {
mView.layoutParams = params mView.layoutParams = params
val mView1 = BigShotThreeView(mContext!!) val mView1 = BigShotThreeView(mContext!!)
mView.setUrl(mDoctorSpecialTopicsList[0], mDoctorSpecialTopicsList[1], mDoctorSpecialTopicsList[2]) mView.setUrl(
mView1.setUrl(mDoctorSpecialTopicsList[3], mDoctorSpecialTopicsList[4], mDoctorSpecialTopicsList[5]) mDoctorSpecialTopicsList[0],
mDoctorSpecialTopicsList[1],
mDoctorSpecialTopicsList[2]
)
mView1.setUrl(
mDoctorSpecialTopicsList[3],
mDoctorSpecialTopicsList[4],
mDoctorSpecialTopicsList[5]
)
itemListView.addView(mView) itemListView.addView(mView)
itemListView.addView(mView1) itemListView.addView(mView1)
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
android:gravity="left|top" android:gravity="left|top"
android:text="标题" android:text="标题"
android:textSize="14dp" android:textSize="14dp"
android:maxLines="1"
android:textColor="#242424" android:textColor="#242424"
android:textStyle="bold"/> android:textStyle="bold"/>
...@@ -41,6 +42,7 @@ ...@@ -41,6 +42,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="left|top" android:gravity="left|top"
android:text="我是描述" android:text="我是描述"
android:maxLines="1"
android:textSize="11dp" android:textSize="11dp"
android:textColor="#999999"/> android:textColor="#999999"/>
</LinearLayout> </LinearLayout>
......
package com.yidianling.consultant.constants package com.yidianling.home.constants
/** /**
* Created by xj on 2019/7/1. * Created by xj on 2019/7/1.
......
...@@ -28,7 +28,7 @@ import com.ydl.ydlcommon.utils.Utils ...@@ -28,7 +28,7 @@ import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.dialog.CommonDialog import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.consultant.constants.HomeBIConstants import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.api.event.HomeModuleTabEvent import com.yidianling.home.api.event.HomeModuleTabEvent
import com.yidianling.home.constract.IHomeContract import com.yidianling.home.constract.IHomeContract
......
...@@ -24,6 +24,7 @@ import com.yidianling.consultant.api.IConsultantService ...@@ -24,6 +24,7 @@ import com.yidianling.consultant.api.IConsultantService
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.adapter.YdlHomeAdapter import com.yidianling.home.adapter.YdlHomeAdapter
import com.yidianling.home.constract.IHomeContract import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.dialog.ActivityDialog import com.yidianling.home.dialog.ActivityDialog
import com.yidianling.home.dialog.ActivityGuideDialog import com.yidianling.home.dialog.ActivityGuideDialog
import com.yidianling.home.event.HomeImpl import com.yidianling.home.event.HomeImpl
...@@ -39,6 +40,7 @@ import kotlinx.android.synthetic.xlzx.home_layout_home_module_head_bg.* ...@@ -39,6 +40,7 @@ import kotlinx.android.synthetic.xlzx.home_layout_home_module_head_bg.*
import kotlinx.android.synthetic.xlzx.home_layout_home_module_input.* import kotlinx.android.synthetic.xlzx.home_layout_home_module_input.*
import kotlinx.android.synthetic.xlzx.home_layout_home_module_toolbar.* import kotlinx.android.synthetic.xlzx.home_layout_home_module_toolbar.*
/** /**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a> * @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 壹点灵首页fragment * @描述: 壹点灵首页fragment
...@@ -63,10 +65,12 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -63,10 +65,12 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
* tablayou上次选中的tab下标 * tablayou上次选中的tab下标
*/ */
private var confideLastSelectPosition = 0 private var confideLastSelectPosition = 0
private var confideLastSelectType = ""
/** /**
* 咨询tablayout上次选中的西边 * 咨询tablayout上次选中的西边
*/ */
private var consultLastSelectPosition = 0 private var consultLastSelectPosition = 0
private var consultLastSelectType= ""
/** /**
* 悬浮tablayout监听事件 * 悬浮tablayout监听事件
*/ */
...@@ -177,11 +181,13 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -177,11 +181,13 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
*/ */
override fun getConfideData(type: String, selectPosition: Int) { override fun getConfideData(type: String, selectPosition: Int) {
confideLastSelectPosition = selectPosition confideLastSelectPosition = selectPosition
confideLastSelectType = type
mPresenter?.getConfideData(type, selectPosition) mPresenter?.getConfideData(type, selectPosition)
} }
override fun getConsultData(type: String, selectPosition: Int) { override fun getConsultData(type: String, selectPosition: Int) {
consultLastSelectPosition = selectPosition consultLastSelectPosition = selectPosition
consultLastSelectType = type
mPresenter?.getConsultData(type, selectPosition) mPresenter?.getConsultData(type, selectPosition)
} }
...@@ -261,6 +267,13 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -261,6 +267,13 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
//每次全局更新后重置下标位 //每次全局更新后重置下标位
confideLastSelectPosition = 0 confideLastSelectPosition = 0
consultLastSelectPosition = 0 consultLastSelectPosition = 0
for (bean in list) {
//咨询模块
if (bean.type == YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW) {
consultLastSelectType = bean.headerBean!!.consultCategoryData!![0].id.toString()
}
}
} }
private fun initHeader(list: MutableList<HomePagerDataBean>) { private fun initHeader(list: MutableList<HomePagerDataBean>) {
...@@ -388,7 +401,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -388,7 +401,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
if (userVisibleHint) { if (userVisibleHint) {
mPresenter?.loadHomeData()
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
mPresenter?.prepareCoupon(activity) mPresenter?.prepareCoupon(activity)
//走咨询助理浮层展示逻辑,是否展示由内部条件与接口判断 //走咨询助理浮层展示逻辑,是否展示由内部条件与接口判断
......
...@@ -134,7 +134,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent: ...@@ -134,7 +134,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
ContextCompat.getDrawable(context, R.drawable.home_consult_chat_rest_bg) ContextCompat.getDrawable(context, R.drawable.home_consult_chat_rest_bg)
} }
tv_consult_chat.setOnClickListener { tv_consult_chat.setOnClickListener {
homeEvent!!.consultChatClick(bodyBean.doctorUid.toString()) homeEvent!!.consultChatClick(bodyBean.uid.toString())
} }
} }
......
...@@ -23,7 +23,7 @@ import com.ydl.ydlcommon.utils.StatusBarUtils ...@@ -23,7 +23,7 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.api.IConsultantService import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.constants.HomeBIConstants import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.adapter.YdlHomeAdapter import com.yidianling.home.adapter.YdlHomeAdapter
import com.yidianling.home.constract.IHomeContract import com.yidianling.home.constract.IHomeContract
...@@ -294,7 +294,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -294,7 +294,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
consultLastSelectPosition = 0 consultLastSelectPosition = 0
//初始化fragment中的tablayout布局,悬停效果使用 //初始化fragment中的tablayout布局,悬停效果使用
for (bean in list) { for (bean in list) {
//倾述模块 //咨询模块
if (bean.type == YdlHomeViewHolderConstract.PAGER_BANNER_VIEW) { if (bean.type == YdlHomeViewHolderConstract.PAGER_BANNER_VIEW) {
initTabLayout(bean.headerBean!!.listenCategoryDate) initTabLayout(bean.headerBean!!.listenCategoryDate)
initConsultTabLayout(bean.headerBean!!.consultCategoryData) initConsultTabLayout(bean.headerBean!!.consultCategoryData)
......
...@@ -5,14 +5,14 @@ import android.text.TextUtils ...@@ -5,14 +5,14 @@ import android.text.TextUtils
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.FrameLayout import android.widget.FrameLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConsultBean
import com.ydl.ydl_image.config.SimpleImageOpConfiger import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.utils.StringUtils import com.ydl.ydlcommon.utils.StringUtils
import com.ydl.ydlcommon.utils.URLUtils import com.ydl.ydlcommon.utils.URLUtils
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeConsultBean
import kotlinx.android.synthetic.ydl.home_consult_item_view.view.* import kotlinx.android.synthetic.ydl.home_consult_item_view.view.*
/** /**
...@@ -113,7 +113,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent: ...@@ -113,7 +113,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
*/ */
private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) { private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) {
tv_consult_chat.setOnClickListener { tv_consult_chat.setOnClickListener {
homeEvent!!.consultChatClick(bodyBean.doctorUid.toString()) homeEvent!!.consultChatClick(bodyBean.uid.toString())
} }
} }
......
...@@ -11,7 +11,7 @@ import android.view.animation.DecelerateInterpolator ...@@ -11,7 +11,7 @@ import android.view.animation.DecelerateInterpolator
import android.view.animation.TranslateAnimation import android.view.animation.TranslateAnimation
import android.widget.LinearLayout import android.widget.LinearLayout
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.consultant.constants.HomeBIConstants import com.yidianling.home.constants.HomeBIConstants
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeHeaderBean import com.yidianling.home.model.bean.HomeHeaderBean
......
...@@ -24,7 +24,7 @@ modular { ...@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl" groupId = "com.ydl"
artifactId = "m-im-api" artifactId = "m-im-api"
//开发时注释掉版本号,发布api时打开 //开发时注释掉版本号,发布api时打开
// version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"] version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖 // API 层打包时需要引入的依赖
apiDependencies { apiDependencies {
implementation "com.google.code.gson:gson:2.8.2" implementation "com.google.code.gson:gson:2.8.2"
......
...@@ -58,7 +58,7 @@ public class MsgReceiveHelper { ...@@ -58,7 +58,7 @@ public class MsgReceiveHelper {
int sum = 0; int sum = 0;
for (int i=0;i<list.length;i++) { for (int i=0;i<list.length;i++) {
try { try {
sum += Integer.parseInt(list[0].toString()); sum += Integer.parseInt(list[i].toString());
}catch (Exception e) { }catch (Exception e) {
sum += 0; sum += 0;
} }
......
...@@ -59,7 +59,7 @@ class NewMultiMessageFragment : BaseFragment() { ...@@ -59,7 +59,7 @@ class NewMultiMessageFragment : BaseFragment() {
} }
override fun getStatusViewOptions(): StatusBarOptions { override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true) return StatusBarOptions(isAddStatusView = true, statusBarDarkMode = true)
} }
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
......
...@@ -66,10 +66,10 @@ public class RequestLogInterceptor implements Interceptor { ...@@ -66,10 +66,10 @@ public class RequestLogInterceptor implements Interceptor {
String bodyString = null; String bodyString = null;
if (responseBody != null && isParseable(responseBody.contentType())) { if (responseBody != null && isParseable(responseBody.contentType())) {
bodyString = printResult(request, originalResponse); bodyString = printResult(request, originalResponse);
} if (mRequestHandler != null){
if (mRequestHandler != null)
mRequestHandler.onHttpResultResponse(bodyString, chain, originalResponse); mRequestHandler.onHttpResultResponse(bodyString, chain, originalResponse);
}
}
if(mIsDebug) { if(mIsDebug) {
final List<String> segmentList = request.url().encodedPathSegments(); final List<String> segmentList = request.url().encodedPathSegments();
......
...@@ -130,6 +130,7 @@ class HttpConfig { ...@@ -130,6 +130,7 @@ class HttpConfig {
chain: Interceptor.Chain, chain: Interceptor.Chain,
response: Response response: Response
): Response { ): Response {
try {
val gson = GsonProvider.getGson() val gson = GsonProvider.getGson()
val resultData= gson.fromJson(httpResult, BaseAPIResponse::class.java) val resultData= gson.fromJson(httpResult, BaseAPIResponse::class.java)
when (resultData.code) { when (resultData.code) {
...@@ -143,6 +144,9 @@ class HttpConfig { ...@@ -143,6 +144,9 @@ class HttpConfig {
} }
} }
} }
} catch (e: Exception) {
LogUtil.e("getRequestHandler:$e")
}
return response return response
} }
......
...@@ -45,8 +45,13 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att ...@@ -45,8 +45,13 @@ class MoreClickView @JvmOverloads constructor(private val mContext: Context, att
msg_new.setVisibility(View.INVISIBLE) msg_new.setVisibility(View.INVISIBLE)
}*/ }*/
un_read_num.text = ModularServiceManager.provide(IImService::class.java).getAllUnReadNum().toString() var unreadNum = ModularServiceManager.provide(IImService::class.java).getAllUnReadNum()
if (unreadNum <= 0) {
un_read_num.visibility = View.GONE
}
else {
un_read_num.text = unreadNum.toString()
}
} }
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
android:id="@+id/un_read_num" android:id="@+id/un_read_num"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="14dp" android:layout_height="14dp"
android:minWidth="14dp"
android:textSize="10dp" android:textSize="10dp"
tools:text="10" tools:text="10"
android:textColor="#ffffff" android:textColor="#ffffff"
......
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