Commit ef62f674 by 徐健

backup

parents 5e49bf67 4c78958e
......@@ -155,7 +155,7 @@ ext {
"bugly-crashreport" : 'com.tencent.bugly:crashreport:2.8.6.0',
"bugly-nativecrashreport" : 'com.tencent.bugly:nativecrashreport:3.6.0.1',
"ydl-image" : 'com.ydl:ydl-image:1.0.7-SNAPSHOT@aar',
"ydl-pushagent" : 'com.ydl:ydl-pushagent:0.1.8',
"ydl-pushagent" : 'com.ydl:ydl-pushagent:0.1.9',
"ydl-notracepoint" : 'com.ydl:notracepoint-lib:0.1.8@aar',
"ydl-js" : 'com.ydl:ydl-js:1.0.7-SNAPSHOT@aar',
"ydl-router" : 'com.ydl:ydl-router:1.3.2-SNAPSHOT@aar',
......@@ -170,6 +170,8 @@ ext {
"ydl-utils" : 'com.ydl:ydl-utils:0.0.2',
"ydl-net" : 'com.ydl:ydl-net:0.0.1',
"ydl-user-router" : 'com.ydl:router:1.0.0-SNAPSHOT@aar',
"ydl-device" : 'com.ydl:device-id:0.0.7@aar',
//功能组件
"ydl-platform" : 'com.ydl:ydl-platform:0.0.15@aar',
......@@ -181,6 +183,7 @@ ext {
"ydl-m-user-api" : 'com.ydl:m-user-api:0.0.5',
"ydl-m-muse-api" : 'com.ydl:m-muse-api:0.0.1',
"ydl-m-fm-api" : 'com.ydl:m-fm-api:0.0.2',
"ydl-m-fm-module-ydl" : 'com.ydl:m-fm-module-ydl:0.0.6@aar'
"ydl-m-fm-module-ydl" : 'com.ydl:m-fm-module-ydl:0.0.6@aar',
"ydl-m-tests-api" : 'com.ydl:m-tests-api:0.0.1',
]
}
modular {
packageName "com.ydl.audioim"
// 模块发布需要的参数
publish {
api {
//发布信息 module/api 通用
groupId = "com.ydl"
artifactId = "m-audioim-api"
version = "0.0.1"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
package com.ydl.audioim
//import com.ydl.audioim.api.IAVRouter
//class AVRouterImpl: IAVRouter {
// override fun loginAgora(userId: String?) {
// YDLavManager.instances.login(userId)
// }
//
//}
\ No newline at end of file
package com.ydl.audioim
import com.ydl.audioim.api.AudioImApi
/**
* 模块对外提供接口的实现类
*/
class AudioImImpl: AudioImApi {
override fun loginAgora(userId: String?) {
YDLavManager.instances.login(userId)
}
}
\ No newline at end of file
package com.ydl.audioim.api
/**
* 对外api接口
*/
interface AudioImApi {
/**
* 登录声网Im
*/
fun loginAgora(uid:String?)
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-confide-module-xlzx"
// 上报的业务模块 aar 包的版本号
version = "0.0.8"
version = "0.0.9"
}
ydl{
......@@ -16,7 +16,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-confide-module-ydl"
// 上报的业务模块 aar 包的版本号
version = "0.0.8"
version = "0.0.9"
}
}
......
......@@ -35,7 +35,7 @@ class ConfideHomeHttpImpl private constructor(): IConfideHomeHttp{
override fun confideHomeRequest(): Observable<BaseAPIResponse<MutableList<ConfideHomeDataBean>>> {
return RxUtils.mapObservable(ConfideHomeParam(0))
.flatMap {
confideHomeApi.confideHome(HttpConfig.SERVER_API_JAVA_URL+"auth/listen/home")
confideHomeApi.confideHome(HttpConfig.JAVA_BASE_URL+"auth/listen/home")
}
}
......@@ -61,7 +61,7 @@ class ConfideHomeHttpImpl private constructor(): IConfideHomeHttp{
val confideParam = sb.toString()
return RxUtils.mapObservable(param)
.flatMap {
confideHomeApi.recommedChange(HttpConfig.SERVER_API_JAVA_URL + "auth/listen/search?"+confideParam)
confideHomeApi.recommedChange(HttpConfig.JAVA_BASE_URL + "auth/listen/search?"+confideParam)
}
}
......
......@@ -2,6 +2,7 @@ package com.yidianling.consultant.adapter
import android.annotation.SuppressLint
import android.content.Context
import android.support.v4.content.ContextCompat
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
......@@ -12,9 +13,9 @@ import android.widget.ImageView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.URLUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
......@@ -127,6 +128,14 @@ class ExpertSearchAdapter(private val context: Context, private val expertSearch
else{
holder.imgAbilityLevel.visibility = View.GONE
}
//活动图标
if (!TextUtils.isEmpty(itemBean.activityImg)){
holder.imgActivity.visibility = View.VISIBLE
GlideApp.with(context).load(itemBean.activityImg).into(holder.imgActivity)
// GlideApp.with(context).load("https://video.ydlcdn.com/2019/11/04/abdd3782c98939d0406080a6a80b8ea5.jpg").into(holder.imgActivity)
}else{
holder.imgActivity.visibility = View.GONE
}
//公益图标
if (1 == itemBean.hasServiceFree){
if (null != itemBean.tagsIcon && !TextUtils.isEmpty(itemBean.tagsIcon.serviceFreeIcon)){
......@@ -196,6 +205,16 @@ class ExpertSearchAdapter(private val context: Context, private val expertSearch
// holder.tvSaleDurationForMonth.visibility = View.GONE
// holder.tvSaleDurationForMonthContent.visibility = View.GONE
// }
//私聊文案
if (TextUtils.isEmpty(itemBean.chatBtnText)){
holder.tvChat.text = "私聊"
holder.tvChat.setTextColor(ContextCompat.getColor(context,R.color.white))
holder.tvChat.background = ContextCompat.getDrawable(context,R.drawable.consultant_expert_search_chat)
}else{
holder.tvChat.text = itemBean.chatBtnText
holder.tvChat.setTextColor(ContextCompat.getColor(context,R.color.platform_color_999999))
holder.tvChat.background = ContextCompat.getDrawable(context,R.drawable.consultant_expert_search_chat_rest)
}
//月售时长
val durationStringBuffer = StringBuffer()
holder.tvSaleDurationForMonth.text = durationStringBuffer.append(itemBean.saleDurationForMonth.toInt()).append("").toString()
......@@ -269,6 +288,8 @@ class ExpertSearchAdapter(private val context: Context, private val expertSearch
val imgHead = itemView.imgHead!!
//专家姓名
val tvName = itemView.tvName!!
//活动图标
val imgActivity = itemView.img_activity!!
//优质图标
val imgAbilityLevel = itemView.imgAbilityLevel!!
//公益图标
......@@ -332,7 +353,7 @@ class ExpertSearchAdapter(private val context: Context, private val expertSearch
itemView.tvChat.setOnClickListener {
if (adapterPosition != RecyclerView.NO_POSITION) {
//判断是否已登录
if(!YdlCommonRouterManager.getYdlCommonRoute().isLogin()){
if(!ConsultantIn.getUserImpl().isLogin()){
TempH5RouteUtils.tempH5Route(IYDLRouterConstant.ROUTER_MINE_LOGIN)
return@setOnClickListener
}
......
......@@ -42,8 +42,16 @@ data class DoctorServiceItem(/**
* 有免费咨询:1.有,2.无
*/
val hasServiceFree : Int?,
/**
* 活动图标
*/
val activityImg:String?,
/**
* 是否参加活动
*/
val joinActivity: Boolean?,
/**
* 是否新入驻:true:是,false:否
* 是否新入驻:true:是,false:否
*/
var isNewEnter : Boolean = false,
/**
......@@ -109,5 +117,9 @@ data class DoctorServiceItem(/**
/**
* 市
*/
val city : String?
val city : String?,
/**
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
*/
val chatBtnText : String?
)
\ No newline at end of file
......@@ -4,7 +4,9 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.support.v7.app.AppCompatActivity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.router.RouterManager
import com.yidianling.user.api.service.IUserService
/**
* author : Zhangwenchao
......@@ -26,4 +28,8 @@ object ConsultantIn {
return RouterManager.getAppRouter()?.mainIntent(activity)
}
fun getUserImpl(): IUserService {
return ModularServiceManager.provide(IUserService::class.java)
}
}
\ No newline at end of file
......@@ -2,7 +2,12 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:startColor="#FFDB14"
android:endColor="#FFDB26"/>
<corners android:radius="@dimen/platform_dp_13"/>
android:startColor="@color/consultant_chat_start_color"
android:endColor="@color/consultant_chat_end_color"/>
<padding
android:bottom="@dimen/platform_dp_3"
android:left="@dimen/platform_dp_10"
android:right="@dimen/platform_dp_10"
android:top="@dimen/platform_dp_3" />
<corners android:radius="@dimen/platform_dp_13" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="180"
android:startColor="#F0F0F0"
android:endColor="#F0F0F0"/>
<corners android:radius="@dimen/platform_dp_13" />
<padding
android:bottom="@dimen/platform_dp_3"
android:left="@dimen/dp_10"
android:right="@dimen/dp_10"
android:top="@dimen/platform_dp_3" />
<stroke android:color="#F0F0F0"/>
</shape>
\ No newline at end of file
......@@ -13,7 +13,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_15"
android:layout_marginLeft="1.5dp"
android:padding="0.5dp"
android:background="@drawable/consultant_bg_radius_line_gray_05"
android:orientation="vertical">
......@@ -35,25 +34,31 @@
<ImageView
android:id="@+id/imgHead_online"
android:layout_width="62dp"
android:layout_height="18dp"
android:layout_height="14dp"
android:layout_gravity="bottom"
android:scaleType="centerCrop"
android:layout_alignBottom="@+id/cvHead"
app:srcCompat="@drawable/consultant_online_yue"
android:layout_marginLeft="@dimen/platform_dp_2"
tools:visibility="visible"
android:layout_marginBottom="@dimen/platform_dp_05"
android:visibility="gone"/>
<ImageView
android:id="@+id/imgHead_online_server"
android:layout_width="42dp"
android:layout_height="18dp"
android:layout_width="41dp"
android:layout_height="14dp"
android:layout_gravity="bottom"
android:scaleType="centerCrop"
android:layout_alignBottom="@+id/cvHead"
app:srcCompat="@drawable/consultant_online_server"
android:layout_marginLeft="@dimen/platform_dp_2"
tools:visibility="visible"
android:layout_marginBottom="@dimen/platform_dp_05"
android:visibility="gone"/>
<!--咨询师姓名-->
<TextView
android:id="@+id/tvName"
......@@ -82,6 +87,13 @@
android:layout_alignBottom="@+id/tvName"
android:layout_toEndOf="@+id/tvName"
android:layout_marginStart="@dimen/platform_dp_2">
<!--活动图标-->
<ImageView
android:id="@+id/img_activity"
android:layout_width="42dp"
android:layout_height="12dp"
android:layout_marginStart="@dimen/dp_4"
android:visibility="gone"/>
<!--公益图标-->
<ImageView
android:id="@+id/imgServiceFree"
......@@ -339,7 +351,7 @@
<!--私聊-->
<TextView
android:id="@+id/tvChat"
android:layout_width="58dp"
android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_24"
android:layout_alignBottom="@+id/cvHead"
android:layout_alignParentRight="true"
......@@ -347,7 +359,7 @@
android:textSize="@dimen/platform_dp_13"
android:textStyle="bold"
android:background="@drawable/consultant_expert_search_chat"
android:textColor="@color/platform_color_242424"
android:textColor="@color/consultant_confirm_text_color"
android:text="私聊"/>
<!--描述-->
......
......@@ -15,4 +15,9 @@
<!--筛选条件选择框字体颜色-->
<color name="consultant_filter_content_text_color_en">#242424</color>
<color name="consultant_filter_content_text_color_un">#555555</color>
<!--私聊按钮背景颜色-->
<color name="consultant_chat_start_color">#ffd814</color>
<color name="consultant_chat_end_color">#ffdb26</color>
</resources>
......@@ -15,4 +15,7 @@
<!--筛选条件选择框字体颜色-->
<color name="consultant_filter_content_text_color_en">#1da1f2</color>
<color name="consultant_filter_content_text_color_un">#242424</color>
<!--私聊按钮背景颜色-->
<color name="consultant_chat_start_color">#23B2FA</color>
<color name="consultant_chat_end_color">#1DA1F2</color>
</resources>
......@@ -76,9 +76,11 @@ dependencies {
api project(':ydl-webview')
api project(':ydl-platform')
implementation modularPublication('com.ydl:m-test-api')
implementation modularPublication('com.ydl:m-user-api')
}else {
//发布时使用
implementation modularPublication('com.ydl:m-test-api')
compileOnly rootProject.ext.dependencies["ydl-m-tests-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
......@@ -24,13 +24,12 @@ modular {
groupId = "com.ydl"
artifactId = "m-tests-api"
//开发时注释掉版本号,发布api时打开
//version = "0.0.1"
version = "0.0.1"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
implementation 'de.greenrobot:eventbus:2.4.0'
}
}
}
......
......@@ -21,6 +21,8 @@
<!--测评首页-->
<activity
android:name=".home.TestHomeActivity"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:theme="@style/tests_NoTitleTheme"
/>
</application>
</manifest>
package com.yidianling.tests.home
import android.os.Build
import android.support.v4.content.ContextCompat
import android.support.v4.widget.SwipeRefreshLayout
import android.support.v7.widget.LinearLayoutManager
import android.support.v7.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLAsyncUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.*
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.RxImageTool
import com.yidianling.tests.R
import com.yidianling.tests.home.adapter.AdapterWrapper
import com.yidianling.tests.home.adapter.TestHomeAdapter
......@@ -97,8 +97,23 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac
img_mine.setOnClickListener {
(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() {
if (null != intent && intent.hasExtra("routerParam")) {
......@@ -112,7 +127,7 @@ class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContrac
private fun initAdapter() {
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)
recyclerview.layoutManager = mLayoutManager
if (null == mTestHomeAdapter) {
......
......@@ -10,7 +10,6 @@ import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.yidianling.router.RouterManager
import com.yidianling.tests.list.view.TestCategoryListActivity
import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity
......@@ -122,7 +121,7 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
if ("ceshi" == uri.host) {
val id = uri.getQueryParameter("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")) {
YDLRouterManager.router(
......
......@@ -14,13 +14,11 @@ import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.DisplayUtils
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.tests.R
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.CategotyPopItem
import com.yidianling.tests.list.model.bean.TestCategory
......@@ -308,8 +306,8 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
} else {
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_google_green))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_green_18dp, 0)
tv.setTextColor(ContextCompat.getColor(this, R.color.tests_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.tests_ic_arrow_drop_down, 0)
}
}
......
......@@ -17,16 +17,12 @@ import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.ToastUtil
import com.yidianling.router.RouterManager
import com.yidianling.tests.R
import com.yidianling.tests.TestRetrofitApi
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.Test
......@@ -110,7 +106,8 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
}
fun fetchTestList() {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
val loginBean = TestsIn.getYDLUserInfo()
var userId = loginBean?.userId ?: "";
disposable = TestRetrofitApi.getTestRetrofitApi()
......@@ -173,12 +170,12 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
}else{
when (listType) {
1 -> {
RouterManager.getTestsRouter()?.testDetailH5(data.id.toString())
TestsIn.getTestsImpl().testDetailH5(data.id.toString())
}
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,
holder.tvSort.text = item.value
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424))
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
}
}
......@@ -49,7 +49,7 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context,
lastSelectView?.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424))
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){
......
......@@ -2,10 +2,10 @@ package com.yidianling.tests.modular
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.tests.api.service.ITestsApiService
/**
......@@ -19,14 +19,12 @@ public class TestsApiServiceImp : ITestsApiService {
}
override fun testH5Result(testResultId: String) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/result/"+testResultId),"")
val h5Params = H5Params(HttpConfig.MH5_URL+"ceshi/result/"+testResultId, null)
NewH5Activity.start(BaseApp.getApp(),h5Params)
}
override fun testDetailH5(testId: String) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/"+testId),"")
val h5Params = H5Params(HttpConfig.MH5_URL+"ceshi/"+testId, null)
NewH5Activity.start(BaseApp.getApp(),h5Params)
}
}
\ No newline at end of file
......@@ -2,8 +2,13 @@ package com.yidianling.tests.router
import android.app.Activity
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.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
......@@ -12,12 +17,23 @@ import com.yidianling.router.im.IMRequestCallback
*/
object TestsIn {
fun getTestsImpl(): ITestsApiService {
return ModularServiceManager.provide(ITestsApiService::class.java)
}
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? {
return RouterManager.getUserRouter()?.loginWayIntent(activity)
return ModularServiceManager.provide(IUserService::class.java).loginWayIntent(activity)
}
fun publishTrendIntent(activity: Activity, url: String, cover: String, title: String): Intent? {
......
......@@ -21,13 +21,13 @@ import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.ToastUtil
import com.yidianling.router.RouterManager
import com.yidianling.tests.R
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import com.yidianling.tests.list.model.bean.Test
import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter
import com.yidianling.tests.router.TestsIn
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.tests_activity_test_search.*
import kotlinx.android.synthetic.main.tests_item_hot_search.view.*
......@@ -98,11 +98,11 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
hotSearchAdapter = TestListRecyclerAdapter(this, hotSearchedTestList, TestListRecyclerAdapter.PAGE_TYPE_SEARCH)
searchAdapter?.onItemClickListener = MyBaseAdapter.OnItemClickListener { _, _, data ->
RouterManager.getTestsRouter()?.testDetailH5(data.id.toString())
TestsIn.getTestsImpl().testDetailH5(data.id.toString())
}
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?;
......
......@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<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"/>
<solid android:color="#cacaca"/>
</shape>
......@@ -10,7 +10,7 @@
<item android:state_enabled="true" android:state_pressed="false">
<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"/>
<solid android:color="@color/white"/>
</shape>
......
......@@ -3,14 +3,14 @@
<item android:state_enabled="true" android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="100dp"/>
<solid android:color="@color/platform_google_green_dark"/>
<solid android:color="@color/tests_main_theme"/>
</shape>
</item>
<item android:state_enabled="true" android:state_pressed="false">
<shape android:shape="rectangle">
<corners android:radius="100dp"/>
<solid android:color="@color/platform_google_green"/>
<solid android:color="@color/tests_main_theme"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<color android:color="@color/platform_google_green_dark" />
<color android:color="@color/tests_main_theme" />
</item>
<item android:state_enabled="true" android:state_pressed="false">
<color android:color="@color/platform_google_green" />
<color android:color="@color/tests_main_theme" />
</item>
</selector>
\ No newline at end of file
......@@ -8,14 +8,14 @@
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<solid android:color="@color/platform_google_green" />
<solid android:color="@color/tests_main_theme" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/platform_google_green" />
<solid android:color="@color/tests_main_theme" />
</shape>
</clip>
</item>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#56CCF2"
android:endColor="#2F80ED"
android:startColor="@color/tests_main_theme_light"
android:endColor="@color/tests_main_theme"
android:angle="0" />
</shape>
\ No newline at end of file
......@@ -69,6 +69,7 @@
app:pa_tab_height="44dp"
app:pa_tab_indicator_margin="13dp"
app:pa_tab_mode="scrollable"
app:pa_indicator_color="@color/tests_main_theme"
/>
<LinearLayout
......
......@@ -45,9 +45,9 @@
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabIndicatorColor="@color/platform_google_green"
app:tabIndicatorColor="@color/tests_main_theme"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/platform_google_green" />
app:tabSelectedTextColor="@color/tests_main_theme" />
<View
android:layout_width="match_parent"
......
......@@ -12,6 +12,6 @@
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:textColor="@color/platform_google_green"
android:textColor="@color/tests_main_theme"
tools:text="自闭症" />
<?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_height="match_parent"
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:id="@+id/swipe_refresh_layout"
......@@ -20,10 +26,6 @@
android:layout_height="match_parent"
android:visibility="gone" />
<include layout="@layout/tests_testhome_bar" />
</FrameLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</FrameLayout>
</LinearLayout>
......@@ -3,14 +3,15 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="162dp"
android:layout_height="114dp"
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_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="54dp"
android:layout_marginTop="6dp"
android:layout_marginRight="15dp"
app:cardCornerRadius="6dp"
app:cardElevation="2dp">
......
<?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_height="48dp"
android:orientation="horizontal">
<View
android:id="@+id/v_bg"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/tests_testhome_bg" />
android:orientation="horizontal"
android:id="@+id/rl_tests_title_layout"
android:background="@drawable/tests_testhome_bg"
>
<LinearLayout
android:id="@+id/ll_bar_root"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_height="match_parent"
android:orientation="horizontal">
<ImageView
......@@ -55,4 +52,4 @@
android:padding="5dp"
android:src="@drawable/tests_testhome_mine" />
</LinearLayout>
</FrameLayout>
</RelativeLayout>
......@@ -3,16 +3,5 @@
<!--主题色-->
<color name="tests_main_theme">#fdbd00</color>
<!--主题浅色-->
<color name="tests_main_theme_light">#FFEC8C</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>
<color name="tests_main_theme_light">#FCDA42</color>
</resources>
......@@ -3,16 +3,5 @@
<!--主题色-->
<color name="tests_main_theme">#1da1f2</color>
<!--主题浅色-->
<color name="tests_main_theme_light">#60BDF5</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>
<color name="tests_main_theme_light">#56CCF2</color>
</resources>
......@@ -14,7 +14,7 @@ import android.text.method.LinkMovementMethod
import android.text.style.ClickableSpan
import android.view.View
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.user.LoginUtils
import com.yidianling.user.R
......@@ -111,7 +111,7 @@ class PrivacyDialog : Dialog {
if (UserHelper.getUserInfo() != null && !TextUtils.isEmpty(UserHelper.getUserInfo()!!.uid)) {
uid = UserHelper.getUserInfo()!!.uid!!
} else {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
val loginBean = ModularServiceManager.getPlatformUserService()?.getUser()
if (loginBean != null) {
uid = loginBean.userId
}
......
......@@ -79,7 +79,10 @@ dependencies {
api rootProject.ext.dependencies["ydl-utils"]
api rootProject.ext.dependencies["ydl-flutter"]
api rootProject.ext.dependencies["ydl-net"]
api(rootProject.ext.dependencies["ydl-js"]) {
api ('com.ydl:device-id:0.0.7@aar'){
transitive = true
}
api(rootProject.ext.dependencies["ydl-device"]) {
transitive = true
}
api(rootProject.ext.dependencies["ydl-router"]) {
......
......@@ -5,6 +5,7 @@ import android.app.Application
import com.alibaba.android.arouter.launcher.ARouter
import com.lzy.imagepicker.ImagePicker
import com.lzy.imagepicker.view.CropImageView
import com.ydl.devicesidlib.DeviceIDHelper
import com.ydl.ydlcommon.actions.imagepicker.YdlImageLoader
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.log.LogHelper
......@@ -22,6 +23,7 @@ object YdlRepository {
// 需要在主 module 的 application 的 onCreate 方法中调用此方法
fun initApp(app: Application,isDebug:Boolean) {
DeviceIDHelper.getInstance().init(app.applicationContext)
LogHelper.getInstance().deleteExpireLogSync()
//初始化工具类
RxTool.init(app)
......
......@@ -70,6 +70,8 @@ abstract class BaseFragment : Fragment() ,IFragmentLifecycleable{
protected lateinit var rootView: View
fun getIsViewCreated() = isViewCreated
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
isViewCreated = true
......
......@@ -34,7 +34,7 @@ class PlatformRamImpl private constructor(): IPlatformRam {
var channel = WalleChannelReader.getChannel(YdlCommonOut.getApp())
if (channel.isNullOrEmpty()){
if (BaseApp.instance.getGlobalConfig().appFrom == YDLConstants.FROM_YDL){
channel="zhuzhan"
channel="android_zhuzhan"
}else{
channel="ATK_7_android_zhuzhan"
}
......
......@@ -11,11 +11,6 @@ import android.content.Context
*/
interface IYdlCommonRouter {
fun startChooseLoginWay(activity: Activity)
fun startPublishTrend(activity: Activity, url: String, cover: String, title: String)
fun publishArticleToTrend(activity: Activity, url: String, cover: String, title: String)
fun startMain(activity: Activity, isSplashActivity: Boolean)
......@@ -26,26 +21,8 @@ interface IYdlCommonRouter {
fun setMoreService(context: Context)
fun safeTipViewGone(): Boolean
fun setTrendsSafeTip(status: Boolean)
fun startPrivacy(context: Context)
fun errorAgainTime(): Long
fun getUserInfo(): YdlUserInfo?
fun startP2PXiaoYi(context: Context)
fun isLogin(): Boolean
fun getUid(): Int
fun getAccessToken(): String?
/**
* 清除未读数
*/
fun cleanUnReadNum()
}
\ No newline at end of file
......@@ -3,11 +3,12 @@ package com.ydl.ydlcommon.utils
import android.app.Activity
import android.app.Dialog
import android.os.Bundle
import android.text.method.ScrollingMovementMethod
import android.view.View
import android.view.ViewGroup
import com.yidianling.common.tools.RxDeviceTool
import com.ydl.ydlcommon.R
import com.ydl.ydlcommon.bean.VersionData
import com.yidianling.common.tools.RxDeviceTool
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import kotlinx.android.synthetic.main.platform_dialog_update_layout.*
......@@ -40,8 +41,11 @@ class ApkUpdateDialog : Dialog{
setContentView(R.layout.platform_dialog_update_layout)
tv_update_content.text = updateData?.title
tv_update_content.setMovementMethod(ScrollingMovementMethod.getInstance());
text_version.text = "v${updateData?.ver}"
text_desc.text = updateData?.content
text_desc.setMovementMethod(ScrollingMovementMethod.getInstance());
v_downpress.setSize(28,14,6,9,4)
v_downpress.setTextSize(10)
......
......@@ -2,6 +2,16 @@ package com.ydl.ydlcommon.utils
import android.app.ActivityManager
import android.content.Context
import com.ydl.ydlcommon.BuildConfig
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.base.config.YDLConstants.ENV_TEST
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.data.http.YdlCommonApi
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlCommonOut
import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxDeviceTool
/**
* Created by haorui on 2019/4/25.
......@@ -27,4 +37,29 @@ object AppUtils {
return isRunning
}
/**
* 获取http请求公用参数
*
*/
fun getHttpCommonParams():Map<String,Any>{
val mMap = mutableMapOf<String, Any>()
val appEnv = BaseApp.instance.getGlobalConfig().appEnv
val isTest = ENV_TEST == appEnv
val osBuild = "${RxDeviceTool.getBuildBrandModel()},${RxDeviceTool.getSDKVersionName()},${RxAppTool.getAppVersionName(
BaseApp.getApp()
)}"
val loginBean = ModularServiceManager.getPlatformUserService()?.getUser()
mMap["isDevelopment"] = isTest
mMap["uid"] = loginBean?.userId?:""
mMap["accessToken"] = loginBean?.token?:""
mMap["isFromApp"] = "1"
mMap["version"] = RxAppTool.getAppVersionName(BaseApp.getApp())
mMap["osBuild"] = osBuild
mMap["ffrom"] = PlatformDataManager.getRam().getChannelName()
mMap["osType"] = "android"
return mMap
}
}
\ No newline at end of file
package com.ydl.ydlcommon.utils;
import android.content.Context;
import com.ydl.burypointlib.BuryPointHelper;
import com.ydl.devicesidlib.DeviceIDHelper;
import com.ydl.pushserver.pushagent.YdlPushAgent;
import com.ydl.pushserver.pushagent.network.pack.RegisterEventBean;
import com.ydl.ydlcommon.BuildConfig;
import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.router.YdlCommonOut;
import com.yidianling.common.tools.RxAppTool;
......@@ -21,15 +25,17 @@ public class YdlBuryPointUtil {
public static void init(Context context1){
try {
context = context1;
if (BuildConfig.DEBUG){
String appEnv = BaseApp.instance.getGlobalConfig().getAppEnv();
boolean isTest = YDLConstants.ENV_TEST.equals(appEnv);
if (isTest){
YdlPushAgent.setDebugAdree("47.97.49.44",8094);
}
RegisterEventBean registerEventBean = new RegisterEventBean();
registerEventBean.setAppId(context.getPackageName());
registerEventBean.setAppVersion(RxAppTool.getAppVersionName(context));
String channelId = JPushUtils.INSTANCE.getRegistrationID();
registerEventBean.setDeviceId(channelId);
String deviceId = DeviceIDHelper.getInstance().getDeviceId();
registerEventBean.setDeviceId(deviceId);
registerEventBean.setManufacturer(RxDeviceTool.getBuildMANUFACTURER());
registerEventBean.setChannel(YdlCommonOut.Companion.getChannelName());
registerEventBean.setOs("Android");
......@@ -44,7 +50,7 @@ public class YdlBuryPointUtil {
YdlPushAgent.init(registerEventBean,BuildConfig.DEBUG);
BuryPointHelper.setDebug(BuildConfig.DEBUG,BuildConfig.DEBUG,true,BuildConfig.DEBUG);
BuryPointHelper.setDebug(isTest,false,true,BuildConfig.DEBUG);
BuryPointHelper.init();
}catch (Exception e){
......@@ -58,8 +64,8 @@ public class YdlBuryPointUtil {
RegisterEventBean registerEventBean = new RegisterEventBean();
registerEventBean.setAppId(context.getPackageName());
registerEventBean.setAppVersion(RxAppTool.getAppVersionName(context));
String channelId = JPushUtils.INSTANCE.getRegistrationID();
registerEventBean.setDeviceId(channelId);
String deviceId = DeviceIDHelper.getInstance().getDeviceId();
registerEventBean.setDeviceId(deviceId);
registerEventBean.setManufacturer(RxDeviceTool.getBuildMANUFACTURER());
registerEventBean.setChannel(YdlCommonOut.Companion.getChannelName());
registerEventBean.setOs("Android");
......@@ -84,8 +90,8 @@ public class YdlBuryPointUtil {
}
//click埋点
public static void sendClick(String eventId){
LogUtil.d(eventId);
YdlPushAgent.sendClickEvent(eventId);
public static void sendClick(String eventId,String... strings){
com.yidianling.common.tools.LogUtil.d(eventId);
YdlPushAgent.sendClickEvent(eventId,strings);
}
}
......@@ -7,6 +7,7 @@ import android.net.wifi.WifiManager
import android.text.TextUtils
import android.util.Log
import com.google.gson.Gson
import com.ydl.devicesidlib.DeviceIDHelper
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.data.http.api.ApiRequestUtil
......@@ -98,7 +99,8 @@ class ActionCountUtils {
actionDataParams.osVersion(android.os.Build.VERSION.RELEASE)
actionDataParams.wifi(if (isWifi()) 0 else 1)
actionDataParams.deviceId(DeviceTool.getIMEI())
actionDataParams.deviceId(DeviceIDHelper.getInstance().deviceId)
signs == null ?: signs.forEachIndexed { index, s ->
//拓展参数个数确定,暂不使用反射调用
......
......@@ -67,6 +67,8 @@
android:maxLines="3"
android:lineSpacingMultiplier="1.3"
android:textColor="#242424"
android:scrollbars="vertical"
android:fadeScrollbars="false"
tools:text="以下是 QQ8.1 体验版更新日志:项,提醒成员关注重要事件;\n2、群文件可创建文件夹,自定分类轻松;\n3、新增“群助手”,群消息自定义收起,消息管理更轻松。" />
<TextView
android:id="@+id/text_desc"
......@@ -77,6 +79,8 @@
android:maxLines="4"
android:lineSpacingMultiplier="1.3"
android:textColor="@color/platform_color_666666"
android:scrollbars="vertical"
android:fadeScrollbars="false"
tools:text="1.优化私聊功能\n2.咨询业务算法调整"/>
</LinearLayout>
......
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 {
fun startMain(activity: Activity){
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