Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
072caa32
Commit
072caa32
authored
Jul 30, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 心理咨询首页添加冥想完成
parent
5fb5b61d
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
108 additions
and
110 deletions
+108
-110
ExampleInstrumentedTest.kt
m-home/src/androidTest/java/com/yidianling/home/ExampleInstrumentedTest.kt
+0
-24
home_data_xlzx.json
m-home/src/main/assets/home_data_xlzx.json
+9
-4
MeditationTypeAdapter.kt
m-home/src/main/java/com/yidianling/home/adapter/MeditationTypeAdapter.kt
+0
-1
MeditationViewPagerAdapter.kt
m-home/src/main/java/com/yidianling/home/adapter/MeditationViewPagerAdapter.kt
+0
-0
HomeBaseHttp.kt
m-home/src/main/java/com/yidianling/home/http/HomeBaseHttp.kt
+4
-0
HomeBasePagerApi.kt
m-home/src/main/java/com/yidianling/home/http/HomeBasePagerApi.kt
+4
-0
HomeCommonTitleView.kt
m-home/src/main/java/com/yidianling/home/view/HomeCommonTitleView.kt
+2
-2
HomeMuseView.kt
m-home/src/main/java/com/yidianling/home/view/HomeMuseView.kt
+4
-6
AdaptiveVideoView.kt
m-home/src/main/java/com/yidianling/home/widget/AdaptiveVideoView.kt
+0
-0
bg_more_meditation.xml
m-home/src/main/res/drawable/bg_more_meditation.xml
+0
-0
home_common_title_view.xml
m-home/src/main/res/layout/home_common_title_view.xml
+0
-0
home_layout_meditation_entrance.xml
m-home/src/main/res/layout/home_layout_meditation_entrance.xml
+0
-0
home_layout_meditation_item.xml
m-home/src/main/res/layout/home_layout_meditation_item.xml
+0
-0
home_layout_meditation_more_type.xml
m-home/src/main/res/layout/home_layout_meditation_more_type.xml
+0
-0
home_muse_view.xml
m-home/src/main/res/layout/home_muse_view.xml
+1
-1
colors.xml
m-home/src/main/res/values/colors.xml
+4
-0
styles.xml
m-home/src/main/res/values/styles.xml
+9
-1
ExampleUnitTest.kt
m-home/src/test/java/com/yidianling/home/ExampleUnitTest.kt
+0
-17
YdlHomeAdapter.kt
m-home/src/xlzx/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
+24
-17
IHomeContract.kt
m-home/src/xlzx/java/com/yidianling/home/constract/IHomeContract.kt
+2
-1
YdlHomeViewHolderConstract.kt
m-home/src/xlzx/java/com/yidianling/home/constract/YdlHomeViewHolderConstract.kt
+11
-4
HomeModelImpl.kt
m-home/src/xlzx/java/com/yidianling/home/model/HomeModelImpl.kt
+10
-1
HomePresenterImpl.kt
m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
+11
-1
YdlHomeAdapter.kt
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
+4
-3
HomeHttp.kt
m-home/src/ydl/java/com/yidianling/home/http/HomeHttp.kt
+0
-4
HomePagerApi.kt
m-home/src/ydl/java/com/yidianling/home/http/HomePagerApi.kt
+0
-4
HomeModelImpl.kt
m-home/src/ydl/java/com/yidianling/home/model/HomeModelImpl.kt
+2
-1
YdlHomeFragment.kt
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+1
-2
home_article_view.xml
m-home/src/ydl/res/layout/home_article_view.xml
+1
-1
home_assuage_grief_view.xml
m-home/src/ydl/res/layout/home_assuage_grief_view.xml
+1
-1
home_confide_view.xml
m-home/src/ydl/res/layout/home_confide_view.xml
+1
-1
home_course_view.xml
m-home/src/ydl/res/layout/home_course_view.xml
+1
-1
home_intelligent_view.xml
m-home/src/ydl/res/layout/home_intelligent_view.xml
+1
-1
home_test_view.xml
m-home/src/ydl/res/layout/home_test_view.xml
+1
-1
colors.xml
m-home/src/ydl/res/values/colors.xml
+0
-1
styles.xml
m-home/src/ydl/res/values/styles.xml
+0
-9
No files found.
m-home/src/androidTest/java/com/yidianling/home/ExampleInstrumentedTest.kt
deleted
100644 → 0
View file @
5fb5b61d
package
com.yidianling.home
import
androidx.test.platform.app.InstrumentationRegistry
import
androidx.test.ext.junit.runners.AndroidJUnit4
import
org.junit.Test
import
org.junit.runner.RunWith
import
org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith
(
AndroidJUnit4
::
class
)
class
ExampleInstrumentedTest
{
@Test
fun
useAppContext
()
{
// Context of the app under test.
val
appContext
=
InstrumentationRegistry
.
getInstrumentation
().
targetContext
assertEquals
(
"com.yidianling.home.test"
,
appContext
.
packageName
)
}
}
m-home/src/main/assets/home_data_xlzx.json
View file @
072caa32
...
@@ -1048,6 +1048,9 @@
...
@@ -1048,6 +1048,9 @@
"type"
:
10004
"type"
:
10004
},
},
{
{
"type"
:
10005
},
{
"courseBean"
:
{
"courseBean"
:
{
"pageNum"
:
1
,
"pageNum"
:
1
,
"pageSize"
:
3
,
"pageSize"
:
3
,
...
@@ -1303,7 +1306,7 @@
...
@@ -1303,7 +1306,7 @@
}
}
]
]
},
},
"type"
:
1000
5
"type"
:
1000
6
},
},
{
{
"askBean"
:
{
"askBean"
:
{
...
@@ -5568,8 +5571,9 @@
...
@@ -5568,8 +5571,9 @@
}
}
]
]
},
},
"type"
:
1000
6
"type"
:
1000
7
},
},
{
"type"
:
1000101
},
{
{
"articleBean"
:
{
"articleBean"
:
{
"list"
:
[
"list"
:
[
...
@@ -5740,9 +5744,9 @@
...
@@ -5740,9 +5744,9 @@
}
}
]
]
},
},
"type"
:
1000
7
"type"
:
1000
8
},
},
{
{
"type"
:
1000
8
"type"
:
1000
9
}
}
]
]
\ No newline at end of file
m-home/src/
ydl
/java/com/yidianling/home/adapter/MeditationTypeAdapter.kt
→
m-home/src/
main
/java/com/yidianling/home/adapter/MeditationTypeAdapter.kt
View file @
072caa32
...
@@ -21,7 +21,6 @@ import com.yidianling.home.R
...
@@ -21,7 +21,6 @@ import com.yidianling.home.R
import
com.yidianling.home.constants.HomeBIConstants
import
com.yidianling.home.constants.HomeBIConstants
import
com.yidianling.home.model.bean.MeditationModuleBean
import
com.yidianling.home.model.bean.MeditationModuleBean
import
com.yidianling.user.api.service.IUserService
import
com.yidianling.user.api.service.IUserService
import
kotlinx.android.synthetic.ydl.home_fragment.*
class
MeditationTypeAdapter
(
class
MeditationTypeAdapter
(
private
val
context
:
Context
,
private
val
context
:
Context
,
...
...
m-home/src/
ydl
/java/com/yidianling/home/adapter/MeditationViewPagerAdapter.kt
→
m-home/src/
main
/java/com/yidianling/home/adapter/MeditationViewPagerAdapter.kt
View file @
072caa32
File moved
m-home/src/main/java/com/yidianling/home/http/HomeBaseHttp.kt
View file @
072caa32
...
@@ -102,4 +102,7 @@ class HomeBaseHttp {
...
@@ -102,4 +102,7 @@ class HomeBaseHttp {
return
RxUtils
.
mapObservable
(
cmd
).
flatMap
{
getHomePagerApi
().
askFocus
(
it
)
}
return
RxUtils
.
mapObservable
(
cmd
).
flatMap
{
getHomePagerApi
().
askFocus
(
it
)
}
}
}
fun
getMeditationInfo
():
Observable
<
BaseAPIResponse
<
MeditationModuleBean
>>{
return
getHomePagerApi
().
getMeditation
()
}
}
}
\ No newline at end of file
m-home/src/main/java/com/yidianling/home/http/HomeBasePagerApi.kt
View file @
072caa32
...
@@ -111,5 +111,8 @@ interface HomeBasePagerApi {
...
@@ -111,5 +111,8 @@ interface HomeBasePagerApi {
@POST
(
"sq-active/focus"
)
@POST
(
"sq-active/focus"
)
fun
askFocus
(
@FieldMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseResponse
<
AskResultBean
>>
fun
askFocus
(
@FieldMap
params
:
Map
<
String
,
String
>):
Observable
<
BaseResponse
<
AskResultBean
>>
@GET
(
"cms/meditation/index"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getMeditation
():
Observable
<
BaseAPIResponse
<
MeditationModuleBean
>>
}
}
\ No newline at end of file
m-home/src/
ydl/java/com/yidianling/home/ui
/view/HomeCommonTitleView.kt
→
m-home/src/
main/java/com/yidianling/home
/view/HomeCommonTitleView.kt
View file @
072caa32
package
com.yidianling.home.
ui.
view
package
com.yidianling.home.view
import
android.content.Context
import
android.content.Context
import
android.util.AttributeSet
import
android.util.AttributeSet
import
android.view.View
import
android.view.View
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.constraintlayout.widget.ConstraintLayout
import
com.yidianling.home.R
import
com.yidianling.home.R
import
kotlinx.android.synthetic.
ydl
.home_common_title_view.view.*
import
kotlinx.android.synthetic.
main
.home_common_title_view.view.*
/**
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...
...
m-home/src/
ydl/java/com/yidianling/home/ui
/view/HomeMuseView.kt
→
m-home/src/
main/java/com/yidianling/home
/view/HomeMuseView.kt
View file @
072caa32
package
com.yidianling.home.
ui.
view
package
com.yidianling.home.view
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
...
@@ -21,10 +21,8 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
...
@@ -21,10 +21,8 @@ import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.yidianling.home.adapter.MeditationViewPagerAdapter
import
com.yidianling.home.adapter.MeditationViewPagerAdapter
import
com.yidianling.home.R
import
com.yidianling.home.R
import
com.yidianling.home.constants.HomeBIConstants
import
com.yidianling.home.constants.HomeBIConstants
import
com.yidianling.home.constract.HomeViewConfig
import
com.yidianling.home.event.IHomeEvent
import
com.yidianling.home.model.bean.MeditationModuleBean
import
com.yidianling.home.model.bean.MeditationModuleBean
import
kotlinx.android.synthetic.
ydl
.home_muse_view.view.*
import
kotlinx.android.synthetic.
main
.home_muse_view.view.*
/**
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...
@@ -33,7 +31,7 @@ import kotlinx.android.synthetic.ydl.home_muse_view.view.*
...
@@ -33,7 +31,7 @@ import kotlinx.android.synthetic.ydl.home_muse_view.view.*
* @Company 壹点灵
* @Company 壹点灵
* @date 2019/09/10
* @date 2019/09/10
*/
*/
class
HomeMuseView
(
private
val
mContext
:
Context
,
private
var
homeEvent
:
IHomeEvent
?
)
:
class
HomeMuseView
(
private
val
mContext
:
Context
)
:
LinearLayout
(
mContext
)
{
LinearLayout
(
mContext
)
{
private
val
meditationTitles
=
mutableListOf
<
String
>()
private
val
meditationTitles
=
mutableListOf
<
String
>()
...
@@ -51,7 +49,7 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
...
@@ -51,7 +49,7 @@ class HomeMuseView(private val mContext: Context, private var homeEvent: IHomeEv
)
)
layoutParams
=
params
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
home_muse_view
,
this
)
View
.
inflate
(
mContext
,
R
.
layout
.
home_muse_view
,
this
)
homeModuleMuseViewHomeCommonTitleView
.
setTitle
(
HomeViewConfig
.
getOrder
().
museTitle
)
homeModuleMuseViewHomeCommonTitleView
.
setTitle
(
"助眠·冥想"
)
}
}
fun
initData
(
bean
:
MeditationModuleBean
?)
{
fun
initData
(
bean
:
MeditationModuleBean
?)
{
...
...
m-home/src/
ydl
/java/com/yidianling/home/widget/AdaptiveVideoView.kt
→
m-home/src/
main
/java/com/yidianling/home/widget/AdaptiveVideoView.kt
View file @
072caa32
File moved
m-home/src/
ydl
/res/drawable/bg_more_meditation.xml
→
m-home/src/
main
/res/drawable/bg_more_meditation.xml
View file @
072caa32
File moved
m-home/src/
ydl
/res/layout/home_common_title_view.xml
→
m-home/src/
main
/res/layout/home_common_title_view.xml
View file @
072caa32
File moved
m-home/src/
ydl
/res/layout/home_layout_meditation_entrance.xml
→
m-home/src/
main
/res/layout/home_layout_meditation_entrance.xml
View file @
072caa32
File moved
m-home/src/
ydl
/res/layout/home_layout_meditation_item.xml
→
m-home/src/
main
/res/layout/home_layout_meditation_item.xml
View file @
072caa32
File moved
m-home/src/
ydl
/res/layout/home_layout_meditation_more_type.xml
→
m-home/src/
main
/res/layout/home_layout_meditation_more_type.xml
View file @
072caa32
File moved
m-home/src/
ydl
/res/layout/home_muse_view.xml
→
m-home/src/
main
/res/layout/home_muse_view.xml
View file @
072caa32
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
android:orientation=
"vertical"
android:orientation=
"vertical"
tools:parentTag=
"android.widget.LinearLayout"
>
tools:parentTag=
"android.widget.LinearLayout"
>
<com.yidianling.home.
ui.
view.HomeCommonTitleView
<com.yidianling.home.view.HomeCommonTitleView
android:id=
"@+id/homeModuleMuseViewHomeCommonTitleView"
android:id=
"@+id/homeModuleMuseViewHomeCommonTitleView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
...
...
m-home/src/main/res/values/colors.xml
0 → 100644
View file @
072caa32
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name=
"white_60"
>
#99FFFFFF
</color>
</resources>
m-home/src/main/res/values/styles.xml
View file @
072caa32
...
@@ -10,7 +10,14 @@
...
@@ -10,7 +10,14 @@
<item
name=
"colorPrimaryDark"
>
@color/platform_main_theme
</item>
<item
name=
"colorPrimaryDark"
>
@color/platform_main_theme
</item>
<item
name=
"colorAccent"
>
@color/platform_main_theme
</item>
<item
name=
"colorAccent"
>
@color/platform_main_theme
</item>
</style>
</style>
<style
name=
"MeditationTabLayoutStyle"
parent=
"Widget.Design.TabLayout"
>
<item
name=
"tabIndicatorColor"
>
@color/white
</item>
<item
name=
"tabIndicatorHeight"
>
2dp
</item>
<item
name=
"tabIndicatorFullWidth"
>
false
</item>
<item
name=
"tabSelectedTextColor"
>
@color/white
</item>
<item
name=
"android:textSize"
>
16sp
</item>
<item
name=
"android:textColor"
>
@color/white_60
</item>
</style>
</resources>
</resources>
\ No newline at end of file
m-home/src/test/java/com/yidianling/home/ExampleUnitTest.kt
deleted
100644 → 0
View file @
5fb5b61d
package
com.yidianling.home
import
org.junit.Test
import
org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class
ExampleUnitTest
{
@Test
fun
addition_isCorrect
()
{
assertEquals
(
4
,
2
+
2
)
}
}
m-home/src/xlzx/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
View file @
072caa32
package
com.yidianling.home.adapter
package
com.yidianling.home.adapter
import
android.content.Context
import
android.content.Context
import
android.graphics.Color
import
android.media.MediaPlayer
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
android.text.TextUtils
import
android.view.LayoutInflater
import
android.view.LayoutInflater
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.widget.ImageView
import
android.widget.ImageView
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydlcommon.data.PlatformDataManager
import
com.yidianling.home.R
import
com.yidianling.home.R
import
com.yidianling.home.constract.YdlHomeViewHolderConstract
import
com.yidianling.home.constract.YdlHomeViewHolderConstract
import
com.yidianling.home.event.HomeImpl
import
com.yidianling.home.event.HomeImpl
...
@@ -17,6 +17,8 @@ import com.yidianling.home.model.bean.HomeConfideBean
...
@@ -17,6 +17,8 @@ import com.yidianling.home.model.bean.HomeConfideBean
import
com.yidianling.home.model.bean.HomeConsultBean
import
com.yidianling.home.model.bean.HomeConsultBean
import
com.yidianling.home.model.bean.HomePagerDataBean
import
com.yidianling.home.model.bean.HomePagerDataBean
import
com.yidianling.home.ui.view.*
import
com.yidianling.home.ui.view.*
import
com.yidianling.home.view.HomeMuseView
import
kotlinx.android.synthetic.main.home_muse_view.view.*
/**
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...
@@ -126,6 +128,11 @@ class YdlHomeAdapter(
...
@@ -126,6 +128,11 @@ class YdlHomeAdapter(
YdlHomeViewHolderConstract
.
ASSUAGE_GRIEF_VIEW
->
{
YdlHomeViewHolderConstract
.
ASSUAGE_GRIEF_VIEW
->
{
return
HomeAssuageGriefViewHolder
(
HomeAssuageGriefView
(
mContext
,
homeEvent
))
return
HomeAssuageGriefViewHolder
(
HomeAssuageGriefView
(
mContext
,
homeEvent
))
}
}
//壹点*冥想模块
YdlHomeViewHolderConstract
.
MUSE_VIEW
->
{
return
HomeMuseViewHolder
(
HomeMuseView
(
mContext
))
}
//文章*阅读模块
//文章*阅读模块
YdlHomeViewHolderConstract
.
ARTICLE_VIEW
->
{
YdlHomeViewHolderConstract
.
ARTICLE_VIEW
->
{
return
HomeArticleViewHolder
(
HomeArticleView
(
mContext
,
homeEvent
))
return
HomeArticleViewHolder
(
HomeArticleView
(
mContext
,
homeEvent
))
...
@@ -157,21 +164,6 @@ class YdlHomeAdapter(
...
@@ -157,21 +164,6 @@ class YdlHomeAdapter(
list
[
position
].
headerBean
?.
askCategoryData
list
[
position
].
headerBean
?.
askCategoryData
)
)
}
}
//倾诉*排解模块
// is HomeConfideViewHolder -> {
// if (!TextUtils.isEmpty(ffrom) && ffrom.endsWith("huawei")) {
// val parm = holder.itemView.layoutParams
// parm.height = 0
// holder.itemView.layoutParams = parm
// } else {
// holder.confideViewView.setTitle(
// list[position].headerBean?.listenCategoryDate,
// confideSelectPosition
// )
// holder.confideViewView.setConfideExpertInfoView(list[position].confideBean?.body)
// confidePosition = position
// }
// }
//课程*成长模块
//课程*成长模块
is
HomeCourseViewHolder
->
{
is
HomeCourseViewHolder
->
{
holder
.
courseViewView
.
initData
(
list
[
position
].
courseBean
?.
list
)
holder
.
courseViewView
.
initData
(
list
[
position
].
courseBean
?.
list
)
...
@@ -202,6 +194,17 @@ class YdlHomeAdapter(
...
@@ -202,6 +194,17 @@ class YdlHomeAdapter(
is
HomeTestViewHolder
->
{
is
HomeTestViewHolder
->
{
holder
.
testView
.
initData
(
list
[
position
].
testListBean
)
holder
.
testView
.
initData
(
list
[
position
].
testListBean
)
}
}
is
HomeMuseViewHolder
->{
holder
.
museViewView
.
video_view
?.
setOnInfoListener
{
mp
,
what
,
extra
->
if
(
what
==
MediaPlayer
.
MEDIA_INFO_VIDEO_RENDERING_START
){
holder
.
museViewView
.
video_view
?.
setBackgroundColor
(
Color
.
TRANSPARENT
)
}
true
}
holder
.
museViewView
.
video_view
?.
start
()
holder
.
museViewView
.
initData
(
list
[
position
].
meditationBean
)
}
}
}
}
}
...
@@ -255,6 +258,10 @@ class YdlHomeAdapter(
...
@@ -255,6 +258,10 @@ class YdlHomeAdapter(
*/
*/
inner
class
HomeArticleViewHolder
(
val
articleViewView
:
HomeArticleView
)
:
inner
class
HomeArticleViewHolder
(
val
articleViewView
:
HomeArticleView
)
:
RecyclerView
.
ViewHolder
(
articleViewView
)
RecyclerView
.
ViewHolder
(
articleViewView
)
/**
* 解忧*问答模块 ViewHolder
*/
inner
class
HomeMuseViewHolder
(
val
museViewView
:
HomeMuseView
)
:
RecyclerView
.
ViewHolder
(
museViewView
)
/**
/**
* 底部提示语模块 ViewHolder
* 底部提示语模块 ViewHolder
...
...
m-home/src/xlzx/java/com/yidianling/home/constract/IHomeContract.kt
View file @
072caa32
...
@@ -62,6 +62,6 @@ class IHomeContract {
...
@@ -62,6 +62,6 @@ class IHomeContract {
*/
*/
fun
getCoupons
(
uid
:
String
):
Observable
<
BaseResponse
<
List
<
CouponBean
>>>
fun
getCoupons
(
uid
:
String
):
Observable
<
BaseResponse
<
List
<
CouponBean
>>>
fun
getMeditation
():
Observable
<
MeditationModuleBean
>
}
}
}
}
\ No newline at end of file
m-home/src/xlzx/java/com/yidianling/home/constract/YdlHomeViewHolderConstract.kt
View file @
072caa32
...
@@ -29,26 +29,32 @@ class YdlHomeViewHolderConstract {
...
@@ -29,26 +29,32 @@ class YdlHomeViewHolderConstract {
* 测试模块
* 测试模块
*/
*/
val
TEST_VIEW
=
10004
val
TEST_VIEW
=
10004
/**
* 冥想模块
*/
val
MUSE_VIEW
=
10005
/**
/**
* 课程*成长模块
* 课程*成长模块
*/
*/
val
COURSE_VIEW
=
1000
5
val
COURSE_VIEW
=
1000
6
/**
/**
* 解忧*问答模块
* 解忧*问答模块
*/
*/
val
ASSUAGE_GRIEF_VIEW
=
1000
6
val
ASSUAGE_GRIEF_VIEW
=
1000
7
/**
/**
* 文章*阅读模块
* 文章*阅读模块
*/
*/
val
ARTICLE_VIEW
=
1000
7
val
ARTICLE_VIEW
=
1000
8
/**
/**
* 底部提示语模块
* 底部提示语模块
*/
*/
val
FOOTER_VIEW
=
1000
8
val
FOOTER_VIEW
=
1000
9
/**
/**
* 倾诉*排解模块
* 倾诉*排解模块
*/
*/
val
CONFIDE_VIEW
=
1000100
val
CONFIDE_VIEW
=
1000100
}
}
}
}
\ No newline at end of file
m-home/src/xlzx/java/com/yidianling/home/model/HomeModelImpl.kt
View file @
072caa32
...
@@ -2,9 +2,13 @@ package com.yidianling.home.model
...
@@ -2,9 +2,13 @@ package com.yidianling.home.model
import
com.yidianling.home.http.HomeHttp
import
com.yidianling.home.http.HomeHttp
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.yidianling.home.constract.IHomeContract
import
com.yidianling.home.constract.IHomeContract
import
com.yidianling.home.http.HomeBaseHttp
import
com.yidianling.home.model.bean.*
import
com.yidianling.home.model.bean.*
import
io.reactivex.Observable
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>
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...
@@ -26,5 +30,9 @@ class HomeModelImpl: BaseHomeModelImpl(), IHomeContract.Model {
...
@@ -26,5 +30,9 @@ class HomeModelImpl: BaseHomeModelImpl(), IHomeContract.Model {
return
HomeHttp
.
getInstance
().
getCoupons
(
uid
)
return
HomeHttp
.
getInstance
().
getCoupons
(
uid
)
}
}
override
fun
getMeditation
():
Observable
<
MeditationModuleBean
>
{
return
HomeBaseHttp
.
getInstance
().
getMeditationInfo
().
compose
(
RxUtils
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
.
onErrorReturn
{
MeditationModuleBean
(
true
)
}
}
}
}
\ No newline at end of file
m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
View file @
072caa32
...
@@ -145,10 +145,15 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
...
@@ -145,10 +145,15 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
if
(
dataBean
.
isRealEmpty
||
dataBean
!
is
HomeAskBean
)
homeTempData
.
askBean
else
dataBean
if
(
dataBean
.
isRealEmpty
||
dataBean
!
is
HomeAskBean
)
homeTempData
.
askBean
else
dataBean
mHomeAskBean
=
item
.
askBean
mHomeAskBean
=
item
.
askBean
}
}
YdlHomeViewHolderConstract
.
MUSE_VIEW
->
{
item
.
meditationBean
=
if
(
dataBean
.
isRealEmpty
||
dataBean
!
is
MeditationModuleBean
)
homeTempData
.
meditationBean
else
dataBean
}
YdlHomeViewHolderConstract
.
ARTICLE_VIEW
->
{
YdlHomeViewHolderConstract
.
ARTICLE_VIEW
->
{
item
.
articleBean
=
item
.
articleBean
=
if
(
dataBean
.
isRealEmpty
||
dataBean
!
is
HomeArticleBean
)
homeTempData
.
articleBean
else
dataBean
if
(
dataBean
.
isRealEmpty
||
dataBean
!
is
HomeArticleBean
)
homeTempData
.
articleBean
else
dataBean
}
}
}
}
return
item
return
item
}
}
...
@@ -220,6 +225,11 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
...
@@ -220,6 +225,11 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
)
)
)
)
},
},
mModel
.
getMeditation
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
)).
map
{
//首页问答数据
homeList
.
add
(
getHomeItemFromTempData
(
it
,
YdlHomeViewHolderConstract
.
MUSE_VIEW
))
},
mModel
.
askRequest
()
mModel
.
askRequest
()
.
compose
(
RxUtils
.
applySchedulers
(
mView
)).
map
{
.
compose
(
RxUtils
.
applySchedulers
(
mView
)).
map
{
//首页问答数据
//首页问答数据
...
@@ -243,7 +253,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
...
@@ -243,7 +253,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
mView
.
homeDataFail
(
msg
)
mView
.
homeDataFail
(
msg
)
}
}
},
Action
{
},
Action
{
if
(
homeList
.
size
!=
9
){
if
(
homeList
.
size
!=
10
){
mView
.
homeDataFail
(
""
)
mView
.
homeDataFail
(
""
)
return
@Action
return
@Action
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/adapter/YdlHomeAdapter.kt
View file @
072caa32
...
@@ -14,7 +14,8 @@ import com.yidianling.home.constract.HomeViewConfig
...
@@ -14,7 +14,8 @@ import com.yidianling.home.constract.HomeViewConfig
import
com.yidianling.home.event.HomeImpl
import
com.yidianling.home.event.HomeImpl
import
com.yidianling.home.model.bean.*
import
com.yidianling.home.model.bean.*
import
com.yidianling.home.ui.view.*
import
com.yidianling.home.ui.view.*
import
kotlinx.android.synthetic.ydl.home_muse_view.view.*
import
com.yidianling.home.view.HomeMuseView
import
kotlinx.android.synthetic.main.home_muse_view.view.*
/**
/**
...
@@ -178,7 +179,7 @@ class YdlHomeAdapter(private val mContext: Context,
...
@@ -178,7 +179,7 @@ class YdlHomeAdapter(private val mContext: Context,
}
}
//壹点*冥想模块
//壹点*冥想模块
HomeViewConfig
.
getOrder
().
museIndex
->
{
HomeViewConfig
.
getOrder
().
museIndex
->
{
return
HomeMuseViewHolder
(
HomeMuseView
(
mContext
,
homeEvent
),
viewType
)
return
HomeMuseViewHolder
(
HomeMuseView
(
mContext
),
viewType
)
}
}
//底部提示语模块
//底部提示语模块
else
->
{
else
->
{
...
@@ -301,7 +302,7 @@ class YdlHomeAdapter(private val mContext: Context,
...
@@ -301,7 +302,7 @@ class YdlHomeAdapter(private val mContext: Context,
/**
/**
* 文章*阅读模块 ViewHolder
* 文章*阅读模块 ViewHolder
*/
*/
inner
class
HomeMuseViewHolder
(
val
museViewView
:
HomeMuseView
,
val
viewType
:
Int
)
:
RecyclerView
.
ViewHolder
(
museViewView
)
inner
class
HomeMuseViewHolder
(
val
museViewView
:
HomeMuseView
,
val
viewType
:
Int
)
:
RecyclerView
.
ViewHolder
(
museViewView
)
/**
/**
* 文章*阅读模块 ViewHolder
* 文章*阅读模块 ViewHolder
...
...
m-home/src/ydl/java/com/yidianling/home/http/HomeHttp.kt
View file @
072caa32
...
@@ -39,8 +39,5 @@ class HomeHttp {
...
@@ -39,8 +39,5 @@ class HomeHttp {
return
getHomePagerApi
().
getMuseData
()
return
getHomePagerApi
().
getMuseData
()
}
}
fun
getMeditationInfo
():
Observable
<
BaseAPIResponse
<
MeditationModuleBean
>>{
return
getHomePagerApi
().
getMeditation
()
}
}
}
\ No newline at end of file
m-home/src/ydl/java/com/yidianling/home/http/HomePagerApi.kt
View file @
072caa32
...
@@ -23,8 +23,5 @@ interface HomePagerApi {
...
@@ -23,8 +23,5 @@ interface HomePagerApi {
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getMuseData
():
Observable
<
BaseAPIResponse
<
MuseModuleBean
>>
fun
getMuseData
():
Observable
<
BaseAPIResponse
<
MuseModuleBean
>>
@GET
(
"cms/meditation/index"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA
)
fun
getMeditation
():
Observable
<
BaseAPIResponse
<
MeditationModuleBean
>>
}
}
\ No newline at end of file
m-home/src/ydl/java/com/yidianling/home/model/HomeModelImpl.kt
View file @
072caa32
...
@@ -2,6 +2,7 @@ package com.yidianling.home.model
...
@@ -2,6 +2,7 @@ package com.yidianling.home.model
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.yidianling.home.constract.IHomeContract
import
com.yidianling.home.constract.IHomeContract
import
com.yidianling.home.http.HomeBaseHttp
import
com.yidianling.home.http.HomeHttp
import
com.yidianling.home.http.HomeHttp
import
com.yidianling.home.model.bean.MeditationModuleBean
import
com.yidianling.home.model.bean.MeditationModuleBean
import
com.yidianling.home.model.bean.MuseModuleBean
import
com.yidianling.home.model.bean.MuseModuleBean
...
@@ -28,7 +29,7 @@ class HomeModelImpl : BaseHomeModelImpl(), IHomeContract.Model {
...
@@ -28,7 +29,7 @@ class HomeModelImpl : BaseHomeModelImpl(), IHomeContract.Model {
}
}
override
fun
getMeditation
():
Observable
<
MeditationModuleBean
>
{
override
fun
getMeditation
():
Observable
<
MeditationModuleBean
>
{
return
HomeHttp
.
getInstance
().
getMeditationInfo
().
compose
(
RxUtils
.
resultJavaData
())
return
Home
Base
Http
.
getInstance
().
getMeditationInfo
().
compose
(
RxUtils
.
resultJavaData
())
.
subscribeOn
(
Schedulers
.
io
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
Schedulers
.
io
()).
observeOn
(
AndroidSchedulers
.
mainThread
())
.
onErrorReturn
{
MeditationModuleBean
(
true
)
}
.
onErrorReturn
{
MeditationModuleBean
(
true
)
}
}
}
...
...
m-home/src/ydl/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
072caa32
...
@@ -47,10 +47,9 @@ import io.reactivex.Observable
...
@@ -47,10 +47,9 @@ import io.reactivex.Observable
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.disposables.Disposable
import
io.reactivex.disposables.Disposable
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.home_muse_view.*
import
kotlinx.android.synthetic.ydl.home_fragment.*
import
kotlinx.android.synthetic.ydl.home_fragment.*
import
kotlinx.android.synthetic.ydl.home_fragment.tab_layout
import
kotlinx.android.synthetic.ydl.home_fragment.tab_layout
import
kotlinx.android.synthetic.ydl.home_muse_view.*
import
kotlinx.android.synthetic.ydl.home_muse_view.view.*
import
java.util.concurrent.TimeUnit
import
java.util.concurrent.TimeUnit
...
...
m-home/src/ydl/res/layout/home_article_view.xml
View file @
072caa32
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<com.yidianling.home.
ui.
view.HomeCommonTitleView
<com.yidianling.home.view.HomeCommonTitleView
android:id=
"@+id/homeModuleArticleViewHomeCommonTitleView"
android:id=
"@+id/homeModuleArticleViewHomeCommonTitleView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
...
...
m-home/src/ydl/res/layout/home_assuage_grief_view.xml
View file @
072caa32
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<com.yidianling.home.
ui.
view.HomeCommonTitleView
<com.yidianling.home.view.HomeCommonTitleView
android:id=
"@+id/homeModuleAssuageGriefViewHomeCommonTitleView"
android:id=
"@+id/homeModuleAssuageGriefViewHomeCommonTitleView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
...
...
m-home/src/ydl/res/layout/home_confide_view.xml
View file @
072caa32
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<com.yidianling.home.
ui.
view.HomeCommonTitleView
<com.yidianling.home.view.HomeCommonTitleView
android:id=
"@+id/homeModuleConfideViewHomeCommonTitleView"
android:id=
"@+id/homeModuleConfideViewHomeCommonTitleView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
...
...
m-home/src/ydl/res/layout/home_course_view.xml
View file @
072caa32
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
>
<com.yidianling.home.
ui.
view.HomeCommonTitleView
<com.yidianling.home.view.HomeCommonTitleView
android:id=
"@+id/homeModuleCourseViewHomeCommonTitleView"
android:id=
"@+id/homeModuleCourseViewHomeCommonTitleView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
...
...
m-home/src/ydl/res/layout/home_intelligent_view.xml
View file @
072caa32
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
>
>
<com.yidianling.home.
ui.
view.HomeCommonTitleView
<com.yidianling.home.view.HomeCommonTitleView
android:id=
"@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:id=
"@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
...
...
m-home/src/ydl/res/layout/home_test_view.xml
View file @
072caa32
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
>
>
<com.yidianling.home.
ui.
view.HomeCommonTitleView
<com.yidianling.home.view.HomeCommonTitleView
android:id=
"@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:id=
"@+id/homeModuleIntelligentViewHomeCommonTitleView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
...
...
m-home/src/ydl/res/values/colors.xml
View file @
072caa32
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<color
name=
"white_60"
>
#99FFFFFF
</color>
<color
name=
"white"
>
#FFFFFF
</color>
<color
name=
"white"
>
#FFFFFF
</color>
<color
name=
"home_confide_61CEAC"
>
#61CEAC
</color>
<color
name=
"home_confide_61CEAC"
>
#61CEAC
</color>
...
...
m-home/src/ydl/res/values/styles.xml
View file @
072caa32
...
@@ -11,13 +11,5 @@
...
@@ -11,13 +11,5 @@
<item
name=
"android:windowIsTranslucent"
>
true
</item>
<item
name=
"android:windowIsTranslucent"
>
true
</item>
</style>
</style>
<style
name=
"MeditationTabLayoutStyle"
parent=
"Widget.Design.TabLayout"
>
<item
name=
"tabIndicatorColor"
>
@color/white
</item>
<item
name=
"tabIndicatorHeight"
>
2dp
</item>
<item
name=
"tabIndicatorFullWidth"
>
false
</item>
<item
name=
"tabSelectedTextColor"
>
@color/white
</item>
<item
name=
"android:textSize"
>
16sp
</item>
<item
name=
"android:textColor"
>
@color/white_60
</item>
</style>
</resources>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment