Commit 7b60266b by 徐健

home

parent 370deb0b
......@@ -175,7 +175,6 @@ dependencies {
api rootProject.ext.dependencies["butterknife"]
kapt rootProject.ext.dependencies["butterknife-compiler"]
if (true) {
//开发模式
implementation fileTree(dir: 'aars', include: ['*.aar'])
......@@ -186,6 +185,9 @@ dependencies {
implementation modularPublication('com.ydl:m-consultant-api')
api project(':m-confide')
implementation project(':m-home')
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
......@@ -198,6 +200,7 @@ dependencies {
implementation project(':ydl-media')
implementation project(':m-muse')
......
......@@ -57,6 +57,12 @@
<data android:scheme="tencent1105070461" />
</intent-filter>
</activity>
<activity
android:name=".home.HomeActivity"
android:launchMode="singleTask"
android:noHistory="true">
</activity>
</application>
</manifest>
\ No newline at end of file
......@@ -132,6 +132,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
ARouter.getInstance().build("/course/home")
.navigation()
}
bt_to_home.setOnClickListener {
}
}
......
package com.ydl.component.home
import com.ydl.component.R
import com.ydl.ydlcommon.base.BaseActivity
class HomeActivity: BaseActivity() {
override fun layoutResId(): Int {
return R.layout.activity_home
}
override fun initDataAndEvent() {
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<fragment
android:id="@+id/home_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
\ No newline at end of file
......@@ -151,6 +151,26 @@
android:text="课程" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingLeft="40dp"
android:paddingRight="40dp"
android:paddingBottom="20dp">
<Button
android:id="@+id/bt_to_home"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginRight="10dp"
android:text="首页" />
</LinearLayout>
</LinearLayout>
<com.ydl.ydlcommon.mvp.lce.view.YDLStateView
......
......@@ -19,14 +19,14 @@ buildscript {
google()
//壹点灵android maven私服 开发版
mave n{
maven{
url 'http://nexus.yidianling.com/repository/AndroidRepository/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
mave n{
maven{
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
credentials {
username "admin"
......@@ -34,7 +34,7 @@ buildscript {
}
}
mave n{ url 'http://maven.aliyun.com/nexus/content/groups/public/ '}
// maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/ '}
maven {
url 'https://dl.bintray.com/zouyuhan/maven'
......@@ -65,21 +65,21 @@ buildscript {
allprojects {
repositories {
//壹点灵android maven私服 开发版
mave n{
maven{
url 'http://nexus.yidianling.com/repository/AndroidRepository/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
mave n{
maven{
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
mave n{ url 'http://maven.aliyun.com/nexus/content/groups/public/ '}
// maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/ '}
// maven { url'http://developer.huawei.com/repo/' }
maven { url "https://jitpack.io" }
maven {
......
ext {
kotlin_version = "1.3.21"
dev_mode = false
dev_mode = true
ydl_app = [
appName : "心理咨询壹点灵",
......@@ -47,6 +47,7 @@ ext {
"m-consultant" : "0.0.44",
"m-fm" : "0.0.21",
"m-user" : "0.0.37",
"m-home" : "0.0.1",
"m-muse" : "0.0.19.5",
"m-tests" : "0.0.13.5",
......
......@@ -58,23 +58,25 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.airbnb.android:lottie:2.5.0"
implementation "com.alibaba:arouter-api:$arouter_api"
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){
//开发时使用
api "com.ydl:m-consultant-api:0.0.3"
api "com.ydl:m-user-api:0.0.7"
implementation project(':ydl-webview')
api project(":ydl-platform")
implementation project(':ydl-media')
implementation project(':ydl-flutter-base')
} else {
//发布时使用
api rootProject.ext.dependencies["ydl-media"]
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
implementation rootProject.ext.dependencies["ydl-flutter-base"]
}
}
modular {
//模块包名
packageName "com.yidianling.home"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-home-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
ydl{
groupId = "com.ydl"
artifactId = "m-home-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = rootProject.ext.ydlPublishVersion[childProject.getName()]
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-home-api"
//开发时注释掉版本号,发布api时打开
//version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
[{"headerBean":{"askCategoryData":[{"cateId":1,"cateTitle":"恋爱咨询","coverUrl":"https://img.ydlcdn.com/file/2018/08/14/eusz6pcbf8zaou1e.png","url":"https://h2.yidianling.com/experts/search?cat\u003d1\u0026"},{"cateId":1,"cateTitle":"婚姻咨询","coverUrl":"https://img.ydlcdn.com/file/2018/08/14/35kd8ih9fiwgv16r.png","url":"https://h2.yidianling.com/experts/search?cat\u003d27\u0026"},{"cateId":23,"cateTitle":"亲子教育","coverUrl":"https://img.ydlcdn.com/file/2018/09/05/09mwdfydytsdg1gt.png","url":"https://h2.yidianling.com/experts/search?cat\u003d23\u0026"},{"cateId":25,"cateTitle":"人际关系","coverUrl":"https://img.ydlcdn.com/file/2018/08/14/d6xi5o3ii3lsy4yr.png","url":"https://h2.yidianling.com/experts/search?cat\u003d25\u0026"},{"cateId":27,"cateTitle":"情绪压力","coverUrl":"https://img.ydlcdn.com/file/2018/08/14/no02u0gfo1kgzt8y.png","url":"https://h2.yidianling.com/experts/search?cat\u003d27\u0026"},{"cateId":22,"cateTitle":"职场心理","coverUrl":"https://img.ydlcdn.com/file/2018/08/14/ra5tbfuo05upjl66.png","url":"https://h2.yidianling.com/experts/search?cat\u003d22\u0026"},{"cateId":26,"cateTitle":"个人成长","coverUrl":"https://img.ydlcdn.com/file/2018/09/05/ge29bumccrtykv9r.png","url":"https://h2.yidianling.com/experts/search?cat\u003d26\u0026"},{"cateId":229,"cateTitle":"法律咨询","coverUrl":"https://img.ydlcdn.com/file/2019/04/02/ofb8othapbpkb6zx.png","url":"https://h2.yidianling.com/experts/search?cat\u003d229\u0026"},{"cateId":1,"cateTitle":"情感挽回","coverUrl":"https://img.ydlcdn.com/file/2019/04/03/7zhoecx4amc23gah.png","url":"https://h2.yidianling.com/experts/search?cat\u003d27\u0026"},{"cateId":0,"cateTitle":"全部","coverUrl":"https://img.ydlcdn.com/file/2018/08/14/xoo4q3k6irtrhsjc.png","url":"https://h2.yidianling.com/experts/cates"}],"consultCategoryData":[{"id":1,"name":"恋爱咨询"},{"id":1,"name":"婚姻咨询"},{"id":23,"name":"亲子教育"},{"id":25,"name":"人际关系"},{"id":27,"name":"情绪压力"},{"id":22,"name":"职场心理"},{"id":26,"name":"个人成长"}],"doctorName":"","focusList":[{"focId":11405,"imageIphonex":"https://img.ydlcdn.com/file/2019/05/22/b4wgh83z4tr962a0.jpg","imageUrl":"https://img.ydlcdn.com/file/2019/05/22/7z7mzwfnx7zp6ke5.jpg","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fl.yidianling.com%2Fp%2Fq%2Fjvyux2jq%22%7D","shareData":{"title":"钟媛媛 明星咨询师推荐","cover":"https://img.ydlcdn.com/file/2019/05/22/7z7mzwfnx7zp6ke5.jpg","desc":"","shareUrl":""},"title":"钟媛媛 明星咨询师推荐"},{"focId":11284,"imageIphonex":"https://img.ydlcdn.com/file/2019/05/17/3wyxa3dqzrrxdema.png","imageUrl":"https://img.ydlcdn.com/file/2019/05/17/jmtc5w1jzzk77hva.png","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fl.yidianling.com%2Fp%2Fq%2Fjtnzsdmg%22%7D","shareData":{"title":"人气咨询师排行榜-壹点灵","cover":"https://img.ydlcdn.com/file/2019/05/17/jmtc5w1jzzk77hva.png","desc":"","shareUrl":""},"title":"人气咨询师排行榜-壹点灵"},{"focId":11130,"imageIphonex":"https://img.ydlcdn.com/file/2019/05/09/eije5jwiyjcyyub6.png","imageUrl":"https://img.ydlcdn.com/file/2019/05/09/5cwmsbzfydshzh92.png","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fl.yidianling.com%2Fp%2Fq%2Fydlaplus1%22%7D","shareData":{"title":"A++融资公告","cover":"https://img.ydlcdn.com/file/2019/05/09/5cwmsbzfydshzh92.png","desc":"","shareUrl":""},"title":"A++融资公告"},{"focId":10853,"imageIphonex":"https://img.ydlcdn.com/file/2019/04/24/pgx73v43ty9zzcn0.png","imageUrl":"https://img.ydlcdn.com/file/2019/04/24/synob5zlakccjcb5.png","linkUrl":"ydl-user://h5/confide?params\u003d%7b%22url%22%3a%22https%3a%2f%2fwebapp2.ydl.com%2factivity%2flisten%2fcoupon%22%7d","shareData":{"title":"128元倾诉新用户活动","cover":"https://img.ydlcdn.com/file/2019/04/24/synob5zlakccjcb5.png","desc":"","shareUrl":""},"title":"128元倾诉新用户活动"},{"focId":10730,"imageIphonex":"https://img.ydlcdn.com/file/2019/04/11/str4mvjunwuul5lq.png","imageUrl":"https://img.ydlcdn.com/file/2019/04/11/jluqy3kasv2fl63b.png","linkUrl":"ydl-user://h5/confide?params\u003d%7b%22url%22%3a%22https%3a%2f%2fh5.ydl.com%2fconfideMatch%22%7d","shareData":{"title":"一键倾诉","cover":"https://img.ydlcdn.com/file/2019/04/11/jluqy3kasv2fl63b.png","desc":"","shareUrl":""},"title":"一键倾诉"},{"focId":10131,"imageIphonex":"https://img.ydlcdn.com/file/2019/04/24/bedrm9rjwflt2vhd.png","imageUrl":"https://img.ydlcdn.com/file/2019/04/24/6n2pb6n6ctipmvux.png","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fwebapp.ydl.com%2Ffe-app-yidianling%2Fcourse%2Fdetail%2F2757%22%7D","shareData":{"title":"【重磅课程】丁Sir说挽回:像心理学家一样去挽回","cover":"https://img.ydlcdn.com/file/2019/04/24/6n2pb6n6ctipmvux.png","desc":"","shareUrl":""},"title":"【重磅课程】丁Sir说挽回:像心理学家一样去挽回"},{"focId":906,"imageIphonex":"https://img.ydlcdn.com/file/2019/01/30/xt55wf76k13c8qb6.png","imageUrl":"https://img.ydlcdn.com/file/2019/01/30/gvca1sh5xg5ao85w.png","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fct%2Flist%3F%22%7D","shareData":{"title":"免费体验","cover":"https://img.ydlcdn.com/file/2019/01/30/gvca1sh5xg5ao85w.png","desc":"","shareUrl":"https://h2.yidianling.com/ct/list?"},"title":"免费体验"},{"focId":11519,"imageIphonex":"https://img.ydlcdn.com/file/2019/05/27/dc09x8zkkbhyfc21.png","imageUrl":"https://img.ydlcdn.com/file/2019/05/27/v5k0yg761a8qxv25.png","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fl.yidianling.com%2Fp%2Fq%2Fzhiyeceshi%22%7D","shareData":{"title":"职场晋升攻略","cover":"https://img.ydlcdn.com/file/2019/05/27/v5k0yg761a8qxv25.png","desc":"","shareUrl":""},"title":"职场晋升攻略"},{"focId":11133,"imageIphonex":"https://img.ydlcdn.com/file/2019/05/15/bojyl3stwslfgct0.png","imageUrl":"https://img.ydlcdn.com/file/2019/05/15/o5cpxtbgpxv6a7ry.png","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fwjwlkj.wjx.cn%2Fjq%2F39247133.aspx%22%7D","shareData":{"title":"亲密关系问卷","cover":"https://img.ydlcdn.com/file/2019/05/15/o5cpxtbgpxv6a7ry.png","desc":"","shareUrl":""},"title":"亲密关系问卷"},{"focId":9714,"imageIphonex":"https://img.ydlcdn.com/file/2019/04/05/73s6p5r7zk7u6b4u.png","imageUrl":"https://img.ydlcdn.com/file/2019/04/05/1agqihpp9o8w276v.png","linkUrl":"ydl-user://h5/h5?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fwebapp.ydl.com%2Ffe-app-yidianling%2Fcourse%2Fdetail%2F3029%22%7D","shareData":{"title":"【【新课推荐】读心术,读懂你的另一半","cover":"https://img.ydlcdn.com/file/2019/04/05/1agqihpp9o8w276v.png","desc":"","shareUrl":""},"title":"【【新课推荐】读心术,读懂你的另一半"}],"homeSaleData":[{"contentAfter":"的电话倾诉","contentBefore":"刚刚","createTime":"May 27, 2019 5:19:30 PM","doctorId":4422,"doctorName":"段宁","nickName":"y**","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F4422%22%7D"},{"contentAfter":"的电话倾诉","contentBefore":"刚刚","createTime":"May 27, 2019 5:22:23 PM","doctorId":9295,"doctorName":"朱礼火","nickName":"老**","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F9295%22%7D"},{"contentAfter":"的电话倾诉","contentBefore":"刚刚","createTime":"May 27, 2019 5:30:15 PM","doctorId":5954,"doctorName":"吴杰","nickName":"","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F5954%22%7D"},{"contentAfter":"的电话倾诉","contentBefore":"刚刚","createTime":"May 27, 2019 5:34:51 PM","doctorId":1261,"doctorName":"吴立秀","nickName":"M**","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F1261%22%7D"},{"contentAfter":"的电话倾诉","contentBefore":"刚刚","createTime":"May 27, 2019 5:34:53 PM","doctorId":10330,"doctorName":"徐听","nickName":"","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F10330%22%7D"}],"keywordData":[{"id":5,"keyword":"性心理","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E6%80%A7%26%22%7D"},{"id":2,"keyword":"抑郁","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E6%8A%91%E9%83%81%26%22%7D"},{"id":3,"keyword":"焦虑","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E7%84%A6%E8%99%91%26%22%7D"},{"id":4,"keyword":"婚姻挽回","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E5%A9%9A%E5%A7%BB%26%22%7D"},{"id":8,"keyword":"早恋","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E6%97%A9%E6%81%8B%26%22%7D"},{"id":6,"keyword":"同性恋","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E5%90%8C%E6%80%A7%E6%81%8B%26%22%7D"},{"id":7,"keyword":"出轨","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E5%87%BA%E8%BD%A8%26%22%7D"},{"id":1,"keyword":"失恋","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch%3Fsearch_word%3D%E6%81%8B%26%22%7D"},{"id":9,"keyword":"情感修复","url":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2Fsearch2%3Fsearch_word%3D%E6%83%85%E6%84%9F%E4%BF%AE%E5%A4%8D%26%22%7D"}],"listenCategoryDate":[{"id":1,"name":"恋爱"},{"id":2,"name":"婚姻家庭"},{"id":3,"name":"陪聊治愈"},{"id":4,"name":"情绪压力"},{"id":5,"name":"亲子教育"},{"id":7,"name":"职业"},{"id":8,"name":"人际"},{"id":9,"name":"个人成长"}],"isRealEmpty":false},"type":10001},{"type":10002},{"consultBean":{"endRow":3,"isHasNextPage":false,"isHasPreviousPage":false,"isIsFirstPage":false,"isIsLastPage":false,"list":[{"city":"唐山","doctorHead":"https://img.ydlcdn.com/file/2019/05/10/vw6sx2i72exvbr95.jpg!s120x120","doctorId":1261,"doctorName":"吴立秀","doctorUid":49874,"feedbackRate":99.8,"hUrl":"https://h2.yidianling.com/experts/1261","isOnline":1,"mUrl":"https://m.ydl.com/experts/1261","profesBack":"二级心理咨询师\r\n三级心理咨询师\r\n壹点灵签约心理咨询师\r\n中科院心理研究所心理学研究生在读","province":"河北省","serviceFee":175,"share":{"cover":"https://img.ydlcdn.com/file/2019/05/10/vw6sx2i72exvbr95.jpg!s120x120","desc":"","shareUrl":"https://m.ydl.com/experts/1261","title":"吴立秀咨询工作室"},"tags":["恋爱情感","婚姻家庭","个人成长"],"zixunOrderNum":7978},{"city":"温州","doctorHead":"https://img.ydlcdn.com/file/2019/05/08/krzlfwzfn5h1w7wu.jpg!s120x120","doctorId":1131,"doctorName":"朱静","doctorUid":34649,"feedbackRate":99.7,"hUrl":"https://h2.yidianling.com/experts/1131","isOnline":1,"mUrl":"https://m.ydl.com/experts/1131","profesBack":"三级心理咨询师","province":"浙江省","serviceFee":250,"share":{"cover":"https://img.ydlcdn.com/file/2019/05/08/krzlfwzfn5h1w7wu.jpg!s120x120","desc":"","shareUrl":"https://m.ydl.com/experts/1131","title":"朱静咨询工作室"},"tags":["恋爱婚姻","情绪压力","人际关系"],"zixunOrderNum":7431},{"city":"苏州","doctorHead":"https://img.ydlcdn.com/file/2019/05/08/vp663mvqvf193phi.jpg!s120x120","doctorId":7387,"doctorName":"钟媛媛","doctorUid":1915807,"feedbackRate":99.9,"hUrl":"https://h2.yidianling.com/experts/7387","isOnline":1,"mUrl":"https://m.ydl.com/experts/7387","profesBack":"三级心理咨询师","province":"江苏省","serviceFee":150,"share":{"cover":"https://img.ydlcdn.com/file/2019/05/08/vp663mvqvf193phi.jpg!s120x120","desc":"","shareUrl":"https://m.ydl.com/experts/7387","title":"钟媛媛咨询工作室"},"tags":["恋爱婚姻","情绪压力","个人成长"],"zixunOrderNum":1135}],"navigateFirstPage":1,"navigateLastPage":8,"navigatePages":8,"navigatepageNums":[1,2,3,4,5,6,7,8],"nextPage":2,"pageNum":1,"pageSize":3,"pages":2034,"prePage":0,"size":3,"startRow":1,"total":6100,"isRealEmpty":false},"type":10003},{"confideBean":{"body":[{"confideAddress":"沈阳","confideConnection":"100%","confideContent":"不必失落,适合自己的人生就是最好的人生。","confideFee":"50","confideHearNum":"已聆听324次","confideLine":3,"confideNum":"324人","confidePraise":"100.0%","confideSex":2,"confideVoice":"https://img.ydlcdn.com/file/2019/02/26/0idx62mjf22q9r8y.mp3","confidedIcon":"https://img.ydlcdn.com/file/2019/05/07/pxkkwuh1pkeg80bu.jpg!s200x200","confidedId":839,"confidedName":"吴杰","confidedTag":["恋爱婚姻","家庭关系","个人成长"],"couponMoney":"0","couponText":"新用户送120元红包","doctorId":5954,"linkUrl":"https://h5.ydl.com/confideDetail?id\u003d839","status":2,"tags":"恋爱婚姻,家庭关系,个人成长","uid":1645151},{"confideAddress":"淮安","confideConnection":"100%","confideContent":"用心陪伴,用爱倾听,留下烦恼,带走轻松。","confideFee":"50","confideHearNum":"已聆听1539次","confideLine":1,"confideNum":"1539人","confidePraise":"100.0%","confideSex":2,"confideVoice":"https://video.ydlcdn.com/2017/09/11/718dbba7c20d0b4ea1dcf35b024aab51.mp3","confidedIcon":"https://img.ydlcdn.com/file/2019/05/a3646cb80aea494682c488e4c22be8fe.jpg!s200x200","confidedId":554,"confidedName":"翟曙霞","confidedTag":["80后","恋爱婚姻","情绪压力","人际关系"],"couponMoney":"0","couponText":"新用户送120元红包","doctorId":2353,"linkUrl":"https://h5.ydl.com/confideDetail?id\u003d554","status":1,"tags":"80后,恋爱婚姻,情绪压力,人际关系","uid":1085815},{"confideAddress":"","confideConnection":"100%","confideContent":"慢慢地陪着你走,慢慢地听花开的声音","confideFee":"50","confideHearNum":"已聆听272次","confideLine":1,"confideNum":"272人","confidePraise":"100.0%","confideSex":2,"confideVoice":"https://img.ydlcdn.com/file/2019/02/26/jxv0beey8ukn5jpc.mp3","confidedIcon":"https://img.ydlcdn.com/file/2019/03/30/ewaq0g790zgo6jbn.png!s200x200","confidedId":838,"confidedName":"林岚","confidedTag":["恋爱婚姻","学生成长"],"couponMoney":"0","couponText":"新用户送120元红包","doctorId":9433,"linkUrl":"https://h5.ydl.com/confideDetail?id\u003d838","status":1,"tags":"恋爱婚姻,学生成长","uid":2327655}],"diviLine":1,"type":5,"isRealEmpty":false},"type":10004},{"testListBean":[{
"recommendLinkUrl": "ydl-user://ceshi/detail?params\u003d%7B%22id%22%3A738%7D",
"id": 738,
"name": "心理健康测评-SCL90专业版",
"shareImage": "https://img.ydlcdn.com/file/2019/08/13/6yrkvyu64ak93k6b.png",
"testNum": 113011,
"hits": 355799,
"countOfResult": 20901
}, {
"recommendLinkUrl": "ydl-user://ceshi/detail?params\u003d%7B%22id%22%3A1008%7D",
"id": 1008,
"name": "出轨倾向评估",
"shareImage": "https://img.ydlcdn.com/file/2019/08/13/bs2etrpjp1ly1y5k.png",
"testNum": 44588,
"hits": 62332,
"countOfResult": 1366
}, {
"recommendLinkUrl": "ydl-user://ceshi/detail?params\u003d%7B%22id%22%3A735%7D",
"id": 735,
"name": "职场生存力评估",
"shareImage": "https://img.ydlcdn.com/file/2019/08/13/dmycr3apmz155lho.png",
"testNum": 71481,
"hits": 24380,
"countOfResult": 848
}, {
"recommendLinkUrl": "ydl-user://ceshi/detail?params\u003d%7B%22id%22%3A1119%7D",
"id": 1119,
"name": "产后抑郁症状评估(产后版)",
"shareImage": "https://img.ydlcdn.com/file/2019/04/16/wlrnn3rjib55juu1.jpg",
"testNum": 88323,
"hits": 41367,
"countOfResult": 1420
}, {
"recommendLinkUrl": "ydl-user://ceshi/detail?params\u003d%7B%22id%22%3A1278%7D",
"id": 1278,
"name": "测你是一个口是心非的人吗",
"shareImage": "https://img.ydlcdn.com/file/2018/10/30/zg3l6syyaw33mkq8.jpg",
"testNum": 12914,
"hits": 99249,
"countOfResult": 32094
}],"type":10005},{"courseBean":{"endRow":3,"isHasNextPage":false,"isHasPreviousPage":false,"isIsFirstPage":false,"isIsLastPage":false,"list":[{"applyFee":99.0,"chatLinkUri":"ydl-user://chat/private?params\u003d%7B%22toUid%22%3A2705537%2C%22userType%22%3A2%7D","consultLinkUri":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F12511%22%7D","hostConfidedId":0,"hostHead":"https://img.ydlcdn.com/file/2019/05/25/exkclexoa7ki5v5a.png","hostId":12511,"hostName":"王秀兰","hostUid":2705537,"id":3359,"isAvailable":0,"isInvite":0,"isOpenChat":1,"isOpenConsult":1,"isOpenListen":0,"isPromotion":2,"isShowHostButton":0,"joinNum":81,"listenLinkUri":"https://h2.yidianling.com/listen/detail/0","originalApplyFee":0.0,"pic":"https://img.ydlcdn.com/file/2019/05/19/36btxlb5hlnynn6j.jpg","promotionApplyFee":69.0,"readNums":2195,"shareData":{"cover":"https://img.ydlcdn.com/file/2019/05/19/36btxlb5hlnynn6j.jpg","desc":"27个沟通秘术,让夫妻沟通更顺畅","shareUrl":"https://m.ydl.com/course/3359","title":"男女沟通秘籍,让老公乖乖听话的秘密"},"title":"男女沟通秘籍,让老公乖乖听话的秘密"},{"applyFee":39.0,"chatLinkUri":"ydl-user://chat/private?params\u003d%7B%22toUid%22%3A1334422%2C%22userType%22%3A2%7D","consultLinkUri":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F4304%22%7D","hostConfidedId":0,"hostHead":"https://img.ydlcdn.com/file/2018/05/06/4ab73371ed439a0ac0920af7a6fa04af..jpg","hostId":4304,"hostName":"徐泽旭","hostUid":1334422,"id":3235,"isAvailable":0,"isInvite":0,"isOpenChat":1,"isOpenConsult":1,"isOpenListen":0,"isPromotion":2,"isShowHostButton":0,"joinNum":237,"listenLinkUri":"https://h2.yidianling.com/listen/detail/0","originalApplyFee":99.0,"pic":"https://img.ydlcdn.com/file/2019/04/25/pzehq0yiqpdc76rh.jpg","promotionApplyFee":39.0,"readNums":8909,"shareData":{"cover":"https://img.ydlcdn.com/file/2019/04/25/pzehq0yiqpdc76rh.jpg","desc":"改变负面语言模式,重塑自信人生","shareUrl":"https://m.ydl.com/course/3235","title":"自卑、胆怯、不敢说话?扭转自卑语言,重塑自信人生!"},"title":"自卑、胆怯、不敢说话?扭转自卑语言,重塑自信人生!"},{"applyFee":129.0,"chatLinkUri":"ydl-user://chat/private?params\u003d%7B%22toUid%22%3A2441930%2C%22userType%22%3A2%7D","consultLinkUri":"ydl-user://h5/consult?params\u003d%7B%22url%22%3A%22https%3A%2F%2Fh2.yidianling.com%2Fexperts%2F9945%22%7D","hostConfidedId":0,"hostHead":"https://img.ydlcdn.com/file/2018/10/10/0xcrep11r0ibykmd.png","hostId":9945,"hostName":"壹点灵|产品研究院","hostUid":2441930,"id":3174,"isAvailable":0,"isInvite":0,"isOpenChat":1,"isOpenConsult":1,"isOpenListen":0,"isPromotion":2,"isShowHostButton":0,"joinNum":337,"listenLinkUri":"https://h2.yidianling.com/listen/detail/0","originalApplyFee":299.0,"pic":"https://img.ydlcdn.com/file/2019/04/18/b3gti2nci9y5oi7a.jpg","promotionApplyFee":0.0,"readNums":3767,"shareData":{"cover":"https://img.ydlcdn.com/file/2019/04/18/b3gti2nci9y5oi7a.jpg","desc":"孩子学习不好是因为注意力不好造成的?!不不不,正确对待注意力缺失,注意力不好也能学习好!","shareUrl":"https://m.ydl.com/course/3174","title":"父母必修课—注意力不好的娃如何更好的成长"},"title":"父母必修课—注意力不好的娃如何更好的成长"}],"navigateFirstPage":1,"navigateLastPage":8,"navigatePages":8,"navigatepageNums":[1,2,3,4,5,6,7,8],"nextPage":2,"pageNum":1,"pageSize":3,"pages":21,"prePage":0,"size":3,"startRow":1,"total":63,"isRealEmpty":false},"type":10006},{"askBean":{"bannerResps":[{"bannerId":9587,"bannerImageUrl":"https://img.ydlcdn.com/file/2019/04/10/hdxv2z8s0vpslmps.jpg","bannerLinkUrl":"ydl-user://fm/list","bannerTitle":"FM"}],"data":[{"adImg":"","askTag":"家庭关系","avatar":"http://img.ydlcdn.com/v2/images/avatar_default.png","bigAttach":[],"comments":[{"answerCreateTime":"5-18 13:35","askId":397095,"content":"您好!看起来您的家庭都是靠您一个人在打理,您工作赚钱供房,还要费时费力的照顾孩子,自己为了生活为了孩子拼命地付出,而看到老公却是得过且过,不操心家庭的经济,孩子生病也不懂得照顾孩子替您分担压力,每天享受着他自己轻松的个人生活,这让独自承担家庭压力的您心态越来越失去平衡,对您老公堆积的不满情绪似乎已到了爆发的边缘,让您这段时间特别容易一点就燃,甚至产生了逃离的想法,是吗?\n\n您的问题在于对于家庭的发展计划夫妻之间似乎没有良好的沟通,没有达成共识,而你们的生活观念似乎也存在较大的差异。\n\n首先,建议您先跟您老公做一次深入的沟通,把您的情绪感受都告诉他,让他体会您的感受。但请记得,不要带着情绪去沟通,不要追究他的问题,先听听他怎么说。想想,今天的问题,是因为他结婚后变了导致的?还是双方的生活观不同,又没有及时地去相互协调而导致的?也许,他还是曾经的他,却不知道家庭生活是需要承担更多责任的。\n\n再者,两个人重新规划一下家庭的经济管理,表达需要您老公一起帮您分担压力的需求,让您老公感受到自己是被需要的人,是家庭里重要的角色。可以想象长期以来,您独自承担家庭的压力,学会放下担子,放下好强,让他一点点承担起责任来。当他有一些改变时,即使可能未尽如人意,却需要及时认可。\n\n家庭关系的维系及发展离不开夫妻沟通,而结果如何,就看你们是如何沟通的了。\n加油吧!祝福您!","doctorId":12042,"gender":2,"id":2809328,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"王文丹","time_str":"5-18 13:35","toContent":"您是好老师","toName":"富士康优尔鸿信检测中心刘天伟","uid":3208710,"userHead":"https://img.ydlcdn.com/file/2019/03/27/p6bbxzc44i93uj9f.png!s200x200","userType":2,"zan":3},{"answerCreateTime":"5-18 13:16","askId":397095,"content":"你好。心太累了就是这么个结果。易激惹、对工作和生活倦怠、想逃避是表现形式。这和老公缺位有直接关系。先给自己的心情放个假,稍事休息,其它的事有需要联系老师,老师愿意帮你分析和解决。","doctorId":11964,"gender":2,"id":2809308,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"刘晓梅","time_str":"5-18 13:16","toContent":"","toName":"","uid":3179183,"userHead":"https://img.ydlcdn.com/file/2019/03/22/7p5zdsfbbvdlrnv3.jpg!s200x200","userType":2,"zan":1},{"answerCreateTime":"今天 12:59","askId":397095,"content":"您是好老师","doctorId":0,"gender":1,"id":2824313,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"富士康优尔鸿信检测中心刘天伟","time_str":"今天 12:59","toContent":"","toName":"","uid":3646319,"userHead":"http://thirdwx.qlogo.cn/mmopen/vi_32/rh2vpwiage7hQjqJzXlvzL4X00u1TRgYUCPyUS1ZX4Pg8LcZX8ibFrRgfZB5a1jTpoDC65axChibI5RUtwicOaM7DA/132","userType":1,"zan":1},{"answerCreateTime":"5-18 13:37","askId":397095,"content":"离婚","doctorId":0,"gender":1,"id":2809336,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"一个好人","time_str":"5-18 13:37","toContent":"","toName":"","uid":3034265,"userHead":"https://img.ydlcdn.com/file/2019/02/27/a2e8665842bafe81f01f4d16d450a7e1..jpg!s200x200","userType":1,"zan":1},{"answerCreateTime":"5-18 13:05","askId":397095,"content":"面对一点儿都提供帮助的老公。你还能赚钱,带孩子,非常的辛苦,也非常的努力。真的是太不容易了。我非常佩服你。真的太辛苦了……\n这样的婚姻,很多女性早就离婚了。而你还在维持这个家庭,是什么让你坚持七年了??\n我建议您找个咨询师,好好倾述一下,梳理一下生活吧。不要一个人憋在心里……","doctorId":6915,"gender":1,"id":2809283,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"黄海龙","time_str":"5-18 13:05","toContent":"","toName":"","uid":1747729,"userHead":"https://img.ydlcdn.com/file/2019/04/24/sr7a9285def7fw1y.jpg!s200x200","userType":2,"zan":0},{"answerCreateTime":"5-18 13:07","askId":397095,"content":"理解你的不容易 一个人扛了家里所有的压力和责任 老公一开始就这样毫无担当还是后来变成这样的呢\n\n当前的情况 家里生存是首位 至少你跟孩子要生存 努力工作不是为你的老公 而是为你和你孩子 也让自己拥有选择的权利\n\n对于老公的情况 需要跟他严肃冷静的沟通 他需要承担属于他的责任","doctorId":9485,"gender":2,"id":2809290,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"赵承凤","time_str":"5-18 13:07","toContent":"","toName":"","uid":1682980,"userHead":"https://img.ydlcdn.com/file/2018/09/14/38wajp3kgq3e0wwf.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"5-18 13:30","askId":397095,"content":"你真的承担了很多,而你的老公与其说是你的伴侣,更像是你另外一个孩子。但在感情的双人舞之中,没有绝对的对与错,拍子是你们一起配合着跳的。婚姻关系也是自己内心关系的一个折射,你需要彻底的梳理和调整,才能更好地让这段关系往健康、滋养的方向发展,自己也能更轻松,更被理解和支持。","doctorId":4226,"gender":2,"id":2809321,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"黄柳玥","time_str":"5-18 13:30","toContent":"","toName":"","uid":1271193,"userHead":"https://img.ydlcdn.com/file/2019/05/17/7hiau9bi76ihjp7a.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"5-18 13:07","askId":397095,"content":"老师,很能理解你的感受,以前你真的是一个好女人,努力工作都是为了孩子,那你最初是由于你的孤独感造成的,老公不争气,完全没有女人的归属感,导致你现在有点消极情绪,有兴趣可以和老师私聊","doctorId":11024,"gender":1,"id":2809293,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"李忻珂","time_str":"5-18 13:07","toContent":"","toName":"","uid":2585983,"userHead":"https://img.ydlcdn.com/file/2019/01/02/6dd22w0l3jr5fxpw.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"5-18 16:35","askId":397095,"content":"能感受到你在感情关系中的迷茫和无助,婚姻从来不是一个人的事情,如何去沟通和处理问题是件不容易的事情。可以关注我图像,预约初始访谈,明确问题表现和解决方向,相信能够帮助你!","doctorId":7349,"gender":2,"id":2809784,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"张莹华","time_str":"5-18 16:35","toContent":"","toName":"","uid":1912401,"userHead":"https://img.ydlcdn.com/file/2018/04/24/35szo08ifju8qh61.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"5-18 14:37","askId":397095,"content":"依据你现在的说法和心情,我说“壮士断腕”是你的苦恼,你能接受吗?","doctorId":12407,"gender":2,"id":2809480,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"陈静","time_str":"5-18 14:37","toContent":"","toName":"","uid":1461852,"userHead":"https://img.ydlcdn.com/file/2019/04/26/10a484cdfa138eadce930d7f66486e1b..jpg!s200x200","userType":2,"zan":0},{"answerCreateTime":"5-18 15:00","askId":397095,"content":"为什么你会允许你老公这样什么也不付出?他知道你对他的期待没吗?","doctorId":12046,"gender":2,"id":2809549,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"卓晓静","time_str":"5-18 15:00","toContent":"怎么会有这种责备式反问,来访者已经很痛苦了,先做好倾听吧。","toName":"弱水","uid":3208815,"userHead":"https://img.ydlcdn.com/file/2019/03/27/y249crhafi0ocwgl.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"今天 11:43","askId":397095,"content":"怎么会有这种责备式反问,来访者已经很痛苦了,先做好倾听吧。","doctorId":0,"gender":2,"id":2824162,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"弱水","time_str":"今天 11:43","toContent":"","toName":"","uid":1946940,"userHead":"https://img.ydlcdn.com/file/2019/01/18/c4e0b3671d5f0f94e570e411baf6c2c7..headImage!s200x200","userType":1,"zan":0},{"answerCreateTime":"今天 15:08","askId":397095,"content":"我的情况跟你差不多,很想和你好好聊聊,同命相连的苦命女人","doctorId":0,"gender":2,"id":2824490,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"左岸幸福","time_str":"今天 15:08","toContent":"","toName":"","uid":1337225,"userHead":"https://img.ydlcdn.com/file/2017/07/16/c481dbeb7a5df87402317b0a5edb2651.jpg!s200x200","userType":1,"zan":0},{"answerCreateTime":"5-18 14:47","askId":397095,"content":"丧偶式婚姻吗?你老公有没有让你觉得还可以的地方?","doctorId":11404,"gender":2,"id":2809510,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"张娟","time_str":"5-18 14:47","toContent":"","toName":"","uid":1839482,"userHead":"https://img.ydlcdn.com/file/2019/03/04/v4sd6i6j80f8ncy2.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"今天 11:33","askId":397095,"content":"你自己缺乏沟通!而且你也不了解男人!","doctorId":0,"gender":0,"id":2824143,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"","time_str":"今天 11:33","toContent":"","toName":"","uid":3644578,"userHead":"https://img.ydlcdn.com/file/2016/11/11/a3vtt0qscbsuxkfm.png","userType":1,"zan":0},{"answerCreateTime":"今天 07:00","askId":397095,"content":"他哪里来的钱玩?钓鱼花销不便宜吧。","doctorId":0,"gender":2,"id":2823740,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"ladycony","time_str":"今天 07:00","toContent":"","toName":"","uid":2058695,"userHead":"https://img.ydlcdn.com/file/2018/06/15/ffc026b136c3042f3bea4704f57fd8de..jpg!s200x200","userType":1,"zan":0},{"answerCreateTime":"今天 10:55","askId":397095,"content":"离家出走几个月,这样男人不能惯着","doctorId":0,"gender":1,"id":2824076,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"坤哥","time_str":"今天 10:55","toContent":"","toName":"","uid":1012586,"userHead":"https://img.ydlcdn.com/file/2018/06/14/3b72f6d4a1c379ab5127d619c48e9e17..jpg!s200x200","userType":1,"zan":0},{"answerCreateTime":"5-19 00:19","askId":397095,"content":"祝福","doctorId":0,"gender":1,"id":2810389,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"一个好人","time_str":"5-19 00:19","toContent":"","toName":"","uid":3034265,"userHead":"https://img.ydlcdn.com/file/2019/02/27/a2e8665842bafe81f01f4d16d450a7e1..jpg!s200x200","userType":1,"zan":0}],"commentsCount":18,"content":"我结婚7年,有一个丫头5岁,我以前很努力的工作上班是为了孩子能过的好点,结婚7年我老公没有做一件事让我觉得开心快乐过,他的想法就是现在年轻玩,等老了玩不动了,一天在他身上看不到希望,我为了孩子能在城市上学我买了一套70平米的房子,房子50万家里没给一分,我月供5千,我老公就知道玩玩,孩子生病一个月里,他每天就知道钓鱼,我不知道我该怎么办,每个月月供我的还,孩子的开支我的开支也得我管,我老公啥都不管,孩子生病的一个月里,我对我老公真心的没希望也没指望了,不知怎么的现在的我也不想上班,每天也是浑浑噩噩的,就是不想上班,也不知道我该怎么办,孩子我在带,我还的上班带孩子,孩子现在一闹情绪,一哭我头疼,我瞬间就心情不好了,就想发火,我不知道我这是怎么了,每天觉得压力好大,火气也好大,我觉得好像我现在的心态有问题,一天也是起早贪黑的,现在的我就是不想上班,我觉得我老公每天都在玩,也知道玩,我也想玩,啥都不想管,可是我的压力好大,月供我的还,孩子看病我老公都拿不出钱来,我生病住院他也拿不出钱来,都是我自己出钱,我现在看见他都不想给他说话,他想碰我我就来火,我不知道我怎么了,是心里有问题还是抑郁,还��怎么的,接下来我真的不知道我该怎么办,每天就想去外地不想在这里呆,","extContent":"","focId":0,"from":"来自Android客户端","gender":2,"header":"http://img.ydlcdn.com/v2/images/avatar_default.png","hits":211,"id":397095,"isAd":0,"isFocused":2,"isSelf":0,"isZan":2,"multitextType":1,"name":"匿名","replyCounter":18,"smallAttach":[],"timeStr":"5-18 12:53","title":"✘现在的我不知道该怎么办","topicId":6,"topicTitle":"家庭关系","uid":0,"url":"","utype":2,"visitCount":211,"zanCount":7},{"adImg":"","askTag":"恋爱婚姻","avatar":"https://img.ydlcdn.com/file/2017/06/04/77af519cd0daee982c97ae66719ae007.jpg","bigAttach":[],"comments":[{"answerCreateTime":"前天 08:12","askId":399730,"content":"你好!留言中看到你的困惑与迷茫。理解你。\n\n研究生快毕业了,工作的状态不令你满意,所以有不舒服是吧!\n\n你读那么多年的书,很想工作有一番作为,回报社会和父母,这个是很多毕业生的愿望。但是现实生活中总是有一些让人不满意的地方。\n\n翻译工作的确是需要不断的在语言环境中,不然自己感觉能力提升的慢。这种不舒服可以理解。\n\n这样好不好呢,试一试去和人事部门谈一谈,说一说自己的需求(说一说自己做翻译的优势,想有机会参加那样的会议,或换一换有更多机会参加会议的岗位,这样又有丰厚的工资保障,又可以做自己喜欢的工作)。\n\n也可以伺机换一换自己喜欢的其他工作,会兼职(别影响正常工作,兼职目的是多一些收入和更好体现成就感与价值观)。\n\n如果你愿意和我进一步探讨一下,可以联系我!\n\n加油","doctorId":12036,"gender":2,"id":2820647,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"赵立新","time_str":"前天 08:12","toContent":"","toName":"","uid":3185565,"userHead":"https://img.ydlcdn.com/file/2019/03/29/0u50t166f6uionx7.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"前天 07:55","askId":399730,"content":"朋友您好,我是平台注册的心理咨询师,您提出的问题和困惑我非常理解,这属于现实问题,建议您问问自己的内心,到底对什么感兴趣?如果让自己的兴趣和工作合二为一的话,你会非常的幸福!否则就会花一些时间来适应,如果实在不了解自己内心的真实,状态,欢迎私聊我,我们一起探索一些你内心深处的你不知道的你知道!","doctorId":12552,"gender":1,"id":2820629,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"张玉石","time_str":"前天 07:55","toContent":"","toName":"","uid":3505186,"userHead":"https://img.ydlcdn.com/file/2019/05/10/sax9xb54z5rgydnp.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"前天 08:58","askId":399730,"content":"理解你的困惑,你可能朦胧知道自己要什么,但是缺乏理清这些问题的思路和原则。刚上社会工作的一年,对今后的发展非常重要,所以焦虑。进一步,可以私聊。","doctorId":12530,"gender":1,"id":2820701,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"宗辉","time_str":"前天 08:58","toContent":"","toName":"","uid":3498206,"userHead":"https://img.ydlcdn.com/file/2019/05/13/veok0sd1rzy7zj4s.png!s200x200","userType":2,"zan":0}],"commentsCount":3,"content":"我是研三的学生,已经工作了半年多,今年6月毕业。因为想做翻译来到了一家汽车厂子,刚进公司那阵会参加一些会议翻译,后来被调了部门,跟的领导不参加会议,我也没有参加会议翻译的机会了,后来一直是跟在他身边做翻译。现在的部门是修机器的部门,虽然我还是做翻译,时间长了,我发现我只是简单做一些口头翻译和事务性工作,并不会有什么实质性的提高,对机械我也不是很感兴趣,车间的环境也比较吵,对身体不好。\n虽然一直想换工作,却也一直没找到合适的,自己想去做的工作。很迷茫,不知道做什么。而且,像是套在了这里,虽然很想走,生活的压力却又走不了的感觉。不知道怎么办,之前想过当老师,也许更适合自己,面试过兼职,不过后来因为上班,一直没时间去签约…\n迷城!","extContent":"","focId":0,"from":"来自Android客户端","gender":2,"header":"https://img.ydlcdn.com/file/2017/06/04/77af519cd0daee982c97ae66719ae007.jpg","hits":116,"id":399730,"isAd":0,"isFocused":2,"isSelf":0,"isZan":2,"multitextType":1,"name":"52赫兹的鲸","replyCounter":3,"smallAttach":[],"timeStr":"前天 07:42","title":"职业发展困惑","topicId":44,"topicTitle":"今日打卡","uid":1241744,"url":"","utype":2,"visitCount":116,"zanCount":5},{"adImg":"","askTag":"个人成长","avatar":"http://img.ydlcdn.com/v2/images/avatar_default.png","bigAttach":[],"comments":[{"answerCreateTime":"昨天 10:30","askId":400232,"content":"觉得现在的小三都很理直气壮。自己在怀孕期间老公出轨。您一定很伤心吧。目前觉得接受不了这个事实也不知道如何面对小三。\n1.首先要看下老公的态度。毕竟老公是和您有直接关系的人。对么?老公目前是想维持现状还是想回归家庭?觉得您需要和老公好好谈一谈。如果想继续经营家庭。双方需要做哪些努力?\n2.小三理直气壮一定让您非常愤怒吧。侵入了别人的家庭还觉得理所当然。有时候小三觉得可以激怒您的情绪很有成就感。您所要做的就是不要让这种成就感发生。想想看如何自己不被激怒?小三的道德观是她的价值体系,和您的无关。没有必要为了这样的人自己生气影响身体。主要看您老公的处理态度。如果需要。您宣誓主权也是必要的。\n3.这件事情发生了。不是您的错。但是需要反思在日常生活中和老公的沟通方式,相处方式是否存在问题。这虽然不能成为对方出轨的条件,但是至少是一部分原因。如果两个人想继续经营家庭,双方都需要做哪些改善?","doctorId":11920,"gender":2,"id":2822486,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"李海霞","time_str":"昨天 10:30","toContent":"","toName":"","uid":2175215,"userHead":"https://img.ydlcdn.com/file/2019/03/18/3318c6b6d185ed8d1c4db3c1e714c08b.jpg!s200x200","userType":2,"zan":4},{"answerCreateTime":"昨天 11:00","askId":400232,"content":"这要看作为老婆的一方是想继续维持婚姻让老公回归家庭,还是想离婚了。具体问题还需要进一步沟通。","doctorId":6703,"gender":1,"id":2822534,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"孙斌","time_str":"昨天 11:00","toContent":"","toName":"","uid":1799760,"userHead":"https://img.ydlcdn.com/file/2018/04/03/2i0t5tl9f67sjryz.png!s200x200","userType":2,"zan":1},{"answerCreateTime":"昨天 10:23","askId":400232,"content":"感谢也是一种攻击,运用得好的话,会很伤人的。看你用什么态度来表达哟。","doctorId":12471,"gender":2,"id":2822471,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"康雅雯","time_str":"昨天 10:23","toContent":"","toName":"","uid":3406232,"userHead":"https://img.ydlcdn.com/file/2019/05/05/fx8yy5ttk6panqey.png!s200x200","userType":2,"zan":1},{"answerCreateTime":"今天 11:20","askId":400232,"content":"正室:小三,我TM谢谢你\n小三:你跟我客气NM","doctorId":0,"gender":1,"id":2824114,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"垂直握把","time_str":"今天 11:20","toContent":"","toName":"","uid":3520847,"userHead":"https://img.ydlcdn.com/file/2019/05/10/6f451e4b64c4b1922d8f0a2a1ea9030c..headImage!s200x200","userType":1,"zan":1},{"answerCreateTime":"昨天 10:21","askId":400232,"content":"在女人最需要老公关心的时候,发生这种事情谁都受不了。但我们现在应该如何去应对小三,怎么让老公全心全意的爱你,心甘情愿的为你付出,理解你的感受,在乎你的付出,你给老师说说具体情况,老师教你如何应对","doctorId":12286,"gender":2,"id":2822465,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"吕喜梅","time_str":"昨天 10:21","toContent":"","toName":"","uid":1215808,"userHead":"https://img.ydlcdn.com/file/2019/05/17/tv0zeceiffczyefi.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 11:09","askId":400232,"content":"这个事情嘛,是你老公需要解决的问题。你是什么样的情况,一定需要你去面对吗?","doctorId":11584,"gender":2,"id":2822541,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"卢红臻","time_str":"昨天 11:09","toContent":"","toName":"","uid":2750468,"userHead":"https://img.ydlcdn.com/file/2019/02/21/d73bdq8whpgy8jld.jpg!s200x200","userType":2,"zan":0},{"answerCreateTime":"今天 07:03","askId":400232,"content":"会背叛妻子的人,当然也会背叛小三。结婚誓言都不作数,山盟海誓算什么呢?","doctorId":0,"gender":2,"id":2823743,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"ladycony","time_str":"今天 07:03","toContent":"","toName":"","uid":2058695,"userHead":"https://img.ydlcdn.com/file/2018/06/15/ffc026b136c3042f3bea4704f57fd8de..jpg!s200x200","userType":1,"zan":0},{"answerCreateTime":"昨天 14:10","askId":400232,"content":"为什么要见面呢?","doctorId":11655,"gender":1,"id":2822757,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"李翀","time_str":"昨天 14:10","toContent":"","toName":"","uid":2900760,"userHead":"https://img.ydlcdn.com/file/2019/02/26/fbaa0e237fc92a3674ffc16e18228370.jpg!s200x200","userType":2,"zan":0}],"commentsCount":8,"content":"现在的小三都特别理直气壮,正室见了小三,该如何面对才正确,是不是,要当面感谢感谢她,在我怀孕期间,替我解决老公的生理欲望呢?","extContent":"","focId":0,"from":"来自Android客户端","gender":0,"header":"http://img.ydlcdn.com/v2/images/avatar_default.png","hits":135,"id":400232,"isAd":0,"isFocused":2,"isSelf":0,"isZan":2,"multitextType":1,"name":"匿名","replyCounter":8,"smallAttach":[],"timeStr":"昨天 10:02","title":"正室怎么面对小三","topicId":34,"topicTitle":"倾诉港湾","uid":0,"url":"","utype":2,"visitCount":135,"zanCount":3},{"adImg":"","askTag":"孩子教育","avatar":"http://img.ydlcdn.com/v2/images/avatar_default.png","bigAttach":[],"comments":[{"answerCreateTime":"昨天 21:27","askId":400477,"content":"新手妈妈,你好!\n\n看到你满屏的母爱,看得出你是一个负责任的母亲,你对自己的要求很高,并且对于宝宝的处理,还有点摸不着头绪!\n\n我们一个一个来说:\n1、奶水不好宝宝吃不饱\n宝宝现在多大!如果是真的吃不饱,可以在两次喂奶中间加少量的配方奶粉,混合喂养!\n而你也不要放弃母乳喂养。坚持哺乳放松心情很关键!\n\n2、应对宝宝问题不懂\n猜测宝宝应该不大,小月龄的宝宝其实表达很直接,你不用过于担心,她如果不舒服就会哭,告诉你!\n饿了,渴了,肚子不舒服都可以用哭来表达!\n那么你需要观察的是每天排便是否正常,睡觉规律与否,哭闹的大概时间,如果固定2到3个小时,可能是饿了!\n诸如此类的很多app都是有帮助新手妈妈解决问题的!\n\n3、想让宝宝长身体\n这个阶段的宝宝只要吃饱睡觉长身体是肯定的,那现在宝宝吃你的母乳,你如此的焦虑并不有利于宝宝身体的发育,你的情绪舒缓,心情愉悦,宝宝吃你的哺乳会更愉快,吃的好自然就是睡得好!\n\n我们能做的,就是多了解喂养知识,调整心情,其他的都顺理成章!\n\n这样一个母爱十足的妈妈,一定可以越来越棒的喂养好幸福的宝贝!\n\n新手妈妈在路上,加油","doctorId":11765,"gender":2,"id":2823423,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"罗曼","time_str":"昨天 21:27","toContent":"","toName":"","uid":2000077,"userHead":"https://img.ydlcdn.com/file/2019/03/06/nj6979gihd2ug6sb.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 21:03","askId":400477,"content":"新手妈妈的奶水不足,心疼宝宝因为吃不饱哭闹而心疼,可以理解您!因为宝宝刚出生,不管吃多了,吃少了,冷热,不舒服只能用哭来表达,那么您只能观察,然后对症下药,如果只是没吃饱,那就搭配适合宝宝的奶粉,多喝水,宝宝的哭闹一定会减少的!\n您现在也需要注意您的身体哦,产后的身体是非常虚弱的,注意营养的补充及充足的睡眠,也有助于奶水的增多哦!","doctorId":12391,"gender":2,"id":2823387,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"高敏","time_str":"昨天 21:03","toContent":"","toName":"","uid":2725755,"userHead":"https://img.ydlcdn.com/file/2019/05/17/b2ds7mg50qmrlzfh.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 22:21","askId":400477,"content":"过于焦虑奶水不够,情绪也会影响奶水的质量,你也不想宝宝奶水不足时,还吃到的质量不高的奶是吗。\n\n奶水不足既然是事实,看看有无办法可想?从自己的身体调养一是休息好,情绪好,通过食调下,有很多发奶的方子的。再就是可以找找有机牛奶或者羊奶作为补充。祝好!","doctorId":10489,"gender":2,"id":2823501,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"罗小芳","time_str":"昨天 22:21","toContent":"","toName":"","uid":2625705,"userHead":"https://img.ydlcdn.com/file/2018/11/23/y2n86o7ibndxdzp8.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 22:04","askId":400477,"content":"你好\n恭喜你成为伟大的妈妈,接纳自己现在的心情,第一次做妈妈都是这样,孩子哭也是正常的现象。这个时候正是母婴共同体的时期,你的焦虑也会影响孩子。平和面对这样一个可爱鲜活的生命,建议多看看书,了解孩子生命成长的规律,读懂孩子的语言。","doctorId":7314,"gender":2,"id":2823468,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"孙秀芹","time_str":"昨天 22:04","toContent":"","toName":"","uid":1851997,"userHead":"https://img.ydlcdn.com/file/2018/04/22/ba9699ec445e0348e5ffa16fb6f8e67b..jpg!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 20:59","askId":400477,"content":"你好,感受到你的焦虑,担心宝宝,可你越是焦虑,情绪紧张,更会导致奶水的减少。其实我们可以从两个方面来缓解现在的状态:1.通过和心理老师的交流,调整情绪。2.通过调整饮食。双管齐下的努力,让你顺利的度过这段时间。","doctorId":9190,"gender":2,"id":2823376,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"许小利","time_str":"昨天 20:59","toContent":"","toName":"","uid":1524513,"userHead":"https://img.ydlcdn.com/file/2019/04/23/yvr5gg1ip3itn95d.jpg!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 20:48","askId":400477,"content":"看到了你的担心,你的自责。你希望宝宝健康的成长,这是大部分做妈妈的期望,但是从现在看宝宝��为奶水不足好像长的慢,所以你很是焦虑不安。","doctorId":12345,"gender":2,"id":2823355,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"张立平","time_str":"昨天 20:48","toContent":"","toName":"","uid":3347853,"userHead":"https://img.ydlcdn.com/file/2019/04/23/d7b3b4500b8c81a2b4c0c26721f66f46.jpg!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 20:47","askId":400477,"content":"新手妈妈一般都会手忙脚乱,无所适从,不着急哈,慢慢来,你一定可以成为一个好妈妈的,如果你有任何疑惑可以找我聊聊。","doctorId":11957,"gender":2,"id":2823353,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"卓艳侠","time_str":"昨天 20:47","toContent":"","toName":"","uid":3080354,"userHead":"https://img.ydlcdn.com/file/2019/03/21/fj9kpfvpe3a2rjik.jpg!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 20:54","askId":400477,"content":"能体会到你对宝宝的心疼,我的宝宝小时候也是这样的。你适当的给宝宝补充点奶粉,这样宝宝吃饱了基本就不会哭闹了","doctorId":12384,"gender":2,"id":2823366,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"李娜","time_str":"昨天 20:54","toContent":"","toName":"","uid":3383401,"userHead":"https://img.ydlcdn.com/file/2019/05/17/zdagnz8wdzq1q4nv.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"昨天 21:06","askId":400477,"content":"我妈要是能有你这么多觉悟,我也不至于现在长得这么低、这么瘦,加油!","doctorId":0,"gender":1,"id":2823390,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"不知道起啥名","time_str":"昨天 21:06","toContent":"额","toName":"小小莉","uid":3603520,"userHead":"https://img.ydlcdn.com/file/2019/05/25/c980d7a1fd8653079b1c0dea924d4555..jpg!s200x200","userType":1,"zan":0},{"answerCreateTime":"昨天 21:45","askId":400477,"content":"额","doctorId":0,"gender":2,"id":2823441,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"匿名","time_str":"昨天 21:45","toContent":"","toName":"","uid":0,"userHead":"http://img.ydlcdn.com/v2/images/avatar_default.png","userType":1,"zan":0}],"commentsCount":10,"content":"自己奶水不足,看到自己的宝宝没吃饱,哭到肠子都断了似的,好心疼啊,感觉很多宝宝的一些基本哭闹也不懂,很怕宝宝这里不好,那里不好,没及时发现,宝宝也不能说出口自己哪里不好,突然发现自己心有余而力不足,每天只想让宝宝吃好睡好,少哭闹,才能多长身体,半个月宝宝也才长了几两,心里面好烦躁","extContent":"","focId":0,"from":"来自iphone客户端","gender":2,"header":"http://img.ydlcdn.com/v2/images/avatar_default.png","hits":47,"id":400477,"isAd":0,"isFocused":2,"isSelf":0,"isZan":2,"multitextType":1,"name":"匿名","replyCounter":10,"smallAttach":[],"timeStr":"昨天 20:31","title":"新手妈妈的心情","topicId":52,"topicTitle":"新手妈妈","uid":0,"url":"","utype":2,"visitCount":47,"zanCount":7},{"adImg":"","askTag":"恋爱婚姻","avatar":"http://img.ydlcdn.com/v2/images/avatar_default.png","bigAttach":[],"comments":[{"answerCreateTime":"今天 11:22","askId":399743,"content":"可能不是你的孩子","doctorId":0,"gender":1,"id":2824117,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"垂直握把","time_str":"今天 11:22","toContent":"","toName":"","uid":3520847,"userHead":"https://img.ydlcdn.com/file/2019/05/10/6f451e4b64c4b1922d8f0a2a1ea9030c..headImage!s200x200","userType":1,"zan":1},{"answerCreateTime":"前天 08:48","askId":399743,"content":"你好。\n\n7岁的孩子,做事情比较慢,不专心。\n\n很多家长会遇到你说的这样问题。\n\n孩子的学习能力很强,源于孩子的好奇心比较强,对什么都比较感兴趣,注意力也容易分散,当受到外界干扰时,非常容易走神。\n\n还有一点,当孩子做不感兴趣的事情,注意力不够专注,基本处于边玩边做的状态,看上去好像孩子做事比较慢,其实是他没有用心去做,思想开小差了。\n\n当然,也不排除孩子本身做事就不着急的性格。\n\n遇到有这样问题的孩子,可以通过一些注意力训练,做事竞赛,设立小目标,完成之后的成就感,激发孩子做事又快又认真的潜力,并慢慢将这些培养成良好的习惯。\n\n孩子有什么问题,多数问题在家长身上,家长要自我多检讨。\n\n我见过很多家长,碰到孩子做事没有自己想象的快,骂的多,抱怨的多,很少见到家长关心的问问孩子原因,愿意陪着孩子一起去做好的。\n\n所以家长的教育方式和对待孩子的态度很重要。聪明的孩子家长天天骂笨,孩子会真的变笨的。\n\n衷心的祝福你,希望您的孩子,在您的悉心教育下,快乐的成长。\n\n如果我的回答对您有帮助,请帮忙点“感谢”。您的鼓励和认可,会激发我做的更好。谢谢您!","doctorId":12261,"gender":1,"id":2820687,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"刘杰","time_str":"前天 08:48","toContent":"","toName":"","uid":3311427,"userHead":"https://img.ydlcdn.com/file/2019/04/17/mw3cjjokgbz5dsm4.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"前天 08:38","askId":399743,"content":"这要看孩子的具体反应状况了,您说的慢和不专心是怎么样的一个程度呢。有没有对他的正常生活和学习造成比较大的影响呢?","doctorId":10145,"gender":1,"id":2820666,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"陈鹏","time_str":"前天 08:38","toContent":"","toName":"","uid":2503576,"userHead":"https://img.ydlcdn.com/file/2018/10/27/vap6cldxwswiyz5c.jpg!s200x200","userType":2,"zan":0}],"commentsCount":3,"content":"我的孩子7岁,做什么事都很慢,不专心。请问这是心理障碍吗?","extContent":"","focId":0,"from":"来自Android客户端","gender":0,"header":"http://img.ydlcdn.com/v2/images/avatar_default.png","hits":75,"id":399743,"isAd":0,"isFocused":2,"isSelf":0,"isZan":2,"multitextType":1,"name":"ydl359875***","replyCounter":3,"smallAttach":[],"timeStr":"前天 08:30","title":"关于孩子心理障碍的问题","topicId":44,"topicTitle":"今日打卡","uid":3598753,"url":"","utype":2,"visitCount":75,"zanCount":2},{"adImg":"","askTag":"个人成长","avatar":"https://img.ydlcdn.com/file/2019/05/24/8a2b585ad51442b74e7e6b3d6993fbc6..jpg","bigAttach":[],"comments":[{"answerCreateTime":"5-24 13:13","askId":399367,"content":"亲爱的同学,看了你的文字,非常理解你的心苦心累,儿时父母外出打工,把你寄养在外婆家,自小你就有了分离恐惧,这种缺乏父母之爱及安全感的生活一直影响至今,让你养成了讨好型人格,和面对生活的勇气、、、\n\n过去的发生的一切已既成事实,相信爸妈也是为了生活不得已离开你外出打拼,所以,不要怨恨父母,相反,接纳父母,与父母在情感上和解,你也会放下很多,心态也会平和些,这有利于你面对当下的高考,面对未来的人生之路。\n\n原生家庭中爱及安全感的缺失,可以随着年龄的增长由自己补上这门功课,前提是不要站在原地,除了抱怨,不再选择成长,所以,你需要为自己赋正向的能量,用爱与感恩激发内在的资源,如果感觉个人成长有些无力,那建议你高考后找一个匹配的心理老师做系统梳理和调整。\n\n还有十几天就要高考了,这期间,试着放下对过去的执念,也放下对未来的焦虑,正念于当下的生活,不管成绩如何,首先要保持一个好的状态,迎接高考的到来。最后祝你考试取得好成绩!","doctorId":11123,"gender":2,"id":2819302,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"罗凤萍","time_str":"5-24 13:13","toContent":"","toName":"","uid":2303146,"userHead":"https://img.ydlcdn.com/file/2019/04/28/usob2k4pyac7y11l.jpg!s200x200","userType":2,"zan":2},{"answerCreateTime":"5-24 12:31","askId":399367,"content":"你好,通过你的描述看到你面临两个问题:\n1.考前焦虑的问题。\n2.自己的性格问题。\n性格问题的调节需要长时间的努力,所以现在的重点还是放在考试焦虑上。\n不知道你这几次的模拟考试成绩怎么样?这个成绩基本就是你的高考成绩了。你之所以感到焦虑是因为你对这个成绩的不认同,所以你给自己定了一个比较高的目标,想要通过短期的冲刺达到这个目标,这时焦虑的情绪就会出来了,在焦虑的状态下你会感觉注意力不集中,读不进书,情绪低沉消极。\n所以现在需要你做的是:\n1.认清现实:你的成绩怎么样基本已经定了,三年的学习都没让你的成绩大幅度的提升,最后这段时间也就别逼自己了。\n2.降低期待:明确知道了自己的水平,接纳自己就是这样的成绩,接下来面临的考试只是拿回属于自己的东西的过程,也就是说你最低也会考到平时的成绩,不会再差了。\n3.知道了自己的最低水平,接下来这段时间的学习其实就像是赚外快一样,你每多学一点都是你的额外收入,你要告诉自己:收入的多点更好,收入少也没关系,不管多少都是我赚的。","doctorId":9361,"gender":1,"id":2819247,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"王颖松","time_str":"5-24 12:31","toContent":"谢谢您","toName":"","uid":1240451,"userHead":"https://img.ydlcdn.com/file/2019/04/23/zhajkdiajqxxitq8.png!s200x200","userType":2,"zan":1},{"answerCreateTime":"5-24 10:22","askId":399367,"content":"你好,看得出来你想要改变现状。童年少了父母的陪伴,让你缺乏安全感,不敢独自面对困难,也让你隐藏真实的自己,不敢表达自己真实的意愿。你愿意和父母聊聊你的想法吗,有了父母的支持,相信你在这个人生的转折点可以更坚定地走下去,加油!我非常希望能带给您帮助并缓解您的问题,文字回复有限,可以选择私聊详细叙述问题,我们再细细详谈。","doctorId":6628,"gender":2,"id":2819098,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"覃夏园","time_str":"5-24 10:22","toContent":"","toName":"","uid":1353467,"userHead":"https://img.ydlcdn.com/file/2019/03/26/jd04agx8pr98th6y.png!s200x200","userType":2,"zan":0},{"answerCreateTime":"今天 10:37","askId":399367,"content":"父母不可能带你一起走,那样你没办法上学。","doctorId":0,"gender":2,"id":2824036,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"ladycony","time_str":"今天 10:37","toContent":"","toName":"","uid":2058695,"userHead":"https://img.ydlcdn.com/file/2018/06/15/ffc026b136c3042f3bea4704f57fd8de..jpg!s200x200","userType":1,"zan":0},{"answerCreateTime":"5-24 10:23","askId":399367,"content":"求支招啊!~[大哭]","doctorId":0,"gender":1,"id":2819100,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"心苦,心累","time_str":"5-24 10:23","toContent":"","toName":"","uid":3617818,"userHead":"https://img.ydlcdn.com/file/2019/05/24/8a2b585ad51442b74e7e6b3d6993fbc6..jpg!s200x200","userType":1,"zan":0},{"answerCreateTime":"今天 02:08","askId":399367,"content":"谢谢您","doctorId":0,"gender":0,"id":2823672,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"","time_str":"今天 02:08","toContent":"","toName":"","uid":3642950,"userHead":"https://img.ydlcdn.com/file/2016/11/11/a3vtt0qscbsuxkfm.png","userType":1,"zan":0},{"answerCreateTime":"今天 11:16","askId":399367,"content":"我也是","doctorId":0,"gender":0,"id":2824108,"isAvailable":0,"isOpenListen":0,"listenLinkUrl":"https://h2.yidianling.com/listen/detail/null","name":"","time_str":"今天 11:16","toContent":"","toName":"","uid":3644184,"userHead":"https://img.ydlcdn.com/file/2016/11/11/a3vtt0qscbsuxkfm.png","userType":1,"zan":0}],"commentsCount":7,"content":"现在的我是一名高三的学生,成绩较差,就快高考了,这些天感觉什么都记不住,但我又强迫自己去记,我不想放弃,情绪很低沉,消极,我知道高考是为了读书,为了以后有更好的路可走,可我居然还在担心去往大学的路上到火车站会迷路,会错过站台,\n 唉,可能与儿时的经历有关吧,在我出生后的一年左右,父母离家外出打工,把我寄托给外婆外公抚养,后来外婆跟我说那时的我就一直哭,我也有模糊的记忆,小时候我哭着问外婆,我爸爸妈妈去哪儿了,她说,妈妈去给你买香蕉去了,(那时的我很喜欢香蕉),那他们不会不要我了吧[大哭],外婆说快回来了,明天就回来了,每次等他们回来就是一年,小时候总是很害怕,晚上每次睡觉都要摸着外婆的耳朵才能睡着,现在长大了,碰到什么困难会躲避,而不是去面对,我恨父母,可我更恨自己的无能为力,(和别人交流时我是那种讨好型人格)在人生的转折点上,不能带有情绪的去面对,可我做不到,害怕,迷茫,消沉,我到底该怎么办啊!谁能帮帮我,~~~。[大哭][大哭]","extContent":"","focId":0,"from":"来自Android客户端","gender":1,"header":"https://img.ydlcdn.com/file/2019/05/24/8a2b585ad51442b74e7e6b3d6993fbc6..jpg","hits":239,"id":399367,"isAd":0,"isFocused":2,"isSelf":0,"isZan":2,"multitextType":1,"name":"心苦,心累","replyCounter":7,"smallAttach":[],"timeStr":"5-24 10:12","title":"成长的烦恼","topicId":9,"topicTitle":"个人成长","uid":3617818,"url":"","utype":2,"visitCount":239,"zanCount":6}],"ext_data":[{"anonymous":0.0,"askSource":"","browser":"","channel":"","checkStatus":0.0,"content":"","createTime":"Jan 22, 2019 9:03:30 PM","deleteUser":"","doctorId":0,"extContent":"","favTotalNum":0,"ffrom":"","fsid":"","hits":0,"hotTime":0,"id":350751,"ip":"","isDelete":0,"isDoctorShow":0.0,"isHot":0.0,"isPublish":0.0,"isTop":122,"multitextType":0.0,"operateStatus":0.0,"parentId":0,"platform":"","replyCounter":0,"showTips":0.0,"status":0,"tags":"","tags2":"","title":"公告|关于账号重新绑定QQ账号的规范公告","topPage":0.0,"topRule":0.0,"topTime":0,"topicId":0,"type":0,"uid":0,"zanCounter":0,"zhuishuTop":0},{"anonymous":0.0,"askSource":"","browser":"","channel":"","checkStatus":0.0,"content":"","createTime":"Mar 19, 2019 2:01:56 PM","deleteUser":"","doctorId":0,"extContent":"","favTotalNum":0,"ffrom":"","fsid":"","hits":0,"hotTime":0,"id":372358,"ip":"","isDelete":0,"isDoctorShow":0.0,"isHot":0.0,"isPublish":0.0,"isTop":33,"multitextType":0.0,"operateStatus":0.0,"parentId":0,"platform":"","replyCounter":0,"showTips":0.0,"status":0,"tags":"","tags2":"","title":"活动│公益咨询20元起","topPage":0.0,"topRule":0.0,"topTime":0,"topicId":0,"type":0,"uid":0,"zanCounter":0,"zhuishuTop":0}],"isRealEmpty":false},"type":10007},{"museBean":{
"muses": [{
"id": 12,
"name": "放松练习-1-体验放松",
"audioUrl": "https://video.ydlcdn.com/2019/06/11/94db54be02fc457df892329cfde76071.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/vqrj1y0mt9t7udli.png",
"effectCode": 6,
"category": 2,
"playCount": 9351,
"sort": 106,
"isDelete": 1,
"createTime": "Jun 6, 2019 2:11:04 PM",
"updateTime": "Jun 27, 2019 3:17:48 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 13,
"name": "放松练习-2-感受平静",
"audioUrl": "https://video.ydlcdn.com/2019/06/11/cfb8d05d946fcd65b380315f04dbc105.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/cb7ypsoh5f0eooj9.png",
"effectCode": 7,
"category": 2,
"playCount": 2443,
"sort": 105,
"isDelete": 1,
"createTime": "Jun 6, 2019 2:14:20 PM",
"updateTime": "Jun 27, 2019 3:17:59 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 14,
"name": "放松练习-3-身体扫描",
"audioUrl": "https://video.ydlcdn.com/2019/06/11/304e8b461e10dfda2cdadadba8c499c8.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/jirlyw2xc4n9jkvx.png",
"effectCode": 8,
"category": 2,
"playCount": 1397,
"sort": 104,
"isDelete": 1,
"createTime": "Jun 6, 2019 2:22:40 PM",
"updateTime": "Jun 27, 2019 3:18:08 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 20,
"name": "放松练习-4-学会暂停",
"audioUrl": "https://video.ydlcdn.com/2019/06/17/aab47281f015e7893a12c1bb55093105.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/17/ca9e7o4c00ls4hc2.png",
"effectCode": 1,
"category": 2,
"playCount": 644,
"sort": 103,
"isDelete": 1,
"createTime": "Jun 17, 2019 10:39:17 AM",
"updateTime": "Jun 27, 2019 3:18:30 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 24,
"name": "注意力练习-专注入门",
"audioUrl": "https://video.ydlcdn.com/2019/06/24/29f5dc8a7f4ddb1057dcb46e9fe2b668.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/24/dd1cwey5wbwyralt.png",
"effectCode": 2,
"category": 2,
"playCount": 735,
"sort": 99,
"isDelete": 1,
"createTime": "Jun 24, 2019 8:50:05 PM",
"updateTime": "Jun 27, 2019 3:19:59 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 17,
"name": "学会呼吸-均衡呼吸",
"audioUrl": "https://video.ydlcdn.com/2019/06/15/671e18afef1165be9e1c3ff7ce7aa719.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/15/ulpvf76krxtqh5rm.png",
"effectCode": 1,
"category": 2,
"playCount": 544,
"sort": 99,
"isDelete": 1,
"createTime": "Jun 15, 2019 1:56:58 PM",
"updateTime": "Jun 17, 2019 10:35:23 AM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 25,
"name": "注意力练习-改善专注",
"audioUrl": "https://video.ydlcdn.com/2019/06/25/616720030ea93cf2b8e9014d3baae85f.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/25/j70uuvvyfrpczo10.png",
"effectCode": 3,
"category": 2,
"playCount": 438,
"sort": 98,
"isDelete": 1,
"createTime": "Jun 25, 2019 4:13:17 PM",
"updateTime": "Jun 27, 2019 3:20:08 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 18,
"name": "学会呼吸-4-7-8呼吸",
"audioUrl": "https://video.ydlcdn.com/2019/06/15/1e2d20ed1904ebd775e1e5bb0801d44d.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/15/xhgkumwb9sqjmt2n.png",
"effectCode": 2,
"category": 2,
"playCount": 385,
"sort": 98,
"isDelete": 1,
"createTime": "Jun 15, 2019 1:58:24 PM",
"updateTime": "Jun 17, 2019 10:35:40 AM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 26,
"name": "注意力练习-专注进阶",
"audioUrl": "https://video.ydlcdn.com/2019/06/27/b495b6b32b83f3311fbf6484ee82d065.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/27/eb3f3snilgaqxy61.png",
"effectCode": 4,
"category": 2,
"playCount": 255,
"sort": 97,
"isDelete": 1,
"createTime": "Jun 27, 2019 1:51:16 PM",
"updateTime": "Jun 27, 2019 3:20:24 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 19,
"name": "学会呼吸-快速呼吸",
"audioUrl": "https://video.ydlcdn.com/2019/06/15/002e65229b1e970578e039a92764f0a2.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/15/o0s13tvm9p5dzju6.png",
"effectCode": 3,
"category": 2,
"playCount": 277,
"sort": 97,
"isDelete": 1,
"createTime": "Jun 15, 2019 2:00:17 PM",
"updateTime": "Jun 17, 2019 10:35:50 AM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 27,
"name": "注意力练习-持续专注",
"audioUrl": "https://video.ydlcdn.com/2019/06/28/68b0fad788b3db9ae24acc38648b74ed.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/28/3ug6jx7izug99yj3.png",
"effectCode": 5,
"category": 2,
"playCount": 276,
"sort": 96,
"isDelete": 1,
"createTime": "Jun 28, 2019 4:07:15 PM",
"updateTime": "Jun 28, 2019 4:07:53 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 1,
"name": "冥想基础介绍-1-什么是冥想?",
"audioUrl": "https://video.ydlcdn.com/2019/05/30/cd3e847fcb4b2114c8dae161d90d1ade.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/0c5ugexoi5cjod0g.png",
"effectCode": 1,
"category": 2,
"playCount": 1289,
"sort": 5,
"isDelete": 1,
"createTime": "May 30, 2019 4:22:44 PM",
"updateTime": "Jun 15, 2019 2:00:53 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 2,
"name": "冥想基础介绍-2-冥想的类型",
"audioUrl": "https://video.ydlcdn.com/2019/05/30/722b95682e22248572dd24d7f8829a31.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/jrkpxnhp1uua6z63.png",
"effectCode": 2,
"category": 2,
"playCount": 712,
"sort": 4,
"isDelete": 1,
"createTime": "May 30, 2019 4:25:46 PM",
"updateTime": "Jun 15, 2019 2:01:02 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 3,
"name": "冥想基础介绍-3-冥想的作用",
"audioUrl": "https://video.ydlcdn.com/2019/05/30/0c36f519badf5c9c9bd9aba576290d7f.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/ud3h215v9u5wawia.png",
"effectCode": 3,
"category": 2,
"playCount": 601,
"sort": 3,
"isDelete": 1,
"createTime": "May 30, 2019 4:27:49 PM",
"updateTime": "Jun 15, 2019 2:01:14 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 4,
"name": "冥想基础介绍-4-正确做冥想",
"audioUrl": "https://video.ydlcdn.com/2019/05/30/7fb45da97d6ba28a4dba7670269d0df0.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/8dq3agfl6hecby9c.png",
"effectCode": 4,
"category": 2,
"playCount": 659,
"sort": 2,
"isDelete": 1,
"createTime": "May 30, 2019 4:29:32 PM",
"updateTime": "Jun 15, 2019 2:01:24 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 5,
"name": "冥想基础介绍-5-常见的问题",
"audioUrl": "https://video.ydlcdn.com/2019/05/30/f6e9462719a6a93ce113cfee7138f1b6.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/cj3fw55fqthmpkkx.png",
"effectCode": 5,
"category": 2,
"playCount": 971,
"sort": 1,
"isDelete": 1,
"createTime": "May 30, 2019 4:30:56 PM",
"updateTime": "Jun 15, 2019 2:01:40 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}],
"sleeps": [{
"id": 34,
"name": "情绪管理-释放愤怒",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/3409c37d4c25ecfcded562bbe4e0a33c.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/cc5wp86ozz1zix96.png",
"effectCode": 0,
"category": 1,
"playCount": 890,
"sort": 116,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:00:53 AM",
"updateTime": "Sep 23, 2019 10:03:26 AM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 35,
"name": "情绪管理-缓解悲伤",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/12d6196d21e7b5dcfa5f5cd8c0a60538.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/2x43kbgux5tnbodw.png",
"effectCode": 0,
"category": 1,
"playCount": 424,
"sort": 115,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:06:08 AM",
"updateTime": "Sep 23, 2019 1:16:52 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 36,
"name": "情绪管理-克服恐惧",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/43cddc42edd336c04e066a67cb9ad976.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/salapz5mu8ld372w.png",
"effectCode": 0,
"category": 1,
"playCount": 361,
"sort": 114,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:10:12 AM",
"updateTime": "Sep 23, 2019 12:22:21 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 37,
"name": "情绪管理-缓解疲劳",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/af1ca1832982fc63411307bbb6edc9c1.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/2i0s2r15nq3146xy.png",
"effectCode": 0,
"category": 1,
"playCount": 1186,
"sort": 113,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:12:01 AM",
"updateTime": "Sep 23, 2019 12:41:05 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 38,
"name": "情绪管理-缓解焦虑",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/a3afa7bd3a08faa94f1c6ee44010c8de.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/eobk0emj57z210o9.png",
"effectCode": 0,
"category": 1,
"playCount": 618,
"sort": 112,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:14:20 AM",
"updateTime": "Sep 23, 2019 12:12:53 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 39,
"name": "情绪管理-缓解抑郁",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/14cb2013245aac8ca8a48d1d550326f3.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/inosx6iytyn83utv.png",
"effectCode": 0,
"category": 1,
"playCount": 463,
"sort": 111,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:21:25 AM",
"updateTime": "Sep 23, 2019 12:23:43 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 40,
"name": "情绪管理-舒缓压抑",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/188212f4a5bbd6754c25e7c609d506a0.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/r4zhfqlxq8cxxgrd.png",
"effectCode": 0,
"category": 1,
"playCount": 349,
"sort": 110,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:23:10 AM",
"updateTime": "Sep 23, 2019 10:24:35 AM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 41,
"name": "情绪管理-控制成瘾",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/74d8fe217a5892265ddd130561679643.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/t1cucbrd32rczn97.png",
"effectCode": 0,
"category": 1,
"playCount": 208,
"sort": 109,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:27:43 AM",
"updateTime": "Sep 23, 2019 10:38:28 AM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 42,
"name": "情绪管理-走出迷茫",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/8fd6cd9c93d66eaee72a945768d38f29.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/iaqdu2nraue74fz7.png",
"effectCode": 0,
"category": 1,
"playCount": 294,
"sort": 108,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:31:00 AM",
"updateTime": "Sep 23, 2019 10:38:31 AM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 28,
"name": "入睡准备-1-清理思绪",
"audioUrl": "https://video.ydlcdn.com/2019/06/29/9bd2472dccd6dffae91920ce4626ef64.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/29/i4yuj3lymzmhksr7.png",
"effectCode": 1,
"category": 1,
"playCount": 10934,
"sort": 108,
"isDelete": 1,
"createTime": "Jun 29, 2019 11:31:31 PM",
"updateTime": "Jul 3, 2019 9:08:00 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 43,
"name": "情绪管理-逆境重生",
"audioUrl": "https://video.ydlcdn.com/2019/09/23/31245e1cb7a6b4658dbfb72c4caa0520.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/09/23/sd5zmb2v54jk0owb.png",
"effectCode": 0,
"category": 1,
"playCount": 258,
"sort": 107,
"isDelete": 1,
"createTime": "Sep 23, 2019 10:35:02 AM",
"updateTime": "Sep 23, 2019 12:23:50 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 29,
"name": "入睡准备-2-舒缓焦虑",
"audioUrl": "https://video.ydlcdn.com/2019/06/30/1881ee0fa066cc01dc08b713aa96301c.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/30/3quzge9tgtjbfuye.png",
"effectCode": 1,
"category": 1,
"playCount": 6114,
"sort": 107,
"isDelete": 1,
"createTime": "Jun 30, 2019 10:10:10 PM",
"updateTime": "Jul 3, 2019 9:07:50 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 30,
"name": "入睡准备-3-躯体扫描",
"audioUrl": "https://video.ydlcdn.com/2019/07/01/a0c95ac996107fde7857acff45b6cb2e.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/07/01/k8wrwaki0hr7rx77.png",
"effectCode": 1,
"category": 1,
"playCount": 4284,
"sort": 106,
"isDelete": 1,
"createTime": "Jul 1, 2019 2:03:56 PM",
"updateTime": "Jul 3, 2019 9:07:39 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 31,
"name": "入睡准备-4-放松身体",
"audioUrl": "https://video.ydlcdn.com/2019/07/02/1b0781a0148e124e6007d677643400cc.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/07/02/84136a1kbeialqiq.png",
"effectCode": 1,
"category": 1,
"playCount": 4864,
"sort": 105,
"isDelete": 1,
"createTime": "Jul 2, 2019 3:09:14 PM",
"updateTime": "Jul 3, 2019 9:07:27 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 32,
"name": "入睡准备-5-想象入睡",
"audioUrl": "https://video.ydlcdn.com/2019/07/03/469aae03c8950a3589df3461ea3fb130.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/07/03/8s5519jitkt182xd.png",
"effectCode": 1,
"category": 1,
"playCount": 3565,
"sort": 104,
"isDelete": 1,
"createTime": "Jul 3, 2019 6:12:01 PM",
"updateTime": "Jul 3, 2019 9:07:12 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 33,
"name": "入睡准备-6-准备入睡",
"audioUrl": "https://video.ydlcdn.com/2019/08/19/227ce0d231115084d8f0c2090d90ec26.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/07/03/acnnm1ftzczruwx3.png",
"effectCode": 1,
"category": 1,
"playCount": 3122,
"sort": 103,
"isDelete": 1,
"createTime": "Jul 3, 2019 9:06:56 PM",
"updateTime": "Aug 19, 2019 12:39:08 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 21,
"name": "午休-10分钟婴儿般睡眠",
"audioUrl": "https://video.ydlcdn.com/2019/06/18/07413c21959d725b467920c2c1b359fa.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/18/p4kxa7iq7y4ga406.png",
"effectCode": 1,
"category": 1,
"playCount": 8404,
"sort": 102,
"isDelete": 1,
"createTime": "Jun 18, 2019 11:44:05 AM",
"updateTime": "Jun 27, 2019 3:18:45 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 23,
"name": "苏醒-天天都是自然醒",
"audioUrl": "https://video.ydlcdn.com/2019/06/20/de9ffdba914a76f618a6ce6853cdb694.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/20/giqmz67npr3ek6dt.png",
"effectCode": 1,
"category": 1,
"playCount": 2232,
"sort": 101,
"isDelete": 1,
"createTime": "Jun 20, 2019 7:11:12 PM",
"updateTime": "Jun 27, 2019 3:19:34 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 22,
"name": "唤醒-开启充满能量的一天",
"audioUrl": "https://video.ydlcdn.com/2019/06/19/b953022e5586465af7749f9927df8b28.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/19/ycdbj7zat9wlpjgu.png",
"effectCode": 1,
"category": 1,
"playCount": 2650,
"sort": 100,
"isDelete": 1,
"createTime": "Jun 19, 2019 1:58:31 PM",
"updateTime": "Jun 27, 2019 3:19:42 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 7,
"name": "海风海浪",
"audioUrl": "https://video.ydlcdn.com/2019/06/06/1b581d7050d2ff3f7b42dd3898710358.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/11/7uxele8p8ej5ltj2.png",
"effectCode": 0,
"category": 1,
"playCount": 4397,
"sort": 100,
"isDelete": 1,
"createTime": "Jun 6, 2019 1:10:19 PM",
"updateTime": "Jun 11, 2019 3:02:26 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 6,
"name": "春雨润物",
"audioUrl": "https://video.ydlcdn.com/2019/06/11/2d063f2f3f872b721fb4d8ae9d7a29de.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/06/e3tvjeka4c788arb.png",
"effectCode": 0,
"category": 1,
"playCount": 3037,
"sort": 99,
"isDelete": 1,
"createTime": "Jun 6, 2019 1:07:39 PM",
"updateTime": "Jun 11, 2019 2:57:09 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 8,
"name": "夏夜蛙叫",
"audioUrl": "https://video.ydlcdn.com/2019/06/06/eeeb331ac48c0da69b247defadde1038.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/10/apdactb60px50ars.png",
"effectCode": 0,
"category": 1,
"playCount": 2449,
"sort": 98,
"isDelete": 1,
"createTime": "Jun 6, 2019 1:17:17 PM",
"updateTime": "Jun 10, 2019 9:06:24 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 9,
"name": "静谧森林",
"audioUrl": "https://video.ydlcdn.com/2019/06/06/0ee8a58c6fcdf7d3dade5b08abb0e652.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/06/5wvqfek93gvlzp60.png",
"effectCode": 0,
"category": 1,
"playCount": 2529,
"sort": 97,
"isDelete": 1,
"createTime": "Jun 6, 2019 1:42:07 PM",
"updateTime": "Jun 6, 2019 4:11:43 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 10,
"name": "夏夜虫鸣",
"audioUrl": "https://video.ydlcdn.com/2019/06/06/d1dc9bed15f31236f414908a2e5e7dc9.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/06/rax09rnm6qcbgx38.png",
"effectCode": 0,
"category": 1,
"playCount": 2323,
"sort": 96,
"isDelete": 1,
"createTime": "Jun 6, 2019 1:52:54 PM",
"updateTime": "Jun 6, 2019 4:12:18 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 11,
"name": "小溪流水",
"audioUrl": "https://video.ydlcdn.com/2019/06/06/cfea73643804a0068b25b1cc3451b429.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/11/i2tlh46j8jokoclc.png",
"effectCode": 0,
"category": 1,
"playCount": 2375,
"sort": 95,
"isDelete": 1,
"createTime": "Jun 6, 2019 2:04:27 PM",
"updateTime": "Jun 11, 2019 3:03:16 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 15,
"name": "炉火温暖",
"audioUrl": "https://video.ydlcdn.com/2019/06/11/4088b38d50ef1e56e879990b986c2979.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/11/azab5zx2mwxigd4i.png",
"effectCode": 0,
"category": 1,
"playCount": 2292,
"sort": 94,
"isDelete": 1,
"createTime": "Jun 11, 2019 3:00:36 PM",
"updateTime": "Jun 11, 2019 3:06:37 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}, {
"id": 16,
"name": "秋风落叶",
"audioUrl": "https://video.ydlcdn.com/2019/06/11/f29286e08293d7f51d530caebf2feff4.mp3",
"backgroundUrl": "https://img.ydlcdn.com/file/2019/06/11/fekegxl0bcajqucz.png",
"effectCode": 0,
"category": 1,
"playCount": 2642,
"sort": 93,
"isDelete": 1,
"createTime": "Jun 11, 2019 3:10:24 PM",
"updateTime": "Jun 11, 2019 3:11:06 PM",
"shareUrl": "https://m.ydl.com/app",
"appId": "gh_c154608001f0",
"path": "pages/index/main"
}]
}, "type":10008},{"fmBean":{"endRow":4,"isHasNextPage":false,"isHasPreviousPage":false,"isIsFirstPage":false,"isIsLastPage":false,"list":[{"adminId":928,"appImg":"https://img.ydlcdn.com/file/2019/05/13/lnmz47l5xmxtwca1.jpg","author":"蕊希","categoryId":1,"createTime":"May 13, 2019 8:02:39 PM","description":"主播蕊希,转载自公众号蕊希","favorites":2688,"fmUrl":"https://video.ydlcdn.com/2019/05/13/7c15aa5c5bc6d6038d280114b1f2b72d.mp3","hits":4916,"id":597,"imageUrl":"https://img.ydlcdn.com/file/2019/05/13/lnmz47l5xmxtwca1.jpg","isOriginal":"2","isShow":"1","name":"结婚前一定要知道的事","orderNum":1,"period":"1","shareCount":0,"updateTime":"May 27, 2019 3:30:02 PM"},{"adminId":928,"appImg":"https://img.ydlcdn.com/file/2019/05/13/udkv4bbny3xqnsm5.jpg","author":"凯哥","categoryId":1,"createTime":"May 13, 2019 8:01:49 PM","description":"主播凯紫,转载自公众号凯紫","favorites":2145,"fmUrl":"https://video.ydlcdn.com/2019/05/13/d558c7f6b521484d100075f35e548565.mp3","hits":4053,"id":596,"imageUrl":"https://img.ydlcdn.com/file/2019/05/13/udkv4bbny3xqnsm5.jpg","isOriginal":"2","isShow":"1","name":"成年人的恋爱:不要靠的太近","orderNum":1,"period":"1","shareCount":0,"updateTime":"May 27, 2019 5:06:40 PM"},{"adminId":928,"appImg":"https://img.ydlcdn.com/file/2019/04/23/bnrmoifrha035bpm.jpg","author":"蕊希","categoryId":1,"createTime":"Apr 23, 2019 9:21:30 PM","description":"主播蕊希,转载自公众号蕊希","favorites":3518,"fmUrl":"https://video.ydlcdn.com/2019/04/23/7ea8a77c9da09d22fea1e325da280e59.mp3","hits":6893,"id":590,"imageUrl":"https://img.ydlcdn.com/file/2019/04/23/bnrmoifrha035bpm.jpg","isOriginal":"2","isShow":"1","name":"再被你提起,已是连名带姓。","orderNum":1,"period":"1","shareCount":0,"updateTime":"May 27, 2019 4:39:45 PM"},{"adminId":928,"appImg":"https://img.ydlcdn.com/file/2019/04/23/17dupdzmcgrb4uix.jpg","author":"凯哥","categoryId":1,"createTime":"Apr 23, 2019 9:20:10 PM","description":"主播凯紫,转载自公众号凯紫","favorites":3211,"fmUrl":"https://video.ydlcdn.com/2019/04/23/ded5110a34c9d8cb0cdab022cc4b2086.mp3","hits":5567,"id":589,"imageUrl":"https://img.ydlcdn.com/file/2019/04/23/17dupdzmcgrb4uix.jpg","isOriginal":"2","isShow":"1","name":"有一种人,在爱情里一开始就输了","orderNum":1,"period":"1","shareCount":0,"updateTime":"May 27, 2019 4:10:27 PM"}],"navigateFirstPage":1,"navigateLastPage":8,"navigatePages":8,"navigatepageNums":[1,2,3,4,5,6,7,8],"nextPage":2,"pageNum":1,"pageSize":4,"pages":145,"prePage":0,"size":4,"startRow":1,"total":577,"isRealEmpty":false},"type":10009},{"articleBean":{"category":[{"descript":"情感","id":482,"isShow":1,"keyword":"情感","name":"情感","parentId":464,"place":1,"title":"情感"},{"descript":"亲子","id":483,"isShow":1,"keyword":"亲子","name":"亲子","parentId":464,"place":1,"title":"亲子"},{"descript":"职场","id":484,"isShow":1,"keyword":"职场","name":"职场","parentId":464,"place":1,"title":"职场"},{"descript":"健康","id":485,"isShow":1,"keyword":"健康","name":"健康","parentId":464,"place":1,"title":"健康"},{"descript":"科普","id":486,"isShow":1,"keyword":"科普","name":"科普","parentId":464,"place":1,"title":"科普"}],"list":[{"countOfFavorite":1,"createTime":"May 26, 2019 9:01:30 PM","createTimeFormat":"2019-05-26","desc":"希望我们每个职场人都能重视培养自己的逆商,成为人生长跑中,笑到最后的那个人。","doctorId":9490,"hUrl":"https://h2.yidianling.com/article/9358","id":9358,"imgUrl":"https://img.ydlcdn.com/file/2019/05/27/2blzfhhxwy0xa7no.jpg","name":"丁路遥","pseudonym":"丁路遥","readNum":1472,"smallImage":"https://img.ydlcdn.com/file/2018/09/15/6c84a0333706f4a0558d55550045def8..jpg!s120x120","title":"职场中比情商高更重要的是逆商"},{"countOfFavorite":2,"createTime":"May 26, 2019 1:07:15 PM","createTimeFormat":"2019-05-26","desc":"依赖他人,是我们满足自己心理需求和现实需求很重要的手段之一。它弥补了我们自身的软弱、局限和无能,让我们的人生更加完整和滋养。但是过度依赖,必定会迎来失望,失望之后的不甘心,必定是无止境的愤怒。","doctorId":4064,"hUrl":"https://h2.yidianling.com/article/9356","id":9356,"imgUrl":"https://img.ydlcdn.com/file/2019/05/27/5u4tb1c6xe037xjv.jpg","name":"陈瑾瑾","pseudonym":"陈瑾瑾","readNum":1406,"smallImage":"https://img.ydlcdn.com/file/2018/03/15/p5hmpru0n0dt5331.png!s120x120","title":"为什么你总是遇到失败的爱情,却让人心疼不起来?"},{"countOfFavorite":0,"createTime":"May 26, 2019 1:04:44 PM","createTimeFormat":"2019-05-26","desc":"我们不需要去矫正“我不够好”的认知,而需要去拓宽自己对自己的认知。","doctorId":4064,"hUrl":"https://h2.yidianling.com/article/9355","id":9355,"imgUrl":"https://img.ydlcdn.com/file/2019/05/27/gujcrezyt9gigogo.jpg","name":"陈瑾瑾","pseudonym":"陈瑾瑾","readNum":1135,"smallImage":"https://img.ydlcdn.com/file/2018/03/15/p5hmpru0n0dt5331.png!s120x120","title":"有句魔咒叫:“我不够好。”"},{"countOfFavorite":1,"createTime":"May 26, 2019 1:03:46 PM","createTimeFormat":"2019-05-26","desc":"你会选择跟一个爱你的人还是你爱的人在一起?","doctorId":4064,"hUrl":"https://h2.yidianling.com/article/9354","id":9354,"imgUrl":"https://img.ydlcdn.com/file/2019/05/27/c7lo4sq28kvql8c1.jpg","name":"陈瑾瑾","pseudonym":"陈瑾瑾","readNum":1141,"smallImage":"https://img.ydlcdn.com/file/2018/03/15/p5hmpru0n0dt5331.png!s120x120","title":"为什么恋爱中的你,却比单身时还寂寞"}],"isRealEmpty":false},"type":10010},{"type":10011}]
\ No newline at end of file
{"v":"5.5.8","fr":30,"ip":0,"op":56,"w":22,"h":22,"nm":"抱抱动效","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"爱心","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":16,"s":[0],"e":[100]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":22,"s":[100],"e":[100]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":35,"s":[100],"e":[0]},{"t":49}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[11,11,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":16,"s":[30,30,100],"e":[119.565,119.565,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":22,"s":[119.565,119.565,100],"e":[119.565,119.565,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":35,"s":[119.565,119.565,100],"e":[172.565,172.565,100]},{"t":49}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0.174,0],[0.137,0.106],[0.999,0.903],[0.552,0.866],[0.185,0.438],[0,0.541],[-0.65,0.711],[-0.955,0],[-0.663,-0.875],[-1.069,0],[-0.668,-0.731],[0,-0.997],[0.423,-0.665],[1.331,-1.204],[0.093,-0.072]],"o":[[-0.174,0],[-0.093,-0.072],[-1.331,-1.204],[-0.25,-0.393],[-0.221,-0.523],[0,-0.997],[0.668,-0.731],[1.069,0],[0.663,-0.875],[0.955,0],[0.65,0.711],[0,1.227],[-0.552,0.866],[-0.999,0.903],[-0.138,0.106]],"v":[[0,5.75],[-0.483,5.585],[-2.421,3.952],[-5.259,0.833],[-5.935,-0.387],[-6.262,-1.969],[-5.254,-4.617],[-2.737,-5.75],[0,-4.351],[2.737,-5.75],[5.254,-4.617],[6.262,-1.969],[5.259,0.833],[2.421,3.952],[0.482,5.585]],"c":true},"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.999295343137,0.847525383444,0.60063344918,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":600,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"抱抱 6","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0],"e":[100]},{"t":3}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[10.898,17.5,0],"ix":2},"a":{"a":0,"k":[0.023,6.5,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":8,"s":[{"i":[[0,0],[0.633,1.162],[-1.087,0.716],[0,0],[-0.416,0],[0,0],[-0.378,-0.226],[0,0],[0.633,-1.162],[1.122,0.657],[0,0],[0,0],[1.394,0],[0,0],[0,1.292],[0,0]],"o":[[-1.122,0.657],[-0.633,-1.162],[0,0],[0.353,-0.169],[0,0],[0.508,0],[0,0],[1.062,0.756],[-0.634,1.162],[0,0],[0,0],[0,1.292],[0,0],[-1.394,0],[0,0],[0,0]],"v":[[12.144,39.311],[8.953,38.391],[9.84,35.084],[13.675,32.555],[15.487,32.189],[22.794,32.189],[24.924,32.555],[28.482,35.084],[29.37,38.391],[26.178,39.311],[25.329,38.809],[25.329,42.321],[22.794,44.67],[15.487,44.67],[12.953,42.321],[12.959,38.825]],"c":true}],"e":[{"i":[[0,0],[0.633,1.162],[-0.992,0.899],[0,0],[-0.416,0],[0,0],[-0.378,-0.226],[0,0],[0.633,-1.162],[0.67,0.172],[0,0],[0,0],[1.394,0],[0,0],[0,1.292],[0,0]],"o":[[-0.358,-0.016],[-0.633,-1.162],[0,0],[0.353,-0.169],[0,0],[0.508,0],[0,0],[1.062,0.756],[-0.634,1.162],[0,0],[0,0],[0,1.292],[0,0],[-1.394,0],[0,0],[0,0]],"v":[[12.144,39.311],[10.265,37.953],[11.59,34.021],[13.675,32.555],[15.487,32.189],[22.794,32.189],[24.924,32.555],[26.795,33.709],[28.433,38.016],[26.178,39.311],[25.329,38.809],[25.329,42.321],[22.794,44.67],[15.487,44.67],[12.953,42.321],[12.959,38.825]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":22,"s":[{"i":[[0,0],[0.633,1.162],[-0.992,0.899],[0,0],[-0.416,0],[0,0],[-0.378,-0.226],[0,0],[0.633,-1.162],[0.67,0.172],[0,0],[0,0],[1.394,0],[0,0],[0,1.292],[0,0]],"o":[[-0.358,-0.016],[-0.633,-1.162],[0,0],[0.353,-0.169],[0,0],[0.508,0],[0,0],[1.062,0.756],[-0.634,1.162],[0,0],[0,0],[0,1.292],[0,0],[-1.394,0],[0,0],[0,0]],"v":[[12.144,39.311],[10.265,37.953],[11.59,34.021],[13.675,32.555],[15.487,32.189],[22.794,32.189],[24.924,32.555],[26.795,33.709],[28.433,38.016],[26.178,39.311],[25.329,38.809],[25.329,42.321],[22.794,44.67],[15.487,44.67],[12.953,42.321],[12.959,38.825]],"c":true}],"e":[{"i":[[0,0],[0.633,1.162],[-0.992,0.899],[0,0],[-0.416,0],[0,0],[-0.378,-0.226],[0,0],[0.633,-1.162],[0.67,0.172],[0,0],[0,0],[1.394,0],[0,0],[0,1.292],[0,0]],"o":[[-0.358,-0.016],[-0.633,-1.162],[0,0],[0.353,-0.169],[0,0],[0.508,0],[0,0],[1.062,0.756],[-0.634,1.162],[0,0],[0,0],[0,1.292],[0,0],[-1.394,0],[0,0],[0,0]],"v":[[12.144,39.311],[10.265,37.953],[11.59,34.021],[13.675,32.555],[15.487,32.189],[22.794,32.189],[24.924,32.555],[26.795,33.709],[28.433,38.016],[26.178,39.311],[25.329,38.809],[25.329,42.321],[22.794,44.67],[15.487,44.67],[12.953,42.321],[12.959,38.825]],"c":true}]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":35,"s":[{"i":[[0,0],[0.633,1.162],[-0.992,0.899],[0,0],[-0.416,0],[0,0],[-0.378,-0.226],[0,0],[0.633,-1.162],[0.67,0.172],[0,0],[0,0],[1.394,0],[0,0],[0,1.292],[0,0]],"o":[[-0.358,-0.016],[-0.633,-1.162],[0,0],[0.353,-0.169],[0,0],[0.508,0],[0,0],[1.062,0.756],[-0.634,1.162],[0,0],[0,0],[0,1.292],[0,0],[-1.394,0],[0,0],[0,0]],"v":[[12.144,39.311],[10.265,37.953],[11.59,34.021],[13.675,32.555],[15.487,32.189],[22.794,32.189],[24.924,32.555],[26.795,33.709],[28.433,38.016],[26.178,39.311],[25.329,38.809],[25.329,42.321],[22.794,44.67],[15.487,44.67],[12.953,42.321],[12.959,38.825]],"c":true}],"e":[{"i":[[0,0],[0.633,1.162],[-1.087,0.716],[0,0],[-0.416,0],[0,0],[-0.378,-0.226],[0,0],[0.633,-1.162],[1.122,0.657],[0,0],[0,0],[1.394,0],[0,0],[0,1.292],[0,0]],"o":[[-1.122,0.657],[-0.633,-1.162],[0,0],[0.353,-0.169],[0,0],[0.508,0],[0,0],[1.062,0.756],[-0.634,1.162],[0,0],[0,0],[0,1.292],[0,0],[-1.394,0],[0,0],[0,0]],"v":[[12.144,39.311],[8.953,38.391],[9.84,35.084],[13.675,32.555],[15.487,32.189],[22.794,32.189],[24.924,32.555],[28.482,35.084],[29.37,38.391],[26.178,39.311],[25.329,38.809],[25.329,42.321],[22.794,44.67],[15.487,44.67],[12.953,42.321],[12.959,38.825]],"c":true}]},{"t":43}],"ix":2},"nm":"路径 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[2.388,0],[0,2.352],[-2.388,0],[0,-2.352]],"o":[[-2.388,0],[0,-2.352],[2.388,0],[0,2.352]],"v":[[19.159,32.189],[14.835,27.93],[19.159,23.67],[23.482,27.93]],"c":true},"ix":2},"nm":"路径 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[1,0.388235324037,0.509803921569,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-19.161,-34.17],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":4,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":600,"st":0,"bm":0}],"markers":[{"tm":43,"cm":"1","dr":0}]}
\ No newline at end of file
{"v":"5.5.8","fr":25,"ip":0,"op":199,"w":504,"h":234,"nm":"mingxiang","ddd":0,"assets":[{"id":"image_0","w":504,"h":234,"u":"images/","p":"img_0.png","e":0},{"id":"image_1","w":504,"h":22,"u":"images/","p":"img_1.png","e":0},{"id":"image_2","w":504,"h":234,"u":"images/","p":"img_2.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"feather","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[15.025],"e":[-10.285]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":71,"s":[-10.285],"e":[0]},{"t":127}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":0.665},"o":{"x":0.333,"y":0},"t":0,"s":[212,-43,0],"e":[263,70.637,0],"to":[0,4.714,0],"ti":[-34.871,-28.686,0]},{"i":{"x":0.63,"y":1},"o":{"x":0.333,"y":0.409},"t":71,"s":[263,70.637,0],"e":[205.062,130.812,0],"to":[27.792,22.862,0],"ti":[64.833,-1.741,0]},{"t":148}],"ix":2},"a":{"a":0,"k":[252,117,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[74.717,46.521,100],"e":[88.851,50.571,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":71,"s":[88.851,50.571,100],"e":[100,79.07,100]},{"t":127}],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"shadow","refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"s":true,"x":{"a":0,"k":311.75,"ix":3},"y":{"a":0,"k":189.75,"ix":4}},"a":{"a":0,"k":[357.25,11.75,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"bg","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[252,117,0],"ix":2},"a":{"a":0,"k":[252,117,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"背景","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[252,117,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[508.762,239.879],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"st","c":{"a":0,"k":[0.113724996529,0.631372967888,0.949020026712,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"gf","o":{"a":0,"k":100,"ix":10},"r":1,"bm":0,"g":{"p":2,"k":{"a":0,"k":[0,1,1,1,1,0,0,0],"ix":9}},"s":{"a":0,"k":[-228.375,-115.053],"ix":5},"e":{"a":0,"k":[247.004,132.97],"ix":6},"t":1,"nm":"渐变填充 1","mn":"ADBE Vector Graphic - G-Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-1.619,-1.061],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[99.976,98.959],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":750,"st":0,"bm":0}],"markers":[]}
\ No newline at end of file
package com.yidianling.consultant.constants
/**
* Created by xj on 2019/7/1.
*/
class HomeBIConstants {
companion object {
private const val YDL_USER_MAIN_PAGE: String = "ydl_user_main_page|"//壹点灵用户版首页 partId
const val YDL_USER_SEARCH_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_search_click"//搜索栏
const val YDL_USER_TELEPHONE_CUSTOMER_SERVICE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_telephone_customer_service_click"//电话客服
const val YDL_USER_BANNER_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_banner_click"//banner
const val YDL_USER_NOTICE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_notice_click"//公告
const val YDL_USER_CONSULT_CLASSIFICATION_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_consult_classification_click"//首页咨询分类
const val YDL_USER_CONSULT_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_consult_click"//四个大按钮 心理咨询点击人数
const val YDL_USER_TALK_IN_TIME_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_talk_in_time_click"//四个大按钮 即时倾诉点击人数
const val YDL_USER_PSYCHOLOGICAL_CLASSROOM_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_psychological_classroom_click"//四个大按钮 心理课堂点击人数
const val YDL_USER_PSYCHOLOGICAL_TEST_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_psychological_test_click"//四个大按钮 心理测试点击人数
const val YDL_USER_CONSULT_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_consult_more_click"//咨询解惑更多
const val YDL_USER_CONSULT_TYPE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_consult_type_click"//咨询解惑分类标签
const val YDL_USER_EXPERT_INTRODUCTION_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_expert_introduction_click"//咨询师介绍模块
const val YDL_USER_PRIVATE_CHAT_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_private_chat_click"//咨询师私聊按钮
const val YDL_USER_LISTEN_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_listen_more_click"//倾诉排解更多
const val YDL_USER_LISTEN_TYPE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_listen_type_click"//倾诉排解分类标签
const val YDL_USER_LISTENER_INTRODUCTION_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_listener_introduction_click "//倾诉师介绍模块
const val YDL_USER_COURSE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_course_more_click"//课程成长更多
const val YDL_USER_COURSE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_course_click"//课程标题图区域
const val YDL_USER_ASK_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_ask_more_click"//解忧问答更多
const val YDL_USER_ASK_COMMENT_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_ask_comment_click"//问答评论区域
const val YDL_USER_HEART_RADIO_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_heart_radio_more_click"//心灵电台更多
const val YDL_USER_RADIO_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_radio_click "//区域内四个标题
const val YDL_USER_RADIO_PLAY_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_radio_play_click"//心灵电台play按钮点击
const val YDL_USER_ARTICLE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_more_click"//文章阅读更多
const val YDL_USER_ARTICLE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_click"//文章标题图区域
const val YDL_USER_MAIN_PAGE_VISIT: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_visit "//首页浏览事件
}
}
\ No newline at end of file
package com.yidianling.home.adapter
import android.content.Context
import android.support.v4.view.PagerAdapter
import android.util.Log
import android.view.View
import android.view.ViewGroup
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import com.yidianling.home.ui.view.HomeCategoryContainer
import com.yidianling.home.ui.view.HomePagerBannerCategoryItemView
import java.util.*
import kotlin.collections.ArrayList
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/3/18
*/
class HomeCategoryAdapter : PagerAdapter{
private var mContext : Context? = null
private var mHomeEvent : IHomeEvent? = null
//源数据
private var mOriginList : MutableList<HomeHeaderBean.AskCategoryDataBean>? = null
//数据
private var list : MutableList<MutableList<HomeHeaderBean.AskCategoryDataBean>>? = null
init {
list = ArrayList()
}
constructor(context: Context,homeEvent : IHomeEvent?) : super(){
mContext = context
mHomeEvent = homeEvent
}
/**
* 更新数据
*/
fun updateItems(data : MutableList<HomeHeaderBean.AskCategoryDataBean>?){
if (null == data || data.isEmpty()){
return
}
Log.e("http","--------------data.size="+data!!.size)
list = this.averageAssign(data, HomeCategoryContainer.PAGE_ITEM_SIZE)
Log.e("http","--------------list.size="+list!!.size)
notifyDataSetChanged()
}
override fun isViewFromObject(view: View?, `object`: Any?): Boolean {
return view === `object`
}
override fun instantiateItem(container: ViewGroup?, position: Int): Any {
val categoryView = HomePagerBannerCategoryItemView(mContext!!,mHomeEvent!!)
categoryView.initData(list!![position])
container?.addView(categoryView)
return categoryView
}
//====================ViewPager 不刷新问题====================
override fun getItemPosition(`object`: Any?): Int {
return PagerAdapter.POSITION_NONE
}
override fun destroyItem(container: ViewGroup, position: Int, `object`: Any) {
container.removeView(`object` as View)
}
//====================ViewPager 不刷新问题====================
override fun getCount(): Int {
return list!!.size
}
fun <T> averageAssign(source : MutableList<T> , limit : Int) : MutableList<MutableList<T>>{
if (null == source || source.isEmpty()) {
return Collections.emptyList()
}
val result = ArrayList<MutableList<T>>()
var value : MutableList<T> = ArrayList()
// var yushu = source.size%limit
// var quotient = source.size/limit
// for (i in source.indices) {
// value.add(source[i])
// if ((i+1) % limit == 0){
// result.add(value)
// value = ArrayList()
// }else if (i == source.size - 1){
// result.add(value)
// }else if ((i+1) > source.size - yushu){
// value = ArrayList()
// }
// }
for (i in source.indices) {
if ((i + 1) % limit == 1){
//新分组
value = ArrayList()
}
value.add(source[i])
if (i == source.size -1 || ( i + 1 ) % limit == 0){
//列表最后一个或者为分组最后一个
result.add(value)
}
}
return result
}
}
\ No newline at end of file
package com.yidianling.home.adapter
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.yidianling.home.R
import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.*
import com.yidianling.home.ui.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 壹点零首页适配器
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class YdlHomeAdapter(private val mContext: Context,
private var homeEvent: IHomeEvent,
private var list: ArrayList<HomePagerDataBean>) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
private val mInflater: LayoutInflater = LayoutInflater.from(mContext)
/**
* 倾述item的position
*
*/
private var confidePosition = -1
/**
* 咨询条目 position
*/
private var consultPosition = -1
/**
* 倾述模块中tab上次选中的下标
*/
var confideSelectPosition = 0
/**
* 咨询模块中tab上次选中的下标
*/
var consultSelectPosition = 0
/**
* 倾诉分类 缓存
*/
var listenCategoryDate: List<HomeHeaderBean.ListenCategoryDateBean>? = null
/**
* 咨询分类 缓存
*/
var consultCategoryData: List<HomeHeaderBean.ConsultCategoryDateBean>? = null
fun updateItems(list: MutableList<HomePagerDataBean>) {
if (null == this.list || this.list!!.isEmpty()) {
this.list = ArrayList()
} else {
this.list.clear()
}
this.list.addAll(list)
//重置标记位
confidePosition = -1
consultPosition = -1
notifyDataSetChanged()
}
/**
* 更新倾诉模块数据
*/
fun updateConfideData(data: HomeConfideBean, selectPosition: Int) {
if (confidePosition == -1) {
return
}
list[confidePosition].confideBean = data
this.confideSelectPosition = selectPosition
notifyItemChanged(confidePosition)
}
/**
* 更新咨询模块数据
*/
fun updateConsultData(data: HomeConsultBean, selectPosition: Int) {
if (consultPosition == -1) {
return
}
list[consultPosition].consultBean = data
this.consultSelectPosition = selectPosition
notifyItemChanged(consultPosition)
}
/**
* 更新问答模块数据
*/
fun updateAskData(data: HomeAskBean, position: Int) {
list[position].askBean = data
// notifyItemChanged(position)
}
override fun getItemViewType(position: Int): Int {
if (position < list.size) {
return list[position].type!!
} else {
return YdlHomeViewHolderConstract.FOOTER_VIEW
}
}
override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): RecyclerView.ViewHolder {
when (viewType) {
//顶部ViewPager与分类模块
YdlHomeViewHolderConstract.PAGER_BANNER_VIEW -> {
return HomePagerBannerViewHolder(HomePagerBannerView(mContext, homeEvent))
}
//咨询模块
YdlHomeViewHolderConstract.CONSULT_VIEW -> {
return HomeConsultViewHolder(HomeConsultView(mContext, homeEvent))
}
//顶部预约专家,即时倾诉,心理测试按钮模块
YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW -> {
return HomeButtonBannerViewHolder(HomeButtonBannerView(mContext, homeEvent))
}
//倾诉*排解模块
YdlHomeViewHolderConstract.CONFIDE_VIEW -> {
return HomeConfideViewHolder(HomeConfideView(mContext, homeEvent))
}
//课程*成长模块
YdlHomeViewHolderConstract.COURSE_VIEW -> {
return HomeCourseViewHolder(HomeCourseView(mContext, homeEvent))
}
//解忧*问答模块
YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW -> {
return HomeAssuageGriefViewHolder(HomeAssuageGriefView(mContext, homeEvent))
}
//测试模块
YdlHomeViewHolderConstract.TEST_VIEW -> {
return HomeTestViewHolder(HomeTestView(mContext, homeEvent))
}
//心灵*电台模块
YdlHomeViewHolderConstract.INTELLIGENT_VIEW -> {
return HomeIntelligentViewHolder(HomeIntelligentView(mContext, homeEvent))
}
//文章*阅读模块
YdlHomeViewHolderConstract.ARTICLE_VIEW -> {
return HomeArticleViewHolder(HomeArticleView(mContext, homeEvent))
}
//壹点*冥想模块
YdlHomeViewHolderConstract.MUSE_VIEW -> {
return HomeMuseViewHolder(HomeMuseView(mContext, homeEvent))
}
//底部提示语模块
else -> {
val view = mInflater.inflate(R.layout.home_module_footer_view, parent, false)
return FooterViewViewHolder(view)
}
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (holder) {
//顶部ViewPager与分类模块
is HomePagerBannerViewHolder -> {
var headerBean = list[position].headerBean;
this.consultCategoryData = headerBean?.consultCategoryData
this.listenCategoryDate = headerBean?.listenCategoryDate
holder.pagerBannerView.initData(headerBean)
}
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
}
//咨询模块
is HomeConsultViewHolder -> {
holder.consultView.setTitle(this.consultCategoryData, consultSelectPosition)
holder.consultView.setConsultInfoView(list[position].consultBean?.list,this.consultCategoryData?.get(consultSelectPosition))
consultPosition = position
}
//倾诉*排解模块
is HomeConfideViewHolder -> {
holder.confideViewView.setTitle(this.listenCategoryDate, confideSelectPosition)
holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
confidePosition = position
}
//课程*成长模块
is HomeCourseViewHolder -> {
holder.courseViewView.initData(list[position].courseBean?.list)
}
//解忧*问答模块
is HomeAssuageGriefViewHolder -> {
holder.assuageGriefViewView.initData(position,list[position].askBean?.data)
}
//壹点*冥想模块
is HomeMuseViewHolder -> {
holder.museViewView.initData(list[position].museBean)
}
//心灵*电台模块
is HomeIntelligentViewHolder -> {
holder.intelligentViewView.initData(list[position].fmBean?.list)
}
//文章*阅读模块
is HomeArticleViewHolder -> {
holder.articleViewView.initData(list[position].articleBean?.list)
}
//测试模块
is HomeTestViewHolder -> {
holder.testView.initData(list[position].testListBean)
}
}
}
override fun getItemCount(): Int {
return list.size
}
/**
* 顶部ViewPager与分类模块 ViewHolder
*/
inner class HomePagerBannerViewHolder(val pagerBannerView: HomePagerBannerView) : RecyclerView.ViewHolder(pagerBannerView)
/**
* 顶部预约专家,即时倾诉,心理测试按钮模块 ViewHolder
*/
inner class HomeButtonBannerViewHolder(val buttonBannerView: HomeButtonBannerView) : RecyclerView.ViewHolder(buttonBannerView)
/**
* 咨询模块 ViewHolder
*/
inner class HomeConsultViewHolder(val consultView: HomeConsultView) : RecyclerView.ViewHolder(consultView)
/**
* 倾诉*排解模块 ViewHolder
*/
inner class HomeConfideViewHolder(val confideViewView: HomeConfideView) : RecyclerView.ViewHolder(confideViewView)
/**
* 课程*成长模块 ViewHolder
*/
inner class HomeCourseViewHolder(val courseViewView: HomeCourseView) : RecyclerView.ViewHolder(courseViewView)
/**
* 测试模块 ViewHolder
*/
inner class HomeTestViewHolder(val testView: HomeTestView) : RecyclerView.ViewHolder(testView)
/**
* 解忧*问答模块 ViewHolder
*/
inner class HomeAssuageGriefViewHolder(val assuageGriefViewView: HomeAssuageGriefView) : RecyclerView.ViewHolder(assuageGriefViewView)
/**
* 心灵*电台模块 ViewHolder
*/
inner class HomeIntelligentViewHolder(val intelligentViewView: HomeIntelligentView) : RecyclerView.ViewHolder(intelligentViewView)
/**
* 文章*阅读模块 ViewHolder
*/
inner class HomeMuseViewHolder(val museViewView: HomeMuseView) : RecyclerView.ViewHolder(museViewView)
/**
* 文章*阅读模块 ViewHolder
*/
inner class HomeArticleViewHolder(val articleViewView: HomeArticleView) : RecyclerView.ViewHolder(articleViewView)
/**
* 底部提示语模块 ViewHolder
*/
inner class FooterViewViewHolder(val footerView: View) : RecyclerView.ViewHolder(footerView)
}
\ No newline at end of file
package com.yidianling.home.constract
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.home.model.bean.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 壹点灵首页约束类
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class IHomeContract {
interface View : IView {
/**
* 首页数据回调接口
*/
fun homeDataResponse(list: MutableList<HomePagerDataBean>)
/**
* 头部数据回调
*/
fun homeHeadResponse(homeHeaderBean: HomeHeaderBean)
/**
* 首页数据请求失败接口
*/
fun homeDataFail(msg: String)
/**
* 获取倾述数据回调
*/
fun confideDataResponse(data: HomeConfideBean, selectPosition: Int)
/**
* 获取咨询数据回调
*/
fun consultDataResponse(data: HomeConsultBean, selectPosition: Int)
/**
* 问答模块数据回调
*/
fun askDataResponse(data: HomeAskBean, position: Int)
/**
* 首页问答 - 点赞
*/
fun askZan(position: Int, index: Int, id: String)
/**
* 首页问答 - 关注
*/
fun askFocus(position: Int, id: String)
/**
* 获取倾述列表数据
* @param type 倾述类型
* @param selectPosition 选中的position
*/
fun getConfideData(type: String, selectPosition: Int)
/**
* 获取咨询列表数据
*/
fun getConsultData(type: String, selectPosition: Int)
fun showHomeProgress()
fun showRefreshLayout()
fun dismissHomeProgress()
fun startAnim()
fun endAnim()
fun resetModuleTabPosition()
fun getSearchContent() : String
}
}
\ No newline at end of file
package com.yidianling.home.constract
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:壹点零首页ViewHolder约束类
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class YdlHomeViewHolderConstract {
companion object {
/**
* 顶部ViewPager与分类模块
*/
val PAGER_BANNER_VIEW = 10001
/**
* 顶部预约专家,即时倾诉,心理测试按钮模块
*/
val BUTTON_BANNER_VIEW = 10002
/**
* 咨询模块
*/
val CONSULT_VIEW = 10003
/**
* 课程*成长模块
*/
val COURSE_VIEW = 10004
/**
* 倾诉*排解模块
*/
val CONFIDE_VIEW = 10005
/**
* 测试模块
*/
val TEST_VIEW = 10006
/**
* 解忧*问答模块
*/
val ASSUAGE_GRIEF_VIEW = 10007
/**
* 壹点*冥想模块
*/
val MUSE_VIEW = 10008
/**
* 心灵*电台模块
*/
val INTELLIGENT_VIEW = 10009
/**
* 文章*阅读模块
*/
val ARTICLE_VIEW = 10010
/**
* 底部提示语模块
*/
val FOOTER_VIEW = 10011
}
}
\ No newline at end of file
package com.yidianling.home.dialog
import android.app.Activity
import android.app.Dialog
import android.os.Bundle
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_router.manager.YDLRouterManager
import com.yidianling.home.R
import kotlinx.android.synthetic.ydl.dialog_activity.*
import java.lang.ref.WeakReference
/**
* 活动弹窗
*/
class ActivityDialog : Dialog {
private var imgUrl: String? = null
private var linkUrl: String? = null
private var title: String? = null
private var mActivity: WeakReference<Activity>? = null
constructor(activit: Activity, imgUrl: String?, linkUrl: String?, title: String?) : super(
activit,
R.style.activityDialog
) {
this.imgUrl = imgUrl
this.linkUrl = linkUrl
this.title = title
this.mActivity = WeakReference<Activity>(activit)
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
window.setBackgroundDrawableResource(android.R.color.transparent)
setContentView(R.layout.dialog_activity)
initView()
}
private fun initView() {
img_close.setOnClickListener {
this.dismiss()
}
img_activity.setOnClickListener {
//跳转
if (this.linkUrl != null && this.linkUrl!!.startsWith("http")) {
NewH5Activity.start(context, H5Params(this.linkUrl!!, null))
} else {
YDLRouterManager.router(this.linkUrl)
}
}
GlideApp.with(context).load(imgUrl).into(img_activity)
setCanceledOnTouchOutside(false)
setCancelable(false)
}
}
package com.yidianling.home.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Window
import com.yidianling.home.R
import com.ydl.ydl_image.module.GlideApp
import kotlinx.android.synthetic.ydl.dialog_guide_activity.*
import java.util.*
/**
* 首页活动引导弹窗
*/
class ActivityGuideDialog : Dialog {
private var imgUrl: String? = null
private var title: String? = null
constructor(context: Context, imgUrl: String?, title: String?) : super(
context,
R.style.activityDialog
) {
this.imgUrl = imgUrl
this.title = title
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
window.setBackgroundDrawableResource(android.R.color.transparent)
setContentView(R.layout.dialog_guide_activity)
initView()
}
private fun initView() {
c_body.setOnClickListener {
dismiss()
}
tv_content.text = this.title
GlideApp.with(context).load(imgUrl).into(img_activity)
//3秒自动消失
Timer().schedule(object : TimerTask() {
override fun run() {
dismiss()
}
}, 3000)
}
}
\ No newline at end of file
package com.yidianling.home.event
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydl_router.util.YDLRouterParamsUrls
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.consultant.constants.HomeBIConstants
import com.yidianling.home.R
import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.model.bean.*
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import org.json.JSONObject
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 首页点击事件实现类
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeImpl : IHomeEvent {
val HOT_SEARCH_DOCTOR_NAME = "hot_search_doctor_name"
override fun consultItemClick(linkUrl: String?, doctorId: String) {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_EXPERT_INTRODUCTION_CLICK, doctorId)
if (null == linkUrl || linkUrl.isEmpty()) {
return
}
if (linkUrl.startsWith("http")) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), "")
} else {
YDLRouterManager.router(linkUrl)
}
}
override fun consultChatClick(doctorId: String?) {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_PRIVATE_CHAT_CLICK, doctorId
?: "")
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()) {
//跳转登录
jumpToLogin()
return
}
if (mContext is AppCompatActivity && !TextUtils.isEmpty(doctorId)) {
//私聊
YDLRouterManager.router(IYDLRouterConstant.ROUTER_CHAT_PRIVATE,
YDLRouterParams()
.putExtra(IYDLRouterConstant.EXTRA_TOUID, doctorId!!)
.putExtra(IYDLRouterConstant.EXTRA_USERTYPE, "1"))
}
}
fun jumpToLogin() {
ARouter.getInstance().build("/user/login")
.navigation()
}
/**
* 获取咨询列表数据
* 最终调用
* @see com.yidianling.home.ui.fragment.YdlHomeFragment.getConsultData
*
* @param type 倾述类型
* @param selectPosition 选中的position
*/
override fun getConsultData(type: HomeHeaderBean.ConsultCategoryDateBean, selectPosition: Int) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_TYPE_CLICK, type.name
?: "")
mHomeView!!.getConsultData(type.id.toString(), selectPosition)
}
private var headerView: View? = null
private var mContext: Context? = null
private var mHomeView: IHomeContract.View? = null
var COURSE_DETAIL_H5 = YdlRetrofitUtils.WEB_URL + "fe-app-yidianling/course/Detail/"
constructor(context: Context, homeView: IHomeContract.View) {
mContext = context
this.mHomeView = homeView
}
override fun onPageScroll(view_rl_top_bg: View): RecyclerView.OnScrollListener? {
return object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (headerView == null) headerView = recyclerView?.getChildAt(0)
val top = headerView?.top
val height = Math.abs(top!!)
var per = height.toFloat() / 500
//最大比例为1
if (per > 1f) {
per = 1f
}
val alpha = (per * 255).toInt()
// Log.e("Tag", "alpha=$alpha--per=$per")
view_rl_top_bg.background.mutate().alpha = alpha
}
}
}
override fun serviceCallClick() {
try {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_TELEPHONE_CUSTOMER_SERVICE_CLICK)
val tel = if (PlatformRamImpl.getInstance().getGlobalInfo() == null) "400-114-1010'" else PlatformRamImpl.getInstance().getGlobalInfo()!!.info.tel
var con = "\n400-114-1010\n早8:30-凌晨2:00"
if (PlatformRamImpl.getInstance().getGlobalInfo() != null && PlatformRamImpl.getInstance().getGlobalInfo()!!.info != null) {
con = PlatformRamImpl.getInstance().getGlobalInfo()?.info?.tel + "\n" + PlatformRamImpl.getInstance().getGlobalInfo()?.info?.work_time
}
val dialog = CommonDialog(mContext)
.setTitle("欢迎致电壹点灵客服热线")
.setMessage(con)
.setLeftOnclick("取消") { v1 ->
}.setRightClick("拨打") { v12 ->
val phoneIntent = Intent(Intent.ACTION_DIAL,
Uri.parse("tel:$tel"))
mContext?.startActivity(phoneIntent)
}
dialog.setMessageOnclick {
}
dialog.show()
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun searchTvClick(text: String) {
if (Utils.isFastClick()) {
//防止连击
return
}
var doctorName = if (text != mContext?.resources?.getString(R.string.search_hint) && text != mContext?.resources?.getString(R.string.search)) text else ""
ARouter.getInstance()
.build("/consult/hot_search")
.withString(HOT_SEARCH_DOCTOR_NAME, doctorName)
.navigation()
}
override fun consultMoreClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MAIN_TAB, YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_TAB, "2"))
ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_MORE_CLICK)
}
override fun bannerClick(banner: HomeHeaderBean.FocusListBean) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_BANNER_CLICK, banner.focId.toString())
linkTo(banner.linkUrl.toString())
}
override fun categoryClick(data: HomeHeaderBean.AskCategoryDataBean) {
// linkTo(data.url.toString())
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_CLASSIFICATION_CLICK, data.cateId.toString(), data.cateTitle
?: "")
goExpertSearch(data)
}
private fun goExpertSearch(data: HomeHeaderBean.AskCategoryDataBean) {
if (!TextUtils.isEmpty(data.url) && data.url!!.endsWith("?")) {
data.url = data.url!!.substring(0, data.url!!.length - 1)
}
if ("全部类别" == data.cateTitle || "全部分类" == data.cateTitle) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, YdlCommonOut.API_HOST_H5 + "experts/cates"))
} else {
//跳转咨询频道页 服务入口
YDLRouterManager.router(IYDLRouterConstant.ROUTER_CONSULT_LIST,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_CATEID, data.cateId.toString()).putExtra(IYDLRouterConstant.EXTRA_CATETITLE, data.cateTitle!!).putExtra(IYDLRouterConstant.EXTRA_SHOWTYPE, "0"))
}
}
override fun linkTo(linkUrl: String) {
if (Utils.isFastClick()) {
//防止连击
return
}
YDLRouterManager.router(linkUrl)
}
override fun reservationExpertsClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
EventBus.getDefault().post(SelectTabCallPhoneEvent(2))
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_MAIN_TAB,YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_TAB, "2"))
ActionCountUtils.count(HomeBIConstants.YDL_USER_CONSULT_CLICK)
// 咨询列表页(专家服务搜索页面) ydl-user://consult/list
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_CONSULT_LIST)
}
override fun nowConfideClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
// ARouter.getInstance().build("/confide/home")
// .withFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
// .navigation()
ActionCountUtils.count(HomeBIConstants.YDL_USER_TALK_IN_TIME_CLICK)
//倾诉首页 ydl-user://confide/home
YDLRouterManager.router(IYDLRouterConstant.ROUTER_CONFIDE_HOME)
}
override fun psychologyClassClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
//课程频道页 ydl-user://course/home
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_COURSE_HOME)
//埋点
ActionCountUtils.count(HomeBIConstants.YDL_USER_PSYCHOLOGICAL_CLASSROOM_CLICK)
ARouter.getInstance().build("/course/home").navigation()
}
override fun psychologyTestClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_PSYCHOLOGICAL_TEST_CLICK)
//测评频道首页 ydl-user://ceshi/home
YDLRouterManager.router(IYDLRouterConstant.ROUTER_TEST_HOME)
}
override fun confideMoreClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_LISTEN_MORE_CLICK)
//倾诉首页 ydl-user://qingshu/home
YDLRouterManager.router(IYDLRouterConstant.ROUTER_CONFIDE_HOME)
}
/**
* 倾述咨询师点击
* @param linkUrl 跳转地址
*/
override fun confideClick(linkUrl: String?, doctorId: Int) {
if (Utils.isFastClick()) {
//防止连击
return
}
if (null == linkUrl || linkUrl.isEmpty()) {
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_LISTENER_INTRODUCTION_CLICK, doctorId.toString())
if (linkUrl.startsWith("http")) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), "")
} else {
YDLRouterManager.router(linkUrl)
}
}
/**
* 私聊
*/
override fun toChatForMsg(doctorId: String?) {
if (Utils.isFastClick()) {
//防止连击
return
}
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()) {
//跳转登录
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return
}
if (mContext is AppCompatActivity && !TextUtils.isEmpty(doctorId)) {
//私聊
YDLRouterManager.router(IYDLRouterConstant.ROUTER_CHAT_PRIVATE,
YDLRouterParams()
.putExtra(IYDLRouterConstant.EXTRA_TOUID, doctorId!!)
.putExtra(IYDLRouterConstant.EXTRA_USERTYPE, "1"))
}
RouterManager.getImRouter().createTextMessage(doctorId, "你好,我想找你倾诉,请尽快上线私聊我,我在等你。", object : IMRequestCallback<Void> {
override fun onSuccess(aVoid: Void?) {
(mContext as BaseActivity).dismissProgressDialog()
ToastHelper.show("发送成功")
}
override fun onFailed(i: Int) {
(mContext as BaseActivity).dismissProgressDialog()
var message = "发送失败"
if (i == 7101) {
message = "您已被对方拉黑!"
}
ToastHelper.show(message)
}
override fun onException(throwable: Throwable?) {
(mContext as BaseActivity).dismissProgressDialog()
ToastHelper.show("发送异常")
}
})
}
override fun courseMreClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
//课程频道页 ydl-user://course/home
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_COURSE_HOME)
ActionCountUtils.count(HomeBIConstants.YDL_USER_COURSE_MORE_CLICK)
ARouter.getInstance().build("/course/home").navigation()
}
override fun courseItemClick(bean: HomeCourseBean.ListBean) {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_COURSE_CLICK, bean.id.toString())
val h5Params = H5Params(COURSE_DETAIL_H5 + bean.id, mContext?.getString(R.string.course_detail))
if (!TextUtils.isEmpty(bean.shareData?.shareUrl)) {
val shareData = ShareData(bean.shareData?.shareUrl, bean.shareData?.title, bean.shareData?.cover, bean.shareData?.desc)
h5Params.shareData = shareData
}
NewH5Activity.start(mContext, h5Params)
}
override fun askItemFocusClick(position: Int, id: String) {
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()) {
//跳转登录
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return
}
//关注用户
mHomeView?.askFocus(position, id)
}
override fun askItemZanClick(position: Int, index: Int, id: String) {
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()) {
//跳转登录
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return
}
//问答动态点赞
mHomeView?.askZan(position, index, id)
}
override fun askMoreClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_ASK_MORE_CLICK)
//心事动态频道页(首页--问答) ydl-user://answers/home
YDLRouterManager.router(IYDLRouterConstant.ROUTER_ANSWERS_HOME)
}
override fun museMoreClick(dataJson: String) {
if (Utils.isFastClick()) {
//防止连击
return
}
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE,
YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, "")
.putExtra(IYDLRouterConstant.DATA_JSON, dataJson))
}
override fun museClick(musicUrl: String, dataJson: String) {
if (Utils.isFastClick()) {
//防止连击
return
}
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE,
YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, musicUrl)
.putExtra(IYDLRouterConstant.DATA_JSON, dataJson))
}
override fun fmItemClick(bean: HomeFMBean.ListBean) {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_RADIO_CLICK, bean.id.toString())
//电台详情页面
YDLRouterManager.router(IYDLRouterConstant.ROUTER_FM_DETAIL,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_ID, bean.id.toString()))
}
override fun fmPlayClick(fmDetail: HomeFMBean.ListBean) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_RADIO_PLAY_CLICK, fmDetail.id.toString())
YDLMusicHelper.fmId = fmDetail.id
YDLMusicHelper.title = fmDetail.name
YDLMusicHelper.name = fmDetail.author
YDLMusicHelper.cover = fmDetail.imageUrl
YDLMusicHelper.isCanClick = true
if (PlayerFloatHelper.isShow(mContext!!)) {
if (YDLMusicHelper.playType == 1) {
PlayerFloatHelper.removeView(mContext!!)
PlayerFloatHelper.show(mContext!!)
} else {
PlayerFloatHelper.setPlayingState(mContext!!)
}
} else {
mContext?.let { PlayerFloatHelper.show(it) }
}
YDLMusicHelper.fmPlay(fmDetail.fmUrl)
}
override fun fmMoreClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_HEART_RADIO_MORE_CLICK)
//fm列表页 ydl-user://fm/list
YDLRouterManager.router(IYDLRouterConstant.ROUTER_FM_LIST)
}
override fun articleItemClick(bean: HomeArticleBean.Bean?) {
if (Utils.isFastClick()) {
//防止连击
return
}
if (bean == null) {
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_ARTICLE_CLICK, bean.id.toString())
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, bean.gethUrl()!!), "")
}
override fun articleMoreClick() {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_ARTICLE_MORE_CLICK)
//文章列表页 ydl-user://article/list
ARouter.getInstance().build("/article/list").navigation()
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_ARTICLE_LIST)
}
override fun askItemClick(bean: HomeAskBean.DataBean) {
if (Utils.isFastClick()) {
//防止连击
return
}
ActionCountUtils.count(HomeBIConstants.YDL_USER_ASK_COMMENT_CLICK, bean.id.toString())
val bundle = Bundle()
bundle.putInt("trend_id", bean.id)
bundle.putInt("comment_count", bean.commentsCount)
bundle.putBoolean("is_comment", false)
//动态详情
ARouter.getInstance().build("/trends/detail")
.withBundle("bundle", bundle)
.navigation()
}
override fun publishTrendClick() {
val bundle = Bundle()
bundle.putString(YdlCommonOut.PUBLISH_TYPE, "topic_publish")
bundle.putString("topic_id", "44")
bundle.putString("topic_title", "今日打卡")
//发布动态
ARouter.getInstance().build("/trend/publish")
.withBundle("bundle", bundle)
.navigation()
}
/**
* 获取倾述列表数据
* 最终调用
* @see com.yidianling.home.ui.fragment.YdlHomeFragment.getConfideData
*
* @param type 倾述类型
* @param selectPosition 选中的position
*/
override fun getConfideData(type: HomeHeaderBean.ListenCategoryDateBean, selectPosition: Int) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_LISTEN_TYPE_CLICK, type.name
?: "")
mHomeView!!.getConfideData(type.id.toString(), selectPosition)
}
override fun testItemClick(linkUrl: String?) {
if (Utils.isFastClick()) {
//防止连击
return
}
if (null == linkUrl || linkUrl.isEmpty()) {
return
}
if (linkUrl.startsWith("app")) {
val uri = Uri.parse(linkUrl)
if ("ceshi" == uri.host) {
val id = uri.getQueryParameter("id")
RouterManager.getTestsRouter()?.testDetailH5(id)
}
} else if (linkUrl.startsWith("http")) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, linkUrl), "")
} else if (linkUrl.contains("ceshi/detail?")) {
val routerParamsUrls = YDLRouterParamsUrls(linkUrl)
val jsonObject = JSONObject(routerParamsUrls.getParams())
RouterManager.getTestsRouter()?.testDetailH5(jsonObject.getString("id").toString());
} else {
YDLRouterManager.router(linkUrl)
}
}
override fun testMoreClick() {
psychologyTestClick()
}
}
package com.yidianling.home.event
import android.support.v7.widget.RecyclerView
import android.view.View
import com.yidianling.home.model.bean.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 首页点击事件接口类
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
interface IHomeEvent {
/**
* 服务电话点击事件
*/
fun serviceCallClick()
/**
* 动态编辑按钮点击
*/
fun publishTrendClick()
/**
* 咨询条目点击事件
*/
fun consultItemClick(linkUrl: String?, doctorId: String)
/**
* 咨询私聊点击事件
*/
fun consultChatClick(doctorId: String?)
/**
* 测试条目点击事件
*/
fun testItemClick(linkUrl: String?)
/**
* 测试更多点击事件
*/
fun testMoreClick()
/**
* 咨询更多点击事件
*/
fun consultMoreClick()
/**
* 搜索框点击事件
*/
fun searchTvClick(text:String)
/**
* 列表滚动事件
*/
fun onPageScroll(view_rl_top_bg: View): RecyclerView.OnScrollListener?
/**
* 跳转链接点击
* Banner & 首页分类 & 首页条目 使用
*/
fun linkTo(linkUrl: String)
/**
* banner点击跳转
*/
fun bannerClick(banner:HomeHeaderBean.FocusListBean)
/**
* 首页分类跳转
*/
fun categoryClick(category: HomeHeaderBean.AskCategoryDataBean)
/**
* 预约专家点击事件
*/
fun reservationExpertsClick()
/**
* 即可倾诉点击事件
*/
fun nowConfideClick()
/**
* 心理课堂点击事件
*/
fun psychologyClassClick()
/**
* 心理测试点击事件
*/
fun psychologyTestClick()
/**
* 倾诉更多点击事件
*/
fun confideMoreClick()
/**
* 倾述咨询师点击
* @param linkUrl 跳转地址
*/
fun confideClick(linkUrl: String?, doctorId: Int)
/**
* 私聊
*/
fun toChatForMsg(doctorId: String?)
/**
* 课程item点击事件
*/
fun courseItemClick(bean: HomeCourseBean.ListBean)
/**
* 课程更多点击事件
*/
fun courseMreClick()
/**
* 问答条目关注点击事件
* @param id : 用户uid
*/
fun askItemFocusClick(position:Int,id: String)
/**
* 问答条目点赞事件
* @param id : 动态id
*/
fun askItemZanClick(position:Int,index:Int,id: String)
/**
* 问答更多点击事件
*/
fun askMoreClick()
/**
* 问答条目点击事件
*/
fun askItemClick(bean:HomeAskBean.DataBean)
/**
* 冥想更多点击事件
*/
fun museMoreClick(dataJson: String)
/**
* 冥想item点击事件
*/
fun museClick(url: String, dataJson: String)
/**
* 电台条目点击播放事件
*/
fun fmPlayClick(bean: HomeFMBean.ListBean)
/**
* 电台条目点击进入详情
*/
fun fmItemClick(bean: HomeFMBean.ListBean)
/**
* 电台更多点击事件
*/
fun fmMoreClick()
/**
* 文章更多点击事件
*/
fun articleMoreClick()
/**
* 文章item点击事件
*/
fun articleItemClick(bean: HomeArticleBean.Bean?)
/**
* 获取倾述列表数据
* 最终调用
* @see com.yidianling.home.ui.fragment.YdlHomeFragment.getConfideData
*
* @param type 倾述类型
* @param selectPosition 选中的position
*/
fun getConfideData(type: HomeHeaderBean.ListenCategoryDateBean, selectPosition: Int)
/**
* 获取咨询列表数据
* 最终调用
* @see com.yidianling.home.ui.fragment.YdlHomeFragment.getConsultData
*
* @param type 类型
* @param selectPosition 选中的position
*/
fun getConsultData(type: HomeHeaderBean.ConsultCategoryDateBean, selectPosition: Int)
interface IRequestListener<T> {
fun onResponse(result:T)
}
}
\ No newline at end of file
package com.yidianling.home.http
import com.yidianling.home.model.bean.*
import com.yidianling.ydlcommon.bean.MuseModuleBean
import com.yidianling.ydlcommon.http.BaseAPIResponse
import com.yidianling.ydlcommon.http.BaseCommand
import com.yidianling.ydlcommon.http.BaseResponse
import com.yidianling.ydlcommon.http.YdlRetrofitUtils
import com.yidianling.ydlcommon.router.YdlCommonRouterManager
import io.reactivex.Observable
/**
* @author jiucheng
* @描述:首页接口实现类
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/8/22
*/
class HomeHttp private constructor() {
companion object {
fun getInstance(): HomeHttp {
return Holder.INSTANCE
}
fun clearHomPagerApi() {
Holder.INSTANCE.homPagerApi = null
Holder.INSTANCE.phpHomPagerApi = null
}
}
object Holder {
val INSTANCE = HomeHttp()
}
private var homPagerApi: HomePagerApi? = null
private var phpHomPagerApi: HomePagerApi? = null
private fun getPhpHomPagerApi(): HomePagerApi {
if (phpHomPagerApi == null) {
phpHomPagerApi = YdlRetrofitUtils.getRxRetrofit().create(HomePagerApi::class.java)
}
return phpHomPagerApi!!
}
private fun getHomPagerApi(): HomePagerApi {
if (homPagerApi == null) {
homPagerApi = YdlRetrofitUtils.getRxRetrofit().newBuilder().baseUrl(YdlRetrofitUtils.SERVER_API_JAVA_URL).build().create(HomePagerApi::class.java)
}
return homPagerApi!!
}
//首页头部 分类&Banner 请求
fun newHomeHeaderRequest(): Observable<BaseAPIResponse<HomeHeaderBean>> {
return getHomPagerApi().getHomeHeaderData()
}
//首页倾述请求
fun getConfideData(goodType: String): Observable<BaseAPIResponse<HomeConfideBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
return getHomPagerApi().getConfideData(goodType, uid = userId);
}
//首页课程请求
fun getCourseData(listType: String = "10"): Observable<BaseAPIResponse<HomeCourseBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
return getHomPagerApi().getCourseData(listType, uid = userId);
}
//首页测试请求
fun getTestData(): Observable<BaseAPIResponse<MutableList<HomeTestItemBean>>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
return getHomPagerApi().getTestData(uid = userId)
}
//首页问答请求
fun getAskData(): Observable<BaseAPIResponse<HomeAskBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
var token = loginBean?.token ?: "";
return getHomPagerApi().getAskData(accessToken = token, uid = userId);
}
//首页电台请求
fun getFMData(): Observable<BaseAPIResponse<HomeFMBean>> {
return getHomPagerApi().getFMData();
}
//首页文章请求
fun getArticleData(perPageRows: String = "4"): Observable<BaseAPIResponse<HomeArticleBean>> {
return getHomPagerApi().getArticleData()
}
//首页咨询请求
fun getConsultData(goodType: String): Observable<BaseAPIResponse<HomeConsultBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: ""
return getHomPagerApi().getConsultData(category = goodType, uid = userId)
}
//首页问答 - 点赞
fun askZan(id: String): Observable<BaseResponse<AskResultBean>> {
val cmd = AskRequestParamBean.ZanAction("2", id)
return getPhpHomPagerApi().askZan(formatParams(cmd))
}
//首页问答 - 关注
fun askFocus(id: String): Observable<BaseResponse<AskResultBean>> {
val cmd = AskRequestParamBean.FocusCmd(id, "1")
return getPhpHomPagerApi().askFocus(formatParams(cmd))
}
//壹点冥想
fun newMuseRequest(): Observable<BaseAPIResponse<MuseModuleBean>> {
return getHomPagerApi().getMuseData()
}
private fun formatParams(cmd: BaseCommand) =
YdlRetrofitUtils.getMaps(YdlRetrofitUtils.getPostList(cmd))
}
\ No newline at end of file
package com.yidianling.home.http
import com.yidianling.home.model.bean.*
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.ydlcommon.app.YdlCommonApp
import com.yidianling.ydlcommon.bean.MuseModuleBean
import com.yidianling.ydlcommon.data.YdlDataManager
import com.yidianling.ydlcommon.http.BaseAPIResponse
import com.yidianling.ydlcommon.http.BaseResponse
import io.reactivex.Observable
import retrofit2.http.*
/**
* @author jiucheng
* @描述:首页接口api
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/8/22
*/
interface HomePagerApi {
/**
* 首页头部数据 Banner&分类
*/
@GET("home/index")
fun getHomeHeaderData(): Observable<BaseAPIResponse<HomeHeaderBean>>
/**
* 首页咨询请求
* goodType 为空或不传 则获取默认类型数据
*/
@GET("doctor/list")
fun getConsultData(@Query("categories") category: String,
@Query("limit") limit: String = "3",
@Query("page") page: String = "1",
@Query("uid") uid: String,
@Query("searchWord") searchWord: String = "",
@Query("showType") showType: String = "0",
@Query("ffrom") ffrom: String = YdlDataManager.getRam().getChannelName(),
@Query("version") version: String = RxDeviceTool.getAppVersionName(YdlCommonApp.getApp())
): Observable<BaseAPIResponse<HomeConsultBean>>
/**
* 首页倾述请求
* goodType 为空或不传 则获取默认类型数据
*/
@GET("auth/listen/search")
fun getConfideData(@Query("goodType") goodType: String,
@Query("limit") limit: String = "3",
@Query("page") page: String = "1",
// 1: 查询第一个类型列表,较goodType比,低优先级
@Query("isDefaultType") isDefaultType: String = "1",
@Query("uid") uid: String,
@Query("ffrom") ffrom: String = YdlDataManager.getRam().getChannelName(),
@Query("version") version: String = RxDeviceTool.getAppVersionName(YdlCommonApp.getApp())
): Observable<BaseAPIResponse<HomeConfideBean>>
//首页课程请求
@GET("auth/course/getList")
fun getCourseData(@Query("listType") listType: String = "10",
@Query("limit") limit: String = "3",
@Query("uid") uid: String,
@Query("ffrom") ffrom: String = YdlDataManager.getRam().getChannelName(),
@Query("version") version: String = RxDeviceTool.getAppVersionName(YdlCommonApp.getApp())
): Observable<BaseAPIResponse<HomeCourseBean>>
//首页测试请求
@GET("test-item/home-recommend")
fun getTestData(@Query("uid") uid: String,
@Query("ffrom") ffrom: String = YdlDataManager.getRam().getChannelName(),
@Query("version") version: String = RxDeviceTool.getAppVersionName(YdlCommonApp.getApp())
): Observable<BaseAPIResponse<MutableList<HomeTestItemBean>>>
//首页问答请求
@GET("ask/list-old")
fun getAskData(@Query("perPageRows") perPageRows: String = "6",
@Query("tab") tab: String = "2",
@Query("accessToken") accessToken: String,
@Query("uid") uid: String
): Observable<BaseAPIResponse<HomeAskBean>>
//首页电台请求
@GET("fm/list/all")
fun getFMData(@Query("perPageRows") perPageRows: String = "4"): Observable<BaseAPIResponse<HomeFMBean>>
//首页文章请求
@GET("article/list/all")
fun getArticleData(@Query("perPageRows") perPageRows: String = "4"): Observable<BaseAPIResponse<HomeArticleBean>>
//首页问答 - 点赞
@FormUrlEncoded
@POST("sq-active/zan")
fun askZan(@FieldMap params: Map<String, String>): Observable<BaseResponse<AskResultBean>>
//首页问答 - 关注
@FormUrlEncoded
@POST("sq-active/focus")
fun askFocus(@FieldMap params: Map<String, String>): Observable<BaseResponse<AskResultBean>>
//壹点 - 冥想
@GET("meditation/meditation/list")
fun getMuseData(): Observable<BaseAPIResponse<MuseModuleBean>>
}
\ No newline at end of file
package com.yidianling.home.listener
import android.content.Context
import android.support.design.widget.TabLayout
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import com.yidianling.home.adapter.YdlHomeAdapter
import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
/**
* @author yuanwai
* @描述:悬浮按钮监听事件
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/9/25
*/
class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
private var mContext : Context? = null
private var mCurrentPosition = 0
private var mSuspensionHeight: Int = RxImageTool.dip2px(51f)
//倾诉筛选layout
private var confideFilterView: LinearLayout? = null
//咨询筛选layout
private var consultFilterView : LinearLayout? = null
//首页界面View接口
private var mHomeView : IHomeContract.View? = null
private var adapter: YdlHomeAdapter? = null
private var mPhoneCallView : ImageView? = null
//是否执行收缩动画
private var excuteStartAnim : Boolean = true
//是否执行展开动画
private var excuteEndAnim : Boolean = true
private var dp5 : Int = 0
private var dp14 : Int = 0
private var dp15 : Int = 0
private var dp34 : Int = 0
private var cvWidth : Int = 0
private var maxCVWidth : Int = 0
private var minCVWidth : Int = 0
init {
dp5 = RxImageTool.dip2px(5f)
dp14 = RxImageTool.dip2px(14f)
dp15 = RxImageTool.dip2px(15f)
dp34 = RxImageTool.dip2px(34f)
}
fun setContext(context: Context){
mContext = context
cvWidth = RxDeviceTool.getScreenWidth(context) - RxImageTool.dip2px(73f)
minCVWidth = RxImageTool.dip2px(105f)
maxCVWidth = cvWidth
}
fun setHomeView(homeView : IHomeContract.View){
this.mHomeView = homeView
}
fun setConfideFilterView(filterView: LinearLayout) {
this.confideFilterView = filterView
}
fun setConsultFilterView(filterView: LinearLayout){
this.consultFilterView = filterView
}
fun setSectionAdapter(adapter: YdlHomeAdapter) {
this.adapter = adapter
}
fun setPhoneCallImageView(callView : ImageView){
this.mPhoneCallView = callView
}
override fun onScrollStateChanged(recyclerView: RecyclerView?, newState: Int) {
super.onScrollStateChanged(recyclerView, newState)
if (null != confideFilterView) {
mSuspensionHeight = confideFilterView!!.height
}
}
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (null == adapter) {
return
}
Log.e("Tag", "-------dy=$dy")
// moveSearchView(dy)
val manager = recyclerView!!.layoutManager as LinearLayoutManager
if (mCurrentPosition != manager.findFirstVisibleItemPosition()) {
mCurrentPosition = manager.findFirstVisibleItemPosition()
}
if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONFIDE_VIEW) {
val view = manager.findViewByPosition(mCurrentPosition)
if (view != null) {
if (view is ViewGroup) {
if (view.getChildAt(1) is TabLayout) {
val tabLayout = view.getChildAt(1)
val location = IntArray(2)
tabLayout.getLocationOnScreen(location)
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
confideFilterView!!.visibility = View.VISIBLE
} else {
confideFilterView!!.visibility = View.INVISIBLE
}
}
}
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
confideFilterView!!.visibility = View.INVISIBLE
}
}
}else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONSULT_VIEW) {
val view = manager.findViewByPosition(mCurrentPosition)
if (view != null) {
if (view is ViewGroup) {
if (view.getChildAt(1) is TabLayout) {
val tabLayout = view.getChildAt(1)
val location = IntArray(2)
tabLayout.getLocationOnScreen(location)
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
consultFilterView?.visibility = View.VISIBLE
} else {
consultFilterView?.visibility = View.INVISIBLE
}
}
}
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
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
}
}
/**
* 移动搜索View
*/
private fun moveSearchView(dy : Int){
// if (null != mCardView){
// cvWidth -= dy
// if (cvWidth < minCVWidth){
// cvWidth = minCVWidth
// mPhoneCallView?.visibility = View.GONE
// }else if (cvWidth > maxCVWidth){
// cvWidth = maxCVWidth
// mPhoneCallView?.visibility = View.VISIBLE
// }else{
// mPhoneCallView?.visibility = View.VISIBLE
// }
// val params = RelativeLayout.LayoutParams(cvWidth,dp34)
// params.setMargins(dp15,dp14,dp15,dp5)
// mCardView?.layoutParams = params
// }
}
}
\ No newline at end of file
package com.yidianling.home.model
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.home.http.HomeHttp
import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.model.bean.*
import com.yidianling.ydlcommon.http.BaseAPIResponse
import com.yidianling.ydlcommon.bean.MuseModuleBean
import com.yidianling.ydlcommon.http.RxUtils
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeModelImpl {
companion object {
/**
* 首页咨询请求
*/
fun consultRequest(category: String): Observable<HomeConsultBean> {
return HomeHttp.getInstance().getConsultData(category).compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeConsultBean(true) }
}
/**
* 首页问答 - 点赞
*/
fun askZan(id: String): Observable<AskResultBean> {
return HomeHttp.getInstance().askZan(id).compose(RxUtils.resultData())
}
/**
* 首页问答 - 关注
*/
fun askFocus(id: String): Observable<AskResultBean> {
return HomeHttp.getInstance().askFocus(id).compose(RxUtils.resultData())
}
/**
* 首页电台请求
*/
fun fmRequest(): Observable<HomeFMBean> {
return HomeHttp.getInstance().getFMData().compose(RxUtils.resultJavaData())
.onErrorReturn { HomeFMBean(true) }
}
/**
* 首页课程请求
*/
fun courseRequest(): Observable<HomeCourseBean> {
return HomeHttp.getInstance().getCourseData().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeCourseBean(true) }
}
/**
* 首页测试题请求
*/
fun testRequest(): Observable<BaseAPIResponse<MutableList<HomeTestItemBean>>> {
return HomeHttp.getInstance().getTestData()
}
/**
* 首页倾听请求
*/
fun confideRequest(goodType: String): Observable<HomeConfideBean> {
return HomeHttp.getInstance().getConfideData(goodType).compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeConfideBean(true) }
}
/**
* 首页问答请求
*/
fun askRequest(): Observable<HomeAskBean> {
return HomeHttp.getInstance().getAskData().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeAskBean(true) }
}
/**
* 首页文章请求
*/
fun articleRequest(): Observable<HomeArticleBean> {
return HomeHttp.getInstance().getArticleData().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeArticleBean(true) }
}
/**
* 首页头部 分类&Banner请求
*/
fun headerRequest(): Observable<HomeHeaderBean> {
return HomeHttp.getInstance().newHomeHeaderRequest().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeHeaderBean(true) }
}
/**
* 首页冥想请求
*/
fun museRequest(): Observable<MuseModuleBean> {
return HomeHttp.getInstance().newMuseRequest().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { MuseModuleBean(true) }
}
}
}
\ No newline at end of file
package com.yidianling.home.model.bean;
import com.ydl.ydlcommon.data.http.BaseCommand;
/**
* Created by haorui on 2019/2/19.
* Des:
*/
public class AskRequestParamBean {
//关注
public static class FocusCmd extends BaseCommand {
public String id;//话题id或用户uid
public String type;//业务类型:1关注用户,2关注话题
public FocusCmd(String id, String type) {
this.id = id;
this.type = type;
}
}
//点赞:动态,回帖,个人主页
public static class ZanAction extends BaseCommand {
public String type;//业务类型:1访问用户,2动态,3话题
public String id;//动态id,回复id,用户uid
public ZanAction(String type, String id) {
this.type = type;
this.id = id;
}
}
}
package com.yidianling.home.model.bean
/**
* Created by haorui on 2019/2/19.
* Des:
*/
class AskResultBean {
/**
* 点赞接口 1:点赞 2:取消赞
*/
var status: Int = 0
}
\ No newline at end of file
package com.yidianling.home.model.bean
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by haorui on 2019/2/14.
* Des:首页文章模块参数
*/
class HomeArticleBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
var category: List<CategoryBean>? = null
var list: List<Bean>? = null
class CategoryBean {
var descript: String? = null
var id: Int = 0
var isShow: Int = 0
var keyword: String? = null
var name: String? = null
var parentId: Int = 0
var place: Int = 0
var title: String? = null
}
class Bean {
/**
* 收藏数
*/
var countOfFavorite: Int = 0
var createTime: String? = null
var createTimeFormat: String? = null
/**
* 文章简介
*/
var desc: String? = null
var doctorId: Int = 0
private var hUrl: String? = null
/**
* 文章id
*/
var id: Int = 0
/**
* 封面图片地址
*/
var imgUrl: String? = null
var url: String? = null
/**
* 医生名字
*/
var name: String? = null
/**
* 笔名
*/
var pseudonym: String? = null
/**
* 阅读次数
*/
var readNum: Int = 0
/**
* 120*120小头像
*/
var smallImage: String? = null
/**
* 标题
*/
var title: String? = null
fun gethUrl(): String? {
return hUrl
}
fun sethUrl(hUrl: String) {
this.hUrl = hUrl
}
}
}
package com.yidianling.home.model.bean
import com.google.gson.annotations.SerializedName
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by haorui on 2019/2/14.
* Des:首页问答模块参数
*/
class HomeAskBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
var data: MutableList<DataBean>? = null
@SerializedName(value = "ext_data", alternate = ["extData"])
var ext_data: List<ExtDataBean>? = null
var bannerResps: List<BannerResp>? = null
class BannerResp {
var bannerId: Int? = 0 //bannerId ,
var bannerImageUrl: String? = null //图片地址 ,
var bannerLinkUrl: String? = null //链接地址 ,
var bannerTitle: String? = null //标题
}
class DataBean {
/**
* askId
*/
var id: Int = 0
/**
* 问答创建时间
*/
@SerializedName(value = "timeStr", alternate = ["time_str"])
var timeStr: String? = null
/**
* 浏览数量,点击数量
*/
var hits: Int = 0
/**
* 问题的标题
*/
var title: String? = null
/**
* 内容类型:1纯文本,2图片,3图文,4url链接和app内部跳转
*/
var multitextType: Int = 0
/**
* 话题id,1:心事问答
*/
var topicId: Int = 0
/**
* 回帖量
*/
var replyCounter: Int = 0
/**
* multitype=4时候添加到这个字段,json格式4:{url: '',cover:'',topicTitle:''}
*/
var extContent: String? = null
/**
* 问答发布内容
*/
var content: String? = null
/**
* 问答发布者uid,匿名为0
*/
var uid: Int = 0
/**
* 问答发布显示名称,匿名null
*/
var name: String? = null
/**
* 问答发布者性别
*/
var gender: Int = 0
/**
* 问答标签
*/
var askTag: String? = null
/**
* 总的温暖数量
*/
var zanCount: Int = 0
/**
* 问答发布者头像,匿名为null
*/
var avatar: String? = null
/**
* 安卓,问答发布者头像,匿名为null
*/
var header: String? = null
/**
* 评论数
*/
var commentsCount: Int = 0
/**
* 话题的标题
*/
var topicTitle: String? = null
/**
* 点赞id,0为未点赞
*/
var isZan: Int = 0
/**
* 访问量
*/
var visitCount: Int = 0
/**
* 来自平台
*/
var from: String? = null
var utype: Int = 0
/**
* 是否为广告
*/
@SerializedName(value = "isAd", alternate = ["is_ad"])
var isAd: Int = 0
/**
* 广告的跳转
*/
var url: String? = null
var adImg: String? = null
var focId: Int = 0
/**
* 是否关注 1关注
*/
var isFocused: Int = 0
var share: Any? = null
var isSelf: Int = 0
/**
* multitype=4,5时候添加到这个字段,json格式4:{url: '',cover:'',title:''};5待定
*/
var ext: Any? = null
/**
* 附件
*/
var smallAttach: List<*>? = null
/**
* 附件
*/
var bigAttach: List<*>? = null
/**
* 问答答案列表
*/
var comments: List<CommentsBean>? = null
class CommentsBean {
/**
* 评论用户显示姓名
*/
var name: String? = null
/**
* 评论内容
*/
var content: String? = null
/**
* 文章评论专家姓名
*/
@SerializedName(value = "toName", alternate = ["to_name"])
var toName: String? = null
/**
* 评论用户头像
*/
var userHead: String? = null
/**
* 评论发表时间
*/
var answerCreateTime: String? = null
/**
* 问答创建时间
*/
var time_str: String? = null
/**
* 文章评论内容
*/
@SerializedName(value = "toContent", alternate = ["to_content"])
var toContent: String? = null
/**
* 文章评论id
*/
var id: Int = 0
/**
* 评论用户id
*/
var uid: Int = 0
/**
* 评论问答id
*/
var askId: Int = 0
var zan: Int = 0
/**
* 文章评论用户性别
*/
var gender: Int = 0
/**
* 文章评论用户类型, 2则为专家
*/
@SerializedName(value = "userType", alternate = ["user_type"])
var userType: Int = 0
/**
* 文章评论专家id
*/
@SerializedName(value = "doctorId", alternate = ["doctor_id"])
var doctorId: Int = 0
/**
* 是否开通倾诉 0-否 1-是
*/
var isOpenListen: Int = 0
/**
* 是否空闲 0-否 1-是
*/
var isAvailable: Int = 0
/**
* 倾诉链接
*/
var listenLinkUrl: String? = null
}
}
class ExtDataBean {
var id: Int = 0
var type: Int = 0
var parentId: Int = 0
var status: Int = 0
var doctorId: Int = 0
var uid: Int = 0
var createTime: String? = null
var updateTime: Any? = null
var deleteTime: Any? = null
var deleteUser: String? = null
var isDelete: Int = 0
var hits: Int = 0
var tags: String? = null
var tags2: String? = null
var askSource: String? = null
var ffrom: String? = null
var fsid: String? = null
var browser: String? = null
var favTotalNum: Int = 0
var ip: String? = null
var title: String? = null
var showTips: Any? = null
var channel: String? = null
var platform: String? = null
var isTop: Int = 0
var zhuishuTop: Int = 0
var multitextType: Any? = null
var topicId: Int = 0
var isPublish: Any? = null
var isHot: Any? = null
var replyCounter: Int = 0
var zanCounter: Int = 0
var extContent: String? = null
var hotTime: Int = 0
var topTime: Int = 0
var anonymous: Any? = null
var checkStatus: Any? = null
var operateStatus: Any? = null
var topRule: Any? = null
var topPage: Any? = null
var isDoctorShow: Any? = null
var content: String? = null
}
}
package com.yidianling.home.model.bean
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by haorui on 2019/2/14.
* Des:首页倾听模块参数
*/
class HomeConfideBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
var type: Int = 0
var diviLine: Int = 0
/**
* 头像
*/
var head: Any? = null
var body: List<BodyBean>? = null
class BodyBean {
var confidedId: Int = 0
var confidedName: String? = null
/**
* 头像
*/
var confidedIcon: String? = null
var confideHearNum: String? = null
var doctorId: Int = 0
var uid: Int = 0
var confideVoice: String? = null
var tags: String? = null
var confideContent: String? = null
var confideSex: Int = 0
var status: Int = 0
/**
* 通话状态
* 1在线 2离线 3通话中 4继续倾诉
*/
var confideLine: Int = 0
var confideAddress: String? = null
var confidePraise: String? = null
/**
* 实际费用
*/
var confideFee: String? =null
/**
* 接通率
*/
var confideConnection: String? = null
/**
* 人数
*/
var confideNum: String? = null
/**
* 跳转地址
*/
var linkUrl: String? = null
/**
* 红包金额
*/
var couponMoney: String? = null
var confidedTag: List<String>? = null
/**
* 红包展示文本
*/
var couponText : String? = null
}
}
package com.yidianling.home.model.bean
import com.google.gson.annotations.SerializedName
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by haorui on 2019/3/13.
* Des:
*/
class HomeConsultBean: HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
/**
* pageNum : 1
* pageSize : 3
* size : 3
* startRow : 1
* endRow : 3
* pages : 962
* prePage : 0
* nextPage : 2
* isFirstPage : true
* isLastPage : false
* hasPreviousPage : false
* hasNextPage : true
* navigatePages : 8
* navigatepageNums : [1,2,3,4,5,6,7,8]
* navigateFirstPage : 1
* navigateLastPage : 8
* total : 2884
* list : [{"doctorUid":97078,"doctorId":1614,"doctorName":"姜建萍","doctorHead":"https://img.ydlcdn.com/file/2018/10/20/juffcjgn6cphz7ef.jpg!s120x120","profesBack":"二级心理咨询师\r\n中学高级教师\r\n学校心理咨询师\r\n30年教育教学管理工作经历","tags":["恋爱婚姻","情绪压力","孩子教育"],"serviceFee":300,"zixunOrderNum":4841,"feedbackRate":99.7,"province":"北京","city":"北京","isOnline":1,"mUrl":"https://m.ydl.com/experts/1614","hUrl":"https://h2.yidianling.com/experts/1614","share":{"title":"姜建萍咨询工作室","cover":"https://img.ydlcdn.com/file/2018/10/20/juffcjgn6cphz7ef.jpg!s120x120","desc":"","shareUrl":"https://m.ydl.com/experts/1614","share_url":"https://m.ydl.com/experts/1614"},"isHiddenXcx":""},{"doctorUid":1204629,"doctorId":3351,"doctorName":"孙丽","doctorHead":"https://img.ydlcdn.com/file/2018/10/05/98cf1af2dc5c6f8e2c4a9ac43f58bd8d..jpg!s120x120","profesBack":"二级心理咨询师\r\n教师资格认证","tags":["恋爱婚姻","孩子教育","情绪压力"],"serviceFee":100,"zixunOrderNum":2590,"feedbackRate":100,"province":"江苏省","city":"南京","isOnline":1,"mUrl":"https://m.ydl.com/experts/3351","hUrl":"https://h2.yidianling.com/experts/3351","share":{"title":"孙丽咨询工作室","cover":"https://img.ydlcdn.com/file/2018/10/05/98cf1af2dc5c6f8e2c4a9ac43f58bd8d..jpg!s120x120","desc":"","shareUrl":"https://m.ydl.com/experts/3351","share_url":"https://m.ydl.com/experts/3351"},"isHiddenXcx":""},{"doctorUid":1177559,"doctorId":3118,"doctorName":"李艳","doctorHead":"https://img.ydlcdn.com/file/2017/02/22/5799q3ctnrm7hhi9.jpg!s120x120","profesBack":"二级心理咨询师\r\n三级心理咨询师","tags":["情绪压力","恋爱婚姻","上岗认证"],"serviceFee":150,"zixunOrderNum":4868,"feedbackRate":99.9,"province":"北京","city":"北京","isOnline":1,"mUrl":"https://m.ydl.com/experts/3118","hUrl":"https://h2.yidianling.com/experts/3118","share":{"title":"李艳咨询工作室","cover":"https://img.ydlcdn.com/file/2017/02/22/5799q3ctnrm7hhi9.jpg!s120x120","desc":"","shareUrl":"https://m.ydl.com/experts/3118","share_url":"https://m.ydl.com/experts/3118"},"isHiddenXcx":""}]
*/
var size: Int = 0
var list: MutableList<ListBean>? = null
class ListBean {
/**
* doctorUid : 97078
* doctorId : 1614
* doctorName : 姜建萍
* doctorHead : https://img.ydlcdn.com/file/2018/10/20/juffcjgn6cphz7ef.jpg!s120x120
* profesBack : 二级心理咨询师
* 中学高级教师
* 学校心理咨询师
* 30年教育教学管理工作经历
* tags : ["恋爱婚姻","情绪压力","孩子教育"]
* serviceFee : 300
* zixunOrderNum : 4841
* feedbackRate : 99.7
* province : 北京
* city : 北京
* isOnline : 1
* mUrl : https://m.ydl.com/experts/1614
* hUrl : https://h2.yidianling.com/experts/1614
* share : {"title":"姜建萍咨询工作室","cover":"https://img.ydlcdn.com/file/2018/10/20/juffcjgn6cphz7ef.jpg!s120x120","desc":"","shareUrl":"https://m.ydl.com/experts/1614","share_url":"https://m.ydl.com/experts/1614"}
* isHiddenXcx :
*/
//字段名称改了
@SerializedName("uid")
var doctorUid: Int = 0
var doctorId: String = ""
@SerializedName("name")
var doctorName: String? = null
@SerializedName("head")
var doctorHead: String? = null
var profesBack: String? = null
@SerializedName("minBookingPrice")
var serviceFee: Int = 0
var zixunOrderNum: Int = 0
var feedbackRate: Float = 0f
var province: String? = null
var city: String? = null
var isOnline: Int = 0
var mUrl: String? = null
@SerializedName("linkUrl")
var hUrl: String? = null
var share: ShareBean? = null
var isHiddenXcx: String? = null
var tags: String? = null
class ShareBean {
/**
* title : 姜建萍咨询工作室
* cover : https://img.ydlcdn.com/file/2018/10/20/juffcjgn6cphz7ef.jpg!s120x120
* desc :
* shareUrl : https://m.ydl.com/experts/1614
* share_url : https://m.ydl.com/experts/1614
*/
var title: String? = null
var cover: String? = null
var desc: String? = null
var shareUrl: String? = null
var share_url: String? = null
}
}
}
package com.yidianling.home.model.bean
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by haorui on 2019/2/14.
* Des:首页课程模块参数
*/
class HomeCourseBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
var pageNum: Int = 0
var pageSize: Int = 0
var size: Int = 0
var startRow: Int = 0
var endRow: Int = 0
var pages: Int = 0
var prePage: Int = 0
var nextPage: Int = 0
var isIsFirstPage: Boolean = false
var isIsLastPage: Boolean = false
var isHasPreviousPage: Boolean = false
var isHasNextPage: Boolean = false
var navigatePages: Int = 0
var navigateFirstPage: Int = 0
var navigateLastPage: Int = 0
var total: Int = 0
var navigatepageNums: List<Int>? = null
var list: List<ListBean>? = null
class ListBean {
var shareData: ShareDataBean? = null
var id: Int = 0
/**
* 课程标题
*/
var title: String? = null
/**
* 课程图
*/
var pic: String? = null
/**
* 课程价格
*/
var applyFee: Float? = null
/**
* 课程原价
*/
var originalApplyFee: Float? = null
/**
* 课程促销价
*/
var promotionApplyFee: Float? = null
/**
* 课程报名人数
*/
var joinNum: Int = 0
/**
* 课程浏览量
*/
var readNums: Int = 0
/**
* 是否促销 1活动中 2结束or没开始 3倒计时
*/
var isPromotion: Int = 0
/**
* 是否返利 1是双返利 2是单返利 0无返利
*/
var isInvite: Int = 0
/**
* 主讲人uid
*/
var hostUid: Int = 0
/**
* 主讲人头像
*/
var hostHead: String? = null
/**
* 主讲人倾诉id
*/
var hostConfidedId: Int = 0
/**
* 主讲人专家id
*/
var hostId: Int = 0
/**
* 主讲人名称
*/
var hostName: String? = null
/**
* 主讲人是否开通私聊 0-否 1-是
*/
var isOpenChat: Int = 0
/**
* 主讲人是否开通倾诉 0-否 1-是
*/
var isOpenListen: Int = 0
/**
* 主讲人是否空闲 0-否 1-是
*/
var isAvailable: Int = 0
/**
* 主讲人是否开通咨询 0-否 1-是
*/
var isOpenConsult: Int = 0
/**
* 聊天跳转资源
*/
var chatLinkUri: String? = null
/**
* 咨询跳转资源
*/
var consultLinkUri: String? = null
/**
* 倾诉跳转资源
*/
var listenLinkUri: String? = null
/**
* 是否展示倾诉咨询聊天三个按钮 0-否 1-是
*/
var isShowHostButton: Int = 0
class ShareDataBean {
var title: String? = null
var cover: String? = null
var desc: String? = null
var shareUrl: String? = null
}
}
}
package com.yidianling.home.model.bean
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by haorui on 2019/2/14.
* Des:首页电台模块参数
*/
class HomeFMBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
var endRow: Int = 0
var isHasNextPage: Boolean = false
var isHasPreviousPage: Boolean = false
var isIsFirstPage: Boolean = false
var isIsLastPage: Boolean = false
var navigateFirstPage: Int = 0
var navigateLastPage: Int = 0
var navigatePages: Int = 0
var nextPage: Int = 0
var pageNum: Int = 0
var pageSize: Int = 0
var pages: Int = 0
var prePage: Int = 0
var size: Int = 0
var startRow: Int = 0
var total: Int = 0
var list: List<ListBean>? = null
var navigatepageNums: List<Int>? = null
class ListBean {
var adminId: Int = 0
var appImg: String? = null
var author: String? = null
var categoryId: Int = 0
var createTime: String? = null
var description: String? = null
/**
* 喜欢人数
*/
var favorites: Int = 0
/**
* 电台地址
*/
var fmUrl: String? = null
/**
* 收听人数
*/
var hits: Int = 0
var id: Int = 0
/**
* 封面地址
*/
var imageUrl: String? = null
var isOriginal: String? = null
var isShow: String? = null
var name: String? = null
var orderNum: Int = 0
var period: String? = null
var shareCount: Int = 0
var updateTime: String? = null
}
}
package com.yidianling.home.model.bean
import com.yidianling.router.consultant.Keyworks
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by haorui on 2019/2/14.
* Des:首页头部模块数据 Banner&分类
*/
class HomeHeaderBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
/**
* 活动弹窗数据
*/
var activityResponse: ActivityResponse? = null
/**
* 分类数据
*/
var askCategoryData: MutableList<AskCategoryDataBean>? = null
/**
* 焦点图数据
*/
var focusList: List<FocusListBean>? = null
/**
* 滚动销售数据
*/
var homeSaleData: List<HomeSaleDataBean>? = null
/**
* 搜索关键词数据
*/
var keywordData: MutableList<Keyworks>? = null
/**
* 倾诉分类
*/
var listenCategoryDate: List<ListenCategoryDateBean>? = null
/**
* 咨询分类
*/
var consultCategoryData: List<ConsultCategoryDateBean>? = null
/**
* 专家名称
*/
var doctorName : String? = null
class AskCategoryDataBean {
/**
* id
*/
var cateId: Int = 0
/**
* 名称
*/
var cateTitle: String? = null //
/**
* 跳转url
*/
var url: String? = null
/**
* 图片icon
*/
var coverUrl: String? = null
}
class FocusListBean {
/**
* 标题
*/
var title: String? = null
/**
* 跳转链接
*/
var linkUrl: String? = null
/**
* 图片
*/
var imageUrl: String? = null
/**
* iPhone X图片
*/
var imageIphonex: String? = null
/**
* 焦点图id
*/
var focId: Int = 0
/**
* 分享数据
*/
var shareData: Any? = null
}
class ConsultCategoryDateBean {
var id: Int = 0
var name: String? = null
}
class HomeSaleDataBean {
/**
* 用户昵称
*/
var nickName: String? = null
/**
* 老师名字
*/
var doctorName: String? = null
/**
* 老师id
*/
var doctorId: Int = 0
/**
* 跳转专家主页
*/
var url: String? = null
/**
* 内容开头
*/
var contentBefore: String? = null
/**
* 内容结尾
*/
var contentAfter: String? = null
/**
* 创建时间
*/
var createTime: String? = null
}
class ListenCategoryDateBean {
var id: Int = 0
var name: String? = null
}
class ActivityResponse{
var imageBanner:String? = null// 弹窗图片
var imageUrl: String?=null// 图片
var linkUrl:String?=null // 首页弹窗
var btnLinkurl:String?=null // 首页入口(左上角图标)
var title :String? = null// 标题
}
}
package com.yidianling.home.model.bean
import com.yidianling.ydlcommon.bean.MuseModuleBean
/**
* Created by haorui on 2019/2/14.
* Des:首页数据
*/
class HomePagerDataBean() {
constructor(type: Int) : this() {
this.type = type;
}
constructor(homeHeaderBean: HomeHeaderBean,
homeConsultBean: HomeConsultBean,
homeConfideBean: HomeConfideBean,
homeCourseBean: HomeCourseBean,
testListBean: MutableList<HomeTestItemBean>?,
homeAskBean: HomeAskBean,
museBean: MuseModuleBean,
homeFMBean: HomeFMBean,
homeArticleBean: HomeArticleBean):this(){
this.headerBean = homeHeaderBean
this.consultBean = homeConsultBean
this.articleBean = homeArticleBean
this.askBean = homeAskBean
this.courseBean = homeCourseBean
this.testListBean = testListBean
this.museBean = museBean
this.fmBean = homeFMBean
this.confideBean = homeConfideBean
}
/**
* 咨询模块数据
*/
var consultBean: HomeConsultBean? = null
/**
* 文章模块数据
*/
var articleBean: HomeArticleBean? = null
/**
* 问答模块数据
*/
var askBean: HomeAskBean? = null
/**
* 课程模块数据
*/
var courseBean: HomeCourseBean? = null
/**
* 测试模块数据
*/
var testListBean: MutableList<HomeTestItemBean>? = null
/**
* 冥想模块数据
*/
var museBean: MuseModuleBean? = null
/**
* 电台模块数据
*/
var fmBean: HomeFMBean? = null
/**
* 倾述模块数据
*/
var confideBean: HomeConfideBean? = null
/**
* 首页头部数据
*/
var headerBean: HomeHeaderBean? = null
/**
* 模块分类 @see [com.yidianling.home.constract.YdlHomeViewHolderConstract]
*/
var type: Int?= 0
}
package com.yidianling.home.model.bean
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
/**
* Created by xj on 2019/9/29.
*/
class HomeTestBean: HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
/**
* 分类数据
*/
var testItemList: MutableList<HomeTestItemBean>? = null
}
\ No newline at end of file
package com.yidianling.home.model.bean;
/**
* Created by haorui on 2019/3/13.
* Des:
*/
public class HomeTestItemBean {
/**
* id : 1003
* name : 产后抑郁症状评估
* shareImage : http://img.diggme.cn/2018/03/15/f6475c6d9fc547e2d6d99d1efa43fd9d.jpg?x-oss-process=image/auto-orient,1/resize,m_lfit,w_300/quality,q_90
* testNum : 1
* hits : 133
* countOfResult : 1
*/
private int id;
private String name;
private String shareImage;
private int testNum;
private int hits;
private int countOfResult;
private String recommendLinkUrl;
public String getRecommendLinkUrl() {
return recommendLinkUrl;
}
public void setRecommendLinkUrl(String recommendLinkUrl) {
this.recommendLinkUrl = recommendLinkUrl;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getShareImage() {
return shareImage;
}
public void setShareImage(String shareImage) {
this.shareImage = shareImage;
}
public int getTestNum() {
return testNum;
}
public void setTestNum(int testNum) {
this.testNum = testNum;
}
public int getHits() {
return hits;
}
public void setHits(int hits) {
this.hits = hits;
}
public int getCountOfResult() {
return countOfResult;
}
public void setCountOfResult(int countOfResult) {
this.countOfResult = countOfResult;
}
}
package com.yidianling.home.presenter
import android.annotation.SuppressLint
import android.content.Context
import android.text.TextUtils
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.meituan.robust.patch.annotaion.Modify
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.model.HomeModelImpl
import com.yidianling.home.model.bean.*
import com.yidianling.home.utils.HomeFileUtils
import com.yidianling.home.utils.HomeLogPrinter
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxAppTool
import com.yidianling.router.RouterManager
import com.yidianling.ydlcommon.app.YdlCommonApp
import com.yidianling.ydlcommon.bean.HomeItemBaseBean
import com.yidianling.ydlcommon.bean.MuseModuleBean
import com.yidianling.ydlcommon.http.RxUtils
import com.yidianling.ydlcommon.http.ThrowableConsumer
import com.yidianling.ydlcommon.mvp.RxPresenter
import com.yidianling.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.ydlcommon.utils.YDLAsyncUtils
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.functions.Action
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
private var CACHE_HOME_PAGER_DATA = "cache_home_pager_data"
//首页json文件和缓存数据结构不一致时临时使用
private var IS_NEW_CACHE_HOME_PAGER_DATA = "IS_NEW_CACHE_HOME_PAGER_DATA"
//首页缓存版本号
private var HOME_PAGER_DATA_CACHE_VERISON = "HOME_PAGER_DATA_CACHE_VERISON"
private var mConsultDisposable: Disposable? = null;
private var mConfideDisposable: Disposable? = null;
private var mHomeDisposable: Disposable? = null;
var mConfideType: String = ""
var mConsultType: String = ""
/**
* 本次启动时候已经获取过优惠券的标记
* 因为优惠券调用逻辑在onResum方法中执行,避免不必要的判断逻辑,增加标记
* 每次请求优惠券成功之后,将值置为true
*/
private var hasRequestCoupon = false
@Volatile
private var mHomeAskBean: HomeAskBean? = null
/**
* 防止重复请求
*/
// private var zanRequestList: MutableList<String>? = mutableListOf()
//首页数据缓存
private var homeTempData: HomePagerDataBean = HomePagerDataBean()
/**
* 加载本地缓存
*/
fun localHomeData(context: Context) {
YDLAsyncUtils.asyncAsResult(object : YDLAsyncUtils.AsyncObjecyerResult {
override fun doAsyncAction(): Any {
//首页缓存数据
var cacheHomeData = ""
//是否为新的数据结构
var isNewPageData = SharedPreferencesEditor.getString(IS_NEW_CACHE_HOME_PAGER_DATA);
var homeCacheVersion =
SharedPreferencesEditor.getString(HOME_PAGER_DATA_CACHE_VERISON);
var appVersionCode = RxAppTool.getAppVersionCode(BaseApp.getApp())
//版本更新后不使用上个版本的首页缓存
if (isNewPageData.isEmpty() || (!TextUtils.isEmpty(homeCacheVersion) && appVersionCode > homeCacheVersion.toInt())) {
cacheHomeData = ""
} else {
//上次首页缓存数据
cacheHomeData = SharedPreferencesEditor.getString(CACHE_HOME_PAGER_DATA)
}
if (cacheHomeData.isEmpty()) {
//第一次安装使用本地临时数据
cacheHomeData =
String(HomeFileUtils.getAssertsFile(context, "home_data.json")!!)
}
return cacheHomeData
}
override fun asyncResult(`object`: Any?) {
//如果没有缓存数据,显示加载框
if (`object` !is String || TextUtils.isEmpty(`object`)) {
mView?.let { it.showRefreshLayout() }
}
if (`object` is String) {
val list = Gson().fromJson<MutableList<HomePagerDataBean>>(
`object`,
object : TypeToken<MutableList<HomePagerDataBean>>() {
}.type
)
if (null != list && !list.isEmpty()) {
mView?.let { it.homeDataResponse(list) }
saveTempData(list)
}
}
}
})
}
/**
* 刷新首页数据请求
*/
fun refreshHomeData() {
val homeItemFromTempData = getHomeItemFromTempData(
HomeHeaderBean(true),
YdlHomeViewHolderConstract.PAGER_BANNER_VIEW
)
mConsultType =
if (homeItemFromTempData.headerBean?.listenCategoryDate == null || homeItemFromTempData.headerBean?.listenCategoryDate!!.isEmpty()) {
"1"
} else {
homeItemFromTempData.headerBean?.consultCategoryData!![0].id.toString()
}
mConfideType = ""
mView?.resetModuleTabPosition()
loadHomeData()
}
/**
* 获取首页数据请求
*/
@SuppressLint("CheckResult")
fun loadHomeData() {
disposeHome()
val homeList: MutableList<HomePagerDataBean> = mutableListOf()
LogUtil.d("mConsultType-loadHomeData:" + mConsultType)
Observable.mergeArray(
HomeModelImpl.headerRequest().map { it ->
//首页头部数据 分类 & Banner
homeList.add(
getHomeItemFromTempData(
it,
YdlHomeViewHolderConstract.PAGER_BANNER_VIEW
)
)
mView?.let { i -> i.homeHeadResponse(it) }
//获取咨询分类后,再次请求咨询模块数据,防止出现默认分类为空,数据不对
if (it.consultCategoryData != null && it.consultCategoryData!!.size > 0) {
//咨询分类和缓存分类不一致,重新加载咨询列表数据
if (!it.consultCategoryData!![0].id.toString().equals(mConsultType)) {
getConsultData("${it.consultCategoryData!![0].id}", 0)
}
}
homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW))
//保存热门搜索列表
it.keywordData?.let { RouterManager.getConsultantRouter()?.setHotSearch(it) }
},
HomeModelImpl.consultRequest(mConsultType).map {
//首页咨询数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONSULT_VIEW))
},
//GoodType为空 获取默认类型
HomeModelImpl.confideRequest(mConfideType).map {
//首页倾述数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONFIDE_VIEW))
},
HomeModelImpl.courseRequest().map {
//首页课程数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.COURSE_VIEW))
},
HomeModelImpl.testRequest().map {
//首页测试数据
val homeTestBean = HomeTestBean()
homeTestBean.testItemList = it.data
homeList.add(
getHomeItemFromTempData(
homeTestBean,
YdlHomeViewHolderConstract.TEST_VIEW
)
)
},
HomeModelImpl.askRequest().map {
//首页问答数据
homeList.add(
getHomeItemFromTempData(
it,
YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW
)
)
},
HomeModelImpl.museRequest().map {
//首页冥想数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.MUSE_VIEW))
},
HomeModelImpl.fmRequest().map {
//首页电台数据
homeList.add(
getHomeItemFromTempData(
it,
YdlHomeViewHolderConstract.INTELLIGENT_VIEW
)
)
},
HomeModelImpl.articleRequest().map {
//首页文章数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.ARTICLE_VIEW))
homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.FOOTER_VIEW))
})
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {}, object : ThrowableConsumer() {
override fun accept(msg: String) {
mView?.homeDataFail(msg)
}
}, Action {
homeList.sortWith(compareBy { it.type })
mView?.let { it.homeDataResponse(homeList) }
//更新本地缓存数据
SharedPreferencesEditor.putString(CACHE_HOME_PAGER_DATA, Gson().toJson(homeList))
SharedPreferencesEditor.putString(IS_NEW_CACHE_HOME_PAGER_DATA, true.toString())
SharedPreferencesEditor.putString(
HOME_PAGER_DATA_CACHE_VERISON,
RxAppTool.getAppVersionCode(BaseApp.getApp()).toString()
)
HomeLogPrinter.printLongLog(
HomePresenterImpl::class.java.simpleName,
Gson().toJson(homeList)
);
})
}
fun saveTempData(list: MutableList<HomePagerDataBean>) {
val homeBean = HomePagerDataBean()
for (dataBean in list) {
when (dataBean.type) {
YdlHomeViewHolderConstract.PAGER_BANNER_VIEW -> {
homeBean.headerBean = dataBean.headerBean
dataBean.headerBean?.keywordData?.let {
RouterManager.getConsultantRouter()?.setHotSearch(it)
}
}
YdlHomeViewHolderConstract.CONSULT_VIEW -> {
homeBean.consultBean = dataBean.consultBean
}
YdlHomeViewHolderConstract.CONFIDE_VIEW -> {
homeBean.confideBean = dataBean.confideBean
}
YdlHomeViewHolderConstract.COURSE_VIEW -> {
homeBean.courseBean = dataBean.courseBean
}
YdlHomeViewHolderConstract.TEST_VIEW -> {
homeBean.testListBean = dataBean.testListBean
}
YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW -> {
mHomeAskBean = dataBean.askBean;
homeBean.askBean = dataBean.askBean
}
YdlHomeViewHolderConstract.MUSE_VIEW -> {
homeBean.museBean = dataBean.museBean
}
YdlHomeViewHolderConstract.INTELLIGENT_VIEW -> {
homeBean.fmBean = dataBean.fmBean
}
YdlHomeViewHolderConstract.ARTICLE_VIEW -> {
homeBean.articleBean = dataBean.articleBean
}
}
}
homeTempData = homeBean
}
private fun getHomeItemFromTempData(
dataBean: HomeItemBaseBean,
type: Int
): HomePagerDataBean {
val item = HomePagerDataBean(type)
when (type) {
YdlHomeViewHolderConstract.PAGER_BANNER_VIEW -> {
item.headerBean =
if (dataBean.isRealEmpty || dataBean !is HomeHeaderBean) homeTempData.headerBean else dataBean
}
YdlHomeViewHolderConstract.CONSULT_VIEW -> {
item.consultBean =
if (dataBean.isRealEmpty || dataBean !is HomeConsultBean) homeTempData.consultBean else dataBean
}
YdlHomeViewHolderConstract.CONFIDE_VIEW -> {
item.confideBean =
if (dataBean.isRealEmpty || dataBean !is HomeConfideBean) homeTempData.confideBean else dataBean
}
YdlHomeViewHolderConstract.COURSE_VIEW -> {
item.courseBean =
if (dataBean.isRealEmpty || dataBean !is HomeCourseBean) homeTempData.courseBean else dataBean
}
YdlHomeViewHolderConstract.TEST_VIEW -> {
item.testListBean =
if (dataBean.isRealEmpty || dataBean !is HomeTestBean) homeTempData.testListBean else dataBean.testItemList
}
YdlHomeViewHolderConstract.ASSUAGE_GRIEF_VIEW -> {
item.askBean =
if (dataBean.isRealEmpty || dataBean !is HomeAskBean) homeTempData.askBean else dataBean
mHomeAskBean = item.askBean
}
YdlHomeViewHolderConstract.MUSE_VIEW -> {
item.museBean =
if (dataBean.isRealEmpty || dataBean !is MuseModuleBean) homeTempData.museBean else dataBean
}
YdlHomeViewHolderConstract.INTELLIGENT_VIEW -> {
item.fmBean =
if (dataBean.isRealEmpty || dataBean !is HomeFMBean) homeTempData.fmBean else dataBean
}
YdlHomeViewHolderConstract.ARTICLE_VIEW -> {
item.articleBean =
if (dataBean.isRealEmpty || dataBean !is HomeArticleBean) homeTempData.articleBean else dataBean
}
}
return item
}
/**
*获取倾述列表
*/
@SuppressLint("CheckResult")
fun getConfideData(type: String, selectPosition: Int) {
disposeConfide()
disposeHome()
mConfideType = type
HomeModelImpl.confideRequest(type)
.map { it }
.filter { true }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView?.confideDataResponse(it, selectPosition)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
mView?.homeDataFail(msg)
}
})
}
/**
*获取咨询列表
*/
fun getConsultData(type: String, selectPosition: Int) {
disposeConsult()
disposeHome()
mConsultType = type
mConsultDisposable = HomeModelImpl.consultRequest(type)
.map { it }
.filter { true }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView?.consultDataResponse(it, selectPosition)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
mView?.homeDataFail(msg)
}
})
}
fun disposeConfide() {
if (mConfideDisposable != null && !mConfideDisposable!!.isDisposed) {
mConfideDisposable?.dispose()
}
}
fun disposeConsult() {
if (mConsultDisposable != null && !mConsultDisposable!!.isDisposed) {
mConsultDisposable?.dispose()
}
}
fun disposeHome() {
if (mHomeDisposable != null && !mHomeDisposable!!.isDisposed) {
mHomeDisposable?.dispose()
}
}
/**
* 首页问答 - 点赞
*/
@SuppressLint("CheckResult")
fun askZan(position: Int, index: Int, id: String) {
// if (zanRequestList?.contains(id)!!) {
// return
// }
// zanRequestList?.add(id)
HomeModelImpl.askZan(id)
.compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.map { result ->
// mHomeAskBean!!.data!![index].isZan = result.status
// if (result.status == 1) mHomeAskBean!!.data!![index].zanCount++ else mHomeAskBean!!.data!![index].zanCount--
// mHomeAskBean
}
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
// zanRequestList?.remove(id)
// view.askDataResponse(it!!, position)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
//zanRequestList?.remove(id)
mView?.homeDataFail(msg)
}
})
}
/**
* 首页问答 - 关注
*/
fun askFocus(position: Int, id: String) {
HomeModelImpl.askFocus(id)
.compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.map { result ->
// //遍历更改集合中已关注用户状态
// var tempList = mutableListOf<HomeAskBean.DataBean>();
// for ((index, value) in mHomeAskBean!!.data?.withIndex()!!) {
// if (value.uid.toString() == id) {
// value.isFocused = result.status
// }
// tempList.add(value)
// }
// mHomeAskBean!!.data = tempList
// mHomeAskBean
}
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
// view.askDataResponse(it!!, position)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
mView.homeDataFail(msg)
}
})
}
inner class CouponReceiveBean {
var couponIds: List<String>? = null
}
}
\ No newline at end of file
package com.yidianling.home.ui.fragment
import android.app.Dialog
import android.graphics.Typeface
import android.os.Build
import android.support.design.widget.TabLayout
import android.support.v4.content.ContextCompat
import android.support.v4.widget.SwipeRefreshLayout
import android.support.v7.widget.LinearLayoutManager
import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.base.BaseMvpFragment
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.actionutil.BIConstants
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.constants.HomeBIConstants
import com.yidianling.home.R
import com.yidianling.home.adapter.YdlHomeAdapter
import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.constract.YdlHomeViewHolderConstract
import com.yidianling.home.dialog.ActivityDialog
import com.yidianling.home.dialog.ActivityGuideDialog
import com.yidianling.home.event.HomeImpl
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.listener.HomeConfideRecyleSuspendListener
import com.yidianling.home.model.bean.*
import com.yidianling.home.presenter.HomePresenterImpl
import com.yidianling.home.ui.view.CouponDialog
import com.yidianling.home.utils.Double11ActivityManagerUtils
import com.yidianling.home.utils.HomeAnimUtils
import com.yidianling.router.RouterManager
import kotlinx.android.synthetic.ydl.home_module_fragment.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 壹点灵首页fragment
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/12
*/
class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>(),
IHomeContract.View,
SwipeRefreshLayout.OnRefreshListener {
private var adapter: YdlHomeAdapter? = null
private var homeEvent: IHomeEvent? = null
private var dialog: CouponDialog? = null
//双11活动弹窗
//双11活动弹窗
private var aa: Dialog? = null
/**
* tablayou上次选中的tab下标
*/
private var confideLastSelectPosition = 0
/**
* TabLayout.OnTabSelectedListener
*/
private var consultTabListener: TabLayout.OnTabSelectedListener? = null
private var confideTabListener: TabLayout.OnTabSelectedListener? = null
/**
* 咨询tablayout上次选中的下标
*/
private var consultLastSelectPosition = 0
/**
* 悬浮tablayout监听事件
*/
private var scrollListner: HomeConfideRecyleSuspendListener? = null
//咨询模块数据缓存
private var consultCategoryDate: MutableList<HomeHeaderBean.ConsultCategoryDateBean>? = null
private var searchContent: String = "搜索话题、咨询师姓名"
override fun layoutResId(): Int {
return R.layout.home_module_fragment
}
override fun initDataAndEvent() {
homeEvent = HomeImpl(activity, this)
initView()
initTopButtonBanner()
initAdapter()
}
override fun startAnim() {
HomeAnimUtils.startAnim(context, rl_top, rl_search, home_service_call, home_tv)
HomeAnimUtils.startSearchShow(ll_top_function, view_search_input_bg, home_tv, iv_search_icon, img_ad)
}
override fun endAnim() {
HomeAnimUtils.endAnim(context, rl_top, rl_search, home_tv, home_service_call, this)
HomeAnimUtils.startSearchHide(ll_top_function, view_search_input_bg, home_tv, iv_search_icon, img_ad)
}
override fun getSearchContent(): String {
return if (TextUtils.isEmpty(searchContent)) "搜索话题、咨询师姓名" else searchContent
}
/**
* 设置顶部导航栏 功能点击事件
*/
private fun initTopButtonBanner() {
tv_consult.setOnClickListener {
homeEvent?.reservationExpertsClick()
}
tv_confide.setOnClickListener {
homeEvent?.nowConfideClick()
}
tv_course.setOnClickListener {
homeEvent?.psychologyClassClick()
}
tv_test.setOnClickListener {
homeEvent?.psychologyTestClick()
}
rl_backTop.setOnClickListener {
home_module_fragment_recycler.scrollToPosition(0)
}
}
private fun initAdapter() {
mPresenter?.localHomeData(this.context)
adapter = YdlHomeAdapter(context, homeEvent!!, ArrayList())
val layoutManager = LinearLayoutManager(context)
home_module_fragment_recycler.layoutManager = layoutManager
home_module_fragment_recycler.adapter = adapter
scrollListner = HomeConfideRecyleSuspendListener()
home_module_fragment_recycler.addOnScrollListener(scrollListner)
setSuspendListener()
}
private fun initView() {
home_swipe_refresh_layout?.setOnRefreshListener(this)
home_swipe_refresh_layout?.setColorSchemeColors(ContextCompat.getColor(context, R.color.platform_main_theme_blue))
home_swipe_refresh_layout?.setProgressViewOffset(false, 0, 200)
home_module_fragment_recycler.addOnScrollListener(homeEvent?.onPageScroll(view_rl_top_bg))
home_service_call.setOnClickListener { homeEvent?.serviceCallClick() }
home_tv.setOnClickListener { homeEvent?.searchTvClick(searchContent) }
initStatus()
}
/**
* 初始化状态栏位置
*/
private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(activity)
var homeTitleBarHeight = resources.getDimension(R.dimen.home_title_bar_height)
val lp1 = view_rl_top_bg.layoutParams as RelativeLayout.LayoutParams
lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
view_rl_top_bg.layoutParams = lp1
val lp2 = rl_top.layoutParams as RelativeLayout.LayoutParams
lp2.topMargin = statusBarHeight
rl_top.layoutParams = lp2
}
}
override fun initDataAndEventLazy() {
}
override fun createPresenter(): HomePresenterImpl {
return HomePresenterImpl()
}
override fun onRefresh() {
home_swipe_refresh_layout.isRefreshing = true
mPresenter?.refreshHomeData()
}
override fun resetModuleTabPosition() {
adapter?.confideSelectPosition = 0
adapter?.consultSelectPosition = 0
}
/**
* 设置悬浮顶部监听数据
*/
private fun setSuspendListener() {
scrollListner?.setContext(context)
scrollListner?.setHomeView(this)
scrollListner?.setConfideFilterView(ll_layout)
scrollListner?.setConsultFilterView(ll_consultLayout)
scrollListner?.setSectionAdapter(adapter!!)
scrollListner?.setPhoneCallImageView(home_service_call)
}
/**
* 获取倾述列表数据
* @param type 倾述类型
* @param selectPosition 选中的position
*/
override fun getConfideData(type: String, selectPosition: Int) {
confideLastSelectPosition = selectPosition
// tab_layout.getTabAt(confideLastSelectPosition)!!.select()
mPresenter?.getConfideData(type, selectPosition)
}
/**
* 获取咨询列表数据
*/
override fun getConsultData(type: String, selectPosition: Int) {
consultLastSelectPosition = selectPosition
// tab_consultLayout.getTabAt(consultLastSelectPosition)
mPresenter?.getConsultData(type, selectPosition)
}
override fun homeHeadResponse(homeHeaderBean: HomeHeaderBean) {
//展示活动数据
val act = homeHeaderBean.activityResponse
if (act != null) {
if (!TextUtils.isEmpty(act!!.imageUrl)) {
img_ad.visibility = View.VISIBLE
GlideApp.with(this).load(act!!.imageUrl).into(img_ad)
img_ad.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if (act.btnLinkurl != null && act.btnLinkurl!!.startsWith("http")) {
NewH5Activity.start(activity, H5Params(act.btnLinkurl!!, null))
} else {
YDLRouterManager.router(act.btnLinkurl)
}
}
} else {
img_ad.visibility = View.GONE
}
if (!TextUtils.isEmpty(act.imageBanner)) {
val va = SharedPreferencesEditor.getString(act.imageBanner)
if (TextUtils.equals("yes", va)) {
//已经显示过,不再弹出
return
}
}
if (RouterManager.getUserRouter()?.isLogin() != true) {
//未登录不显示
return
}
if (Double11ActivityManagerUtils.notShowDouble11Activity) {
return
}
if (!TextUtils.isEmpty(act.imageBanner)) {
//展示弹窗
if (aa == null) {
aa = ActivityDialog(activity, act.imageBanner, act.linkUrl, act.title)
aa?.show()
aa?.setOnDismissListener {
//文案不为空才显示引导--李思开
if (!TextUtils.isEmpty(act.title)){
ActivityGuideDialog(activity, act.imageUrl, act.title).show()
}
}
Double11ActivityManagerUtils.notShowDouble11Activity = false
}
//仅展示一次,以后不再展示
SharedPreferencesEditor.putString(act.imageBanner, "yes")
}
}
}
override fun homeDataResponse(list: MutableList<HomePagerDataBean>) {
home_swipe_refresh_layout.isRefreshing = false
//更新首页数据
adapter?.updateItems(list)
if (!TextUtils.isEmpty(list[0].headerBean?.doctorName)) {
searchContent = list[0].headerBean?.doctorName!!
home_tv.text = searchContent
}
//每次全局更新后重置下标位
confideLastSelectPosition = 0
consultLastSelectPosition = 0
//初始化fragment中的tablayout布局,悬停效果使用
for (bean in list) {
//倾述模块
if (bean.type == YdlHomeViewHolderConstract.PAGER_BANNER_VIEW) {
initTabLayout(bean.headerBean!!.listenCategoryDate)
initConsultTabLayout(bean.headerBean!!.consultCategoryData)
}
}
//每次全局更新后重置下标位
consultLastSelectPosition = 0
}
/**
* 初始化fragment中的tablayout布局,悬停效果使用
*/
private fun initTabLayout(listenCategoryDate: List<HomeHeaderBean.ListenCategoryDateBean>?) {
if (confideTabListener == null) {
confideTabListener = ConfideExpertTabSelectedListener(listenCategoryDate!!, tab_layout)
tab_layout.addOnTabSelectedListener(confideTabListener!!)
}
tab_layout.removeAllTabs()
for ((index, bean) in listenCategoryDate!!.withIndex()) {
tab_layout.addTab(tab_layout.newTab().setText(bean.name), index == confideLastSelectPosition)
}
var textView = ((tab_layout!!.getChildAt(0) as LinearLayout).getChildAt(confideLastSelectPosition) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(activity, R.color.platform_color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
}
/**
* 初始化fragment中咨询tablayout布局,悬停效果使用
*/
private fun initConsultTabLayout(listenCategoryDate: List<HomeHeaderBean.ConsultCategoryDateBean>?) {
if (consultTabListener == null) {
consultTabListener = ConsultExpertTabSelectedListener(listenCategoryDate!!, tab_consultLayout)
tab_consultLayout.addOnTabSelectedListener(consultTabListener!!)
}
if (null == consultCategoryDate) {
consultCategoryDate = ArrayList()
}
//如果 数据不变 则不重新构建
if (null != listenCategoryDate && consultCategoryDate!!.size == listenCategoryDate.size && consultCategoryDate!!.retainAll(listenCategoryDate)) {
return
}
consultCategoryDate?.clear()
if (null != listenCategoryDate) {
consultCategoryDate?.addAll(listenCategoryDate)
}
tab_consultLayout.removeAllTabs()
for ((index, bean) in listenCategoryDate!!.withIndex()) {
tab_consultLayout.addTab(tab_consultLayout.newTab().setText(bean.name), index == confideLastSelectPosition)
}
val textView = ((tab_consultLayout!!.getChildAt(0) as LinearLayout).getChildAt(confideLastSelectPosition) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(activity, R.color.platform_color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
}
override fun confideDataResponse(data: HomeConfideBean, selectPosition: Int) {
//更新倾述列表数据
adapter?.updateConfideData(data, selectPosition)
}
override fun consultDataResponse(data: HomeConsultBean, selectPosition: Int) {
//更新咨询列表数据
adapter?.updateConsultData(data, selectPosition)
}
override fun askDataResponse(data: HomeAskBean, position: Int) {
//更新问答模块数据
adapter?.updateAskData(data, position)
}
override fun homeDataFail(msg: String) {
home_swipe_refresh_layout?.isRefreshing = false
// ToastHelper.show(msg)
}
override fun askZan(position: Int, index: Int, id: String) {
mPresenter?.askZan(position, index, id)
}
override fun askFocus(position: Int, id: String) {
mPresenter?.askFocus(position, id)
}
override fun showHomeProgress() {
showHomeProgress()
}
override fun showRefreshLayout() {
home_swipe_refresh_layout?.isRefreshing = true
}
override fun dismissHomeProgress() {
dismissHomeProgress()
}
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser)
if (isVisibleToUser && isResumed) {
showConsultAssistantDialog()
} else {
hideConsultAssistantDialog()
}
if (isVisibleToUser && isResumed) {
onResume()
}
}
private fun showConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java).showConsultAssistantDialog(activity)
}
private fun hideConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java).hideConsultAssistantDialog()
}
override fun onResume() {
super.onResume()
if (userVisibleHint) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_MAIN_PAGE_VISIT)
mPresenter?.loadHomeData()
showConsultAssistantDialog()
}
}
/**
* 咨询楼层tablayout
*/
inner class ConsultExpertTabSelectedListener : TabLayout.OnTabSelectedListener {
private var list: List<HomeHeaderBean.ConsultCategoryDateBean>? = null
private var tabLayout: TabLayout? = null
constructor(list: List<HomeHeaderBean.ConsultCategoryDateBean>, tabLayout: TabLayout) {
this.list = list
this.tabLayout = tabLayout
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 15f
textView.setTextColor(ContextCompat.getColor(activity, R.color.platform_color_333333))
}
}
override fun onTabSelected(tab: TabLayout.Tab?) {
if (tab!!.position == consultLastSelectPosition) {
return
}
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(activity, R.color.platform_color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
homeEvent!!.getConsultData(list!![tab!!.position], tab!!.position)
}
}
inner class ConfideExpertTabSelectedListener : TabLayout.OnTabSelectedListener {
private var list: List<HomeHeaderBean.ListenCategoryDateBean>? = null
private var tabLayout: TabLayout? = null
constructor(list: List<HomeHeaderBean.ListenCategoryDateBean>, tabLayout: TabLayout) {
this.list = list
this.tabLayout = tabLayout
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 15f
textView.setTextColor(ContextCompat.getColor(activity, R.color.platform_color_333333))
}
}
override fun onTabSelected(tab: TabLayout.Tab?) {
if (tab!!.position == confideLastSelectPosition) {
return
}
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(activity, R.color.platform_color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
homeEvent!!.getConfideData(list!![tab!!.position], tab!!.position)
}
}
override fun onDestroyView() {
super.onDestroyView()
HomeAnimUtils.clear()
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.app.Activity
import android.app.Dialog
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.text.TextUtils
import com.yidianling.home.R
import com.yidianling.ydlcommon.pay.model.CouponBean
import kotlinx.android.synthetic.main.dialog_coupon.*
/**
* @author jiucheng
* @描述:首页优惠券弹窗
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/8/6
*/
class CouponDialog : Dialog {
private var activity: Activity? = null
var status: Int = STATUS_RECEIVER
var couponBean: CouponBean? = null
var list: List<CouponBean>? = null
var listener: OnClickEnsureListener? = null
companion object {
var STATUS_RECEIVER = 0 //立即领取
var STATUS_GET = 1 //查看我的卡券
}
constructor(activity: Activity?, list: List<CouponBean>, listener: OnClickEnsureListener?) : super(activity) {
this.activity = activity
this.couponBean = list[0]
this.list = list
this.listener = listener
}
fun updateStatus(status: Int) {
this.status = status
updateUiByStatus()
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.dialog_coupon)
setCanceledOnTouchOutside(false)
window.setBackgroundDrawable(ColorDrawable())
if (couponBean != null) {
if (!TextUtils.isEmpty(couponBean!!.title)) {
tv_title.text = couponBean!!.title
}
tv_duration.text = couponBean!!.validity
if (TextUtils.equals("1", couponBean!!.type)) {
tv_money.text = couponBean!!.amount
tv_unit.text = "元"
} else {
tv_money.text = (couponBean!!.discount.toFloat() * 10).toString()
tv_unit.text = "折"
}
tv_limit.text = couponBean!!.condition
}
updateUiByStatus()
tv_ensure.setOnClickListener {
if (listener != null) {
listener!!.clickEnsure(status)
}
if (status == STATUS_GET) {
dismiss()
}
}
iv_close.setOnClickListener {
dismiss()
}
}
private fun updateUiByStatus() {
var title = ""
var ensureText = ""
var iamge = 0
when (status) {
STATUS_RECEIVER -> {
if (list!!.size > 1) {
title = "获得${list!!.size}张新的优惠券"
} else {
title = "获得新优惠券"
}
ensureText = "立即领取"
iamge = R.drawable.coupon_receiver
}
STATUS_GET -> {
if (list!!.size > 1) {
title = "获得${list!!.size}张新的优惠券"
} else {
title = "恭喜您,领取成功"
}
ensureText = "查看我的卡券"
iamge = R.drawable.coupon_success
}
}
iv_title.setImageResource(iamge)
tv_status.text = title
tv_ensure.text = ensureText
}
interface OnClickEnsureListener {
fun clickEnsure(status: Int)
}
override fun show() {
if (null == activity || activity!!.isFinishing) {
return
}
super.show()
}
}
\ No newline at end of file
package com.yidianling.home.ui.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.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeArticleBean
import com.ydl.ydl_image.manager.YDLImageCacheManager
import kotlinx.android.synthetic.main.home_module_article_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 文章*阅读模块item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/14
*/
class HomeArticleItemView(private val mContext: Context, private var homeEvent: IHomeEvent?): LinearLayout(mContext) {
init {
initView()
}
private fun initView() {
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_article_item_view, this)
}
fun updateData(bean: HomeArticleBean.Bean?) {
homeModuleArticleItemViewTitle.text = bean?.title
homeModuleArticleItemViewContent.text = bean?.desc
homeModuleArticleItemViewAuthor.text = bean?.name
homeModuleArticleItemViewGreatNum.text = bean?.countOfFavorite.toString()
homeModuleArticleItemViewLookNum.text = bean?.readNum.toString()
YDLImageCacheManager.showImage(mContext,bean?.imgUrl,homeModuleArticleItemViewImg)
setOnClickListener {
homeEvent?.articleItemClick(bean)
}
}
/**
* 最后一个item需要隐藏item的下划线
*/
fun hideBottomLine() {
homeModuleArticleItemViewBottomLine.visibility = View.GONE
}
}
\ No newline at end of file
package com.yidianling.home.ui.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.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeArticleBean
import kotlinx.android.synthetic.main.home_module_article_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 文章*阅读模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeArticleView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var cacheList : ArrayList<HomeArticleBean.Bean> = ArrayList()
init {
initView()
}
private fun initView() {
orientation = VERTICAL
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_article_view, this)
homeModuleArticleViewHomeCommonTitleView.setTitle("文章·阅读")
homeModuleArticleViewHomeCommonTitleView.setOnClickListener {
homeEvent?.articleMoreClick()
}
}
fun initData(list: List<HomeArticleBean.Bean>?) {
//添加View
list?.let {
if (cacheList.size != list?.size) {
cacheList.clear()
cacheList.addAll(list!!)
updateHomeArticleItemViewNumber()
}
//刷新数据
for (index in 0 until childCount) {
val itemView = getChildAt(index)
if (itemView is HomeArticleItemView) {
itemView.updateData(list[index - 1])
// 最后一个隐藏底部横线
if (index == childCount - 1) {
itemView.hideBottomLine()
}
}
}
}
}
/**
* 更新itemView的数量以适应新的数据集
*/
private fun updateHomeArticleItemViewNumber() {
var childCountRecord = childCount -1 //减1是因为第一个子View是标题View
while (cacheList.size > childCountRecord) {
addView(HomeArticleItemView(mContext, homeEvent))
childCountRecord++
}
while (cacheList.size < childCountRecord && getChildAt(childCountRecord) is HomeArticleItemView) {
removeViewAt(childCountRecord)
childCountRecord--
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.support.v7.widget.CardView
import android.util.Log
import android.view.View
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.yidianling.common.tools.RxDeviceTool
import kotlinx.android.synthetic.main.home_module_assuage_grief_image_more_five_item_view.view.*
import kotlinx.android.synthetic.main.home_module_assuage_grief_image_under_four_item_view.view.*
import kotlinx.android.synthetic.main.home_module_assuage_grief_image_under_two_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 解忧*问答模块内部图片模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/15
*/
class HomeAssuageGriefImageItemView(private val mContext: Context, private val urlList: List<String>, private var homeEvent: IHomeEvent?) : CardView(mContext) {
init {
initView()
}
private fun initView() {
radius = 4f
cardElevation = 0f
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = (screenWidth - 2 * 30 * RxDeviceTool.getScreenDensity(mContext)).toInt()
var params: LinearLayout.LayoutParams?
//根据图片的数量,加载不同的图片布局
if (urlList.size <= 2) {
var viewHeight = viewWidth * 178 / 315
params = LinearLayout.LayoutParams(viewWidth, viewHeight)
params.bottomMargin = (20 * RxDeviceTool.getScreenDensity(mContext)).toInt()
layoutParams = params
View.inflate(mContext, R.layout.home_module_assuage_grief_image_under_two_item_view, this)
YDLImageCacheManager.showImage(mContext, urlList[0], homeModuleAssuageGriefUnderTwoItemViewImg)
} else if (urlList.size <= 4) {
var viewHeight = viewWidth * 178 / 315
params = LinearLayout.LayoutParams(viewWidth, viewHeight)
params.bottomMargin = (20 * RxDeviceTool.getScreenDensity(mContext)).toInt()
layoutParams = params
View.inflate(mContext, R.layout.home_module_assuage_grief_image_under_four_item_view, this)
YDLImageCacheManager.showImage(mContext, urlList[0], homeModuleAssuageGriefUnderFourItemViewFirstImg)
YDLImageCacheManager.showImage(mContext, urlList[1], homeModuleAssuageGriefUnderFourItemViewSecondImg)
YDLImageCacheManager.showImage(mContext, urlList[2], homeModuleAssuageGriefUnderFourItemViewThirdImg)
homeModuleAssuageGriefUnderFourthItemViewTag.text = urlList.size.toString() + "图"
} else if (urlList.size >= 5) {
var viewHeight = viewWidth * 180 / 315
params = LinearLayout.LayoutParams(viewWidth, viewHeight)
params.bottomMargin = (20 * RxDeviceTool.getScreenDensity(mContext)).toInt()
layoutParams = params
View.inflate(mContext, R.layout.home_module_assuage_grief_image_more_five_item_view, this)
YDLImageCacheManager.showImage(mContext, urlList[0], homeModuleAssuageGriefUnderFiveItemViewFirstImg)
YDLImageCacheManager.showImage(mContext, urlList[1], homeModuleAssuageGriefUnderFiveItemViewSecondImg)
YDLImageCacheManager.showImage(mContext, urlList[2], homeModuleAssuageGriefUnderFiveItemViewThirdImg)
YDLImageCacheManager.showImage(mContext, urlList[3], homeModuleAssuageGriefUnderFiveItemViewFourthImg)
YDLImageCacheManager.showImage(mContext, urlList[4], homeModuleAssuageGriefUnderFiveItemViewFiveImg)
homeModuleAssuageGriefUnderFiveItemViewTag.text = urlList.size.toString() + "图"
}
}
fun updateData() {
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.text.*
import android.text.style.ForegroundColorSpan
import android.text.style.ImageSpan
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeAskBean
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterManager
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.ydlcommon.router.IYDLRouterConstant
import com.yidianling.ydlcommon.router.YdlCommonRouterManager
import com.yidianling.ydlcommon.utils.MoonUtil
import com.yidianling.ydlcommon.utils.Utils
import kotlinx.android.synthetic.main.home_module_assuage_grief_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 解忧*问答模块item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/15
*/
class HomeAssuageGriefItemView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var homeAssuageGriefImageItemView: HomeAssuageGriefImageItemView? = null
private var focusClick: Boolean = false;
init {
initView()
}
private fun initView() {
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
params.setMargins((15 * RxDeviceTool.getScreenDensity(mContext)).toInt()
, (0 * RxDeviceTool.getScreenDensity(mContext)).toInt()
, (15 * RxDeviceTool.getScreenDensity(mContext)).toInt()
, (16 * RxDeviceTool.getScreenDensity(mContext)).toInt())
layoutParams = params
View.inflate(mContext, R.layout.home_module_assuage_grief_item_view, this)
}
fun updateData(bean: HomeAskBean.DataBean, position: Int, index: Int) {
this.setOnClickListener {
homeEvent?.askItemClick(bean)
}
val op = SimpleImageOpConfiger()
op.errorPic = com.yidianling.ydlcommon.R.drawable.head_place_hold_pic
op.loadingPic = com.yidianling.ydlcommon.R.drawable.head_place_hold_pic
YDLImageCacheManager.showImage(mContext, bean?.header, homeModuleAssuageGriefViewPersonImg, op)
homeModuleAssuageGriefViewPersonName.text = bean?.name
homeModuleAssuageGriefViewTime.text = bean?.timeStr
MoonUtil.identifyFaceExpression(mContext, homeModuleAssuageGriefViewContent,
bean?.content, ImageSpan.ALIGN_BOTTOM)
homeModuleAssuageGriefViewTag.text = bean?.askTag
homeModuleAssuageGriefViewCommentsCount.text = bean?.commentsCount.toString()
homeModuleAssuageGriefViewZanCount.text = bean?.zanCount.toString()
/**
* 点赞
*/
ll_zan.setOnClickListener {
//防止连击
if (!Utils.isFastClick()) {
if (!YdlCommonRouterManager.getYdlCommonRoute().isLogin()) {
//跳转登录
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return@setOnClickListener
}
bean.isZan = if (bean.isZan == 1 ) 0 else 1
if (bean.isZan == 1) {
homeModuleAssuageGriefViewIsZan.progress = 0f
homeModuleAssuageGriefViewIsZan.visibility = View.VISIBLE
homeModuleAssuageGriefViewIsNotZan.visibility = View.GONE
homeModuleAssuageGriefViewIsZan.playAnimation()
} else {
homeModuleAssuageGriefViewIsZan.visibility = View.GONE
homeModuleAssuageGriefViewIsNotZan.visibility = View.VISIBLE
}
bean.zanCount = if (bean.isZan == 1 ) bean.zanCount+1 else bean.zanCount-1
homeModuleAssuageGriefViewZanCount.text = bean?.zanCount.toString()
homeEvent?.askItemZanClick(position, index, bean.id.toString())
}
}
homeModuleAssuageGriefItemViewIsFollow.setOnClickListener {
//防止连击
if (!Utils.isFastClick()) {
if (bean.isFocused == 1) {
homeEvent?.askItemClick(bean)
} else {
if (!YdlCommonRouterManager.getYdlCommonRoute().isLogin()) {
//跳转登录
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return@setOnClickListener
}
bean.isFocused = if(bean.isFocused == 1) 0 else 1
setFollowType(bean.isFocused == 1)
homeEvent?.askItemFocusClick(position, bean.uid.toString())
}
}
}
if (bean.uid == 0) {
//匿名,隐藏关注按钮
homeModuleAssuageGriefItemViewIsFollow.visibility = View.GONE
} else {
/**
* 关注
*/
if (bean.isFocused == 1) {
setFollowType(true)
} else {
setFollowType(false)
}
}
/**
* 标题
*/
if (!TextUtils.isEmpty(bean?.title)) {
homeModuleAssuageGriefViewTitle.visibility = View.VISIBLE
homeModuleAssuageGriefViewTitle.text = bean?.title
}
/**
* 点赞
*/
if (bean?.isZan == 1) {
homeModuleAssuageGriefViewIsZan.visibility = View.VISIBLE
homeModuleAssuageGriefViewIsZan.progress = 1.0f
homeModuleAssuageGriefViewIsNotZan.visibility = View.GONE
} else {
homeModuleAssuageGriefViewIsZan.visibility = View.GONE
homeModuleAssuageGriefViewIsNotZan.visibility = View.VISIBLE
}
/**
* 图片
*/
if (null != bean?.smallAttach && bean?.smallAttach!!.isNotEmpty()) {
if (homeAssuageGriefImageItemView != null) {
homeModuleAssuageGriefViewChildLayout.removeView(homeAssuageGriefImageItemView)
}
homeAssuageGriefImageItemView = HomeAssuageGriefImageItemView(mContext, bean?.smallAttach as List<String>, homeEvent)
homeModuleAssuageGriefViewChildLayout.addView(homeAssuageGriefImageItemView, 1)
} else {
if (null != homeAssuageGriefImageItemView) {
homeModuleAssuageGriefViewChildLayout.removeView(homeAssuageGriefImageItemView)
}
}
/**
* 评论
*/
initComment(bean)
}
private fun setFollowType(boolean: Boolean) {
if (boolean) {
homeModuleAssuageGriefItemViewFollow.visibility = View.VISIBLE
homeModuleAssuageGriefItemViewUnFollow.visibility = View.GONE
} else {
homeModuleAssuageGriefItemViewFollow.visibility = View.GONE
homeModuleAssuageGriefItemViewUnFollow.visibility = View.VISIBLE
}
}
private fun initComment(bean: HomeAskBean.DataBean) {
if (bean?.commentsCount > 0) {
homeModuleAssuageGriefViewComment.visibility = View.VISIBLE
var index: Int = 0
var commentBean = bean?.comments!![0]
if (null != commentBean.name && commentBean.name!!.isNotEmpty())
setPartTextColor(homeModuleAssuageGriefViewHotViewComment, commentBean.name,
0, commentBean.name?.length!!, Color.parseColor("#1DA1F2"))
// userType为2 ,专家
if (commentBean.userType == 2) {
setImage(mContext, homeModuleAssuageGriefViewHotViewComment, "vip",
R.drawable.home_module_assuage_grief_item_user_type_v,
RxImageTool.dp2px(13f),
RxImageTool.dp2px(13f))
}
setAppendPartTextColor(homeModuleAssuageGriefViewHotViewComment, ":",
0,
1
, Color.parseColor("#1DA1F2"))
MoonUtil.identifyFaceExpression(mContext, homeModuleAssuageGriefViewHotViewCommentContent,
commentBean.content, ImageSpan.ALIGN_BOTTOM)
var emptyString = ""
if (null != commentBean.name && commentBean.name!!.isNotEmpty()) {
if (commentBean.userType == 2) {
emptyString += "缩"
}
for (index in 0 until commentBean.name!!.length) {
emptyString += commentBean.name!![index]
}
emptyString += "缩"
}
val span = SpannableStringBuilder(emptyString + homeModuleAssuageGriefViewHotViewCommentContent.text)
span.setSpan(ForegroundColorSpan(Color.TRANSPARENT), 0, emptyString.length,
Spanned.SPAN_INCLUSIVE_EXCLUSIVE)
homeModuleAssuageGriefViewHotViewCommentContent.text = span
}
}
fun setPartTextColor(textView: TextView, text: String?,
start: Int, end: Int, colorId: Int) {
var ss: SpannableString = SpannableString(text)
ss.setSpan(ForegroundColorSpan(colorId), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
textView.text = ss
}
fun setAppendPartTextColor(textView: TextView, text: String?,
start: Int, end: Int, colorId: Int) {
var ss: SpannableString = SpannableString(text)
ss.setSpan(ForegroundColorSpan(colorId), start, end,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
textView.append(ss)
}
fun setImage(context: Context, textView: TextView, bitmapText: String, resId: Int, width: Int, height: Int) {
var ss: SpannableString = SpannableString(bitmapText)
var drawable: Drawable = context.resources.getDrawable(resId)
drawable.setBounds(0, 0, width, height)
var imageSpan: ImageSpan = ImageSpan(drawable, ImageSpan.ALIGN_BASELINE)
ss.setSpan(imageSpan, 0, bitmapText.length,
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)
textView.append(ss)
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeAskBean
import kotlinx.android.synthetic.main.home_module_assuage_grief_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 解忧*问答模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeAssuageGriefView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var cacheList: ArrayList<HomeAskBean.DataBean> = ArrayList()
init {
initView()
}
private fun initView() {
orientation = VERTICAL
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_assuage_grief_view, this)
homeModuleAssuageGriefViewHomeCommonTitleView.setTitle("解忧·问答")
homeModuleAssuageGriefViewHomeCommonTitleView.setOnClickListener {
homeEvent?.askMoreClick()
}
}
fun initData(position: Int, list: List<HomeAskBean.DataBean>?) {
//添加View
list?.let {
if (null != list && cacheList.size != list?.size) {
cacheList.clear()
cacheList.addAll(list!!)
updateHomeAssuageGriefItemViewNumber()
}
//刷新数据
for (index in 0..childCount) {
val itemView = getChildAt(index)
if (itemView is HomeAssuageGriefItemView) {
if ((index - 1) < list!!.size) {
itemView.updateData(list!![index - 1], position, index - 1)
}
}
}
}
}
/**
* 更新itemView的数量以适应新的数据集
*/
private fun updateHomeAssuageGriefItemViewNumber() {
var childCountRecord = childCount - 1 //减1是因为第一个子View是标题View
while (cacheList.size > childCountRecord) {
addView(HomeAssuageGriefItemView(mContext, homeEvent))
childCountRecord++
}
while (cacheList.size < childCountRecord && getChildAt(childCountRecord) is HomeAssuageGriefItemView) {
removeViewAt(childCountRecord)
childCountRecord--
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.common.tools.RxDeviceTool
import kotlinx.android.synthetic.main.home_module_button_banner_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeButtonBannerView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var buttonParams: LinearLayout.LayoutParams? = null
init {
initView()
}
private fun initView() {
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_button_banner_view, this)
initButtonView()
homeModuleButtonBannerFirst.setOnClickListener {
homeEvent?.reservationExpertsClick()
}
homeModuleButtonBannerSecond.setOnClickListener {
homeEvent?.nowConfideClick()
}
homeModuleButtonBannerThird.setOnClickListener {
homeEvent?.psychologyClassClick()
}
homeModuleButtonBannerFourth.setOnClickListener {
homeEvent?.psychologyTestClick()
}
}
/**
* 初始化四个按钮
*/
private fun initButtonView() {
if (null == buttonParams) {
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = ((screenWidth - 2 * 9 * RxDeviceTool.getScreenDensity(mContext)) / 4).toInt()
var viewHeight = viewWidth * 78 / 80
buttonParams = LinearLayout.LayoutParams(viewWidth, viewHeight)
homeModuleButtonBannerFirst.layoutParams = buttonParams
homeModuleButtonBannerSecond.layoutParams = buttonParams
homeModuleButtonBannerThird.layoutParams = buttonParams
homeModuleButtonBannerFourth.layoutParams = buttonParams
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.support.v4.view.ViewPager
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import com.yidianling.home.R
import com.yidianling.home.adapter.HomeCategoryAdapter
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.home_module_category_container.view.*
/**
* created by HaoRui
* des: 首页分类Pager包装类
*/
class HomeCategoryContainer(private val mContext: Context, private var homeEvent: IHomeEvent?) : RelativeLayout(mContext), ViewPager.OnPageChangeListener {
private var mHomeCategoryAdapter: HomeCategoryAdapter? = null
private var indicatorImages: MutableList<ImageView>? = ArrayList()
private var mIndicatorSelectedResId = R.drawable.home_module_category_tip_select
private var mIndicatorUnselectedResId = R.drawable.home_module_category_tip_unselect
private var lastPosition = 0
private var count = 0
private var mIndicatorWidth: Int = RxImageTool.dip2px(9f)
private var mIndicatorHeight: Int = RxImageTool.dip2px(5f)
private var dp2 : Int = 0
companion object {
var PAGE_ITEM_SIZE:Int = 10
}
init {
initView()
dp2 = RxImageTool.dip2px(4f)
}
private fun initView() {
View.inflate(mContext, R.layout.home_module_category_container, this)
initViewPager()
}
/**
* 填充数据
*/
fun initData(bean: HomeHeaderBean?) {
mHomeCategoryAdapter?.updateItems(bean?.askCategoryData)
if (bean?.askCategoryData?.size!! > PAGE_ITEM_SIZE){
count = Math.ceil(Math.ceil(bean.askCategoryData?.size?.toFloat()?.div(PAGE_ITEM_SIZE.toFloat())?.toDouble()!!)).toInt()
createIndicator()
val params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,RxImageTool.dip2px(153f))
vp_category.layoutParams = params
}else{
val params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,RxImageTool.dip2px(143f))
vp_category.layoutParams = params
ll_Indicator.visibility = View.GONE
}
}
private fun initViewPager() {
if (null == mHomeCategoryAdapter) {
mHomeCategoryAdapter = HomeCategoryAdapter(context, homeEvent)
vp_category.adapter = mHomeCategoryAdapter
}
}
private fun createIndicator() {
vp_category.addOnPageChangeListener(this)
indicatorImages?.clear()
ll_Indicator.visibility = visibility
ll_Indicator.removeAllViews()
for (i in 0 until count) {
val imageView = ImageView(context)
val params: LinearLayout.LayoutParams = LinearLayout.LayoutParams(mIndicatorWidth, mIndicatorHeight)
params.rightMargin = dp2
if (i == 0) {
imageView.setImageResource(mIndicatorSelectedResId)
} else {
imageView.setImageResource(mIndicatorUnselectedResId)
}
indicatorImages?.add(imageView)
ll_Indicator.addView(imageView, params)
}
}
override fun onPageScrollStateChanged(state: Int) {
}
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
}
override fun onPageSelected(position: Int) {
indicatorImages?.get(lastPosition)?.setImageResource(mIndicatorUnselectedResId)
indicatorImages?.get(position)?.setImageResource(mIndicatorSelectedResId)
lastPosition = position
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.PointF
import android.support.v4.view.ViewPager
import android.util.AttributeSet
import android.util.Log
import android.view.MotionEvent
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/3/22
*/
class HomeCategoryViewPager : ViewPager {
constructor(context: Context) : super(context){
}
constructor(context: Context,attributeSet: AttributeSet) : super(context,attributeSet){
}
/** 触摸时按下的点 */
private var downP = PointF()
/** 触摸时当前的点 */
private var curP = PointF()
/** 触摸抬起的点 */
private var upP = PointF()
private var mOnSingleTouchListener: OnSingleTouchListener? = null
override fun onInterceptTouchEvent(arg0: MotionEvent): Boolean {
// TODO Auto-generated method stub
//当拦截触摸事件到达此位置的时候,返回true,
//说明将onTouch拦截在此控件,进而执行此控件的onTouchEvent
return true
}
override fun onTouchEvent(arg0: MotionEvent): Boolean {
// TODO Auto-generated method stub
//每次进行onTouch事件都记录当前的按下的坐标
curP.x = arg0.x
curP.y = arg0.y
if (arg0.action == MotionEvent.ACTION_DOWN) {
//记录按下时候的坐标
//切记不可用 downP = curP ,这样在改变curP的时候,downP也会改变
downP.x = arg0.x
downP.y = arg0.y
//此句代码是为了通知他的父ViewPager现在进行的是本控件的操作,不要对我的操作进行干扰
// parent.requestDisallowInterceptTouchEvent(true)
}
if (arg0.action == MotionEvent.ACTION_MOVE) {
//此句代码是为了通知他的父ViewPager现在进行的是本控件的操作,不要对我的操作进行干扰
// parent.requestDisallowInterceptTouchEvent(true)
}
if (arg0.action == MotionEvent.ACTION_UP) {
upP.x = arg0.x
upP.y = arg0.y
val x = Math.abs(upP.x - downP.x)
val y = Math.abs(upP.y - downP.y)
val z = Math.sqrt(((x * x) + (y * y)).toDouble())
val jiaodu = Math.round((Math.asin(y / z) / Math.PI * 180))// 角度
if (upP.y < downP.y && jiaodu > 45) {// 上
Log.d("onTouchEvent-ACTION_UP", "角度:$jiaodu, 動作:上")
parent.requestDisallowInterceptTouchEvent(false)
} else if (upP.y > downP.y && jiaodu > 45) {// 下
Log.d("onTouchEvent-ACTION_UP", "角度:$jiaodu, 動作:下")
parent.requestDisallowInterceptTouchEvent(false)
} else if (upP.x < downP.x && jiaodu <= 45) {// 左
Log.d("onTouchEvent-ACTION_UP", "角度:$jiaodu, 動作:左")
// 原方向不是向右時,方向轉右
parent.requestDisallowInterceptTouchEvent(true)
} else if (upP.x > downP.x && jiaodu <= 45) {// 右
Log.d("onTouchEvent-ACTION_UP", "角度:$jiaodu, 動作:右")
// 原方向不是向左時,方向轉右
parent.requestDisallowInterceptTouchEvent(true)
}
//在up时判断是否按下和松手的坐标为一个点
//如果是一个点,将执行点击事件,这是我自己写的点击事件,而不是onclick
if (downP.x == curP.x && downP.y == curP.y) {
onSingleTouch()
return true
}
}
return super.onTouchEvent(arg0)
}
/**
* 单击
*/
private fun onSingleTouch() {
mOnSingleTouchListener?.onSingleTouch()
}
fun setOnSingleTouchListener(onSingleTouchListener : OnSingleTouchListener){
mOnSingleTouchListener = onSingleTouchListener
}
/**
* 创建点击事件接口
* @author wanpg
*/
interface OnSingleTouchListener {
fun onSingleTouch()
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.support.constraint.ConstraintLayout
import android.util.AttributeSet
import android.view.View
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import kotlinx.android.synthetic.main.home_module_common_title_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 首页通用标题
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/14
*/
class HomeCommonTitleView(private val mContext: Context, private val attributeSet: AttributeSet) : ConstraintLayout(mContext, attributeSet) {
init {
initView()
}
private fun initView() {
View.inflate(mContext, R.layout.home_module_common_title_view, this)
}
fun setTitle(title: String) {
homeModuleCommonTitleViewTitle.text = title
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Paint
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeConfideBean
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.home_module_confide_expert_info_view.view.*
/**
* @author jiucheng
* @描述:首页倾诉模块--专家个人信息view
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/2/16
*/
class HomeConfideExpertInfoView(private var mContext: Context, private var homeEvent: IHomeEvent?) : FrameLayout(mContext) {
private var dp70 = 0
init {
initView()
dp70 = RxImageTool.dip2px(70f)
}
private fun initView() {
var params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(context, R.layout.home_module_confide_expert_info_view, this)
}
fun setData(bean: HomeConfideBean.BodyBean?, position: Int, isLast: Boolean) {
if (bean == null) {
visibility = View.GONE
return
}
//设置头像
setHead(bean)
//设置名称
tv_name.text = bean.confidedName
//咨询师标签
tag_view.initData(bean.confidedTag as MutableList<String>)
//设置向TA倾诉人数
setConfideNum(bean)
//设置接通率文案
setConnection(bean)
//设置向TA倾诉按钮状态
setConfideButton(bean)
//设置红包、原价
setCoupon(bean)
//最后一项显示分割线
if (isLast) {
view_line.visibility = View.GONE
} else {
view_line.visibility = View.VISIBLE
}
this.setOnClickListener {
homeEvent!!.confideClick(bean.linkUrl,bean.doctorId)
}
}
/**
* 设置头像
*/
private fun setHead(bean: HomeConfideBean.BodyBean) {
val op = SimpleImageOpConfiger()
op.errorPic = com.yidianling.ydlcommon.R.drawable.head_place_hold_pic
op.loadingPic = com.yidianling.ydlcommon.R.drawable.head_place_hold_pic
op.transform = 0
YDLImageCacheManager.showImage(mContext, bean.confidedIcon, img_head, op)
}
/**
* 设置向TA倾诉人数
*/
private fun setConfideNum(bodyBean: HomeConfideBean.BodyBean) {
if (TextUtils.isEmpty(bodyBean.confideNum)) {
tv_confideNum.visibility = View.GONE
tv_tv_confideNumContent.visibility = View.GONE
} else {
tv_confideNum.visibility = View.VISIBLE
tv_tv_confideNumContent.visibility = View.VISIBLE
tv_confideNum.text = bodyBean.confideNum
}
}
/**
* 设置接通率文案
*/
private fun setConnection(bodyBean: HomeConfideBean.BodyBean) {
if (TextUtils.isEmpty(bodyBean.confideConnection)) {
tv_Connection.visibility = View.INVISIBLE
tv_ConnectionContent.visibility = View.INVISIBLE
} else {
tv_Connection.visibility = View.VISIBLE
tv_ConnectionContent.visibility = View.VISIBLE
tv_Connection.text = bodyBean.confideConnection
}
}
/**
* 设置向TA倾诉按钮状态
*/
private fun setConfideButton(bodyBean: HomeConfideBean.BodyBean) {
when (bodyBean.confideLine) {//1在线 2离线 3通话中 4继续倾诉
1 -> {
tv_confide.setBackgroundResource(R.drawable.home_module_confide_line_1)
}
2 -> {
tv_confide.setBackgroundResource(R.drawable.home_module_confide_line_2)
}
3 -> {
tv_confide.setBackgroundResource(R.drawable.home_module_confide_line_3)
}
4 -> {
tv_confide.setBackgroundResource(R.drawable.home_module_confide_line_4)
}
}
tv_confide.setOnClickListener {
if (bodyBean.confideLine == 2) {//喊他上线 私聊
homeEvent!!.toChatForMsg(bodyBean.uid.toString())
} else {
homeEvent!!.confideClick(bodyBean.linkUrl, bodyBean.doctorId)
}
}
}
/**
* 设置红包、原价
*/
@SuppressLint("SetTextI18n")
private fun setCoupon(bodyBean: HomeConfideBean.BodyBean) {
if(!TextUtils.isEmpty(bodyBean.couponText)){
tvCoupon.text = bodyBean.couponText
tvCoupon.visibility = View.VISIBLE
}else{
tvCoupon.visibility = View.GONE
}
if (TextUtils.isEmpty(bodyBean.confideFee) || TextUtils.isEmpty(bodyBean.couponMoney) || bodyBean.couponMoney!!.toFloat() <= 0){
tvOriginalPrice.visibility = View.GONE
}else{
tvOriginalPrice.visibility = View.VISIBLE
val originalBuffer = StringBuffer()
originalBuffer.append(bodyBean.confideFee).append("元/次")
tvOriginalPrice.text = originalBuffer.toString()
//添加删除线
tvOriginalPrice.paint.flags = Paint.STRIKE_THRU_TEXT_FLAG
}
try {
val couponMoney = bodyBean.couponMoney!!.toFloat().toInt()
val confideFee = bodyBean.confideFee!!.toFloat().toInt()
if (couponMoney >= confideFee){
tv_price.text = "¥0"
}else{
val price = confideFee - couponMoney
tv_price.text = "¥"+price.toString()
}
}catch (e:Exception){
//防止数据类型变化引起奔溃
}
}
}
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Typeface
import android.os.Build
import android.support.design.widget.TabLayout
import android.support.v4.content.ContextCompat
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeConfideBean
import com.yidianling.home.model.bean.HomeHeaderBean
import com.yidianling.common.tools.LogUtil
import kotlinx.android.synthetic.main.home_module_confide_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 倾诉*排解模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeConfideView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var mLastPosition: Int = 0
/**
* 专家信息view缓存list
*/
private var cacheInfoViewList: ArrayList<HomeConfideExpertInfoView>? = null
/**
* TabLayout.OnTabSelectedListener
*/
private var listener: ConfideExpertTabSelectedListener? = null
init {
initView()
}
private fun initView() {
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
orientation = VERTICAL
View.inflate(mContext, R.layout.home_module_confide_view, this)
homeModuleConfideViewHomeCommonTitleView.setTitle("倾诉·排解")
homeModuleConfideViewHomeCommonTitleView.setOnClickListener {
homeEvent?.confideMoreClick()
}
}
/**
* 创建tab栏
* @param lastPosition 上次选中的下标
*/
fun setTitle(list: List<HomeHeaderBean.ListenCategoryDateBean>?, lastPosition: Int) {
if (list == null || list.isEmpty()) {
visibility = View.GONE
return
}
if (listener != null) {
tab_layout.removeOnTabSelectedListener(listener!!)
}
mLastPosition = lastPosition
tab_layout.removeAllTabs()
for ((index, bean) in list.withIndex()) {
tab_layout.addTab(tab_layout.newTab().setText(bean.name), index == lastPosition)
}
listener = ConfideExpertTabSelectedListener(list, tab_layout)
tab_layout.addOnTabSelectedListener(listener!!)
var textView = ((tab_layout!!.getChildAt(0) as LinearLayout).getChildAt(lastPosition) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(mContext, R.color.color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
tab_layout.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
LogUtil.e("scrollX=$scrollX")
LogUtil.e("oldScrollX=$oldScrollX")
}
}
}
/**
* 设置数据
*/
fun setConfideExpertInfoView(list: List<HomeConfideBean.BodyBean>?) {
if (list == null || list.isEmpty()) {
ll_content.visibility = View.GONE
return
}
ll_content.visibility = View.VISIBLE
ll_content.removeAllViews()
if (cacheInfoViewList == null) {
cacheInfoViewList = ArrayList()
}
//创建HomeConfideExpertInfoView:每个tab最多显示三个专家
if (cacheInfoViewList!!.size >= list.size) {
for (index in 0 until list!!.size) {
//设置数据
cacheInfoViewList!![index].setData(list[index]!!, index, index == list!!.size - 1)
//添加到布局
ll_content.addView(cacheInfoViewList!![index])
}
} else {
for (index in 0 until list!!.size) {
if (index > 2) {
//只取前三条数据
break
}
//数据大于缓存view数量,创建view
if (index > cacheInfoViewList!!.size - 1) {
var homeConfideExpertInfoView = createExpertInfoView()
cacheInfoViewList!!.add(homeConfideExpertInfoView)
}
//设置数据
cacheInfoViewList!![index].setData(list[index]!!, index, index == list!!.size - 1)
//添加到布局
ll_content.addView(cacheInfoViewList!![index])
}
}
}
/**
* 创建专家信息view
*/
private fun createExpertInfoView(): HomeConfideExpertInfoView {
return HomeConfideExpertInfoView(mContext, homeEvent)
}
inner class ConfideExpertTabSelectedListener : TabLayout.OnTabSelectedListener {
private var list: List<HomeHeaderBean.ListenCategoryDateBean>? = null
private var tabLayout: TabLayout? = null
constructor(list: List<HomeHeaderBean.ListenCategoryDateBean>, tabLayout: TabLayout) {
this.list = list
this.tabLayout = tabLayout
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 15f
textView.setTextColor(ContextCompat.getColor(mContext, R.color.color_333333))
}
}
override fun onTabSelected(tab: TabLayout.Tab?) {
if (mLastPosition == tab!!.position){
return
}
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(mContext, R.color.color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
homeEvent!!.getConfideData(list!![tab!!.position], tab!!.position)
}
}
}
package com.yidianling.home.ui.view
import android.content.Context
import android.text.TextUtils
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeConsultBean
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.yidianling.common.tools.RxImageTool
import com.yidianling.ydlcommon.tool.StringUtils
import com.yidianling.ydlcommon.utils.URLUtils
import kotlinx.android.synthetic.main.home_module_consult_item_view.view.*
/**
* @author jiucheng
* @描述:首页咨询理解模块--专家个人信息view
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/2/16
*/
class HomeConsultItemView(private var mContext: Context, private var homeEvent: IHomeEvent?) : FrameLayout(mContext) {
private var dp70 = 0
init {
initView()
dp70 = RxImageTool.dip2px(70f)
}
private fun initView() {
val params = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(context, R.layout.home_module_consult_item_view, this)
}
fun setData(bean: HomeConsultBean.ListBean?, position: Int, isLast: Boolean,cateId : String?) {
if (bean == null) {
visibility = View.GONE
return
}
//设置头像
setHead(bean)
//设置名称
tv_consult_name.text = bean.doctorName
//咨询师标签
tag_view.initData(StringUtils.strToList(bean.tags))
//设置向TA倾诉人数
setConfideNum(bean)
//设置接通率文案
setConnection(bean)
//设置向TA倾诉按钮状态
setConfideButton(bean)
//设置红包、原价
setPrice(bean)
this.setOnClickListener {
val url = URLUtils.appendParmas(bean.hUrl,"cateId",cateId)
homeEvent!!.consultItemClick(url,bean.doctorId)
}
}
/**
* 设置头像
*/
private fun setHead(bean: HomeConsultBean.ListBean) {
val op = SimpleImageOpConfiger()
op.errorPic = com.yidianling.ydlcommon.R.drawable.head_place_hold_pic
op.loadingPic = com.yidianling.ydlcommon.R.drawable.head_place_hold_pic
op.transform = 0
YDLImageCacheManager.showImage(mContext, bean.doctorHead, img_consult_head, op)
}
/**
* 设置向TA倾诉人数
*/
private fun setConfideNum(bodyBean: HomeConsultBean.ListBean) {
if (TextUtils.isEmpty(bodyBean.zixunOrderNum.toString())) {
tv_consult_num.visibility = View.GONE
tv_tv_consult_num_content.visibility = View.GONE
} else {
tv_consult_num.visibility = View.VISIBLE
tv_tv_consult_num_content.visibility = View.VISIBLE
tv_consult_num.text = bodyBean.zixunOrderNum.toString()
}
}
/**
* 设置接通率文案
*/
private fun setConnection(bodyBean: HomeConsultBean.ListBean) {
if (TextUtils.isEmpty(bodyBean.feedbackRate.toString())) {
tv_feedback_rate.visibility = View.INVISIBLE
tv_feedback_rate_content.visibility = View.INVISIBLE
} else {
tv_feedback_rate.visibility = View.VISIBLE
tv_feedback_rate_content.visibility = View.VISIBLE
try {
val dd = bodyBean.feedbackRate/5.00f
val str = String.format("%.2f",dd*100f)+"%"
tv_feedback_rate.text = str
}catch (e:Exception){
e.printStackTrace()
}
}
}
/**
* 设置咨询按钮事件
*/
private fun setConfideButton(bodyBean: HomeConsultBean.ListBean) {
tv_consult_chat.setOnClickListener {
homeEvent!!.consultChatClick(bodyBean.doctorUid.toString())
}
}
private fun setPrice(bodyBean: HomeConsultBean.ListBean) {
val confideFee = bodyBean.serviceFee
val sb = StringBuffer()
tv_price.text = sb.append("¥").append(confideFee).toString()
}
}
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Typeface
import android.os.Build
import android.support.design.widget.TabLayout
import android.support.v4.content.ContextCompat
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeConsultBean
import com.yidianling.home.model.bean.HomeHeaderBean
import com.yidianling.common.tools.LogUtil
import kotlinx.android.synthetic.main.home_module_confide_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 咨询理解模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeConsultView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var mLastPosition: Int = 0
/**
* 专家信息view缓存list
*/
private var cacheInfoViewList: ArrayList<HomeConsultItemView>? = null
/**
* TabLayout.OnTabSelectedListener
*/
private var listener: ConsultTabSelectedListener? = null
/**
* 当前选中cateId
*/
var cateId = 0
init {
initView()
}
private fun initView() {
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
orientation = VERTICAL
View.inflate(mContext, R.layout.home_module_confide_view, this)
homeModuleConfideViewHomeCommonTitleView.setTitle("咨询·理解")
homeModuleConfideViewHomeCommonTitleView.setOnClickListener {
homeEvent?.consultMoreClick()
}
}
/**
* 创建tab栏
* @param lastPosition 上次选中的下标
*/
fun setTitle(list: List<HomeHeaderBean.ConsultCategoryDateBean>?, lastPosition: Int) {
if (list == null || list.isEmpty()) {
visibility = View.GONE
return
}
if (listener != null) {
tab_layout.removeOnTabSelectedListener(listener!!)
}
mLastPosition = lastPosition
tab_layout.removeAllTabs()
for ((index, bean) in list.withIndex()) {
tab_layout.addTab(tab_layout.newTab().setText(bean.name), index == lastPosition)
}
listener = ConsultTabSelectedListener(list, tab_layout)
tab_layout.addOnTabSelectedListener(listener!!)
val textView = ((tab_layout!!.getChildAt(0) as LinearLayout).getChildAt(lastPosition) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(mContext, R.color.color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
tab_layout.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
LogUtil.e("scrollX=$scrollX")
LogUtil.e("oldScrollX=$oldScrollX")
}
}
}
/**
* 设置数据
*/
fun setConsultInfoView(list: List<HomeConsultBean.ListBean>?,category : HomeHeaderBean.ConsultCategoryDateBean?) {
if (list == null || list.isEmpty()) {
ll_content.visibility = View.GONE
return
}
cateId = category?.id?:0
ll_content.visibility = View.VISIBLE
if (cacheInfoViewList == null) {
cacheInfoViewList = ArrayList()
}
//创建HomeConsultItemView:每个tab最多显示三个专家
if (cacheInfoViewList!!.size == list.size) {
for (index in 0 until list.size) {
//设置数据
val itemView = ll_content.getChildAt(index)
if (itemView is HomeConsultItemView){
itemView.setData(list[index], index, index == list.size - 1,"${category?.id}")
}
}
} else {
ll_content.removeAllViews()
cacheInfoViewList?.clear()
for (index in 0 until list!!.size) {
if (index > 2) {
//只取前三条数据
break
}
//数据大于缓存view数量,创建view
if (index > cacheInfoViewList!!.size - 1) {
val homeConsultItemView = createConsultInfoView()
cacheInfoViewList!!.add(homeConsultItemView)
}
//设置数据
cacheInfoViewList!![index].setData(list[index]!!, index, index == list!!.size - 1,"${category?.id}")
//添加到布局
ll_content.addView(cacheInfoViewList!![index])
}
}
}
/**
* 创建专家信息view
*/
private fun createConsultInfoView(): HomeConsultItemView {
return HomeConsultItemView(mContext, homeEvent)
}
inner class ConsultTabSelectedListener : TabLayout.OnTabSelectedListener {
private var list: List<HomeHeaderBean.ConsultCategoryDateBean>? = null
private var tabLayout: TabLayout? = null
constructor(list: List<HomeHeaderBean.ConsultCategoryDateBean>, tabLayout: TabLayout) {
this.list = list
this.tabLayout = tabLayout
}
override fun onTabReselected(tab: TabLayout.Tab?) {
}
override fun onTabUnselected(tab: TabLayout.Tab?) {
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 15f
textView.setTextColor(ContextCompat.getColor(mContext, R.color.color_333333))
}
}
override fun onTabSelected(tab: TabLayout.Tab?) {
if (mLastPosition == tab!!.position){
return
}
var textView = ((tabLayout!!.getChildAt(0) as LinearLayout).getChildAt(tab!!.position) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) {
textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(mContext, R.color.color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
}
val bean = list!![tab!!.position]
homeEvent!!.getConsultData(bean, tab!!.position)
}
}
}
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.RelativeLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeCourseBean
import com.ydl.ydl_image.manager.YDLImageCacheManager
import kotlinx.android.synthetic.main.home_module_course_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 课程成长模块item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/14
*/
class HomeCourseItemView(private val mContext: Context, private var homeEvent: IHomeEvent?): RelativeLayout(mContext) {
init {
initView()
}
private fun initView() {
val params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_course_item_view, this)
}
/**
* 刷新数据
*/
fun updateData(bean: HomeCourseBean.ListBean?) {
YDLImageCacheManager.showImage(mContext,bean?.pic,homeModuleCourseItemViewImg)
homeModuleCourseItemViewTitle.text = bean?.title
homeModuleCourseItemViewPersonNum.text = bean?.readNums.toString()
if (bean?.applyFee == 0f) {
homeModuleCourseItemViewFreePrice.visibility = View.VISIBLE
homeModuleCourseItemViewExpensePriceHideView.visibility = View.GONE
}else {
if (bean?.isPromotion == 1) {
homeModuleCourseItemViewExpensePrice.text = "¥" + String.format("%.2f", bean?.promotionApplyFee!!)
}else {
homeModuleCourseItemViewExpensePrice.text = "¥" + String.format("%.2f", bean?.applyFee!!)
}
}
setOnClickListener {
homeEvent?.courseItemClick(bean)
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeCourseBean
import kotlinx.android.synthetic.main.home_module_course_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 课程*成长模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeCourseView(private val mContext: Context, private var homeEvent: IHomeEvent?): LinearLayout(mContext) {
private var cacheList : ArrayList<HomeCourseBean.ListBean> = ArrayList()
init {
initView()
}
private fun initView() {
orientation = VERTICAL
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_course_view, this)
homeModuleCourseViewHomeCommonTitleView.setTitle("课程·成长")
homeModuleCourseViewHomeCommonTitleView.setOnClickListener {
homeEvent?.courseMreClick()
}
}
fun initData(list: List<HomeCourseBean.ListBean>?) {
//添加View
if (list==null){
return
}
if (cacheList.size != list?.size){
cacheList.clear()
cacheList.addAll(list!!)
updateHomeCourseItemViewNumber()
}
//刷新数据
for (index in 0 until childCount){
val itemView = getChildAt(index)
if (itemView is HomeCourseItemView){
itemView.updateData(list[index - 1])
}
}
}
/**
* 更新itemView的数量以适应新的数据集
*/
private fun updateHomeCourseItemViewNumber() {
var childCountRecord = childCount -1 //减1是因为第一个子View是标题View
while (cacheList.size > childCountRecord) {
addView(HomeCourseItemView(mContext, homeEvent))
childCountRecord++
}
while (cacheList.size < childCountRecord && getChildAt(childCountRecord) is HomeCourseItemView) {
removeViewAt(childCountRecord)
childCountRecord--
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeFMBean
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.home_module_intelligent_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 心灵电台模块item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/14
*/
class HomeIntelligentItemView(private val mContext: Context, private var homeEvent: IHomeEvent?): LinearLayout(mContext) {
private var params:LinearLayout.LayoutParams? = null
init {
initView()
}
private fun initView() {
orientation = VERTICAL
params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_intelligent_item_view, this)
}
/**
* 刷新数据
*/
fun updateData(bean: HomeFMBean.ListBean) {
homeModuleIntelligentItemViewTitle.text = bean.name
homeModuleIntelligentItemViewHits.text = bean.hits.toString()
this.setOnClickListener{ homeEvent?.fmItemClick(bean) }
iv_fm_play.setOnClickListener { homeEvent?.fmPlayClick(bean) }
}
/**
* 电台第二个item会有一个marginTop值
*/
fun setTopMargin() {
params?.topMargin = RxImageTool.dp2px(16f)
layoutParams = params
}
/**
* 电台最后一个item会有一个marginBottom值
*/
fun setBottomMargin() {
params?.bottomMargin = RxImageTool.dp2px(16f)
layoutParams = params
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeFMBean
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.home_module_intelligent_top_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 心灵电台模块item--顶部item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/15
*/
class HomeIntelligentTopItemView(private val mContext: Context, private var homeEvent: IHomeEvent?): LinearLayout(mContext) {
init {
initView()
}
private fun initView() {
orientation = VERTICAL
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = (screenWidth - 2 * 15 * RxDeviceTool.getScreenDensity(mContext)).toInt()
var viewHeight = viewWidth * 143 / 345
val params = LinearLayout.LayoutParams(viewWidth, viewHeight)
layoutParams = params
View.inflate(mContext, R.layout.home_module_intelligent_top_item_view, this)
}
/**
* 刷新数据
*/
fun updateData(bean: HomeFMBean.ListBean) {
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = (screenWidth - RxImageTool.dip2px(30f))
var viewHeight = viewWidth * 143 / 345
val sp = SimpleImageOpConfiger()
sp.loadingPic = R.drawable.default_img
sp.errorPic = R.drawable.default_img
sp.scaleType = ISimpleImageOpConfig.CENTER_CROP
sp.isCacheOnDisk = true
YDLImageCacheManager.showImage(mContext,bean.imageUrl,homeModuleIntelligentTopViewImage, viewWidth, viewHeight,sp)
homeModuleIntelligentTopViewTitle.text = bean.name
homeModuleIntelligentTopViewAuthor.text = bean.author
homeModuleIntelligentTopViewHits.text = bean.hits.toString()
this.setOnClickListener{ homeEvent?.fmItemClick(bean) }
iv_play_fm.setOnClickListener{homeEvent?.fmPlayClick(bean)}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeFMBean
import kotlinx.android.synthetic.main.home_module_intelligent_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 心灵*电台模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeIntelligentView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var cacheList : ArrayList<HomeFMBean.ListBean> = ArrayList()
init {
initView()
}
private fun initView() {
orientation = VERTICAL
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_intelligent_view, this)
homeModuleIntelligentViewHomeCommonTitleView.setTitle("心灵·电台")
homeModuleIntelligentViewHomeCommonTitleView.setOnClickListener {
homeEvent?.fmMoreClick()
}
}
fun initData(list: List<HomeFMBean.ListBean>?) {
//添加View
list?.let {
if (cacheList.size != list?.size) {
cacheList.clear()
cacheList.addAll(list!!)
updateHomeIntelligentItemViewNumber()
}
//刷新数据
for (index in 0 until homeModuleIntelligentViewAddLayout.childCount) {
val itemView = homeModuleIntelligentViewAddLayout.getChildAt(index)
if (itemView is HomeIntelligentItemView) {
//第一个这种类型item,需要设置marginTop = 16dp,最后一个item需要设置marginBototm = 16dp
if (index == 1) {
itemView.setTopMargin()
} else if (index == homeModuleIntelligentViewAddLayout.childCount - 1) {
itemView.setBottomMargin()
}
itemView.updateData(list[index])
} else if (itemView is HomeIntelligentTopItemView) {
itemView.updateData(list[index])
}
}
}
}
/**
* 更新itemView的数量以适应新的数据集
*/
private fun updateHomeIntelligentItemViewNumber() {
var childCountRecord = homeModuleIntelligentViewAddLayout.childCount
while (cacheList.size > childCountRecord) {
if (childCountRecord == 0) {
homeModuleIntelligentViewAddLayout.addView(HomeIntelligentTopItemView(mContext, homeEvent))
}else {
homeModuleIntelligentViewAddLayout.addView(HomeIntelligentItemView(mContext, homeEvent))
}
childCountRecord++
}
while (cacheList.size < childCountRecord &&
(homeModuleIntelligentViewAddLayout.getChildAt(childCountRecord) is HomeIntelligentItemView
|| homeModuleIntelligentViewAddLayout.getChildAt(childCountRecord) is HomeIntelligentTopItemView)) {
homeModuleIntelligentViewAddLayout.removeViewAt(childCountRecord)
childCountRecord--
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.annotation.SuppressLint
import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.google.gson.Gson
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.ydlcommon.bean.MuseModuleBean
import kotlinx.android.synthetic.main.home_module_muse_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 冥想模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/09/10
*/
class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var cacheList: ArrayList<HomeMuseView> = ArrayList()
init {
initView()
}
@SuppressLint("RestrictedApi")
private fun initView() {
orientation = VERTICAL
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_muse_view, this)
homeModuleMuseViewHomeCommonTitleView.setTitle("助眠·冥想")
}
fun initData(bean: MuseModuleBean?) {
if (null != bean) {
var dataJson = Gson().toJson(bean)
homeModuleMuseViewHomeCommonTitleView.setOnClickListener {
homeEvent?.museMoreClick(Gson().toJson(bean))
}
if (null != bean.muses) {
if (bean.muses?.size!! > 0) {
muse_first.setOnClickListener {
homeEvent?.museClick(bean.muses!![0].audioUrl, dataJson)
}
}
if (bean.muses?.size!! > 1) {
muse_second.setOnClickListener {
homeEvent?.museClick(bean.muses!![1].audioUrl, dataJson)
}
}
if (bean.muses?.size!! > 2) {
muse_third.setOnClickListener {
homeEvent?.museClick(bean.muses!![2].audioUrl, dataJson)
}
}
if (bean.muses?.size!! > 3) {
muse_forth.setOnClickListener {
homeEvent?.museClick(bean.muses!![3].audioUrl, dataJson)
}
}
}
if (null != bean.sleeps) {
if (bean.sleeps?.size!! > 0) {
sleeps_first.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![0].audioUrl, dataJson)
}
}
if (bean.sleeps?.size!! > 1) {
sleeps_second.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![1].audioUrl, dataJson)
}
}
if (bean.sleeps?.size!! > 2) {
sleeps_third.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![2].audioUrl, dataJson)
}
}
if (bean.sleeps?.size!! > 3) {
sleeps_forth.setOnClickListener {
homeEvent?.museClick(bean.sleeps!![3].audioUrl, dataJson)
}
}
}
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.util.TypedValue
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.TextView
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import com.yidianling.ydlcommon.utils.ScreenUtil
import kotlinx.android.synthetic.main.home_module_pager_banner_category_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 首页顶部模块-分类模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/16
*/
class HomePagerBannerCategoryItemView(mContext: Context, homeEvent: IHomeEvent) : FrameLayout(mContext) {
/**
* 数据缓存
*/
var mDataList: ArrayList<HomeHeaderBean.AskCategoryDataBean>? = null
/**
* 分类view宽度
*/
var categoryWidth: Int = 0
/**
* 图片宽高
*/
var imageViewWidth: Int = 0
/**
* 文本宽度
*/
var textViewWidth: Int = 0
/**
* 文本高度
*/
var textViewHeight: Int = 0
/**
* 间隔
*/
var margin: Int = 0
var dp8: Int = 0
var dp10 : Int = 0
/**
* 是否添加了实时测试状态View
*/
var hasRealTestView: Boolean = false
private var realTestView: HomePagerBannerRealView? = null
/**
* 线
*/
private var lineView: View? = null
/**
* 倍数
*/
private var multiple: Int = 0
/**
* 测评首页事件处理类
*/
private var homeEvent: IHomeEvent? = null
init {
initView()
this.homeEvent = homeEvent
}
/**
* 界面初始化
*/
private fun initView() {
View.inflate(context, R.layout.home_module_pager_banner_category_view, this)
val params = FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)
// params.topMargin = ScreenUtil.screenHeight * (356f / 750f).toInt()
layoutParams = params
initArgs()
}
/**
* 初始化变量
*/
private fun initArgs() {
categoryWidth = ScreenUtil.screenWidth
textViewWidth = categoryWidth / 5
imageViewWidth = RxImageTool.dip2px(38f)
margin = (categoryWidth - 5 * imageViewWidth) / 10
dp8 = RxImageTool.dip2px(8f)
dp10 = RxImageTool.dip2px(10f)
//高度=文字12dp+16dp间距
textViewHeight = RxImageTool.dip2px(28f)
}
//, homeSaleData: List<HomeHeaderBean.HomeSaleDataBean>?
fun initData(askCategoryDataBean: MutableList<HomeHeaderBean.AskCategoryDataBean>?) {
if (null == askCategoryDataBean || askCategoryDataBean.isEmpty()) {
visibility = View.GONE
return
}
visibility = View.VISIBLE
if (null == mDataList) {
mDataList = ArrayList()
}
if (getChange(askCategoryDataBean, mDataList)) {
mDataList!!.clear()
mDataList!!.addAll(askCategoryDataBean)
}
refreshView()
// setRealTextView(homeSaleData)
}
/**
* 判断数据是否变化
*/
private fun getChange(bean: MutableList<HomeHeaderBean.AskCategoryDataBean>?, cacheBean: MutableList<HomeHeaderBean.AskCategoryDataBean>?): Boolean {
if (bean?.size != cacheBean?.size) {
return true
}
for (index in 0 until bean?.size!!) {
if (!bean[index].url.equals(cacheBean!![index].url)
|| !bean[index].coverUrl.equals(cacheBean!![index].coverUrl)
|| !bean[index].cateTitle.equals(cacheBean!![index].cateTitle)
|| bean[index].cateId != cacheBean!![index].cateId) {
return true
}
}
return false
}
/**
* 刷新View
*/
private fun refreshView() {
homeModulePagerBannerFlRoot.removeAllViews()
var i = 0
for (item in mDataList!!) {
if (i > 9) {
break
}
val imageView = createIcon(i)
val textView = createText(i)
homeModulePagerBannerFlRoot.addView(imageView)
homeModulePagerBannerFlRoot.addView(textView)
imageView.setOnClickListener {
homeEvent!!.categoryClick(item)
}
textView.setOnClickListener {
homeEvent!!.categoryClick(item)
}
bindIconData(imageView, item)
bindTextData(textView, item)
i++
}
}
/**
* 创建图标
*/
private fun createIcon(i: Int): ImageView {
val imageParams = FrameLayout.LayoutParams(imageViewWidth, imageViewWidth)
val imageView = ImageView(context)
imageView.scaleType = ImageView.ScaleType.CENTER_CROP
if (i > 4) {
multiple = 2
imageParams.topMargin = imageViewWidth + dp10 + textViewHeight
imageParams.leftMargin = margin * (i - 4) + (i - 5) * (imageViewWidth + margin)
} else {
multiple = 1
imageParams.leftMargin = margin * (i + 1) + i * (imageViewWidth + margin)
}
imageView.layoutParams = imageParams
return imageView
}
/**
* 加载图片
*/
private fun bindIconData(imageView: ImageView, categoryBean: HomeHeaderBean.AskCategoryDataBean) {
GlideApp.with(context).load(categoryBean.coverUrl)
.centerCrop().into(imageView)
}
/**
* 创建文本
*/
private fun createText(index: Int): TextView {
val textParams = FrameLayout.LayoutParams(textViewWidth, textViewHeight)
val textView = TextView(context)
textView.setTextColor(Color.parseColor("#242424"))
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12f)
textView.gravity = Gravity.CENTER_HORIZONTAL
if (index > 4) {
textParams.topMargin = 2 * (imageViewWidth + dp8) + textViewHeight
textParams.leftMargin = textViewWidth * (index - 5)
} else {
textParams.topMargin = imageViewWidth + dp8
textParams.leftMargin = textViewWidth * (index)
}
textView.layoutParams = textParams
return textView
}
/**
* 设置文本
*/
private fun bindTextData(textView: TextView, categoryBean: HomeHeaderBean.AskCategoryDataBean) {
textView.text = categoryBean.cateTitle
}
/**
* 初始化实时测评状态View
*/
private fun initRealTextView() {
if (null == realTestView) {
var realTestParam = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
realTestParam.topMargin = multiple * (imageViewWidth + dp8 + textViewHeight) + dp8 + RxImageTool.dip2px(10f)
realTestView = HomePagerBannerRealView(context, homeEvent!!)
realTestView!!.layoutParams = realTestParam
}
}
private fun initLineView() {
var lineParam = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, RxImageTool.dip2px(0.5f))
var dp15 = RxImageTool.dip2px(15f)
lineParam.leftMargin = dp15
lineParam.rightMargin = dp15
lineParam.topMargin = multiple * (imageViewWidth + dp8 + textViewHeight) + dp8
lineView = View(context)
lineView!!.setBackgroundColor(resources.getColor(R.color.home_module_category_view_test_line))
lineView!!.layoutParams = lineParam
}
/**
* 实时测评状态赋值
*/
private fun setRealTextView(list: List<HomeHeaderBean.HomeSaleDataBean>?) {
if (!hasRealTestView) {
initLineView()
homeModulePagerBannerFlRoot.addView(lineView)
initRealTextView()
homeModulePagerBannerFlRoot.addView(realTestView)
hasRealTestView = true
}
realTestView!!.initData(list)
}
fun onDestory() {
if (null == realTestView) {
return
}
realTestView!!.onDestory()
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.DecelerateInterpolator
import android.view.animation.TranslateAnimation
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import com.yidianling.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.ydlcommon.utils.actionutil.BIConstants
import kotlinx.android.synthetic.main.home_module_real_view_in.view.*
import kotlinx.android.synthetic.main.home_module_real_view_left.view.*
import kotlinx.android.synthetic.main.home_module_real_view_out.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 首页顶部模块-动态标签模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/16
*/
class HomePagerBannerRealView(mContext : Context,homeEvent : IHomeEvent) : LinearLayout(mContext){
private val STATUS_IN = 0
private val STATUS_OUT = 1
private var curTipIndex = 0
private var lastTimeMillis: Long = 0
private val ANIM_DELAYED_MILLIONS = 2 * 1000
/**
* 动画持续时长
*/
private val ANIM_DURATION = 500
/**
* 进、出 两个view (主要用于做动画,其实是两个相同的布局文件)
*/
private var view_out: View? = null
private var view_in:View? = null
/**
* 进、出 两个View 的动画
*/
private var anim_out: Animation? = null
private var anim_in:Animation? = null
/**
* 数据缓存
*/
private var mDataList : List<HomeHeaderBean.HomeSaleDataBean>? = null
private var homeEvent : IHomeEvent? = null
private val mHandler: Handler = object : Handler(Looper.getMainLooper()) {
override fun handleMessage(msg: Message?) {
super.handleMessage(msg)
updateTipAndPlayAnimation()
sendMessageDelayed(Message(), ANIM_DELAYED_MILLIONS.toLong())
}
}
init {
this.homeEvent = homeEvent
initView()
initAnimation()
}
/**
* 界面初始化
*/
private fun initView() {
orientation = HORIZONTAL
var params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT)
View.inflate(context, R.layout.home_module_real_view_left, this)
view_out = View.inflate(context, R.layout.home_module_real_view_out,null)
view_in = View.inflate(context, R.layout.home_module_real_view_in,null)
homeModuleRealViewLeftFrameLayout.addView(view_out)
homeModuleRealViewLeftFrameLayout.addView(view_in)
layoutParams = params
}
private fun initAnimation() {
anim_out = newAnimation(0f, -1f)
anim_in = newAnimation(1f, 0f)
anim_in!!.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {
}
override fun onAnimationRepeat(animation: Animation) {
}
override fun onAnimationEnd(animation: Animation) {
updateViewVisibility()
}
})
}
/**
* 设置数据
*/
fun initData(list: List<HomeHeaderBean.HomeSaleDataBean>?){
mHandler.removeCallbacksAndMessages(null)
if (null == list || list.isEmpty()){
visibility = View.GONE
return
}
visibility = View.VISIBLE
if (null == mDataList){
mDataList = ArrayList()
}else{
(mDataList as ArrayList).clear()
}
(mDataList as ArrayList).addAll(list)
curTipIndex = 0
updateTip(STATUS_OUT)
updateTipAndPlayAnimation()
mHandler.sendMessageDelayed(Message(), ANIM_DELAYED_MILLIONS.toLong())
}
private fun updateViewVisibility() {
if (curTipIndex % 2 == 0) {
view_out!!.visibility = View.INVISIBLE
} else {
view_in!!.visibility = View.INVISIBLE
}
}
private fun newAnimation(fromYValue: Float, toYValue: Float): Animation {
val anim = TranslateAnimation(Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, fromYValue, Animation.RELATIVE_TO_SELF, toYValue)
anim.duration = ANIM_DURATION.toLong()
anim.interpolator = DecelerateInterpolator()
return anim
}
private fun updateTipAndPlayAnimation() {
view_in!!.visibility = View.VISIBLE
view_out!!.visibility = View.VISIBLE
if (curTipIndex % 2 == 0) {
updateTip(STATUS_OUT)
view_in!!.startAnimation(anim_out)
view_out!!.startAnimation(anim_in)
this.bringChildToFront(view_in)
} else {
updateTip(STATUS_IN)
view_out!!.startAnimation(anim_out)
view_in!!.startAnimation(anim_in)
this.bringChildToFront(view_out)
}
}
private fun updateTip(status : Int){
val bodyBean = getNextTip() ?: return
when(status){
STATUS_IN -> {
tv_in_doctor_name.text = bodyBean.doctorName
tv_in_content_before.text = getName(bodyBean)
tv_in_content_after.text = String.format("老师%s",bodyBean.contentAfter)
view_in!!.setOnClickListener{
ActionCountUtils.count(BIConstants.UserMainEvent.YDL_USER_NOTICE_CLICK)
homeEvent!!.linkTo(bodyBean.url!!)
}
}
STATUS_OUT -> {
tv_out_doctor_name.text = bodyBean.doctorName
tv_out_content_before.text = getName(bodyBean)
tv_out_content_after.text = String.format("老师%s",bodyBean.contentAfter)
view_out!!.setOnClickListener{
ActionCountUtils.count(BIConstants.UserMainEvent.YDL_USER_NOTICE_CLICK)
homeEvent!!.linkTo(bodyBean.url!!)
}
}
}
}
private fun getName(bean : HomeHeaderBean.HomeSaleDataBean?) : String{
var nameBuffer = StringBuffer()
nameBuffer.append(bean?.contentBefore)
nameBuffer.append(" ")
nameBuffer.append(bean?.nickName)
nameBuffer.append(resources.getString(R.string.home_module_real_appoint))
return nameBuffer.toString()
}
private fun getNextTip() : HomeHeaderBean.HomeSaleDataBean? {
if (null == mDataList || mDataList!!.isEmpty()){
return null
}
return mDataList!![curTipIndex++ % mDataList!!.size]
}
fun onDestory(){
mHandler.removeCallbacksAndMessages(null)
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.RelativeLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeHeaderBean
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.ydlcommon.YdlBuryPointUtil
import com.yidianling.ydlcommon.view.banner.GlideImageLoader
import kotlinx.android.synthetic.main.home_module_pager_banner_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:顶部ViewPager与分类模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomePagerBannerView(private val mContext: Context, private var homeEvent: IHomeEvent?) : RelativeLayout(mContext) {
private val mImageViews = ArrayList<String>()
private var homePagerBannerCategoryView: HomePagerBannerCategoryItemView? = null
//实时测评数据View
private var realTestView: HomePagerBannerRealView? = null
private var pageContainer: HomeCategoryContainer? = null
init {
initView()
}
private fun initView() {
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
val params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_pager_banner_view, this)
initBannerLayout()
// val addLayoutParams = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
// addLayoutParams.setMargins(0, (ScreenUtil.screenWidth * (356f / 750f)).toInt(),0,0)
// homeModulePagerBannerViewAddLayout.layoutParams = addLayoutParams
initPageContainer()
initRealTextView()
}
private fun initPageContainer() {
if (null == pageContainer) {
var containerParam = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
pageContainer = HomeCategoryContainer(context, homeEvent!!)
pageContainer!!.layoutParams = containerParam
homeModulePagerBannerViewAddLayout.addView(pageContainer)
}
}
private fun initBannerLayout() {
val screenWidth = RxDeviceTool.getScreenWidth(mContext)
val viewHeight = screenWidth * 508 / 750
val params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, viewHeight)
homeModulePagerBannerViewBanner.layoutParams = params
homeModulePagerBannerViewBanner.setIndicatorBottomPadding(68)
initHomeModulePagerBannerViewAddLayout(viewHeight)
}
private fun initHomeModulePagerBannerViewAddLayout(viewHeight : Int){
val params = RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.WRAP_CONTENT)
params.setMargins(0,(viewHeight * 0.76).toInt(),0,0)
homeModulePagerBannerViewAddLayout.layoutParams = params
homeModulePagerBannerViewAddLayout.setPadding(0,RxImageTool.dip2px(24f),0,0)
}
/**
* 填充数据
*/
fun initData(bean: HomeHeaderBean?) {
initBanner(bean?.focusList)
pageContainer?.initData(bean)
//设置实时预约数据
realTestView!!.initData(bean?.homeSaleData)
}
/**
* 初始化实时测评状态View
*/
private fun initRealTextView() {
if (null == realTestView) {
var realTestParam = FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
realTestView = HomePagerBannerRealView(context, homeEvent!!)
realTestView!!.layoutParams = realTestParam
homeModulePagerBannerViewAddLayout.addView(realTestView)
}
}
/**
* 更新banner
*/
private fun initBanner(focusListBean: List<HomeHeaderBean.FocusListBean>?) {
//临时缓存集合
val cacheList = ArrayList<HomeHeaderBean.FocusListBean>()
if (null != focusListBean && focusListBean.isNotEmpty()) {
mImageViews.clear()
//产品说取前8个
if (focusListBean.size > 8){
cacheList.addAll(focusListBean.subList(0,8))
}else{
cacheList.addAll(focusListBean)
}
for (item in cacheList) {
mImageViews.add(item.imageUrl!!)
}
}
homeModulePagerBannerViewBanner.setImageLoader(GlideImageLoader(R.drawable.home_module_image_default_back)).setImages(mImageViews).start()
homeModulePagerBannerViewBanner.setOnBannerListener {
if (it < cacheList?.size) {
homeEvent?.bannerClick(cacheList[it])
YdlBuryPointUtil.sendClick("ydl-user-home-banner$it","${cacheList[it].imageUrl}")
}
}
}
fun startBanner() {
if (homeModulePagerBannerViewBanner != null) {
homeModulePagerBannerViewBanner.startAutoPlay()
}
}
fun stopBanner() {
if (homeModulePagerBannerViewBanner != null) {
homeModulePagerBannerViewBanner.stopAutoPlay()
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeTestItemBean
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.home_module_test_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 测试*分析模块模块item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/14
*/
class HomeTestItemView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var params: LinearLayout.LayoutParams? = null
init {
initView()
}
private fun initView() {
orientation = VERTICAL
params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_test_item_view, this)
}
/**
* 刷新数据
*/
fun updateData(bean: HomeTestItemBean, isLast: Boolean) {
tv_test_item_name.text = bean.name
tv_test_item_hit.text = bean.hits.toString()
tv_tested_count.text = bean.testNum.toString()
YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item)
if (isLast) {
view_test_line.visibility = View.GONE
} else {
view_test_line.visibility = View.VISIBLE
}
this.setOnClickListener {
homeEvent?.testItemClick(bean.recommendLinkUrl)
}
}
/**
* 电台第二个item会有一个marginTop值
*/
fun setTopMargin() {
params?.topMargin = RxImageTool.dp2px(16f)
layoutParams = params
}
/**
* 电台最后一个item会有一个marginBottom值
*/
fun setBottomMargin() {
params?.bottomMargin = RxImageTool.dp2px(16f)
layoutParams = params
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeTestItemBean
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import kotlinx.android.synthetic.main.home_module_intelligent_top_item_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 测试*分析模块item--顶部item
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/15
*/
class HomeTestTopItemView(private val mContext: Context, private var homeEvent: IHomeEvent?): LinearLayout(mContext) {
init {
initView()
}
private fun initView() {
orientation = VERTICAL
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = (screenWidth - 2 * 15 * RxDeviceTool.getScreenDensity(mContext)).toInt()
var viewHeight = viewWidth * 143 / 345
val params = LinearLayout.LayoutParams(viewWidth, viewHeight)
layoutParams = params
View.inflate(mContext, R.layout.home_module_test_top_item_view, this)
}
/**
* 刷新数据
*/
fun updateData(bean: HomeTestItemBean) {
var screenWidth = RxDeviceTool.getScreenWidth(mContext)
var viewWidth = (screenWidth - RxImageTool.dip2px(30f))
var viewHeight = viewWidth * 143 / 345
val sp = SimpleImageOpConfiger()
sp.loadingPic = R.drawable.default_img
sp.errorPic = R.drawable.default_img
sp.scaleType = ISimpleImageOpConfig.CENTER_CROP
sp.isCacheOnDisk = true
YDLImageCacheManager.showImage(mContext,bean?.shareImage,homeModuleIntelligentTopViewImage, viewWidth, viewHeight,sp)
homeModuleIntelligentTopViewTitle.text = bean.name
homeModuleIntelligentTopViewAuthor.text = bean.hits.toString()
homeModuleIntelligentTopViewHits.text = bean.testNum.toString()
this.setOnClickListener{
homeEvent?.testItemClick(bean.recommendLinkUrl)
}
}
}
\ No newline at end of file
package com.yidianling.home.ui.view
import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.home.R
import com.yidianling.home.event.IHomeEvent
import com.yidianling.home.model.bean.HomeTestItemBean
import kotlinx.android.synthetic.main.home_module_intelligent_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述: 测试*分析模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class HomeTestView(private val mContext: Context, private var homeEvent: IHomeEvent?) : LinearLayout(mContext) {
private var cacheList : ArrayList<HomeTestItemBean> = ArrayList()
init {
initView()
}
private fun initView() {
orientation = VERTICAL
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_module_test_view, this)
homeModuleIntelligentViewHomeCommonTitleView.setTitle("测试·分析")
homeModuleIntelligentViewHomeCommonTitleView.setOnClickListener {
homeEvent?.testMoreClick()
}
}
fun initData(list: List<HomeTestItemBean>?) {
//添加View
list?.let {
if (cacheList.size != list?.size) {
cacheList.clear()
cacheList.addAll(list!!)
updateHomeTestItemViewNumber()
}
for (index in 0 until homeModuleIntelligentViewAddLayout.childCount) {
val itemView = homeModuleIntelligentViewAddLayout.getChildAt(index)
if (itemView is HomeTestItemView) {
//第一个这种类型item,需要设置marginTop = 16dp,最后一个item需要设置marginBototm = 16dp
if (index == 1) {
itemView.setTopMargin()
}
// else if (index == homeModuleIntelligentViewAddLayout.childCount -1) {
// itemView.setBottomMargin()
// }
itemView.updateData(list[index], index == list.size - 1)
} else if (itemView is HomeTestTopItemView) {
itemView.updateData(list[index])
}
}
}
}
/**
* 更新itemView的数量以适应新的数据集
*/
private fun updateHomeTestItemViewNumber() {
var childCountRecord = homeModuleIntelligentViewAddLayout.childCount
while (cacheList.size > childCountRecord) {
if (childCountRecord == 0) {
homeModuleIntelligentViewAddLayout.addView(HomeTestTopItemView(mContext, homeEvent))
}else {
homeModuleIntelligentViewAddLayout.addView(HomeTestItemView(mContext, homeEvent))
}
childCountRecord++
}
while (cacheList.size < childCountRecord &&
(homeModuleIntelligentViewAddLayout.getChildAt(childCountRecord -1 ) is HomeTestItemView
|| homeModuleIntelligentViewAddLayout.getChildAt(childCountRecord -1 ) is HomeTestTopItemView)) {
homeModuleIntelligentViewAddLayout.removeViewAt(childCountRecord -1 )
childCountRecord--
}
}
}
\ No newline at end of file
package com.yidianling.home.utils;
/**
* 双十一活动管理类
*/
public class Double11ActivityManagerUtils {
/**
* 不显示双11活动,仅用于2019年双11活动使用
*/
//todo xj 国威说需要在登录接口设置该字段,如果是第一次登录则设置为true,表示不显示,避免与新用户弹框重复
public static boolean notShowDouble11Activity = false;
}
package com.yidianling.home.utils
import android.animation.Animator
import android.animation.AnimatorListenerAdapter
import android.animation.ValueAnimator
import android.content.Context
import android.graphics.Color
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import com.ydl.ydlcommon.utils.ColorCalculateUtils
import com.yidianling.home.constract.IHomeContract
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.ydlcommon.utils.ColorCalculateUtils
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/3/21
*/
class HomeAnimUtils {
companion object {
private var animStart: ValueAnimator? = null
private var animEnd: ValueAnimator? = null
private var animSearchStart : ValueAnimator? = null
private var animSearchEnd : ValueAnimator? = null
fun startAnim(context: Context, rl_top : RelativeLayout, rlSearch : LinearLayout, imageView : ImageView,tv_home : TextView?) {
animEnd?.cancel()
tv_home?.text = "搜索"
initStartAnim(context,rl_top,rlSearch,imageView)
animStart?.start()
}
private fun initStartAnim(context: Context, rl_top : RelativeLayout, rlSearch : LinearLayout, imageView : ImageView) {
if (null != animStart){
return
}
val cvWidth = (RxDeviceTool.getScreenWidth(context) - RxImageTool.dip2px(73f)).toFloat()
val dp105 = RxImageTool.dip2px(105f)
val dp34 = RxImageTool.dip2px(34f)
val dp15 = RxImageTool.dip2px(15f)
val dp7 = RxImageTool.dip2px(7f)
val dp5 = RxImageTool.dip2px(5f)
animStart = ValueAnimator.ofFloat(1f, dp105 / cvWidth)
animStart?.duration = 500// 设置动画运行的时长
animStart?.startDelay = 0// 设置动画延迟播放时间
animStart?.repeatCount = 0 // 设置动画重复播放次数 = 重放次数+1 // 动画播放次数 = infinite时,动画无限重复
animStart?.repeatMode = ValueAnimator.RESTART
// 设置重复播放动画模式
// ValueAnimator.RESTART(默认):正序重放
// ValueAnimator.REVERSE:倒序回放
// 步骤3:将改变的值手动赋值给对象的属性值:通过动画的更新监听器
// 设置 值的更新监听器
// 即:值每次改变、变化一次,该方法就会被调用一次
animStart?.addUpdateListener { animation ->
// 获得改变后的值
val currentValue = animation.animatedValue as Float
val lp = RelativeLayout.LayoutParams((cvWidth * currentValue).toInt(),dp34)
lp.setMargins(dp15,dp7,dp15,dp5)
// 步骤4:将改变后的值赋给对象的属性值,下面会详细说明
rlSearch.layoutParams = lp
rl_top.invalidate()
}
animStart?.addListener(object : AnimatorListenerAdapter() {
// override fun onAnimationEnd(animation: Animator) {
// imageView.visibility = View.GONE
// }
override fun onAnimationStart(animation: Animator?) {
imageView.visibility = View.GONE
}
})
}
fun endAnim(context: Context, rl_top : RelativeLayout, rlSearch : LinearLayout, home_tv : TextView, imageView: ImageView,homeView : IHomeContract.View){
animStart?.cancel()
initEndAnim(context,rl_top,rlSearch,home_tv,imageView,homeView)
animEnd?.start()
}
fun initEndAnim(context: Context, rl_top : RelativeLayout, rlSearch : LinearLayout, home_tv : TextView, imageView: ImageView,homeView : IHomeContract.View) {
if (null != animEnd){
return
}
val cvWidth = (RxDeviceTool.getScreenWidth(context) - RxImageTool.dip2px(73f)).toFloat()
val dp105 = RxImageTool.dip2px(105f)
val dp34 = RxImageTool.dip2px(34f)
val dp15 = RxImageTool.dip2px(15f)
val dp7 = RxImageTool.dip2px(7f)
val dp5 = RxImageTool.dip2px(5f)
animEnd = ValueAnimator.ofFloat(dp105 / cvWidth, 1f)
animEnd?.duration = 500// 设置动画运行的时长
animEnd?.startDelay = 0// 设置动画延迟播放时间
animEnd?.repeatCount = 0 // 设置动画重复播放次数 = 重放次数+1 // 动画播放次数 = infinite时,动画无限重复
animEnd?.repeatMode = ValueAnimator.RESTART
// 设置重复播放动画模式
// ValueAnimator.RESTART(默认):正序重放
// ValueAnimator.REVERSE:倒序回放
// 步骤3:将改变的值手动赋值给对象的属性值:通过动画的更新监听器
// 设置 值的更新监听器
// 即:值每次改变、变化一次,该方法就会被调用一次
animEnd?.addUpdateListener { animation ->
// 获得改变后的值
val currentValue = animation.animatedValue as Float
val lp = RelativeLayout.LayoutParams((cvWidth * currentValue).toInt(),dp34)
lp.setMargins(dp15,dp7,dp15,dp5)
// 步骤4:将改变后的值赋给对象的属性值,下面会详细说明
rlSearch.layoutParams = lp
rl_top.invalidate()
}
animEnd?.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator) {
home_tv.text = homeView.getSearchContent()
imageView.visibility = View.VISIBLE
}
})
}
fun startSearchShow(ll_top_function : LinearLayout, searchBg : View, home_tv : TextView, iv_search_icon:ImageView,img_ad:View){
if (null == animSearchStart){
animSearchStart = ValueAnimator.ofFloat(0f, 1f)
animSearchStart?.duration = 500// 设置动画运行的时长
animSearchStart?.startDelay = 0// 设置动画延迟播放时间
animSearchStart?.repeatCount = 0 // 设置动画重复播放次数 = 重放次数+1 // 动画播放次数 = infinite时,动画无限重复
animSearchStart?.repeatMode = ValueAnimator.RESTART
animSearchStart?.addUpdateListener { animation ->
val currentValue = animation.animatedValue as Float
ll_top_function.alpha = currentValue
//更改搜索框背景透明度/搜索字体透明度/搜索图标透明度
// searchBg.alpha = (1-0.2*currentValue).toFloat()
iv_search_icon.setColorFilter(Color.parseColor(ColorCalculateUtils.calculateColor("#FFB3B3B3", "#B8FFFFFF", currentValue)))
home_tv.setTextColor(Color.parseColor(ColorCalculateUtils.calculateColor("#FF999999", "#A4FFFFFF", currentValue)))
if (img_ad.visibility == View.VISIBLE){
searchBg.alpha = 1 - currentValue
home_tv.alpha = 1 - currentValue
}else{
searchBg.alpha = (1-0.8*currentValue).toFloat()
home_tv.alpha = 1f
}
}
}
animSearchStart?.start()
}
fun startSearchHide(ll_top_function : LinearLayout, searchBg : View, home_tv : TextView, iv_search_icon:ImageView,img_ad:View){
if (null == animSearchEnd){
animSearchEnd = ValueAnimator.ofFloat(1f, 0f)
animSearchEnd?.duration = 500// 设置动画运行的时长
animSearchEnd?.startDelay = 0// 设置动画延迟播放时间
animSearchEnd?.repeatCount = 0 // 设置动画重复播放次数 = 重放次数+1 // 动画播放次数 = infinite时,动画无限重复
animSearchEnd?.repeatMode = ValueAnimator.RESTART
animSearchEnd?.addUpdateListener { animation ->
val currentValue = animation.animatedValue as Float
ll_top_function.alpha = currentValue
//更改搜索框背景透明度/搜索字体透明度/搜索图标透明度
searchBg.alpha = (0.2+(0.8*(1-currentValue))).toFloat()
iv_search_icon.setColorFilter(Color.parseColor(ColorCalculateUtils.calculateColor("#B8FFFFFF", "#FFB3B3B3", 1-currentValue)))
home_tv.setTextColor(Color.parseColor(ColorCalculateUtils.calculateColor("#A4FFFFFF", "#FF999999", 1-currentValue)))
if (img_ad.visibility == View.VISIBLE){
home_tv.alpha = 1-currentValue
}else{
home_tv.alpha = 1f
}
}
}
animSearchEnd?.start()
}
fun clear(){
if (null != animStart){
animStart = null
}
if (null != animEnd){
animEnd = null
}
if (null != animSearchStart){
animSearchStart = null
}
if (null != animSearchEnd){
animSearchEnd = null
}
}
}
}
\ No newline at end of file
package com.yidianling.home.utils
import android.content.Context
import java.io.BufferedInputStream
import java.io.IOException
import java.io.InputStream
/**
* Created by haorui on 2019/2/16.
* Des:
*/
class HomeFileUtils{
companion object {
/**
* 读取Assets下文本文件
*/
fun getAssertsFile(context: Context, fileName: String): ByteArray? {
var inputStream: InputStream? = null
val assetManager = context.assets
try {
inputStream = assetManager.open(fileName)
if (inputStream == null) {
return null
}
var bis: BufferedInputStream? = null
val length: Int
try {
bis = BufferedInputStream(inputStream)
length = bis.available()
val data = ByteArray(length)
bis.read(data)
return data
} catch (e: IOException) {
} finally {
if (bis != null) {
try {
bis.close()
} catch (e: Exception) {
}
}
}
return null
} catch (e: IOException) {
e.printStackTrace()
}
return null
}
}
}
\ No newline at end of file
package com.yidianling.home.utils
import android.util.Log
/**
* Created by haorui on 2019/2/16.
* Des:
*/
class HomeLogPrinter {
companion object {
/**
* 解决LogCat打印长数据不完整问题
*/
fun printLongLog(tag: String, msg: String) {
var msg = msg
val maxStrLength = 2001 - tag.length
while (msg.length > maxStrLength) {
Log.i(tag, msg.substring(0, maxStrLength))
msg = msg.substring(maxStrLength)
}
Log.i(tag, msg)
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape>
<corners android:radius="20dp"/>
<gradient android:endColor="#FAD642" android:startColor="#FA5729" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape>
<corners android:radius="0dp"></corners>
<gradient android:endColor="#05cbfc" android:startColor="#3484da" />
<stroke android:width="0dp" android:color="#bebebe" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="20dp"/>
<solid android:color="@android:color/white" />
<stroke android:width="1px" android:color="#F0F0F0"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
<solid android:color="@color/platform_white"/>
</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:shape="rectangle">
<solid android:color="#FFDD33" />
<corners android:radius="3dp" />
</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:shape="rectangle">
<solid android:color="#F7F7F7" />
<corners android:radius="4dp"/>
<stroke android:width="1dp"
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:shape="rectangle">
<stroke android:width="1dp"
android:color="#E6E6E6" />
<corners android:radius="19dp" />
</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:shape="rectangle">
<stroke android:color="#EBEBEB"
android:width="0.5dp" />
<solid android:color="#FFFFFF" />
<corners
android:radius="10dp"/>
</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:shape="rectangle">
<solid
android:color="#FF1DA1F2"/>
<size
android:width="22dp"
android:height="5dp"/>
<corners android:radius="11dp"/>
</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:shape="rectangle">
<solid
android:color="#E0E0E0"/>
<size
android:width="22dp"
android:height="5dp"/>
<corners android:radius="11dp"/>
</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:shape="rectangle">
<gradient
android:startColor="#1DA1F2"
android:endColor="#5CC8F7"/>
</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:shape="rectangle">
<stroke
android:width="1px"
android:color="#60FF5A4C" />
<solid android:color="#0DFF5A4C" />
<corners android:radius="8dp" />
</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:shape="rectangle">
<solid android:color="#E0E0E0" />
</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:shape="rectangle">
<gradient android:startColor="#00000000"
android:endColor="#66000000"
android:angle="270"/>
</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:shape="rectangle">
<solid android:color="#70FFFFFF" />
<corners android:topRightRadius="9dp"
android:bottomLeftRadius="9dp"
android:bottomRightRadius="9dp" />
</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:shape="rectangle">
<solid android:color="#FFDD33" />
<corners android:topRightRadius="6dp"
android:bottomLeftRadius="6dp" />
</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:shape="rectangle">
<solid android:color="#FDFAEA" />
<corners android:radius="4dp" />
</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:shape="rectangle">
<stroke
android:color="#CCCCCC"
android:width="0.5dp"/>
<corners
android:radius="12dp"/>
</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:shape="rectangle">
<solid
android:color="#FFDD33"/>
<corners android:radius="12dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#70FFFFFF" />
<corners
android:bottomLeftRadius="20dp"
android:bottomRightRadius="20dp"
android:topRightRadius="20dp"
/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#99000000">
<ImageView
android:id="@+id/img_activity"
android:layout_width="350dp"
android:layout_height="400dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<ImageView
android:id="@+id/img_close"
android:layout_width="32dp"
android:layout_height="32dp"
app:layout_constraintTop_toBottomOf="@+id/img_activity"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginTop="20dp"
android:src="@mipmap/ico_close"/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#00000000"
android:gravity="center_horizontal"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="267dp"
android:layout_height="292dp"
app:cardCornerRadius="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="119dp"
android:background="@mipmap/coupon_background"
android:gravity="center_horizontal|center_vertical"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:src="@drawable/coupon_receiver" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="9dp"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="恭喜您,领取成功" />
</LinearLayout>
<RelativeLayout
android:layout_width="227dp"
android:layout_height="90dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="-16dp"
android:background="@mipmap/cotent_backgroudn"
android:paddingLeft="14dp"
android:paddingRight="14dp"
android:paddingTop="16dp">
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/tv_money"
android:textColor="#666666"
android:textSize="14sp"
tools:text="咨询优惠券咨询优惠券" />
<TextView
android:id="@+id/tv_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title"
android:layout_marginTop="4dp"
android:textColor="#999999"
android:textSize="10sp"
tools:text="有效期至2018-08-31" />
<TextView
android:id="@+id/tv_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toLeftOf="@+id/tv_unit"
android:layout_toStartOf="@+id/tv_unit"
android:textColor="#FF8C00"
android:textSize="25sp"
android:textStyle="bold"
tools:text="¥50" />
<TextView
android:id="@+id/tv_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="10dp"
android:text="元"
android:textColor="#FF8C00"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_limit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="10dp"
android:textColor="#999999"
android:textSize="10sp"
tools:text="满500元可用" />
</RelativeLayout>
<TextView
android:id="@+id/tv_ensure"
android:layout_width="192dp"
android:layout_height="42dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:background="@drawable/background_coupon_button"
android:gravity="center"
android:textColor="@color/white"
android:textSize="15sp"
tools:text="立即领取" />
</LinearLayout>
</android.support.v7.widget.CardView>
<ImageView
android:id="@+id/iv_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="37dp"
android:background="@drawable/pop_close"
android:padding="10dp" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/c_body"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:background="#99000000">
<ImageView
android:id="@+id/img_activity"
android:layout_width="64dp"
android:layout_height="34dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="7dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"/>
<ImageView
android:id="@+id/img_line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/activity_guide"
app:layout_constraintTop_toBottomOf="@+id/img_activity"
app:layout_constraintLeft_toLeftOf="@+id/img_activity"
app:layout_constraintRight_toRightOf="@+id/img_activity"/>
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="24dp"
tools:text="这里可以进入双11活动哦"
app:layout_constraintBottom_toBottomOf="@+id/img_line"
app:layout_constraintLeft_toRightOf="@+id/img_line"
android:layout_marginLeft="14dp"
android:textSize="16dp"
android:textColor="@color/platform_white"/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:paddingLeft="@@dimen/platform_dp_15"
android:paddingRight="@@dimen/platform_dp_15"
android:paddingTop="@@dimen/platform_dp_15">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleArticleItemViewCardImg"
android:layout_width="@@dimen/platform_dp_127"
android:layout_height="@@dimen/platform_dp_88"
android:layout_alignParentRight="true"
app:cardCornerRadius="@@dimen/platform_dp_6"
app:cardElevation="0dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:id="@+id/homeModuleArticleItemViewImg"
android:background="@drawable/home_module_image_default_back"/>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/homeModuleArticleItemViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:ellipsize="end"
android:textSize="@@dimen/platform_dp_18"
android:textStyle="bold"
android:layout_marginTop="-2dp"
android:textColor="@color/platform_color_222222"
android:layout_alignParentTop="true"
android:lineSpacingExtra="@@dimen/platform_dp_1"
tools:text="喧嚣的世界中,你的重要何以而来?喧嚣的世界中,你的重要何以而来?"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/homeModuleArticleItemViewCardImg"
android:layout_marginRight="@@dimen/platform_dp_20"/>
<TextView
android:id="@+id/homeModuleArticleItemViewContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:ellipsize="end"
android:textSize="@@dimen/platform_dp_13"
android:layout_marginTop="@@dimen/platform_dp_4"
android:textColor="@color/platform_color_666666"
android:layout_alignParentLeft="true"
android:layout_below="@+id/homeModuleArticleItemViewTitle"
android:lineSpacingExtra="@@dimen/platform_dp_3"
tools:text="喧嚣的世界中,你的重要何以而来?当我伫立在我所伫立之处..."
android:layout_toLeftOf="@+id/homeModuleArticleItemViewCardImg"
android:layout_marginRight="@@dimen/platform_dp_20"/>
<LinearLayout
android:id="@+id/homeModuleArticleItemViewBottomLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_below="@+id/homeModuleArticleItemViewCardImg"
android:layout_marginTop="@@dimen/platform_dp_16">
<ImageView
android:id="@+id/homeModuleArticleItemViewIcon"
android:layout_width="@@dimen/platform_dp_12"
android:layout_height="@@dimen/platform_dp_12"
android:src="@drawable/home_module_article_item_icon"
android:layout_alignParentLeft="true"/>
<TextView
android:id="@+id/homeModuleArticleItemViewAuthor"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:textSize="@@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
android:layout_marginLeft="@@dimen/platform_dp_3"
android:textStyle="bold"
tools:text="赵秀英"/>
<TextView
android:id="@+id/homeModuleArticleItemViewGreatNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="3327"
android:textSize="@@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="点赞"
android:textSize="@@dimen/platform_dp_11"
android:layout_marginRight="@@dimen/platform_dp_12"
android:textColor="@color/platform_color_666666"/>
<TextView
android:id="@+id/homeModuleArticleItemViewLookNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="2656"
android:textSize="@@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="浏览"
android:textSize="@@dimen/platform_dp_11"
android:textColor="@color/platform_color_666666"/>
</LinearLayout>
<View
android:id="@+id/homeModuleArticleItemViewBottomLine"
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="@color/platform_color_EBEBEB"
android:layout_centerInParent="true"
android:layout_below="@+id/homeModuleArticleItemViewBottomLayout"
android:layout_marginTop="@@dimen/platform_dp_16"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.ydl.home_module.ui.view.HomeCommonTitleView
android:id="@+id/homeModuleArticleViewHomeCommonTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</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="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_weight="210"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFiveItemViewFirstImg"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="118"
android:background="@drawable/home_module_image_default_back"/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:background="@color/platform_color_FFFFFF"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="60">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFiveItemViewThirdImg"
android:scaleType="centerCrop"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="104"
android:background="@drawable/home_module_image_default_back"/>
<View
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:background="@color/platform_color_FFFFFF"/>
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFiveItemViewFourthImg"
android:scaleType="centerCrop"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="104"
android:background="@drawable/home_module_image_default_back"/>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="match_parent"
android:background="@color/platform_color_FFFFFF"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="103"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFiveItemViewSecondImg"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="118"
android:background="@drawable/home_module_image_default_back"/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:background="@color/platform_color_FFFFFF"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="60">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFiveItemViewFiveImg"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_module_image_default_back"/>
<TextView
android:id="@+id/homeModuleAssuageGriefUnderFiveItemViewTag"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="@@dimen/platform_dp_5"
android:layout_marginRight="@@dimen/platform_dp_5"
android:background="@drawable/home_module_assuage_grief_item_view_image_num_back"
android:gravity="center"
tools:text="9图"
android:textColor="@color/platform_color_242424"
android:textSize="@@dimen/platform_dp_10" />
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</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="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFourItemViewFirstImg"
android:layout_width="0dp"
android:layout_weight="156"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@drawable/home_module_image_default_back"/>
<View
android:layout_width="0dp"
android:layout_weight="2"
android:layout_height="match_parent"
android:background="@color/platform_color_FFFFFF"/>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="157"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFourItemViewSecondImg"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="88"
android:background="@drawable/home_module_image_default_back"/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:background="@color/platform_color_FFFFFF"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="88"
android:background="#1da1f2">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderFourItemViewThirdImg"
android:scaleType="centerCrop"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_module_image_default_back"/>
<TextView
android:id="@+id/homeModuleAssuageGriefUnderFourthItemViewTag"
android:layout_width="30dp"
android:layout_height="14dp"
android:gravity="center"
tools:text="9图"
android:textSize="@@dimen/platform_dp_10"
android:textColor="@color/platform_color_242424"
android:background="@drawable/home_module_assuage_grief_item_view_image_num_back"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="@@dimen/platform_dp_5"
android:layout_marginBottom="@@dimen/platform_dp_5"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/homeModuleAssuageGriefUnderTwoItemViewImg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:background="@drawable/home_module_image_default_back"/>
</RelativeLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/homeModuleAssuageGriefViewChildLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@@dimen/platform_dp_20"
android:paddingTop="@@dimen/platform_dp_18"
android:paddingLeft="@@dimen/platform_dp_15"
android:paddingRight="@@dimen/platform_dp_15"
android:background="@drawable/home_module_card_view_stroke">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@@dimen/platform_dp_18">
<RelativeLayout
android:id="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_width="38dp"
android:layout_height="38dp"
android:background="@drawable/home_module_assuage_grief_stroke_line">
<android.support.v7.widget.CardView
android:layout_width="@@dimen/platform_dp_36"
android:layout_height="@@dimen/platform_dp_36"
app:cardCornerRadius="@@dimen/platform_dp_18"
app:cardElevation="0dp"
android:layout_centerInParent="true">
<ImageView
android:id="@+id/homeModuleAssuageGriefViewPersonImg"
android:layout_width="@@dimen/platform_dp_36"
android:layout_height="@@dimen/platform_dp_36"
android:src="@drawable/platform_head_place_hold_pic"
android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView>
</RelativeLayout>
<TextView
android:id="@+id/homeModuleAssuageGriefViewPersonName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="Zoe Miller"
android:textSize="@@dimen/platform_dp_14"
android:layout_alignTop="@+id/homeModuleAssuageGriefViewPersonCardView"
android:textColor="@color/platform_color_242424"
android:textStyle="bold"
android:gravity="center_vertical"
android:layout_alignBottom="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_toRightOf="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_marginLeft="@@dimen/platform_dp_8"
/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="今天 15:05"
android:textSize="@@dimen/platform_dp_12"
android:textColor="@color/platform_color_999999"
android:layout_toRightOf="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_alignBottom="@+id/homeModuleAssuageGriefViewPersonCardView"
android:layout_marginLeft="@@dimen/platform_dp_8"
android:layout_marginBottom="0.5dp"
android:visibility="gone"/>
<RelativeLayout
android:id="@+id/homeModuleAssuageGriefItemViewIsFollow"
android:layout_width="@@dimen/platform_dp_60"
android:layout_height="@@dimen/platform_dp_24"
android:layout_centerVertical="true"
android:layout_alignParentRight="true">
<ImageView
android:id="@+id/homeModuleAssuageGriefItemViewFollow"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/home_module_assuage_grief_item_view_follow"
android:layout_centerInParent="true"/>
<ImageView
android:id="@+id/homeModuleAssuageGriefItemViewUnFollow"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/home_module_assuage_grief_item_view_unfollow"
android:layout_centerInParent="true"/>
</RelativeLayout>
</RelativeLayout>
<!-- 标题,默认隐藏-->
<TextView
android:id="@+id/homeModuleAssuageGriefViewTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/platform_color_242424"
android:textSize="@@dimen/platform_dp_18"
android:layout_marginBottom="@@dimen/platform_dp_6"
android:textStyle="bold"
tools:text="可是除了你,没人能左右我的情绪可是除了你,没人能左右我的情绪"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="3"
android:ellipsize="end"
android:lineSpacingExtra="@@dimen/platform_dp_5"
tools:text="在我空闲的时间里,我想起了许久没有联系的露娜,给她打了一通电话。我没有说很多,可她还是感觉出了我的不对劲,竟然不顾雪夜寒冷与路途遥远,一个多钟在我空闲的时间里,我想起了许久没有联系的露娜,给她打了一通电话。我没有说很多,可她还是感觉出了我的不对劲,竟然不顾雪夜寒冷与路途遥远,一个多钟..."
android:textSize="@@dimen/platform_dp_13"
android:textColor="@color/platform_color_666666"/>
<!-- 评论内容,默认隐藏-->
<RelativeLayout
android:id="@+id/homeModuleAssuageGriefViewComment"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@@dimen/platform_dp_12"
android:layout_marginTop="@@dimen/platform_dp_16"
android:background="@drawable/home_module_assuage_grief_item_view_tab_back">
<ImageView
android:id="@+id/homeModuleAssuageGriefViewHotView"
android:layout_height="@@dimen/platform_dp_14"
android:layout_width="@@dimen/platform_dp_28"
android:src="@drawable/home_module_comment_hot_icon"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewHotViewComment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@@dimen/platform_dp_15"
android:layout_marginLeft="@@dimen/platform_dp_15"
tools:text="劳蘸酱:"
android:textStyle="bold"
android:textSize="@@dimen/platform_dp_13"
android:textColor="@color/platform_color_444444"
android:maxLines="2"
android:ellipsize="end"
android:layout_below="@+id/homeModuleAssuageGriefViewHotView"
android:layout_marginTop="@@dimen/platform_dp_5"
/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewHotViewCommentContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="@@dimen/platform_dp_15"
android:layout_marginLeft="@@dimen/platform_dp_15"
android:lineSpacingExtra="@@dimen/platform_dp_4"
tools:text="劳蘸酱:人生的旅途中,我们总是在不断的相遇和告别中前行。生活总会让我们经历着或多或少我们总是在不断的相遇和告别中前行我们总是在不断的相遇和告别中前行"
android:textSize="@@dimen/platform_dp_13"
android:textColor="@color/platform_color_444444"
android:maxLines="2"
android:ellipsize="end"
android:layout_below="@+id/homeModuleAssuageGriefViewHotView"
android:layout_marginTop="@@dimen/platform_dp_5"
/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@@dimen/platform_dp_20">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="@@dimen/platform_dp_7"
android:paddingRight="@@dimen/platform_dp_7"
android:paddingTop="@@dimen/platform_dp_4"
android:paddingBottom="@@dimen/platform_dp_4"
android:gravity="center_vertical"
android:background="@drawable/home_module_assuage_grief_item_view_tab_back">
<ImageView
android:layout_width="11.36dp"
android:layout_height="10.72dp"
android:src="@drawable/home_module_assuage_grief_item_view_tab_icon"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="情感倾诉"
android:textColor="@color/platform_color_242424"
android:textSize="@@dimen/platform_dp_12"
android:layout_marginLeft="@@dimen/platform_dp_3"/>
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="0dp"/>
<ImageView
android:layout_width="@@dimen/platform_dp_18"
android:layout_height="@@dimen/platform_dp_18"
android:src="@drawable/home_module_assuage_grief_item_view_tab_comment"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewCommentsCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="68"
android:textSize="@@dimen/platform_dp_14"
android:textColor="@color/platform_color_242424"
android:layout_marginRight="@@dimen/platform_dp_22"
android:layout_marginLeft="@@dimen/platform_dp_5"/>
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</LinearLayout>
<LinearLayout
android:id="@+id/ll_zan"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/homeModuleAssuageGriefViewIsNotZan"
android:layout_width="@@dimen/platform_dp_18"
android:layout_height="@@dimen/platform_dp_18"
android:src="@drawable/home_module_assuage_grief_item_view_tab_warm"/>
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/homeModuleAssuageGriefViewIsZan"
android:layout_width="@@dimen/platform_dp_18"
android:layout_height="@@dimen/platform_dp_18"
app:lottie_imageAssetsFolder="images"
app:lottie_fileName="hug.json"
android:visibility="gone"
android:scaleType="centerCrop"/>
<TextView
android:id="@+id/homeModuleAssuageGriefViewZanCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="987"
android:textSize="@@dimen/platform_dp_14"
android:textColor="@color/platform_color_242424"
android:layout_marginLeft="@@dimen/platform_dp_5"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.ydl.home_module.ui.view.HomeCommonTitleView
android:id="@+id/homeModuleAssuageGriefViewHomeCommonTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:paddingLeft="@dimen/platform_dp_8"
android:paddingRight="@dimen/platform_dp_8">
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="80dp"
android:layout_height="78dp"
android:background="@drawable/home_module_button_banner_first_img_new"
android:gravity="center">
<TextView
android:id="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="心理咨询"/>
<TextView
android:layout_below="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:text="1W+师资"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="80dp"
android:layout_height="78dp"
android:background="@drawable/home_module_confide_free_icon"
android:gravity="center">
<TextView
android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="即时倾诉"/>
<TextView
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:text="24小时在线"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="80dp"
android:layout_height="78dp"
android:orientation="vertical"
android:background="@drawable/home_module_button_banner_third_img_new"
android:gravity="center">
<TextView
android:id="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="心理课堂"/>
<TextView
android:layout_below="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:text="送28元礼包"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="80dp"
android:layout_height="78dp"
android:background="@drawable/home_module_button_banner_fourth_img_new"
android:gravity="center">
<TextView
android:id="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="心理测试"/>
<TextView
android:layout_below="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:text="抑郁测量"/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.v4.view.ViewPager
android:id="@+id/vp_category"
android:layout_width="match_parent"
android:layout_height="153dp"
android:background="@color/platform_white"/>
<LinearLayout
android:id="@+id/ll_Indicator"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_alignBottom="@id/vp_category"
android:layout_gravity="bottom"
tools:background="@color/platform_red"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:visibility="gone"
tools:visibility="visible"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="@dimen/platform_dp_24"
android:paddingBottom="@dimen/platform_dp_14">
<View
android:layout_width="0dp"
android:layout_height="@dimen/platform_dp_7"
android:background="@drawable/home_module_common_title_gradient_back"
app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/>
<TextView
android:id="@+id/homeModuleCommonTitleViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/platform_dp_1"
tools:text="通用.标题"
android:textSize="24dp"
android:textStyle="bold"
android:textColor="@color/platform_color_333333"
android:layout_marginLeft="@dimen/platform_dp_15"
app:layout_constraintLeft_toLeftOf="parent"/>
<LinearLayout
android:layout_width="@dimen/platform_dp_60"
android:layout_height="@dimen/platform_dp_24"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="@dimen/platform_dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/platform_dp_15"
android:background="@drawable/home_module_show_more_line">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="更多"
android:textStyle="bold"
android:layout_marginLeft="@dimen/platform_dp_2"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_13"/>
<ImageView
android:layout_height="@dimen/platform_dp_10"
android:layout_width="@dimen/platform_dp_6"
android:src="@drawable/home_module_common_more_icon"
android:layout_marginLeft="3dp"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_head"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="21dp"
android:scaleType="fitXY"
android:src="@drawable/platform_head_place_hold_pic" />
<TextView
android:id="@+id/tv_confide"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/img_head"
android:layout_marginTop="@dimen/platform_dp_13"
android:layout_marginEnd="@dimen/platform_dp_15"
android:gravity="center" />
<LinearLayout
android:id="@+id/tv_name_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_alignTop="@+id/img_head"
android:layout_marginTop="-2dp"
android:layout_toEndOf="@+id/img_head">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="姚雨晴" />
<ImageView
android:id="@+id/img_sex"
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_marginStart="6dp"
android:layout_marginLeft="3dp"
android:background="@drawable/home_module_counselor" />
</LinearLayout>
<com.yidianling.ydlcommon.view.TagView
android:id="@+id/tag_view"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_16"
android:layout_below="@+id/tv_name_layout"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="6dp"
android:layout_marginEnd="@dimen/platform_dp_10"
android:layout_toEndOf="@+id/img_head"
android:orientation="horizontal" />
<TextView
android:id="@+id/tv_confideNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="7dp"
android:layout_toEndOf="@+id/img_head"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="8000" />
<TextView
android:id="@+id/tv_tv_confideNumContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginTop="7dp"
android:layout_marginEnd="@dimen/platform_dp_12"
android:layout_toEndOf="@+id/tv_confideNum"
android:text="向TA倾诉"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_11"
tools:ignore="SpUsage" />
<TextView
android:id="@+id/tv_Connection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginTop="7dp"
android:layout_toEndOf="@+id/tv_tv_confideNumContent"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="83%" />
<TextView
android:id="@+id/tv_ConnectionContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginTop="7dp"
android:layout_marginEnd="@dimen/platform_dp_12"
android:layout_toEndOf="@+id/tv_Connection"
android:text="接通率"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_11"
tools:ignore="SpUsage" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_confideNum"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="7dp"
android:layout_marginBottom="18dp"
android:layout_toEndOf="@+id/img_head"
android:gravity="bottom"
android:textColor="#FF5A4C"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="¥199" />
<TextView
android:id="@+id/tv_price_tips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tv_price"
android:layout_marginBottom="2dp"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@+id/tv_price"
android:gravity="center"
android:text="元/次"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"/>
<TextView
android:id="@+id/tvOriginalPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_price"
android:layout_alignBottom="@+id/tv_price"
android:layout_marginStart="@dimen/platform_dp_6"
android:layout_toEndOf="@+id/tv_price_tips"
android:layout_marginBottom="-1dp"
android:gravity="center"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"
tools:ignore="SpUsage"
tools:text="原价¥50" />
<TextView
android:id="@+id/tvCoupon"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_15"
android:layout_alignTop="@+id/tv_price"
android:layout_alignBottom="@+id/tv_price"
android:layout_marginLeft="12dp"
android:layout_marginTop="3dp"
android:layout_marginBottom="2dp"
android:layout_toRightOf="@+id/tvOriginalPrice"
android:background="@drawable/home_module_confide_expert_info_coupon_background"
android:gravity="center"
android:paddingLeft="6dp"
android:paddingRight="6dp"
android:textColor="@color/platform_color_FF5A4C"
android:textSize="@dimen/platform_dp_10"
tools:ignore="SpUsage"
android:textStyle="bold"
tools:text="立减¥30" />
<View
android:id="@+id/view_line"
style="@style/viewline"
android:layout_below="@+id/tv_price"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@color/platform_color_EBEBEB" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.ydl.home_module.ui.view.HomeCommonTitleView
android:id="@+id/homeModuleConfideViewHomeCommonTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabGravity="fill"
app:tabIndicatorHeight="0dp"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_color_242424"
app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="#333" />
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</merge>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/img_consult_head"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="21dp"
android:scaleType="fitXY"
android:src="@drawable/platform_head_place_hold_pic" />
<TextView
android:id="@+id/tv_consult_chat"
android:layout_width="44dp"
android:layout_height="44dp"
android:layout_alignParentEnd="true"
android:layout_alignTop="@+id/img_consult_head"
android:layout_marginTop="@dimen/platform_dp_13"
android:layout_marginEnd="@dimen/platform_dp_15"
android:background="@drawable/home_module_consult_chat"
android:gravity="center" />
<LinearLayout
android:id="@+id/tv_name_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_alignTop="@+id/img_consult_head"
android:layout_marginTop="-2dp"
android:layout_toEndOf="@+id/img_consult_head">
<TextView
android:id="@+id/tv_consult_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="姚雨晴" />
<ImageView
android:id="@+id/img_sex"
android:layout_width="13dp"
android:layout_height="13dp"
android:layout_marginStart="6dp"
android:layout_marginLeft="3dp"
android:background="@drawable/home_module_counselor" />
</LinearLayout>
<com.yidianling.ydlcommon.view.TagView
android:id="@+id/tag_view"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_16"
android:layout_below="@+id/tv_name_layout"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="6dp"
android:layout_marginEnd="@dimen/platform_dp_10"
android:layout_toEndOf="@+id/img_consult_head"
android:orientation="horizontal" />
<TextView
android:id="@+id/tv_tv_consult_num_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_alignLeft="@+id/tv_name_layout"
android:layout_marginTop="7dp"
android:text="咨询次数 "
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_11"
tools:ignore="SpUsage" />
<TextView
android:id="@+id/tv_consult_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginTop="5dp"
android:textColor="@color/platform_color_242424"
android:layout_toRightOf="@+id/tv_tv_consult_num_content"
android:textSize="@dimen/platform_dp_13"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="8000" />
<TextView
android:id="@+id/tv_feedback_rate_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginTop="7dp"
android:layout_marginLeft="12dp"
android:layout_toRightOf="@+id/tv_consult_num"
android:text="好评率 "
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_11"
tools:ignore="SpUsage" />
<TextView
android:id="@+id/tv_feedback_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tag_view"
android:layout_marginTop="5dp"
android:layout_toRightOf="@+id/tv_feedback_rate_content"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="83%" />
<TextView
android:id="@+id/tv_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_consult_num"
android:layout_marginStart="@dimen/platform_dp_16"
android:layout_marginTop="7dp"
android:layout_marginBottom="18dp"
android:layout_toEndOf="@+id/img_consult_head"
android:gravity="bottom"
android:textColor="#FF5A4C"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:ignore="SpUsage"
tools:text="¥199" />
<TextView
android:id="@+id/tv_consult_price"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tv_price"
android:layout_marginBottom="2dp"
android:layout_marginLeft="2dp"
android:layout_toRightOf="@+id/tv_price"
android:gravity="center"
android:text="起"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12" />
<View
android:id="@+id/view_line"
style="@style/viewline"
android:layout_below="@+id/tv_price"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@color/platform_color_EBEBEB" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_99"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_13"
android:layout_marginTop="@dimen/platform_dp_3"
android:padding="@dimen/platform_dp_15"
android:background="@drawable/home_module_card_view_stroke">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleCourseItemViewImgCardView"
android:layout_width="127dp"
android:layout_height="69dp"
app:cardCornerRadius="6dp"
app:cardElevation="0dp">
<ImageView
android:id="@+id/homeModuleCourseItemViewImg"
android:layout_width="127dp"
android:layout_height="69dp"
android:scaleType="centerCrop"
android:src="@drawable/home_module_image_default_back"/>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/homeModuleCourseItemViewTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"
android:textSize="@dimen/platform_dp_16"
android:textColor="@color/platform_color_242424"
android:textStyle="bold"
android:maxLines="2"
android:ellipsize="end"
android:layout_marginTop="-2dp"
tools:text="深度睡眠速效药丸丨帮你
像婴儿般安稳入睡深度睡眠速效药丸丨帮你
像婴儿般安稳入睡"/>
<TextView
android:id="@+id/homeModuleCourseItemViewFreePrice"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="免费"
android:textSize="@dimen/platform_dp_15"
android:textStyle="bold"
android:textColor="@color/platform_color_34CD65"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"/>
<RelativeLayout
android:id="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginBottom="-2dp">
<TextView
android:id="@+id/homeModuleCourseItemViewExpensePrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="¥688"
android:textStyle="bold"
android:textSize="16dp"
android:textColor="@color/platform_color_FF5A4C"/>
</RelativeLayout>
<TextView
android:id="@+id/homeModuleCourseItemViewPersonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人气"
android:textSize="@dimen/platform_dp_11"
android:gravity="center"
android:textColor="@color/platform_color_666666"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_marginBottom="-1dp"/>
<TextView
android:id="@+id/homeModuleCourseItemViewPersonNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="3109"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
android:layout_toLeftOf="@+id/homeModuleCourseItemViewPersonText"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:gravity="center"
android:layout_marginBottom="-1dp"/>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.ydl.home_module.ui.view.HomeCommonTitleView
android:id="@+id/homeModuleCourseViewHomeCommonTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:paddingTop="@dimen/platform_dp_16"
android:paddingBottom="@dimen/platform_dp_16">
<View
android:layout_width="48dp"
android:layout_height="0.5dp"
android:background="@color/platform_color_EBEBEB"
android:layout_marginRight="@dimen/platform_dp_8"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_10"
android:text="我是有底线的"/>
<View
android:layout_width="48dp"
android:layout_height="0.5dp"
android:layout_marginLeft="@dimen/platform_dp_8"
android:background="@color/platform_color_EBEBEB"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:cube_ptr="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_white"
android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/home_swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/home_module_fragment_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_white"
android:divider="@null"
android:overScrollMode="never"/>
</android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:id="@+id/view_rl_top_bg"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/background_home_pager_top" />
<RelativeLayout
android:id="@+id/rl_top"
android:layout_width="match_parent"
android:layout_height="48dp">
<LinearLayout
android:id="@+id/ll_top_function"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginTop="7dp"
android:layout_marginBottom="5dp"
android:paddingRight="10dp"
android:gravity="center_vertical|right"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_consult"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="咨询"
android:layout_marginLeft="@dimen/platform_dp_16"
android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
cube_ptr:ignore="SpUsage"/>
<TextView
android:id="@+id/tv_confide"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_16"
android:gravity="center_vertical"
android:text="倾诉"
android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
cube_ptr:ignore="SpUsage"/>
<TextView
android:id="@+id/tv_course"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_16"
android:gravity="center_vertical"
android:text="课程"
android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
cube_ptr:ignore="SpUsage"/>
<TextView
android:id="@+id/tv_test"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_16"
android:gravity="center_vertical"
android:text="测评"
android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
cube_ptr:ignore="SpUsage"/>
<RelativeLayout
android:id="@+id/rl_backTop"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_18">
<ImageView
android:id="@+id/imgTop"
android:layout_width="14dp"
android:layout_height="9dp"
android:layout_centerHorizontal="true"
android:background="@drawable/home_module_back_top"/>
<TextView
android:id="@+id/tv_returnTop"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_below="@+id/imgTop"
android:gravity="center"
android:text="回顶部"
android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_9"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="4dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="5dp"
android:id="@+id/rl_search"
android:orientation="horizontal">
<ImageView
android:id="@+id/img_ad"
android:layout_width="64dp"
android:layout_height="34dp"
android:layout_marginRight="10dp"
android:visibility="gone"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_home_search_input"
android:tag="tag_search_input_bg"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="12dp"
android:layout_height="12dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp"
android:src="@drawable/icon_search"/>
<TextView
android:id="@+id/home_tv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:text="@string/search_hint"
android:textColor="#999999"
android:textSize="@dimen/platform_default_text_size_small"
android:textStyle="normal"
android:typeface="sans"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<ImageView
android:id="@+id/home_service_call"
android:layout_width="@dimen/platform_dp_34"
android:layout_height="@dimen/platform_dp_34"
android:layout_gravity="center_vertical"
android:layout_marginTop="7dp"
android:layout_marginRight="12dp"
android:layout_toRightOf="@+id/rl_search"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null"
android:src="@drawable/home_module_search_phone"
android:visibility="gone" />
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_layout"
android:layout_width="match_parent"
android:layout_height="41dp"
android:layout_below="@+id/rl_top"
android:orientation="vertical"
android:visibility="gone"
>
<android.support.design.widget.TabLayout
android:id="@+id/tab_layout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/platform_white"
android:visibility="visible"
app:tabGravity="fill"
app:tabIndicatorHeight="0dp"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_color_242424"
app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="#333"/>
<View style="@style/viewline"/>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_consultLayout"
android:layout_width="match_parent"
android:layout_height="41dp"
android:layout_below="@+id/rl_top"
android:orientation="vertical"
android:visibility="gone">
<android.support.design.widget.TabLayout
android:id="@+id/tab_consultLayout"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/platform_white"
android:visibility="visible"
app:tabGravity="fill"
app:tabIndicatorHeight="0dp"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_color_242424"
app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="#333"/>
<View style="@style/viewline"/>
</LinearLayout>
</RelativeLayout>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingLeft="@dimen/platform_dp_15"
android:paddingRight="@dimen/platform_dp_15"
android:paddingTop="@dimen/platform_dp_8"
android:paddingBottom="@dimen/platform_dp_8">
<ImageView
android:id="@+id/iv_fm_play"
android:layout_height="@dimen/platform_dp_22"
android:layout_width="@dimen/platform_dp_22"
android:src="@drawable/home_module_intelligent_item_play_icon"
android:layout_marginRight="@dimen/platform_dp_7"/>
<TextView
android:id="@+id/homeModuleIntelligentItemViewTitle"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
tools:text="2018倒计时,这一年你过2018倒计时,这一年你过的…"
android:textSize="@dimen/platform_dp_16"
android:textColor="@color/platform_color_242424"
android:textStyle="bold"
android:layout_marginRight="@dimen/platform_dp_29"
android:maxLines="1"
android:ellipsize="end"/>
<TextView
android:id="@+id/homeModuleIntelligentItemViewHits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="3785"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_666666"
android:maxLines="1"
android:ellipsize="end"/>
<ImageView
android:layout_height="@dimen/platform_dp_11"
android:layout_width="@dimen/platform_dp_12"
android:src="@drawable/home_module_intelligent_item_listen_icon"
android:layout_marginLeft="@dimen/platform_dp_4"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleIntelligentTopViewImageCardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="@dimen/platform_dp_7"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/homeModuleIntelligentTopViewImage"
android:background="@drawable/home_module_image_default_back"
android:scaleType="centerCrop"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="45"/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="55"
android:background="@drawable/home_module_intelligent_gradient_back"/>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/homeModuleIntelligentTopViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="先结婚还是先买先结婚还是先买房"
android:textSize="@dimen/platform_dp_24"
android:textColor="@color/platform_color_FFFFFF"
android:textStyle="bold"
android:maxLines="1"
android:ellipsize="end"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="@dimen/platform_dp_14"
android:layout_marginBottom="@dimen/platform_dp_35"
android:layout_marginRight="@dimen/platform_dp_115"
/>
<LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18"
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingLeft="@dimen/platform_dp_10"
android:paddingRight="@dimen/platform_dp_10"
android:background="@drawable/home_module_intelligent_top_view_layout_back"
android:layout_alignLeft="@+id/homeModuleIntelligentTopViewTitle"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/platform_dp_14">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="主播/"
android:textColor="@color/platform_color_222222"
android:textSize="@dimen/platform_dp_12"
/>
<TextView
android:id="@+id/homeModuleIntelligentTopViewAuthor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="花心月"
android:textColor="@color/platform_color_222222"
android:textSize="@dimen/platform_dp_12"
android:layout_marginBottom="0.5dp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收听/"
android:textColor="@color/platform_color_222222"
android:textSize="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
/>
<TextView
android:id="@+id/homeModuleIntelligentTopViewHits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="2486"
android:textColor="@color/platform_color_222222"
android:textSize="@dimen/platform_dp_13"
android:layout_marginBottom="1dp"
/>
</LinearLayout>
<ImageView
android:id="@+id/iv_play_fm"
android:layout_width="@dimen/platform_dp_36"
android:layout_height="@dimen/platform_dp_36"
android:src="@drawable/home_module_intelligent_first_play_icon"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="@dimen/platform_dp_14"
android:layout_marginBottom="16.5dp"/>
<RelativeLayout
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_20"
android:layout_alignParentRight="true"
android:background="@drawable/home_module_intelligent_top_view_recommend_back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="每日推荐"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<com.ydl.home_module.ui.view.HomeCommonTitleView
android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/homeModuleIntelligentViewAddLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_2"
android:layout_marginBottom="@dimen/platform_dp_20"
android:background="@drawable/home_module_card_view_stroke"
android:orientation="vertical"></LinearLayout>
</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:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:parentTag="android.widget.LinearLayout">
<com.yidianling.home.ui.view.HomeCommonTitleView
android:id="@+id/homeModuleMuseViewHomeCommonTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="88dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:id="@+id/muse_first"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="5dp"
android:layout_weight="1"
app:cardElevation="0dp"
app:cardCornerRadius="@dimen/platform_dp_4">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/muse_first_img" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="13dp"
android:gravity="center_vertical"
android:layout_marginRight="@dimen/platform_dp_15"
android:orientation="horizontal">
<TextView
android:id="@+id/muse_first_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="深度睡眠"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16" />
<ImageView
android:layout_width="18dp"
android:layout_height="@dimen/platform_dp_18"
android:layout_marginLeft="@dimen/platform_dp_4"
android:src="@drawable/muse_play" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/muse_second"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_weight="1"
app:cardElevation="0dp"
app:cardCornerRadius="@dimen/platform_dp_4">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.airbnb.lottie.LottieAnimationView
android:id="@+id/muse_animation_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:lottie_autoPlay="true"
app:lottie_loop="true"
app:lottie_imageAssetsFolder="images"
app:lottie_fileName="pinna.json"
android:scaleType="centerCrop"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginTop="13dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/muse_second_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="节奏调整"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16" />
<ImageView
android:layout_width="18dp"
android:layout_height="@dimen/platform_dp_18"
android:layout_marginLeft="@dimen/platform_dp_4"
android:src="@drawable/muse_play" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="88dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:id="@+id/muse_third"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="5dp"
android:layout_weight="1"
app:cardElevation="0dp"
app:cardCornerRadius="@dimen/platform_dp_4">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/muse_third_img" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginTop="13dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/muse_third_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="身体扫描"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16"/>
<ImageView
android:layout_width="18dp"
android:layout_height="@dimen/platform_dp_18"
android:layout_marginLeft="@dimen/platform_dp_4"
android:src="@drawable/muse_play" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/muse_forth"
android:layout_width="0dp"
android:layout_height="78dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_weight="1"
app:cardElevation="0dp"
app:cardCornerRadius="@dimen/platform_dp_4">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/muse_fouth_img" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginTop="13dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/muse_forth_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="压力缓冲"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_16" />
<ImageView
android:layout_width="18dp"
android:layout_height="@dimen/platform_dp_18"
android:layout_marginLeft="@dimen/platform_dp_4"
android:src="@drawable/muse_play" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_7"
android:orientation="horizontal"
android:paddingLeft="6.5dp"
android:paddingRight="6.5dp"
android:layout_marginBottom="16dp">
<RelativeLayout
android:id="@+id/sleeps_first"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1">
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:scaleType="centerCrop"
android:src="@drawable/muse_circle_first"
android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView>
<TextView
android:id="@+id/sleeps_first_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="篝火"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_14"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/sleeps_second"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1">
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:scaleType="centerCrop"
android:src="@drawable/muse_circle_second"
android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView>
<TextView
android:id="@+id/sleeps_second_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="溪流"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_14"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/sleeps_third"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1">
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:scaleType="centerCrop"
android:src="@drawable/muse_circle_third"
android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView>
<TextView
android:id="@+id/sleeps_third_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="风声"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_14"
android:textStyle="bold" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/sleeps_forth"
android:layout_width="0dp"
android:layout_height="80dp"
android:layout_weight="1">
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:layout_width="72dp"
android:layout_height="72dp"
android:scaleType="centerCrop"
android:src="@drawable/muse_circle_fouth"
android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView>
<TextView
android:id="@+id/sleeps_forth_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="落雨"
android:textColor="@color/platform_black"
android:textSize="@dimen/platform_dp_14"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<FrameLayout
android:id="@+id/homeModulePagerBannerFlRoot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp" />
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/homeModulePagerBannerViewBanner"
android:layout_width="match_parent"
android:layout_height="180dp"
app:pa_indicator_different_width="14dp"
app:pa_indicator_drawable_selected="@drawable/home_module_banner_tip_select"
app:pa_indicator_drawable_unselected="@drawable/home_module_banner_tip_unselect"
app:pa_indicator_height="5dp"
app:pa_indicator_margin="1.25dp"
app:pa_is_selected_same_unselected="false"/>
<LinearLayout
android:id="@+id/homeModulePagerBannerViewAddLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="175dp"
android:background="@drawable/home_category_bg"
android:orientation="vertical"
android:paddingTop="20dp">
</LinearLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:layout_gravity="center_vertical"
tools:text="刚刚 姚**预约了"
android:layout_marginLeft="8dp"
android:id="@+id/tv_in_content_before"
android:textColor="#64461B"
android:textSize="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
tools:text="周艳玲"
android:id="@+id/tv_in_doctor_name"
android:textSize="12dp"
android:textColor="#FAA05A"
android:lines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/tv_in_content_after"
android:layout_gravity="center_vertical"
tools:text="老师的电话倾诉"
android:textColor="#64461B"
android:textSize="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@drawable/home_module_sale_info_view_bg"
android:paddingRight="@dimen/platform_dp_10"
android:paddingTop="@dimen/platform_dp_10"
android:paddingBottom="@dimen/platform_dp_10"
android:paddingLeft="@dimen/platform_dp_14"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="13dp"
android:layout_marginBottom="15dp">
<ImageView
android:layout_width="13dp"
android:layout_height="15dp"
android:layout_gravity="center_vertical"
android:scaleType="centerCrop"
android:src="@drawable/home_module_category_bottom_real_img"/>
<FrameLayout
android:id="@+id/homeModuleRealViewLeftFrameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
xmlns:tools="http://schemas.android.com/tools"
android:gravity="center_vertical"
>
<TextView
android:layout_gravity="center_vertical"
tools:text="刚刚 姚**预约了"
android:layout_marginLeft="8dp"
android:id="@+id/tv_out_content_before"
android:textColor="#64461B"
android:textSize="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
tools:text="周艳玲"
android:layout_marginLeft="6dp"
android:id="@+id/tv_out_doctor_name"
android:textSize="12sp"
android:textColor="#FAA05A"
android:lines="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/tv_out_content_after"
android:layout_gravity="center_vertical"
tools:text="老师的电话倾诉"
android:layout_marginLeft="6dp"
android:textColor="#64461B"
android:textSize="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="@dimen/platform_dp_8"
android:paddingBottom="@dimen/platform_dp_8"
>
<android.support.v7.widget.CardView
android:layout_width="70dp"
android:layout_height="50dp"
app:cardCornerRadius="@dimen/platform_dp_6"
app:cardElevation="0dp">
<ImageView
android:id="@+id/iv_test_item"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_module_image_default_back"
android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="12dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_test_item_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
tools:text="2018倒计时,这一年你过2018倒计时,这一年你过的…"/>
<LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingRight="@dimen/platform_dp_10">
<TextView
android:id="@+id/tv_test_item_hit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="999"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人气"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"
/>
<TextView
android:id="@+id/tv_tested_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_12"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="2486"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人已测"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"
/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="62dp"
android:layout_height="@dimen/platform_dp_24"
android:background="@drawable/home_module_test_item_go_bg"
android:gravity="center"
android:text="去测试"
android:textSize="12dp"
android:textColor="@color/platform_color_222222"
android:textStyle="bold"/>
</LinearLayout>
<View
android:visibility="gone"
android:layout_marginBottom="@dimen/platform_dp_12"
android:id="@+id/view_test_line"
style="@style/viewline"
android:layout_marginLeft="82dp"
android:background="@color/platform_color_EBEBEB"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView
android:id="@+id/homeModuleIntelligentTopViewImageCardView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="@dimen/platform_dp_7"
app:cardElevation="0dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/homeModuleIntelligentTopViewImage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/home_module_image_default_back"
android:scaleType="centerCrop"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="45"/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="55"
android:background="@drawable/home_module_intelligent_gradient_back"/>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<TextView
android:id="@+id/homeModuleIntelligentTopViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/platform_dp_14"
android:layout_marginRight="@dimen/platform_dp_115"
android:layout_marginBottom="67dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_24"
android:textStyle="bold"
tools:text="先结婚还是先买先结婚还是先买房"
/>
<LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18"
android:layout_alignLeft="@+id/homeModuleIntelligentTopViewTitle"
android:layout_alignParentBottom="true"
android:layout_marginBottom="43dp"
android:background="@drawable/home_module_test_top_view_layout_back"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/platform_dp_10"
android:paddingRight="@dimen/platform_dp_10">
<TextView
android:id="@+id/homeModuleIntelligentTopViewAuthor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="999"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="人气"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"
/>
<TextView
android:id="@+id/homeModuleIntelligentTopViewHits"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_12"
android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="2486"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="已测"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12"
/>
</LinearLayout>
<RelativeLayout
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_20"
android:layout_alignParentRight="true"
android:background="@drawable/home_module_intelligent_top_view_recommend_back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="每日一测"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<com.ydl.home_module.ui.view.HomeCommonTitleView
android:id="@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<LinearLayout
android:id="@+id/homeModuleIntelligentViewAddLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_2"
android:orientation="vertical"/>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="home_module_category_view_test_line">#F0F0F0</color>
</resources>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<resources>
<!--分割线粗细-->
<dimen name="home_title_bar_height">54dp</dimen>
</resources>
<resources>
<string name="app_name">home-module</string>
<string name="home_module_real_appoint">预约了</string>
<string name="search_hint">搜索话题、咨询师姓名</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--设置Tablayout字体大小-->
<style name="TabLayoutTextSize">
<item name="android:textSize">15sp</item>
</style>
<style name="NoTitleTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:windowActionBar">false</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="colorPrimary">@color/platform_main_theme_blue</item>
<item name="colorPrimaryDark">@color/platform_main_theme_blue</item>
<item name="colorAccent">@color/platform_main_theme_blue</item>
</style>
<!--设置Tablayout字体加粗-->
<style name="activityDialog" parent="NoTitleTheme">
<item name="android:windowIsTranslucent">true</item>
</style>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment