Commit 2f0a352e by konghaorui

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3

# Conflicts:
#	m-home/src/xlzx/java/com/yidianling/home/presenter/HomePresenterImpl.kt
parents aeff1b11 3e852281
...@@ -16,7 +16,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model { ...@@ -16,7 +16,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model {
*/ */
override fun consultRequest(category: String): Observable<HomeConsultBean> { override fun consultRequest(category: String): Observable<HomeConsultBean> {
return HomeBaseHttp.getInstance().getConsultData(category).compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().getConsultData(category).compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeConsultBean(true) } .onErrorReturn { HomeConsultBean(true) }
} }
...@@ -47,7 +46,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model { ...@@ -47,7 +46,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model {
*/ */
override fun courseRequest(): Observable<HomeCourseBean> { override fun courseRequest(): Observable<HomeCourseBean> {
return HomeBaseHttp.getInstance().getCourseData().compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().getCourseData().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeCourseBean(true) } .onErrorReturn { HomeCourseBean(true) }
} }
...@@ -63,7 +61,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model { ...@@ -63,7 +61,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model {
*/ */
override fun confideRequest(goodType: String): Observable<HomeConfideBean> { override fun confideRequest(goodType: String): Observable<HomeConfideBean> {
return HomeBaseHttp.getInstance().getConfideData(goodType).compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().getConfideData(goodType).compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeConfideBean(true) } .onErrorReturn { HomeConfideBean(true) }
} }
...@@ -72,7 +69,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model { ...@@ -72,7 +69,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model {
*/ */
override fun askRequest(): Observable<HomeAskBean> { override fun askRequest(): Observable<HomeAskBean> {
return HomeBaseHttp.getInstance().getAskData().compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().getAskData().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeAskBean(true) } .onErrorReturn { HomeAskBean(true) }
} }
...@@ -81,7 +77,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model { ...@@ -81,7 +77,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model {
*/ */
override fun articleRequest(): Observable<HomeArticleBean> { override fun articleRequest(): Observable<HomeArticleBean> {
return HomeBaseHttp.getInstance().getArticleData().compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().getArticleData().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeArticleBean(true) } .onErrorReturn { HomeArticleBean(true) }
} }
...@@ -90,7 +85,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model { ...@@ -90,7 +85,6 @@ open class BaseHomeModelImpl : IHomeBaseContract.Model {
*/ */
override fun headerRequest(): Observable<HomeHeaderBean> { override fun headerRequest(): Observable<HomeHeaderBean> {
return HomeBaseHttp.getInstance().newHomeHeaderRequest().compose(RxUtils.resultJavaData()) return HomeBaseHttp.getInstance().newHomeHeaderRequest().compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.newThread()).observeOn(AndroidSchedulers.mainThread())
.onErrorReturn { HomeHeaderBean(true) } .onErrorReturn { HomeHeaderBean(true) }
} }
} }
\ No newline at end of file
...@@ -114,7 +114,7 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC ...@@ -114,7 +114,7 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
object : TypeToken<MutableList<HomePagerDataBean>>() { object : TypeToken<MutableList<HomePagerDataBean>>() {
}.type }.type
) )
if (null != list && !list.isEmpty()) { if (null != list && list.isNotEmpty()) {
mView.homeDataResponse(list) mView.homeDataResponse(list)
saveTempData(list) saveTempData(list)
} }
...@@ -135,10 +135,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC ...@@ -135,10 +135,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
mConfideType = type mConfideType = type
mConfideDisposable = mModel.confideRequest(type) mConfideDisposable = mModel.confideRequest(type)
.compose(RxUtils.applySchedulers(mView))
.map { it } .map { it }
.filter { true } .filter { true }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
mView.confideDataResponse(it, selectPosition) mView.confideDataResponse(it, selectPosition)
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
...@@ -160,10 +159,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC ...@@ -160,10 +159,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
mConsultType = type mConsultType = type
mConsultDisposable = mModel.consultRequest(type) mConsultDisposable = mModel.consultRequest(type)
.compose(RxUtils.applySchedulers(mView))
.map { it } .map { it }
.filter { true } .filter { true }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
mView.consultDataResponse(it, selectPosition) mView.consultDataResponse(it, selectPosition)
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
...@@ -197,10 +195,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC ...@@ -197,10 +195,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun askZan(position: Int, index: Int, id: String) { override fun askZan(position: Int, index: Int, id: String) {
mModel.askZan(id) mModel.askZan(id)
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.netCheck()) .compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.map {} .map {}
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
override fun accept(msg: String) { override fun accept(msg: String) {
...@@ -216,10 +213,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC ...@@ -216,10 +213,9 @@ abstract class BaseHomePresenterImpl< V : IHomeBaseContract.View,M : IHomeBaseC
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun askFocus(position: Int, id: String) { override fun askFocus(position: Int, id: String) {
mModel.askFocus(id) mModel.askFocus(id)
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.netCheck()) .compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.map {} .map {}
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
// view.askDataResponse(it!!, position) // view.askDataResponse(it!!, position)
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
......
...@@ -161,7 +161,9 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -161,7 +161,9 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
val homeList: MutableList<HomePagerDataBean> = mutableListOf() val homeList: MutableList<HomePagerDataBean> = mutableListOf()
LogUtil.d("mConsultType-loadHomeData:$mConsultType") LogUtil.d("mConsultType-loadHomeData:$mConsultType")
Observable.mergeArray( Observable.mergeArray(
mModel.headerRequest().map { it -> mModel.headerRequest()
.compose(RxUtils.applySchedulers(mView))
.map { it ->
//首页头部数据 分类 & Banner //首页头部数据 分类 & Banner
homeList.add( homeList.add(
getHomeItemFromTempData( getHomeItemFromTempData(
...@@ -190,20 +192,23 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -190,20 +192,23 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
} }
}, },
mModel.consultRequest(mConsultType) mModel.consultRequest(mConsultType)
.map { .compose(RxUtils.applySchedulers(mView)).map {
//首页咨询数据 //首页咨询数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONSULT_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONSULT_VIEW))
}, },
//GoodType为空 获取默认类型 //GoodType为空 获取默认类型
mModel.confideRequest(mConfideType).map { mModel.confideRequest(mConfideType)
.compose(RxUtils.applySchedulers(mView)).map {
//首页倾述数据 //首页倾述数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONFIDE_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONFIDE_VIEW))
}, },
mModel.courseRequest().map { mModel.courseRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页课程数据 //首页课程数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.COURSE_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.COURSE_VIEW))
}, },
mModel.testRequest().map { mModel.testRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页测试数据 //首页测试数据
val homeTestBean = HomeTestBean() val homeTestBean = HomeTestBean()
homeTestBean.testItemList = it.data homeTestBean.testItemList = it.data
...@@ -214,7 +219,8 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -214,7 +219,8 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
) )
) )
}, },
mModel.askRequest().map { mModel.askRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页问答数据 //首页问答数据
homeList.add( homeList.add(
getHomeItemFromTempData( getHomeItemFromTempData(
...@@ -223,7 +229,8 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -223,7 +229,8 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
) )
) )
}, },
mModel.articleRequest().map { mModel.articleRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页文章数据 //首页文章数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.ARTICLE_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.ARTICLE_VIEW))
homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.FOOTER_VIEW)) homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.FOOTER_VIEW))
...@@ -266,11 +273,10 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -266,11 +273,10 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
val couponIdsStr = Gson().toJson(bean) val couponIdsStr = Gson().toJson(bean)
mModel.receiveCoupon(uid, couponIdsStr) mModel.receiveCoupon(uid, couponIdsStr)
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.netCheck()) .compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.doOnSubscribe { mView.showHomeProgress() } .doOnSubscribe { mView.showHomeProgress() }
.doAfterTerminate { mView.dismissHomeProgress() } .doAfterTerminate { mView.dismissHomeProgress() }
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
mView.receiveCouponResponse(it) mView.receiveCouponResponse(it)
}, object : ThrowableConsumer() { }, object : ThrowableConsumer() {
...@@ -297,9 +303,8 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -297,9 +303,8 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
private fun getCouponData() { private fun getCouponData() {
val uid = ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid ?: "" val uid = ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid ?: ""
mModel.getCoupons(uid) mModel.getCoupons(uid)
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.netCheck()) .compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer { .subscribe(Consumer {
hasRequestCoupon = true hasRequestCoupon = true
...@@ -326,7 +331,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac ...@@ -326,7 +331,7 @@ class HomePresenterImpl : BaseHomePresenterImpl<IHomeContract.View, IHomeContrac
private fun compareCouponTime(): Boolean { private fun compareCouponTime(): Boolean {
val simpleFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//如2016-08-10 val simpleFormat = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")//如2016-08-10
val uid = ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid val uid = ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.uid
val last = YDLCacheUtils.getCouponTime(uid); val last = YDLCacheUtils.getCouponTime(uid)
if (TextUtils.isEmpty(last)) { if (TextUtils.isEmpty(last)) {
//还没有获取过优惠券,直接请求数据 //还没有获取过优惠券,直接请求数据
return true return true
......
...@@ -3,6 +3,7 @@ package com.yidianling.home.presenter ...@@ -3,6 +3,7 @@ package com.yidianling.home.presenter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
...@@ -42,7 +43,8 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract ...@@ -42,7 +43,8 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
val homeList: MutableList<HomePagerDataBean> = mutableListOf() val homeList: MutableList<HomePagerDataBean> = mutableListOf()
LogUtil.d("mConsultType-loadHomeData:$mConsultType") LogUtil.d("mConsultType-loadHomeData:$mConsultType")
Observable.mergeArray( Observable.mergeArray(
mModel.headerRequest().map { it -> mModel.headerRequest()
.compose(RxUtils.applySchedulers(mView)).map { it ->
//首页头部数据 分类 & Banner //首页头部数据 分类 & Banner
homeList.add( homeList.add(
getHomeItemFromTempData( getHomeItemFromTempData(
...@@ -64,20 +66,24 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract ...@@ -64,20 +66,24 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
ModularServiceManager.provide(IConsultantService::class.java).setHotSearch(it) ModularServiceManager.provide(IConsultantService::class.java).setHotSearch(it)
} }
}, },
mModel.consultRequest(mConsultType).map { mModel.consultRequest(mConsultType)
.compose(RxUtils.applySchedulers(mView)).map {
//首页咨询数据 //首页咨询数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONSULT_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONSULT_VIEW))
}, },
//GoodType为空 获取默认类型 //GoodType为空 获取默认类型
mModel.confideRequest(mConfideType).map { mModel.confideRequest(mConfideType)
.compose(RxUtils.applySchedulers(mView)).map {
//首页倾述数据 //首页倾述数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONFIDE_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.CONFIDE_VIEW))
}, },
mModel.courseRequest().map { mModel.courseRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页课程数据 //首页课程数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.COURSE_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.COURSE_VIEW))
}, },
mModel.testRequest().map { mModel.testRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页测试数据 //首页测试数据
val homeTestBean = HomeTestBean() val homeTestBean = HomeTestBean()
homeTestBean.testItemList = it.data homeTestBean.testItemList = it.data
...@@ -88,7 +94,8 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract ...@@ -88,7 +94,8 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
) )
) )
}, },
mModel.askRequest().map { mModel.askRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页问答数据 //首页问答数据
homeList.add( homeList.add(
getHomeItemFromTempData( getHomeItemFromTempData(
...@@ -97,11 +104,13 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract ...@@ -97,11 +104,13 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
) )
) )
}, },
mModel.museRequest().map { mModel.museRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页冥想数据 //首页冥想数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.MUSE_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.MUSE_VIEW))
}, },
mModel.fmRequest().map { mModel.fmRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页电台数据 //首页电台数据
homeList.add( homeList.add(
getHomeItemFromTempData( getHomeItemFromTempData(
...@@ -110,7 +119,8 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract ...@@ -110,7 +119,8 @@ class HomePresenterImpl: BaseHomePresenterImpl<IHomeContract.View, IHomeContract
) )
) )
}, },
mModel.articleRequest().map { mModel.articleRequest()
.compose(RxUtils.applySchedulers(mView)).map {
//首页文章数据 //首页文章数据
homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.ARTICLE_VIEW)) homeList.add(getHomeItemFromTempData(it, YdlHomeViewHolderConstract.ARTICLE_VIEW))
homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.FOOTER_VIEW)) homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.FOOTER_VIEW))
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:cube_ptr="http://schemas.android.com/tools" xmlns:cube_ptr="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/platform_white" android:background="@color/platform_white"
android:orientation="vertical"> android:orientation="vertical">
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/home_swipe_refresh_layout" android:id="@+id/home_swipe_refresh_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/home_module_fragment_recycler" android:id="@+id/home_module_fragment_recycler"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/platform_white" android:background="@color/platform_white"
android:divider="@null" android:divider="@null"
android:overScrollMode="never"/> android:overScrollMode="never"/>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<View <View
android:id="@+id/view_rl_top_bg" android:id="@+id/view_rl_top_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:background="@drawable/home_background_home_pager_top" /> android:background="@drawable/home_background_home_pager_top" />
<RelativeLayout <RelativeLayout
android:id="@+id/rl_top" android:id="@+id/rl_top"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp"> android:layout_height="48dp">
<LinearLayout <LinearLayout
android:id="@+id/ll_top_function" android:id="@+id/ll_top_function"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="34dp" android:layout_height="34dp"
android:layout_marginTop="7dp" android:layout_marginTop="7dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:gravity="center_vertical|right" android:gravity="center_vertical|right"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:id="@+id/tv_consult" android:id="@+id/tv_consult"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="咨询" android:text="咨询"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_marginLeft="@dimen/platform_dp_16"
android:textColor="@color/platform_white" android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" android:textStyle="bold"
cube_ptr:ignore="SpUsage"/> cube_ptr:ignore="SpUsage"/>
<TextView <TextView
android:id="@+id/tv_confide" android:id="@+id/tv_confide"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_marginLeft="@dimen/platform_dp_16"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="倾诉" android:text="倾诉"
android:textColor="@color/platform_white" android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" android:textStyle="bold"
cube_ptr:ignore="SpUsage"/> cube_ptr:ignore="SpUsage"/>
<TextView <TextView
android:id="@+id/tv_course" android:id="@+id/tv_course"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_marginLeft="@dimen/platform_dp_16"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="课程" android:text="课程"
android:textColor="@color/platform_white" android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" android:textStyle="bold"
cube_ptr:ignore="SpUsage"/> cube_ptr:ignore="SpUsage"/>
<TextView <TextView
android:id="@+id/tv_test" android:id="@+id/tv_test"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_16" android:layout_marginLeft="@dimen/platform_dp_16"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="测评" android:text="测评"
android:textColor="@color/platform_white" android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" android:textStyle="bold"
cube_ptr:ignore="SpUsage"/> cube_ptr:ignore="SpUsage"/>
<RelativeLayout <RelativeLayout
android:id="@+id/rl_backTop" android:id="@+id/rl_backTop"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/platform_dp_18"> android:layout_marginLeft="@dimen/platform_dp_18">
<ImageView <ImageView
android:id="@+id/imgTop" android:id="@+id/imgTop"
android:layout_width="14dp" android:layout_width="14dp"
android:layout_height="9dp" android:layout_height="9dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:background="@drawable/home_back_top"/> android:background="@drawable/home_back_top"/>
<TextView <TextView
android:id="@+id/tv_returnTop" android:id="@+id/tv_returnTop"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@+id/imgTop" android:layout_below="@+id/imgTop"
android:gravity="center" android:gravity="center"
android:text="回顶部" android:text="回顶部"
android:textColor="@color/platform_white" android:textColor="@color/platform_white"
android:textSize="@dimen/platform_dp_9"/> android:textSize="@dimen/platform_dp_9"/>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="34dp" android:layout_height="34dp"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:id="@+id/rl_search" android:id="@+id/rl_search"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/img_ad" android:id="@+id/img_ad"
android:layout_width="64dp" android:layout_width="64dp"
android:layout_height="34dp" android:layout_height="34dp"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:visibility="gone"/> android:visibility="gone"/>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<View <View
android:id="@+id/view_search_input_bg" android:id="@+id/view_search_input_bg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/home_bg_home_search_input" android:background="@drawable/home_bg_home_search_input"
android:tag="tag_search_input_bg"/> android:tag="tag_search_input_bg"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/iv_search_icon" android:id="@+id/iv_search_icon"
android:layout_width="12dp" android:layout_width="12dp"
android:layout_height="12dp" android:layout_height="12dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:src="@drawable/home_icon_search"/> android:src="@drawable/home_icon_search"/>
<TextView <TextView
android:id="@+id/home_tv" android:id="@+id/home_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="@string/search_hint" android:text="@string/home_search_hint"
android:textColor="#999999" android:textColor="#999999"
android:textSize="@dimen/platform_default_text_size_small" android:textSize="@dimen/platform_default_text_size_small"
android:textStyle="normal" android:textStyle="normal"
android:typeface="sans"/> android:typeface="sans"/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@+id/home_service_call" android:id="@+id/home_service_call"
android:layout_width="@dimen/platform_dp_34" android:layout_width="@dimen/platform_dp_34"
android:layout_height="@dimen/platform_dp_34" android:layout_height="@dimen/platform_dp_34"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginTop="7dp" android:layout_marginTop="7dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:layout_toRightOf="@+id/rl_search" android:layout_toRightOf="@+id/rl_search"
android:background="?android:attr/selectableItemBackground" android:background="?android:attr/selectableItemBackground"
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/home_search_phone" android:src="@drawable/home_search_phone"
android:visibility="gone" /> android:visibility="gone" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_layout" android:id="@+id/ll_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="41dp" android:layout_height="41dp"
android:layout_below="@+id/rl_top" android:layout_below="@+id/rl_top"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
> >
<android.support.design.widget.TabLayout <android.support.design.widget.TabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
android:background="@color/platform_white" android:background="@color/platform_white"
android:visibility="visible" android:visibility="visible"
app:tabGravity="fill" app:tabGravity="fill"
app:tabIndicatorHeight="0dp" app:tabIndicatorHeight="0dp"
app:tabMode="scrollable" app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_color_242424" app:tabSelectedTextColor="@color/platform_color_242424"
app:tabTextAppearance="@style/TabLayoutTextSize" app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="#333"/> app:tabTextColor="#333"/>
<View style="@style/viewline"/> <View style="@style/viewline"/>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_consultLayout" android:id="@+id/ll_consultLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="41dp" android:layout_height="41dp"
android:layout_below="@+id/rl_top" android:layout_below="@+id/rl_top"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone"> android:visibility="gone">
<android.support.design.widget.TabLayout <android.support.design.widget.TabLayout
android:id="@+id/tab_consultLayout" android:id="@+id/tab_consultLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
android:background="@color/platform_white" android:background="@color/platform_white"
android:visibility="visible" android:visibility="visible"
app:tabGravity="fill" app:tabGravity="fill"
app:tabIndicatorHeight="0dp" app:tabIndicatorHeight="0dp"
app:tabMode="scrollable" app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_color_242424" app:tabSelectedTextColor="@color/platform_color_242424"
app:tabTextAppearance="@style/TabLayoutTextSize" app:tabTextAppearance="@style/TabLayoutTextSize"
app:tabTextColor="#333"/> app:tabTextColor="#333"/>
<View style="@style/viewline"/> <View style="@style/viewline"/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</FrameLayout> </FrameLayout>
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