Commit 51ff6dd2 authored by wanglei's avatar wanglei

...上报

parent aa8dfc3f
...@@ -4,6 +4,8 @@ import android.app.Dialog ...@@ -4,6 +4,8 @@ import android.app.Dialog
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.viewbinding.ViewBinding import androidx.viewbinding.ViewBinding
import com.didi.drouter.api.DRouter
import com.koko.drouter.event.EventService
abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
private val TAG = "BaseActivity" private val TAG = "BaseActivity"
...@@ -18,11 +20,17 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() { ...@@ -18,11 +20,17 @@ abstract class BaseActivity<T : ViewBinding> : AppCompatActivity() {
launcher = ActivityLauncher(this) launcher = ActivityLauncher(this)
setContentView(binding.root) setContentView(binding.root)
eventActivity()
// EventUtils.event("page_${javaClass.simpleName}") // EventUtils.event("page_${javaClass.simpleName}")
initView() initView()
initListener() initListener()
} }
private fun eventActivity() {
val eventService = DRouter.build(EventService::class.java).getService()
eventService.eventActivity(this)
}
protected abstract fun initView() protected abstract fun initView()
protected open fun initListener() {} protected open fun initListener() {}
......
package com.koko.drouter.event
import android.app.Activity
interface EventService {
fun eventActivity(activity: Activity) = Unit
}
\ No newline at end of file
package com.base.appzxhy.drouterimp
import android.app.Activity
import com.base.appzxhy.helper.EventUtils
import com.didi.drouter.annotation.Service
import com.koko.drouter.app.AppService
import com.koko.drouter.event.EventService
@Service(function = [EventService::class])
class EventServiceImp : EventService {
override fun eventActivity(activity: Activity) {
super.eventActivity(activity)
EventUtils.event("page_${javaClass.simpleName}")
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment