Commit 5d0b11ab by konghaorui

测评业务模块 UI 适配

parent d89b0bd5
...@@ -14,7 +14,6 @@ import com.ydl.webview.NewH5Activity ...@@ -14,7 +14,6 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.URLUtils import com.ydl.ydlcommon.utils.URLUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
...@@ -332,7 +331,7 @@ class ExpertSearchAdapter(private val context: Context, private val expertSearch ...@@ -332,7 +331,7 @@ class ExpertSearchAdapter(private val context: Context, private val expertSearch
itemView.tvChat.setOnClickListener { itemView.tvChat.setOnClickListener {
if (adapterPosition != RecyclerView.NO_POSITION) { if (adapterPosition != RecyclerView.NO_POSITION) {
//判断是否已登录 //判断是否已登录
if(!YdlCommonRouterManager.getYdlCommonRoute().isLogin()){ if(!ConsultantIn.getUserImpl().isLogin()){
TempH5RouteUtils.tempH5Route(IYDLRouterConstant.ROUTER_MINE_LOGIN) TempH5RouteUtils.tempH5Route(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return@setOnClickListener return@setOnClickListener
} }
......
...@@ -4,7 +4,9 @@ import android.app.Activity ...@@ -4,7 +4,9 @@ import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager import com.yidianling.router.RouterManager
import com.yidianling.user.api.service.IUserService
/** /**
* author : Zhangwenchao * author : Zhangwenchao
...@@ -26,4 +28,8 @@ object ConsultantIn { ...@@ -26,4 +28,8 @@ object ConsultantIn {
return RouterManager.getAppRouter()?.mainIntent(activity) return RouterManager.getAppRouter()?.mainIntent(activity)
} }
fun getUserImpl(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
} }
\ No newline at end of file
...@@ -76,9 +76,11 @@ dependencies { ...@@ -76,9 +76,11 @@ dependencies {
api project(':ydl-webview') api project(':ydl-webview')
api project(':ydl-platform') api project(':ydl-platform')
implementation modularPublication('com.ydl:m-test-api') implementation modularPublication('com.ydl:m-test-api')
implementation modularPublication('com.ydl:m-user-api')
}else { }else {
//发布时使用 //发布时使用
implementation modularPublication('com.ydl:m-test-api') compileOnly modularPublication('com.ydl:m-test-api')
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-webview"] api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) { api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true transitive = true
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
<!--测评首页--> <!--测评首页-->
<activity <activity
android:name=".home.TestHomeActivity" android:name=".home.TestHomeActivity"
android:screenOrientation="portrait" /> android:screenOrientation="portrait"
android:theme="@style/tests_NoTitleTheme"
/>
</application> </application>
</manifest> </manifest>
package com.yidianling.tests.home package com.yidianling.tests.home
import android.os.Build
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.support.v4.widget.SwipeRefreshLayout import android.support.v4.widget.SwipeRefreshLayout
import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView import android.support.v7.widget.RecyclerView
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.LinearLayout
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.base.BaseMvpActivity import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.*
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.RxImageTool
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.home.adapter.AdapterWrapper import com.yidianling.tests.home.adapter.AdapterWrapper
import com.yidianling.tests.home.adapter.TestHomeAdapter import com.yidianling.tests.home.adapter.TestHomeAdapter
...@@ -97,8 +97,23 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac ...@@ -97,8 +97,23 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac
img_mine.setOnClickListener { img_mine.setOnClickListener {
(testHomeEvent as TestHomeEventImpl).jumpMine() (testHomeEvent as TestHomeEventImpl).jumpMine()
} }
initStatus()
} }
/**
* 初始化状态栏位置
*/
private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
StatusBarUtils.setTransparentForImageView(this, null)
val statusBarHeight = StatusBarUtils.getStatusBarHeight(this)
val lp1 = rl_tests_title_layout.layoutParams as LinearLayout.LayoutParams
lp1.height = (RxImageTool.dp2px(48f) + statusBarHeight)
rl_tests_title_layout.setPadding(0, statusBarHeight, 0, 0)
}
}
//路由传递过来的参数 //路由传递过来的参数
private fun getRouterParam() { private fun getRouterParam() {
if (null != intent && intent.hasExtra("routerParam")) { if (null != intent && intent.hasExtra("routerParam")) {
...@@ -112,7 +127,7 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac ...@@ -112,7 +127,7 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac
private fun initAdapter() { private fun initAdapter() {
swipe_refresh_layout.setOnRefreshListener(this) swipe_refresh_layout.setOnRefreshListener(this)
swipe_refresh_layout.setColorSchemeColors(ContextCompat.getColor(this, R.color.platform_main_theme_blue)) swipe_refresh_layout.setColorSchemeColors(ContextCompat.getColor(this, R.color.tests_main_theme))
mLayoutManager = LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false) mLayoutManager = LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)
recyclerview.layoutManager = mLayoutManager recyclerview.layoutManager = mLayoutManager
if (null == mTestHomeAdapter) { if (null == mTestHomeAdapter) {
......
...@@ -10,7 +10,6 @@ import com.ydl.ydl_router.manager.YDLRouterParams ...@@ -10,7 +10,6 @@ import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.BuryPointUtils
import com.yidianling.router.RouterManager
import com.yidianling.tests.list.view.TestCategoryListActivity import com.yidianling.tests.list.view.TestCategoryListActivity
import com.yidianling.tests.router.TestsIn import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity import com.yidianling.tests.search.TestSearchActivity
...@@ -122,7 +121,7 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent { ...@@ -122,7 +121,7 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
if ("ceshi" == uri.host) { if ("ceshi" == uri.host) {
val id = uri.getQueryParameter("id") val id = uri.getQueryParameter("id")
// YDLRouterManager.router(IYDLRouterConstant.ROUTER_TEST_DETAIL, YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_ID, id)) // YDLRouterManager.router(IYDLRouterConstant.ROUTER_TEST_DETAIL, YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_ID, id))
RouterManager.getTestsRouter()?.testDetailH5(id) TestsIn.getTestsImpl().testDetailH5(id)
} }
} else if (linkUrl.startsWith("http")) { } else if (linkUrl.startsWith("http")) {
YDLRouterManager.router( YDLRouterManager.router(
......
...@@ -14,13 +14,11 @@ import com.ydl.ydlcommon.bean.StatusBarOptions ...@@ -14,13 +14,11 @@ import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.DisplayUtils import com.ydl.ydlcommon.utils.DisplayUtils
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.CategotyPopItem import com.yidianling.tests.list.model.bean.CategotyPopItem
import com.yidianling.tests.list.model.bean.TestCategory import com.yidianling.tests.list.model.bean.TestCategory
...@@ -308,8 +306,8 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA ...@@ -308,8 +306,8 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault)) tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
} else { } else {
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_google_green)) tv.setTextColor(ContextCompat.getColor(this, R.color.tests_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_green_18dp, 0) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.tests_ic_arrow_drop_down, 0)
} }
} }
......
...@@ -17,16 +17,12 @@ import com.ydl.ydlcommon.data.http.RxUtils ...@@ -17,16 +17,12 @@ 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.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.router.YdlCommonOut import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.router.RouterManager
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.TestRetrofitApi import com.yidianling.tests.TestRetrofitApi
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.Test import com.yidianling.tests.list.model.bean.Test
...@@ -110,7 +106,8 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test> ...@@ -110,7 +106,8 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
} }
fun fetchTestList() { fun fetchTestList() {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo() val loginBean = TestsIn.getYDLUserInfo()
var userId = loginBean?.userId ?: ""; var userId = loginBean?.userId ?: "";
disposable = TestRetrofitApi.getTestRetrofitApi() disposable = TestRetrofitApi.getTestRetrofitApi()
...@@ -173,12 +170,12 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test> ...@@ -173,12 +170,12 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
}else{ }else{
when (listType) { when (listType) {
1 -> { 1 -> {
RouterManager.getTestsRouter()?.testDetailH5(data.id.toString()) TestsIn.getTestsImpl().testDetailH5(data.id.toString())
} }
2 -> { 2 -> {
RouterManager.getTestsRouter()?.testH5Result(data.testResultId.toString()); TestsIn.getTestsImpl().testH5Result(data.testResultId.toString());
} }
else -> RouterManager.getTestsRouter()?.testDetailH5(data.id.toString()) else -> TestsIn.getTestsImpl().testDetailH5(data.id.toString())
} }
} }
} }
......
...@@ -34,7 +34,7 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context, ...@@ -34,7 +34,7 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context,
holder.tvSort.text = item.value holder.tvSort.text = item.value
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424)) holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424))
if (!TextUtils.isEmpty(lastSelectText) && item.value.equals(lastSelectText) && position!=0){ if (!TextUtils.isEmpty(lastSelectText) && item.value.equals(lastSelectText) && position!=0){
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_google_green)) holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.tests_main_theme))
lastSelectView = holder.tvSort lastSelectView = holder.tvSort
} }
} }
...@@ -49,7 +49,7 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context, ...@@ -49,7 +49,7 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context,
lastSelectView?.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424)) lastSelectView?.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424))
if (adapterPosition != 0){ if (adapterPosition != 0){
tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_google_green)) tvSort.setTextColor(ContextCompat.getColor(context, R.color.tests_main_theme))
} }
if (adapterPosition != RecyclerView.NO_POSITION){ if (adapterPosition != RecyclerView.NO_POSITION){
......
...@@ -2,10 +2,10 @@ package com.yidianling.tests.modular ...@@ -2,10 +2,10 @@ package com.yidianling.tests.modular
import android.content.Context import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydl_router.manager.YDLRouterManager import com.ydl.webview.H5Params
import com.ydl.ydl_router.manager.YDLRouterParams import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.tests.api.service.ITestsApiService import com.yidianling.tests.api.service.ITestsApiService
/** /**
...@@ -19,14 +19,12 @@ public class TestsApiServiceImp : ITestsApiService { ...@@ -19,14 +19,12 @@ public class TestsApiServiceImp : ITestsApiService {
} }
override fun testH5Result(testResultId: String) { override fun testH5Result(testResultId: String) {
YDLRouterManager.router( val h5Params = H5Params(HttpConfig.MH5_URL+"ceshi/result/"+testResultId, null)
IYDLRouterConstant.ROUTER_H5_H5, NewH5Activity.start(BaseApp.getApp(),h5Params)
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/result/"+testResultId),"")
} }
override fun testDetailH5(testId: String) { override fun testDetailH5(testId: String) {
YDLRouterManager.router( val h5Params = H5Params(HttpConfig.MH5_URL+"ceshi/"+testId, null)
IYDLRouterConstant.ROUTER_H5_H5, NewH5Activity.start(BaseApp.getApp(),h5Params)
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/"+testId),"")
} }
} }
\ No newline at end of file
...@@ -2,8 +2,13 @@ package com.yidianling.tests.router ...@@ -2,8 +2,13 @@ package com.yidianling.tests.router
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlUserInfo
import com.yidianling.router.RouterManager import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback import com.yidianling.router.im.IMRequestCallback
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.api.service.IUserService
/** /**
* author : Zhangwenchao * author : Zhangwenchao
...@@ -12,12 +17,23 @@ import com.yidianling.router.im.IMRequestCallback ...@@ -12,12 +17,23 @@ import com.yidianling.router.im.IMRequestCallback
*/ */
object TestsIn { object TestsIn {
fun getTestsImpl(): ITestsApiService {
return ModularServiceManager.provide(ITestsApiService::class.java)
}
fun isLogin(): Boolean { fun isLogin(): Boolean {
return RouterManager.getUserRouter()?.isLogin()?:false return ModularServiceManager.provide(IUserService::class.java).isLogin()
}
fun getYDLUserInfo(): YdlUserInfo? {
return ModularServiceManager.getPlatformUserService()?.getUser()
}
fun getUserInfo(): UserResponseBean.UserInfo? {
return ModularServiceManager.provide(IUserService::class.java).getUserInfo()
} }
fun loginWayIntent(activity: Activity): Intent? { fun loginWayIntent(activity: Activity): Intent? {
return RouterManager.getUserRouter()?.loginWayIntent(activity) return ModularServiceManager.provide(IUserService::class.java).loginWayIntent(activity)
} }
fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent? { fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent? {
......
...@@ -21,13 +21,13 @@ import com.ydl.ydlcommon.bean.StatusBarOptions ...@@ -21,13 +21,13 @@ import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.router.RouterManager
import com.yidianling.tests.R import com.yidianling.tests.R
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.utils.TestHomeUtils import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.RecommendSearchItemBean import com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import com.yidianling.tests.list.model.bean.Test import com.yidianling.tests.list.model.bean.Test
import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter
import com.yidianling.tests.router.TestsIn
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.tests_activity_test_search.* import kotlinx.android.synthetic.main.tests_activity_test_search.*
import kotlinx.android.synthetic.main.tests_item_hot_search.view.* import kotlinx.android.synthetic.main.tests_item_hot_search.view.*
...@@ -98,11 +98,11 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>( ...@@ -98,11 +98,11 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
hotSearchAdapter = TestListRecyclerAdapter(this, hotSearchedTestList, TestListRecyclerAdapter.PAGE_TYPE_SEARCH) hotSearchAdapter = TestListRecyclerAdapter(this, hotSearchedTestList, TestListRecyclerAdapter.PAGE_TYPE_SEARCH)
searchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data -> searchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
RouterManager.getTestsRouter()?.testDetailH5(data.id.toString()) TestsIn.getTestsImpl().testDetailH5(data.id.toString())
} }
hotSearchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data -> hotSearchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
RouterManager.getTestsRouter()?.testDetailH5(data.id.toString()) TestsIn.getTestsImpl().testDetailH5(data.id.toString())
} }
headerHotSearch = View.inflate(this, R.layout.tests_header_hot_search, null) as LinearLayout?; headerHotSearch = View.inflate(this, R.layout.tests_header_hot_search, null) as LinearLayout?;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true"> <item android:state_enabled="true" android:state_pressed="true">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<stroke android:width="1dp" android:color="@color/platform_google_green" /> <stroke android:width="1dp" android:color="@color/tests_main_theme" />
<corners android:radius="100dp"/> <corners android:radius="100dp"/>
<solid android:color="#cacaca"/> <solid android:color="#cacaca"/>
</shape> </shape>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<item android:state_enabled="true" android:state_pressed="false"> <item android:state_enabled="true" android:state_pressed="false">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<stroke android:width="1dp" android:color="@color/platform_google_green" /> <stroke android:width="1dp" android:color="@color/tests_main_theme" />
<corners android:radius="100dp"/> <corners android:radius="100dp"/>
<solid android:color="@color/white"/> <solid android:color="@color/white"/>
</shape> </shape>
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
<item android:state_enabled="true" android:state_pressed="true"> <item android:state_enabled="true" android:state_pressed="true">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="100dp"/> <corners android:radius="100dp"/>
<solid android:color="@color/platform_google_green_dark"/> <solid android:color="@color/tests_main_theme"/>
</shape> </shape>
</item> </item>
<item android:state_enabled="true" android:state_pressed="false"> <item android:state_enabled="true" android:state_pressed="false">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="100dp"/> <corners android:radius="100dp"/>
<solid android:color="@color/platform_google_green"/> <solid android:color="@color/tests_main_theme"/>
</shape> </shape>
</item> </item>
</selector> </selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true"> <item android:state_enabled="true" android:state_pressed="true">
<color android:color="@color/platform_google_green_dark" /> <color android:color="@color/tests_main_theme" />
</item> </item>
<item android:state_enabled="true" android:state_pressed="false"> <item android:state_enabled="true" android:state_pressed="false">
<color android:color="@color/platform_google_green" /> <color android:color="@color/tests_main_theme" />
</item> </item>
</selector> </selector>
\ No newline at end of file
...@@ -8,14 +8,14 @@ ...@@ -8,14 +8,14 @@
<item android:id="@android:id/secondaryProgress"> <item android:id="@android:id/secondaryProgress">
<clip> <clip>
<shape> <shape>
<solid android:color="@color/platform_google_green" /> <solid android:color="@color/tests_main_theme" />
</shape> </shape>
</clip> </clip>
</item> </item>
<item android:id="@android:id/progress"> <item android:id="@android:id/progress">
<clip> <clip>
<shape> <shape>
<solid android:color="@color/platform_google_green" /> <solid android:color="@color/tests_main_theme" />
</shape> </shape>
</clip> </clip>
</item> </item>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient <gradient
android:startColor="#56CCF2" android:startColor="@color/tests_main_theme_light"
android:endColor="#2F80ED" android:endColor="@color/tests_main_theme"
android:angle="0" /> android:angle="0" />
</shape> </shape>
\ No newline at end of file
...@@ -69,6 +69,7 @@ ...@@ -69,6 +69,7 @@
app:pa_tab_height="44dp" app:pa_tab_height="44dp"
app:pa_tab_indicator_margin="13dp" app:pa_tab_indicator_margin="13dp"
app:pa_tab_mode="scrollable" app:pa_tab_mode="scrollable"
app:pa_indicator_color="@color/tests_main_theme"
/> />
<LinearLayout <LinearLayout
......
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
android:id="@+id/tabLayout" android:id="@+id/tabLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="40dp"
app:tabIndicatorColor="@color/platform_google_green" app:tabIndicatorColor="@color/tests_main_theme"
app:tabMode="scrollable" app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_google_green" /> app:tabSelectedTextColor="@color/tests_main_theme" />
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
......
...@@ -12,6 +12,6 @@ ...@@ -12,6 +12,6 @@
android:orientation="vertical" android:orientation="vertical"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:paddingRight="15dp" android:paddingRight="15dp"
android:textColor="@color/platform_google_green" android:textColor="@color/tests_main_theme"
tools:text="自闭症" /> tools:text="自闭症" />
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"> android:orientation="vertical"
>
<include
layout="@layout/tests_testhome_bar"
android:layout_width="match_parent"
android:layout_height="48dp" />
<android.support.v4.widget.SwipeRefreshLayout <android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout" android:id="@+id/swipe_refresh_layout"
...@@ -20,10 +26,6 @@ ...@@ -20,10 +26,6 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:visibility="gone" /> android:visibility="gone" />
<include layout="@layout/tests_testhome_bar" />
</FrameLayout> </FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout> </android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout> </LinearLayout>
...@@ -3,14 +3,15 @@ ...@@ -3,14 +3,15 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="162dp" android:layout_height="114dp"
android:background="@drawable/tests_testhome_bg" /> android:background="@drawable/tests_testhome_bg" />
<android.support.v7.widget.CardView xmlns:app="http://schemas.android.com/apk/res-auto" <android.support.v7.widget.CardView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginTop="54dp" android:layout_marginTop="6dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
app:cardCornerRadius="6dp" app:cardCornerRadius="6dp"
app:cardElevation="2dp"> app:cardElevation="2dp">
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:orientation="horizontal"> android:orientation="horizontal"
android:id="@+id/rl_tests_title_layout"
<View android:background="@drawable/tests_testhome_bg"
android:id="@+id/v_bg" >
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/tests_testhome_bg" />
<LinearLayout <LinearLayout
android:id="@+id/ll_bar_root" android:id="@+id/ll_bar_root"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="match_parent"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
...@@ -55,4 +52,4 @@ ...@@ -55,4 +52,4 @@
android:padding="5dp" android:padding="5dp"
android:src="@drawable/tests_testhome_mine" /> android:src="@drawable/tests_testhome_mine" />
</LinearLayout> </LinearLayout>
</FrameLayout> </RelativeLayout>
...@@ -3,16 +3,5 @@ ...@@ -3,16 +3,5 @@
<!--主题色--> <!--主题色-->
<color name="tests_main_theme">#fdbd00</color> <color name="tests_main_theme">#fdbd00</color>
<!--主题浅色--> <!--主题浅色-->
<color name="tests_main_theme_light">#FFEC8C</color> <color name="tests_main_theme_light">#FCDA42</color>
<!--主题亮色-->
<color name="tests_main_theme_bright">#fffae0</color>
<!--确认按钮背景颜色-->
<color name="tests_confirm_bg_color">#FFDD33</color>
<!--确认按钮字体颜色-->
<color name="tests_confirm_text_color">#242424</color>
<!--确认按钮提示字体颜色-->
<color name="tests_confirm_text_hint_color">#666666</color>
<!--筛选条件选择框字体颜色-->
<color name="tests_filter_content_text_color_en">#242424</color>
<color name="tests_filter_content_text_color_un">#555555</color>
</resources> </resources>
...@@ -3,16 +3,5 @@ ...@@ -3,16 +3,5 @@
<!--主题色--> <!--主题色-->
<color name="tests_main_theme">#1da1f2</color> <color name="tests_main_theme">#1da1f2</color>
<!--主题浅色--> <!--主题浅色-->
<color name="tests_main_theme_light">#60BDF5</color> <color name="tests_main_theme_light">#56CCF2</color>
<!--主题亮色-->
<color name="tests_main_theme_bright">#E8F6FF</color>
<!--确认按钮背景颜色-->
<color name="tests_confirm_bg_color">#1da1f2</color>
<!--确认按钮颜色-->
<color name="tests_confirm_text_color">#ffffff</color>
<!--确认提示颜色-->
<color name="tests_confirm_text_hint_color">#60ffffff</color>
<!--筛选条件选择框字体颜色-->
<color name="tests_filter_content_text_color_en">#1da1f2</color>
<color name="tests_filter_content_text_color_un">#242424</color>
</resources> </resources>
...@@ -14,7 +14,7 @@ import android.text.method.LinkMovementMethod ...@@ -14,7 +14,7 @@ import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan import android.text.style.ClickableSpan
import android.view.View import android.view.View
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.router.YdlCommonRouterManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.R import com.yidianling.user.R
...@@ -111,7 +111,7 @@ class PrivacyDialog : Dialog { ...@@ -111,7 +111,7 @@ class PrivacyDialog : Dialog {
if (UserHelper.getUserInfo() != null && !TextUtils.isEmpty(UserHelper.getUserInfo()!!.uid)) { if (UserHelper.getUserInfo() != null && !TextUtils.isEmpty(UserHelper.getUserInfo()!!.uid)) {
uid = UserHelper.getUserInfo()!!.uid!! uid = UserHelper.getUserInfo()!!.uid!!
} else { } else {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo() val loginBean = ModularServiceManager.getPlatformUserService()?.getUser()
if (loginBean != null) { if (loginBean != null) {
uid = loginBean.userId uid = loginBean.userId
} }
......
...@@ -38,8 +38,6 @@ interface IYdlCommonRouter { ...@@ -38,8 +38,6 @@ interface IYdlCommonRouter {
fun startP2PXiaoYi(context: Context) fun startP2PXiaoYi(context: Context)
fun isLogin(): Boolean
fun getUid(): Int fun getUid(): Int
fun getAccessToken(): String? fun getAccessToken(): String?
......
package com.ydl.webview
import android.net.Uri
import android.text.TextUtils
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydl_router.util.YDLRouterUtils
import com.yidianling.common.tools.LogUtil
import java.io.UnsupportedEncodingException
import java.net.URLDecoder
/**
* Created by haorui on 2019-10-13.
* Des:使用接口返回的 router 链接打开H5页面
*/
object H5RouterUtils {
/**
* 完整的 router 链接
*/
fun tempH5Route(linkUrl: String?) {
if (TextUtils.isEmpty(linkUrl)) {
return
}
val linkUri = Uri.parse(linkUrl)
if (linkUri != null) {
val host = linkUri.host
if (!TextUtils.isEmpty(host) && host == "h5") {
//如果是h5,跳转至NewH5Activity
try {
var params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8")
ARouter.getInstance().build("/new_h5/h5").withSerializable("routerParam", params).navigation()
return
}catch (e : NullPointerException){
LogUtil.e("params参数为空")
}catch (e : UnsupportedEncodingException){
LogUtil.e("解码错误")
}catch (e : UnsupportedOperationException){
LogUtil.e("这不是一个uri格式的地址")
}
return
}
}
YDLRouterManager.router(linkUrl)
}
fun tempH5Route(linkUrl: String?, params: YDLRouterParams?, callBack: String?) {
if (TextUtils.isEmpty(linkUrl)) {
return
}
val newUrl = linkUrl + YDLRouterUtils.ergodic(params) + "&callback=" + callBack
val linkUri = Uri.parse(newUrl)
if (linkUri != null) {
val host = linkUri.host
if (!TextUtils.isEmpty(host) && host == "h5") {
//如果是h5,跳转至NewH5Activity
try {
var params = URLDecoder.decode(linkUri.getQueryParameter("params"),"UTF-8")
ARouter.getInstance().build("/new_h5/h5").withSerializable("routerParam", params).navigation()
return
}catch (e : NullPointerException){
LogUtil.e("params参数为空")
}catch (e : UnsupportedEncodingException){
LogUtil.e("解码错误")
}catch (e : UnsupportedOperationException){
LogUtil.e("这不是一个uri格式的地址")
}
return
}
}
YDLRouterManager.router(linkUrl, params)
}
}
...@@ -28,9 +28,6 @@ class WebModularServiceUtils { ...@@ -28,9 +28,6 @@ class WebModularServiceUtils {
fun startMain(activity: Activity){ fun startMain(activity: Activity){
YdlCommonRouterManager.getYdlCommonRoute().startMain(activity,false) YdlCommonRouterManager.getYdlCommonRoute().startMain(activity,false)
// ARouter.getInstance().build("/main/main")
// .withFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
// .navigation()
} }
} }
} }
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