Compare commits
32 Commits
pack/updat
...
feat/GHZSC
| Author | SHA1 | Date | |
|---|---|---|---|
| 9368d44093 | |||
| 6b04649c34 | |||
| 4497d03dbf | |||
| 287bbe7901 | |||
| fe8f9fcf83 | |||
| 0786342e00 | |||
| 1676f8bffb | |||
| 2e95a42f3c | |||
| da3b3360df | |||
| 080397e0d2 | |||
| 48d6533857 | |||
| 36bcf7f52a | |||
| da2b817d23 | |||
| afd0cce849 | |||
| 6970aedbd4 | |||
| df21c88ad2 | |||
| 7638296860 | |||
| 27058d5551 | |||
| 74b7bd8b47 | |||
| 539c9fb436 | |||
| bc57ba207c | |||
| 90b63b287f | |||
| 1233ff8458 | |||
| b75fd9cc9b | |||
| 6d992c77c7 | |||
| d5dc79f753 | |||
| 168f20a162 | |||
| 56151bc38d | |||
| b7a0f3e74b | |||
| c75a7444a9 | |||
| 0ae6279d60 | |||
| f4b54cbfa0 |
@ -2,7 +2,9 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android' // kotlin
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'therouter'
|
||||
|
||||
import groovy.xml.XmlUtil
|
||||
|
||||
@ -51,6 +53,10 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
ksp {
|
||||
arg("ROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
vectorDrawables.useSupportLibrary = true
|
||||
multiDexEnabled true
|
||||
@ -123,12 +129,6 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
// exclude 部分冗余的文件
|
||||
exclude 'META-INF/gradle/incremental.annotation.processors'
|
||||
@ -197,7 +197,7 @@ android {
|
||||
java.srcDirs = ['src/main/java', "src/default/java"]
|
||||
}
|
||||
internal {
|
||||
java.srcDirs = ['src/main/java', "src/default/java"]
|
||||
java.srcDirs = ['src/main/java', "src/default/java", "src/internal/java"]
|
||||
}
|
||||
tea {
|
||||
java.srcDirs = ['src/main/java', 'src/tea/java']
|
||||
@ -372,13 +372,15 @@ dependencies {
|
||||
// debugImplementation "com.gu.android:toolargetool:${toolargetool}" // 需要使用调试时才启用
|
||||
debugImplementation "com.github.nichbar:WhatTheStack:${whatTheStack}"
|
||||
|
||||
ksp project(":feature:route_doc")
|
||||
|
||||
implementation "androidx.multidex:multidex:${multiDex}"
|
||||
implementation "androidx.fragment:fragment-ktx:${fragment}"
|
||||
|
||||
implementation "androidx.annotation:annotation:${annotation}"
|
||||
|
||||
implementation "androidx.viewpager2:viewpager2:${viewpager2}"
|
||||
kapt "androidx.room:room-compiler:${room}"
|
||||
ksp("androidx.room:room-compiler:${room}")
|
||||
|
||||
implementation "com.tencent.vasdolly:helper:${apkChannelPackage}"
|
||||
implementation "com.tencent.vasdolly:writer:${apkChannelPackage}"
|
||||
@ -428,7 +430,8 @@ dependencies {
|
||||
|
||||
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:${desugarJdkLibs}"
|
||||
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
ksp "cn.therouter:apt:${routerVersion}"
|
||||
|
||||
implementation project(':ndownload')
|
||||
implementation project(':vspace-bridge:vspace')
|
||||
@ -446,13 +449,13 @@ dependencies {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
|
||||
implementation(project(':module_setting')) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
// implementation(project(':module_setting')) {
|
||||
// exclude group: 'androidx.swiperefreshlayout'
|
||||
// }
|
||||
|
||||
// implementation(project(':module_setting_compose')) {
|
||||
// exclude group: 'androidx.swiperefreshlayout'
|
||||
// }
|
||||
implementation(project(':module_setting_compose')) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
|
||||
if (!gradle.ext.excludeOptionalModules || gradle.ext.enablePkg) {
|
||||
implementation(project(':feature:pkg'))
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
-keep class com.gh.gamecenter.db.info.* {*;}
|
||||
-keep class com.gh.gamecenter.entity.** {<fields>;}
|
||||
-keep class com.gh.gamecenter.qa.entity.** {<fields>;}
|
||||
-keep class com.gh.gamecenter.gamedetail.entity.** {<fields>;}
|
||||
-keep class com.gh.download.DownloadDataSimpleEntity {<fields>;}
|
||||
-keep class com.gh.gamecenter.floatingwindow.FloatingWindowEntity {<fields>;}
|
||||
-keep class com.gh.gamecenter.BR
|
||||
|
||||
@ -638,7 +638,7 @@
|
||||
<!-- android:theme="@android:style/Theme.Translucent" />-->
|
||||
|
||||
<activity
|
||||
android:name="com.gh.gamecenter.SkipActivity"
|
||||
android:name="com.gh.gamecenter.SkipCompatActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.AppCompat.Light.Fullscreen.Transparent">
|
||||
<intent-filter>
|
||||
|
||||
@ -12,7 +12,7 @@ import android.widget.FrameLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.TheRouter
|
||||
import com.facebook.drawee.view.SimpleDraweeView
|
||||
import com.gh.common.exposure.ExposureManager
|
||||
import com.gh.common.util.DirectUtils.directToLinkPage
|
||||
@ -94,8 +94,7 @@ object AdDelegateHelper {
|
||||
private fun initAdSdkInternal(context: Context) {
|
||||
// 初始化穿山甲
|
||||
if (mCsjAdImpl == null) {
|
||||
mCsjAdImpl =
|
||||
ARouter.getInstance().build(RouteConsts.provider.csjAd).navigation() as? ICsjAdProvider
|
||||
mCsjAdImpl = TheRouter.get(ICsjAdProvider::class.java)
|
||||
val csjAppId = if (EnvHelper.isDevEnv) BuildConfig.DEV_CSJ_APPID else BuildConfig.CSJ_APPID
|
||||
mCsjAdImpl?.initSDK(context, csjAppId, HaloApp.getInstance().oaid)
|
||||
// 监听亮色/暗色模式切换
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
package com.gh.ad
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewStub
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.provider.ILaunchAd
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge
|
||||
import com.gh.gamecenter.common.utils.goneIf
|
||||
@ -15,10 +12,8 @@ import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
import com.gh.gamecenter.entity.AdConfig
|
||||
|
||||
@Route(path = RouteConsts.provider.vaAd, name = "畅玩启动页广告")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class LaunchAdImpl : ILaunchAd {
|
||||
override fun init(context: Context?) {
|
||||
}
|
||||
|
||||
override fun requestAd(fragment: Fragment, container: ViewGroup, maskView: View, topViewStub: ViewStub, bottomViewStub: ViewStub, adClickAction: () -> Unit): View {
|
||||
if (AdDelegateHelper.shouldShowHelperLaunchAd()) {
|
||||
@ -104,4 +99,4 @@ class LaunchAdImpl : ILaunchAd {
|
||||
companion object {
|
||||
private const val AD_PLACEMENT = "畅玩启动"
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@ import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.ad.AdDelegateHelper
|
||||
import com.gh.common.util.FloatingBackViewManager
|
||||
import com.gh.common.xapk.XapkInstaller
|
||||
@ -53,7 +53,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
|
||||
if (GlobalActivityManager.activityCount == 1) {
|
||||
// 清除桌面角标
|
||||
if (activity !is SplashScreenActivity && activity !is AuthorizationActivity) {
|
||||
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
|
||||
val pushProvider = TheRouter.get(IPushProvider::class.java)
|
||||
pushProvider?.cleanBadgeNumber(activity.applicationContext)
|
||||
}
|
||||
}
|
||||
@ -126,9 +126,7 @@ class GlobalActivityLifecycleObserver : Application.ActivityLifecycleCallbacks {
|
||||
}
|
||||
|
||||
private fun isSuggestionActivity(activity: Activity): Boolean {
|
||||
val helpAndFeedbackProvider =
|
||||
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
|
||||
.navigation() as? IHelpAndFeedbackProvider
|
||||
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
|
||||
return helpAndFeedbackProvider?.isSuggestionActivity(activity) ?: false
|
||||
}
|
||||
|
||||
|
||||
@ -11,7 +11,7 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.common.exposure.ExposureManager
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.util.LogUtils
|
||||
@ -345,7 +345,7 @@ class DefaultJsApi(
|
||||
|
||||
@JavascriptInterface
|
||||
fun getPushId(): String {
|
||||
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
|
||||
val pushProvider = TheRouter.get(IPushProvider::class.java)
|
||||
return pushProvider?.getRegistrationId(HaloApp.getInstance()) ?: "unknown"
|
||||
}
|
||||
|
||||
@ -424,8 +424,7 @@ class DefaultJsApi(
|
||||
|
||||
@JavascriptInterface
|
||||
fun showQaFeedbackDialog(msg: Any) {
|
||||
val mHelpAndFeedbackHelp =
|
||||
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback).navigation() as? IHelpAndFeedbackProvider
|
||||
val mHelpAndFeedbackHelp = TheRouter.get(IHelpAndFeedbackProvider::class.java)
|
||||
mHelpAndFeedbackHelp?.showQaFeedbackDialogFragment(context as AppCompatActivity, msg.toString())
|
||||
}
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ import com.gh.common.util.DirectUtils.directToLegacyVideoDetail
|
||||
import com.gh.common.util.DirectUtils.directToLinkPage
|
||||
import com.gh.common.util.DirectUtils.directToQa
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.SkipCompatActivity
|
||||
import com.gh.gamecenter.WebActivity
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
@ -66,6 +67,10 @@ object DefaultUrlHandler {
|
||||
bringAppToFront: Boolean = false,
|
||||
sourceEntrance: String = ""): Boolean {
|
||||
val uri = Uri.parse(url)
|
||||
|
||||
// 优先交给新的路由拦截处理
|
||||
if (SkipCompatActivity.handleSkip(context, uri)) return true
|
||||
|
||||
if ("ghzhushou" == uri.scheme) {
|
||||
Utils.log("url = $url")
|
||||
Utils.log("url = " + uri.scheme!!)
|
||||
|
||||
@ -7,19 +7,20 @@ import androidx.room.TypeConverters
|
||||
import androidx.room.migration.Migration
|
||||
import androidx.sqlite.db.SupportSQLiteDatabase
|
||||
import com.gh.gamecenter.entity.GamesCollectionEntity
|
||||
import com.gh.gamecenter.entity.HistoryGameDetailEntity
|
||||
import com.gh.gamecenter.entity.HistoryGameEntity
|
||||
import com.gh.gamecenter.entity.MyVideoEntity
|
||||
import com.gh.gamecenter.feature.entity.NewsEntity
|
||||
import com.gh.gamecenter.feature.entity.AnswerEntity
|
||||
import com.gh.gamecenter.feature.entity.ArticleEntity
|
||||
import com.gh.gamecenter.feature.entity.NewsEntity
|
||||
import com.gh.gamecenter.feature.room.converter.*
|
||||
import com.gh.gamecenter.room.converter.*
|
||||
import com.gh.gamecenter.room.dao.*
|
||||
import com.halo.assistant.HaloApp
|
||||
|
||||
@Database(
|
||||
entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class, GamesCollectionEntity::class],
|
||||
version = 14,
|
||||
entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class, GamesCollectionEntity::class, HistoryGameDetailEntity::class],
|
||||
version = 15,
|
||||
exportSchema = false
|
||||
)
|
||||
@TypeConverters(
|
||||
@ -53,6 +54,7 @@ abstract class HistoryDatabase : RoomDatabase() {
|
||||
abstract fun gameDao(): GameDao
|
||||
abstract fun videoHistoryDao(): VideoHistoryDao
|
||||
abstract fun gamesCollectionDao(): GamesCollectionDao
|
||||
abstract fun gameDetailDao(): GameDetailHistoryDao
|
||||
|
||||
companion object {
|
||||
|
||||
@ -152,6 +154,12 @@ abstract class HistoryDatabase : RoomDatabase() {
|
||||
}
|
||||
}
|
||||
|
||||
val MIGRATION_14_15: Migration = object : Migration(14, 15) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("CREATE TABLE HistoryGameDetailEntity (id TEXT NOT NULL PRIMARY KEY, name TEXT DEFAULT '')")
|
||||
}
|
||||
}
|
||||
|
||||
val instance by lazy {
|
||||
Room.databaseBuilder(
|
||||
HaloApp.getInstance().application,
|
||||
@ -170,6 +178,7 @@ abstract class HistoryDatabase : RoomDatabase() {
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.addMigrations(MIGRATION_12_13)
|
||||
.addMigrations(MIGRATION_13_14)
|
||||
.addMigrations(MIGRATION_14_15)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,6 +44,20 @@ object HistoryHelper {
|
||||
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.gameDao().addGame(historyGameEntity) } }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun insertGameDetail(gameEntity: GameEntity) {
|
||||
val historyGameDetailEntity = HistoryGameDetailEntity(gameEntity.id, gameEntity.name)
|
||||
runOnIoThread { tryCatchInRelease { HistoryDatabase.instance.gameDetailDao().addGame(historyGameDetailEntity) } }
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getHistoryGameDetailById(id: String): HistoryGameDetailEntity? =
|
||||
try {
|
||||
HistoryDatabase.instance.gameDetailDao().getHistoryGameDetailById(id)
|
||||
} catch (e: Throwable) {
|
||||
null
|
||||
}
|
||||
|
||||
private fun convertGameUpdateEntityToHistoryGameEntity(updateEntity: GameUpdateEntity): HistoryGameEntity {
|
||||
val historyGame = HistoryGameEntity()
|
||||
|
||||
@ -142,6 +156,15 @@ object HistoryHelper {
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun deleteGameDetailEntity(gameId: String) {
|
||||
runOnIoThread {
|
||||
tryCatchInRelease {
|
||||
HistoryDatabase.instance.gameDetailDao().deleteGame(HistoryGameDetailEntity(id = gameId))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@JvmStatic
|
||||
fun emptyDatabase() {
|
||||
|
||||
@ -103,7 +103,6 @@ class AccelerateNotificationHandler(priority: Int) : PriorityChainHandler(priori
|
||||
context = activity,
|
||||
gameId = gameEntity.id,
|
||||
entrance = "首页插件上架弹窗",
|
||||
defaultTab = -1,
|
||||
isSkipGameComment = false,
|
||||
scrollToLibao = false,
|
||||
openVideoStreaming = false,
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.ActivationHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IActivationProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.activation, name = "ActivationHelper暴露服务")
|
||||
class ActivationProviderImpl : IActivationProvider {
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
override fun sendActivationInfo() {
|
||||
ActivationHelper.sendActivationInfo()
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.AdHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.SettingsEntity
|
||||
import com.gh.gamecenter.feature.provider.IAdHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.adHelper, name = "AdHelper暴露服务")
|
||||
class AdHelperProviderImpl : IAdHelperProvider {
|
||||
override fun getSuggestionFunctionAd(): SettingsEntity.AD? {
|
||||
return AdHelper.getAd(AdHelper.LOCATION_SUGGESTION_FUNCTION)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,20 +1,15 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IAppProvider
|
||||
import com.gh.gamecenter.core.provider.IFlavorProvider
|
||||
import com.gh.gamecenter.va.VCore
|
||||
import com.halo.assistant.HaloApp
|
||||
|
||||
@Route(path = RouteConsts.provider.app, name = "Application暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class AppProviderImpl : IAppProvider {
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
override fun getAppName(): String {
|
||||
return HaloApp.getInstance().getString(R.string.app_name)
|
||||
@ -93,4 +88,5 @@ class AppProviderImpl : IAppProvider {
|
||||
override fun initImageLoaderIfNeeded() {
|
||||
HaloApp.getInstance().initFresco()
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,16 +1,13 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.databind.BindingAdapters
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.bindingAdapters, name = "BindingAdapters暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
|
||||
override fun setGameName(
|
||||
view: TextView,
|
||||
@ -31,8 +28,4 @@ class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
|
||||
override fun setGame(view: View, gameEntity: GameEntity) {
|
||||
BindingAdapters.setGame(view, gameEntity)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,9 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.download.server.BrowserInstallHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IBrowserInstallHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.browserInstallHelper, name = "BrowserInstallHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
|
||||
override fun isUseBrowserToInstallEnabled(): Boolean = BrowserInstallHelper.isUseBrowserToInstallEnabled()
|
||||
|
||||
@ -15,9 +12,4 @@ class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
|
||||
override fun logSwitchInstallSettingEvent() {
|
||||
BrowserInstallHelper.logOrdinaryBrowserEvent(BrowserInstallHelper.Type.SWITCH_INSTALL_SETTING)
|
||||
}
|
||||
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,10 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IBuildConfigProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.buildConfig, name = "BuildConfig暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class BuildConfigImpl : IBuildConfigProvider {
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
override fun getApplicationId(): String = BuildConfig.APPLICATION_ID
|
||||
|
||||
override fun getVersionName(): String = BuildConfig.VERSION_NAME
|
||||
|
||||
@ -1,18 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.CheckLoginUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.ICheckLoginProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.checkLogin, name = "CheckLoginUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class CheckLoginProviderImpl : ICheckLoginProvider {
|
||||
override fun checkLogin(context: Context, entrance: String, action: (() -> Unit)?) {
|
||||
CheckLoginUtils.checkLogin(context, entrance, action)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -3,20 +3,16 @@ package com.gh.common.provider
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Parcelable
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.CommentDetailActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.provider.ICommentDetailProvider
|
||||
import com.gh.gamecenter.feature.entity.MessageEntity
|
||||
|
||||
@Route(path = RouteConsts.provider.commentDetail, name = "CommentDetailActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class CommentDetailProviderImpl : ICommentDetailProvider {
|
||||
|
||||
override fun getIntent(context: Context, commentId: String?, message: Parcelable): Intent {
|
||||
return CommentDetailActivity.getIntent(context, commentId, message as MessageEntity.Article)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +1,14 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.ICommentManagerProvider
|
||||
import com.gh.gamecenter.manager.CommentManager
|
||||
|
||||
@Route(path = RouteConsts.provider.commentManager, name = "CommentManager暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class CommentManagerProviderImpl : ICommentManagerProvider {
|
||||
override fun addUrl(ids: String) {
|
||||
CommentManager.getInstance().addUrl(ids)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,12 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.CommentUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.provider.ICommentUtilsProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.commentUtils, name = "CommentUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class CommentUtilsProviderImpl : ICommentUtilsProvider {
|
||||
override fun setCommentTime(textView: TextView, time: Long) {
|
||||
CommentUtils.setCommentTime(textView, time)
|
||||
@ -16,8 +16,4 @@ class CommentUtilsProviderImpl : ICommentUtilsProvider {
|
||||
override fun getCommentTime(timestamp: Long): String {
|
||||
return CommentUtils.getCommentTime(timestamp)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -8,7 +8,7 @@ import android.widget.LinearLayout
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.facebook.drawee.view.SimpleDraweeView
|
||||
import com.gh.common.util.ConcernContentUtils
|
||||
import com.gh.common.view.ImageContainerView
|
||||
@ -18,7 +18,7 @@ import com.gh.gamecenter.common.utils.toArrayList
|
||||
import com.gh.gamecenter.core.provider.IConcernArticleUtilsProvider
|
||||
import com.gh.gamecenter.databinding.RecyclerGameArticleBinding
|
||||
|
||||
@Route(path = RouteConsts.provider.concernContentUtils, name = "ConcernContentUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ConcernArticleUtilsProviderImpl : IConcernArticleUtilsProvider {
|
||||
override fun addContentPic(
|
||||
context: Context,
|
||||
@ -95,8 +95,4 @@ class ConcernArticleUtilsProviderImpl : IConcernArticleUtilsProvider {
|
||||
override fun getTvComment(binding: ViewBinding): TextView = (binding as RecyclerGameArticleBinding).tvComment
|
||||
|
||||
override fun getTvShare(binding: ViewBinding): TextView = (binding as RecyclerGameArticleBinding).tvShare
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,14 +6,14 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.goneIf
|
||||
import com.gh.gamecenter.common.utils.toColor
|
||||
import com.gh.gamecenter.core.provider.IConcernGiftPackUtilsProvider
|
||||
import com.gh.gamecenter.databinding.RecyclerGiftPackBinding
|
||||
|
||||
@Route(path = RouteConsts.provider.concernGiftPackUtils, name = "ConcernGiftPackUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ConcernGiftPackUtilsProviderImpl : IConcernGiftPackUtilsProvider {
|
||||
override fun createBinding(parent: ViewGroup): ViewBinding {
|
||||
val inflater = LayoutInflater.from(parent.context)
|
||||
@ -48,7 +48,4 @@ class ConcernGiftPackUtilsProviderImpl : IConcernGiftPackUtilsProvider {
|
||||
override fun getTvGiftPackContent(viewBinding: ViewBinding) =
|
||||
(viewBinding as RecyclerGiftPackBinding).tvGiftPackContent
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do Nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,19 +2,15 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.ConcernActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IConcernProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.concernActivity, name = "ConcernActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ConcernProviderImpl : IConcernProvider {
|
||||
|
||||
override fun getIntent(context: Context, entrance: String): Intent {
|
||||
return ConcernActivity.getIntent(context, entrance)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -2,18 +2,14 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IConcernShareNewsProvider
|
||||
import com.gh.gamecenter.newsdetail.NewsShareDialog
|
||||
|
||||
@Route(path = RouteConsts.provider.concernShareNews, name = "ConcernShareNews暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ConcernShareNewsProviderImpl : IConcernShareNewsProvider {
|
||||
override fun share(activity: AppCompatActivity, shortId: String?, id: String?, gameIcon: String?, title: String?) {
|
||||
NewsShareDialog.show(activity, shortId, id, gameIcon, title)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do Nothing
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,9 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.constant.Config
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IConfigProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.config, name = "Config暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ConfigProviderImpl : IConfigProvider {
|
||||
override fun getTencentAppId(): String {
|
||||
return Config.TENCENT_APPID
|
||||
@ -103,8 +100,4 @@ class ConfigProviderImpl : IConfigProvider {
|
||||
override fun isJiguangSwitch(): Boolean {
|
||||
return Config.getNewApiSettingsEntity()?.jiguangSwitch ?: false
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,19 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.constant.Config
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.SettingsEntity
|
||||
import com.gh.gamecenter.feature.provider.IConfigSettingProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.configSetting, name = "Config.getSettings暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ConfigSettingProviderImpl : IConfigSettingProvider {
|
||||
override fun getSettings(): SettingsEntity? {
|
||||
return Config.getSettings()
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.DataCollectionUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.provider.IDataCollectionProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.dataCollection, name = "DataCollectionUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class DataCollectionProviderImpl : IDataCollectionProvider {
|
||||
override fun uploadClick(context: Context, vararg args: String) {
|
||||
DataCollectionUtils.uploadClick(context, *args)
|
||||
@ -15,8 +15,4 @@ class DataCollectionProviderImpl : IDataCollectionProvider {
|
||||
override fun uploadConcern(context: Context, vararg args: String) {
|
||||
DataCollectionUtils.uploadConcern(context, *args)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,20 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.DataUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IDataUtilsProvider
|
||||
import com.halo.assistant.HaloApp
|
||||
|
||||
@Route(path = RouteConsts.provider.dataUtils, name = "DataUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class DataUtilsProviderImpl : IDataUtilsProvider {
|
||||
|
||||
override fun getDeviceCertification() {
|
||||
DataUtils.getDeviceCertification(HaloApp.getInstance().gid)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.DefaultUrlHandler
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IDefaultUrlHandlerProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.defaultUrlHandler, name = "DefaultUrlHandler暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider {
|
||||
|
||||
override fun interceptUrl(
|
||||
@ -19,7 +19,4 @@ class DefaultUrlHandlerProviderImpl : IDefaultUrlHandlerProvider {
|
||||
return DefaultUrlHandler.interceptUrl(context, url, null, entrance, bringAppToFront, sourceEntrance)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,14 +2,12 @@ package com.gh.common.provider
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.gamecenter.common.callback.CancelListener
|
||||
import com.gh.gamecenter.common.callback.ConfirmListener
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IDialogUtilsProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.dialogUtils, name = "DialogUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class DialogUtilsProviderImpl : IDialogUtilsProvider {
|
||||
override fun showRegulationTestDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) {
|
||||
DialogUtils.showRegulationTestDialog(context, object : ConfirmListener {
|
||||
@ -45,8 +43,4 @@ class DialogUtilsProviderImpl : IDialogUtilsProvider {
|
||||
}
|
||||
|
||||
override fun showBindPhoneDialog(context: Context, confirm: () -> Unit): Dialog = DialogUtils.showBindPhoneDialog(context) { confirm.invoke() }
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -3,12 +3,12 @@ package com.gh.common.provider
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IDirectProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.directUtils, name = "DirectUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class DirectProviderImpl : IDirectProvider {
|
||||
|
||||
override fun directToWebView(context: Context, url: String, entrance: String?) {
|
||||
@ -96,8 +96,4 @@ class DirectProviderImpl : IDirectProvider {
|
||||
override fun directToExternalBrowser(context: Context, url: String) {
|
||||
DirectUtils.directToExternalBrowser(context, url)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,7 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.NewFlatLogUtils
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.exposure.ExposureSource
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.entity.GameUpdateEntity
|
||||
@ -17,7 +14,7 @@ import com.gh.gamecenter.packagehelper.PackageRepository
|
||||
import com.lightgame.download.DownloadEntity
|
||||
import com.lightgame.utils.Utils
|
||||
|
||||
@Route(path = RouteConsts.provider.downloadButtonClickedHandler, name = "DownloadButton点击事件暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
|
||||
override fun onClicked(downloadButton: DownloadButton) {
|
||||
var gameId = ""
|
||||
@ -139,8 +136,4 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
|
||||
}
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,13 +1,10 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IDownloadManagerProvider
|
||||
import com.lightgame.download.DownloadEntity
|
||||
|
||||
@Route(path = RouteConsts.provider.downloadManager, name = "DownloadManager暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class DownloadManagerProviderImpl : IDownloadManagerProvider {
|
||||
|
||||
override fun getDownloadEntityByUrl(url: String): DownloadEntity? {
|
||||
@ -18,8 +15,4 @@ class DownloadManagerProviderImpl : IDownloadManagerProvider {
|
||||
DownloadManager.getInstance().resumeAllInvisiblePendingTask()
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,15 +5,16 @@ import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.EntranceUtils
|
||||
import com.gh.gamecenter.common.avoidcallback.Callback
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IEntranceUtilsProvider
|
||||
import com.lightgame.utils.AppManager
|
||||
|
||||
@Route(path = RouteConsts.provider.entranceUtils, name = "EntranceUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class EntranceUtilsProviderImpl : IEntranceUtilsProvider {
|
||||
|
||||
override fun jumpActivity(context: Context, bundle: Bundle) {
|
||||
EntranceUtils.jumpActivity(context, bundle)
|
||||
}
|
||||
@ -32,10 +33,6 @@ class EntranceUtilsProviderImpl : IEntranceUtilsProvider {
|
||||
} else {
|
||||
EntranceUtils.jumpActivityCompat(AppManager.getInstance().currentActivity(), bundle)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,11 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.ErrorHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IErrorHelperProvider
|
||||
import com.gh.gamecenter.login.user.LoginTag
|
||||
import retrofit2.HttpException
|
||||
|
||||
@Route(path = RouteConsts.provider.errorHelper, name = "ErrorHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ErrorHelperProviderImpl : IErrorHelperProvider {
|
||||
|
||||
override fun handleError(
|
||||
@ -28,7 +25,4 @@ class ErrorHelperProviderImpl : IErrorHelperProvider {
|
||||
ErrorHelper.handleLoginError(context, httpException, loginTagChinese, isCertificate)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,20 +1,15 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.exposure.ExposureManager
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.provider.IExposureManagerProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.exposureManager, name = "ExposureManager暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ExposureManagerProviderImpl: IExposureManagerProvider {
|
||||
override fun logExposure(exposureEvent: ExposureEvent) {
|
||||
ExposureManager.log(exposureEvent)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,18 +1,11 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.FixedRateJobHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IFixedRateJobHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.fixedRateJobHelper, name = "FixedRateJobHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class FixedRateJobHelperProviderImpl : IFixedRateJobHelperProvider {
|
||||
override fun getTimeDeltaBetweenServerAndClient(): Long {
|
||||
return FixedRateJobHelper.timeDeltaBetweenServerAndClient
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,12 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider
|
||||
import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
|
||||
|
||||
@Route(path = RouteConsts.provider.gameCollectionDetail, name = "GameCollectionDetailActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class GameCollectionDetailProviderImpl : IGameCollectionDetailProvider {
|
||||
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean): Intent {
|
||||
return GameCollectionDetailActivity.getIntent(context, gameCollectionId, isFromSquare)
|
||||
@ -16,9 +16,4 @@ class GameCollectionDetailProviderImpl : IGameCollectionDetailProvider {
|
||||
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String): Intent {
|
||||
return GameCollectionDetailActivity.getSpecifiedCommentIntent(context, gameCollectionId, topCommentId)
|
||||
}
|
||||
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.provider.IGameDetailProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.gameDetail, name = "GameDetailActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class GameDetailProviderImpl : IGameDetailProvider {
|
||||
override fun startGameDetailActivity(
|
||||
context: Context,
|
||||
@ -54,7 +52,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
|
||||
context: Context,
|
||||
gameId: String,
|
||||
entrance: String?,
|
||||
defaultTab: Int,
|
||||
isSkipGameComment: Boolean,
|
||||
scrollToLibao: Boolean,
|
||||
openVideoStreaming: Boolean,
|
||||
@ -65,7 +62,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
|
||||
context,
|
||||
gameId,
|
||||
entrance,
|
||||
defaultTab,
|
||||
isSkipGameComment,
|
||||
scrollToLibao,
|
||||
openVideoStreaming,
|
||||
@ -73,8 +69,4 @@ class GameDetailProviderImpl : IGameDetailProvider {
|
||||
traceEvent
|
||||
)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,18 +1,14 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.GameTrendsHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IGameTrendsHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.gameTrendsHelper, name = "GameTrendsHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class GameTrendsHelperProviderImpl : IGameTrendsHelperProvider {
|
||||
override fun updateReadPostTime() {
|
||||
GameTrendsHelper.updateReadPostTime()
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,14 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.filter.RegionSettingHelper
|
||||
import com.gh.gamecenter.feature.utils.ApkActiveUtils
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.countOccurrences
|
||||
import com.gh.gamecenter.core.provider.IHandleGameResponseProvider
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
|
||||
@Route(path = RouteConsts.provider.handleGameResponse, name = "处理游戏类型返回")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class HandleGameResponseProviderImpl : IHandleGameResponseProvider {
|
||||
|
||||
override fun handleGameResponse(response: List<Any>, entrance: String): List<Any> {
|
||||
@ -37,8 +34,4 @@ class HandleGameResponseProviderImpl : IHandleGameResponseProvider {
|
||||
return response
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,18 +1,11 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.history.HistoryHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IHistoryHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.historyHelper, name = "HistoryHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class HistoryHelperProviderImpl : IHistoryHelperProvider {
|
||||
override fun emptyDatabase() {
|
||||
HistoryHelper.emptyDatabase()
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.LibaoUtils
|
||||
import com.gh.common.util.LibaoUtils.PostLibaoListener
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.ILibaoUtilsProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.libaoUtils, name = "LibaoUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class LibaoUtilsProviderImpl : ILibaoUtilsProvider {
|
||||
override fun getLibaoStatus(ids: String, successCallback: ((Any?) -> Unit)?, failureCallback: (() -> Unit)?) {
|
||||
LibaoUtils.getLibaoStatus(ids, object : PostLibaoListener {
|
||||
@ -20,8 +20,4 @@ class LibaoUtilsProviderImpl : ILibaoUtilsProvider {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.entity.CommunityEntity
|
||||
@ -10,7 +10,7 @@ import com.gh.gamecenter.common.entity.SuggestType
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.provider.ILinkDirectUtilsProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.linkDirectUtils, name = "DirectUtils暴露服务,主要是暴露directToLinkPage方法")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
|
||||
|
||||
override fun directToLinkPage(
|
||||
@ -61,7 +61,4 @@ class LinkDirectUtilsProviderImpl : ILinkDirectUtilsProvider {
|
||||
DirectUtils.directToCommunityColumn(context, community, subjectId, entrance, path)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,19 +1,13 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.*
|
||||
|
||||
@Route(path = RouteConsts.provider.logUtils, name = "LogUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class LogUtilsProviderImpl : ILogUtilsProvider {
|
||||
|
||||
override fun login(loginStep: String, loginType: String, entrance: String) {
|
||||
LogUtils.login(loginStep, loginType, entrance)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.gamecenter.MainActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IMainProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.mainActivity, name = "MainActivity暴露服务")
|
||||
class MainProviderImpl : IMainProvider {
|
||||
override fun skipToMainActivity(context: Context, type: String) {
|
||||
DirectUtils.directToHomeDefaultTab(context)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -2,13 +2,13 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.MessageDetailActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.ConcernEntity
|
||||
import com.gh.gamecenter.feature.provider.IMessageDetailProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.messageDetail, name = "MessageDetailActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class MessageDetailProviderImpl : IMessageDetailProvider {
|
||||
|
||||
override fun getIntentById(
|
||||
@ -24,8 +24,4 @@ class MessageDetailProviderImpl : IMessageDetailProvider {
|
||||
override fun getIntentByEntity(context: Context, concernEntity: ConcernEntity, entrance: String): Intent? {
|
||||
return MessageDetailActivity.getIntentByEntity(context, concernEntity, entrance)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,13 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import androidx.lifecycle.MediatorLiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.MessageUnreadCount
|
||||
import com.gh.gamecenter.feature.entity.MessageUnreadEntity
|
||||
import com.gh.gamecenter.feature.provider.IMessageUnreadRepositoryProvider
|
||||
import com.gh.gamecenter.message.MessageUnreadRepository
|
||||
|
||||
@Route(path = RouteConsts.provider.messageUnreadRepository, name = "MessageUnreadRepository暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider {
|
||||
|
||||
override fun loadMessageUnreadData() {
|
||||
@ -33,7 +30,4 @@ class MessageUnreadRepositoryProviderImpl : IMessageUnreadRepositoryProvider {
|
||||
return MessageUnreadRepository.messageUnreadCountLiveData
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,13 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IMiniGameRecentlyPlayedProvider
|
||||
import com.gh.gamecenter.minigame.MiniGameRecentlyPlayUseCase
|
||||
|
||||
@Route(path = RouteConsts.provider.miniGameRecentPlayed, name = "MiniGameRecentlyPlayed暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class MiniGameRecentlyPlayedProviderImpl : IMiniGameRecentlyPlayedProvider {
|
||||
override fun clearMiniGameRecentlyPlayed(gameType: String) {
|
||||
MiniGameRecentlyPlayUseCase.clearRecentlyPlayedMiniGameList(gameType)
|
||||
@ -16,8 +16,4 @@ class MiniGameRecentlyPlayedProviderImpl : IMiniGameRecentlyPlayedProvider {
|
||||
override fun refreshQQMiniRecentPlayed() {
|
||||
MiniGameRecentlyPlayUseCase.loadRecentlyPlayedMiniGameList(Constants.QQ_MINI_GAME)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// no implement
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,12 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.provider.INewCommentDetailProvider
|
||||
import com.gh.gamecenter.qa.comment.NewCommentDetailActivity
|
||||
|
||||
@Route(path = RouteConsts.provider.newCommentDetail, name = "NewCommentDetailActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class NewCommentDetailProviderImpl : INewCommentDetailProvider {
|
||||
|
||||
override fun getAnswerCommentIntent(
|
||||
@ -76,8 +76,4 @@ class NewCommentDetailProviderImpl : INewCommentDetailProvider {
|
||||
path
|
||||
)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.PackageHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IPackageHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.packageHelper, name = "PackageHelper暴露服务")
|
||||
class PackageHelperProviderImpl : IPackageHelperProvider {
|
||||
|
||||
override fun getLocalPackageNameSet(): Set<String> {
|
||||
return PackageHelper.localPackageNameSet
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,11 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.PackageInstaller
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IPackageInstallerProvider
|
||||
import com.lightgame.download.DownloadEntity
|
||||
|
||||
@Route(path = RouteConsts.provider.packageInstaller, name = "PackageInstaller暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class PackageInstallerProviderImpl : IPackageInstallerProvider {
|
||||
|
||||
override fun install(context: Context, downloadEntity: DownloadEntity, showUnzipToast: Boolean) {
|
||||
@ -18,7 +16,4 @@ class PackageInstallerProviderImpl : IPackageInstallerProvider {
|
||||
PackageInstaller.uninstall(context, path)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -2,14 +2,12 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.pm.PackageInfo
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.PackageHelper
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
|
||||
import com.gh.gamecenter.core.utils.ProcessUtil
|
||||
|
||||
@Route(path = RouteConsts.provider.packageUtils, name = "PackageUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class PackageUtilsProviderImpl : IPackageUtilsProvider {
|
||||
override fun obtainProcessName(): String? {
|
||||
return ProcessUtil.getCurrentProcessName()
|
||||
@ -50,8 +48,4 @@ class PackageUtilsProviderImpl : IPackageUtilsProvider {
|
||||
override fun getVersionNameByPackageName(packageName: String): String {
|
||||
return PackageUtils.getVersionNameByPackageName(packageName) ?: ""
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,10 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.GameInstall
|
||||
import com.gh.gamecenter.feature.provider.IPackagesManagerProvider
|
||||
import com.gh.gamecenter.manager.PackagesManager
|
||||
|
||||
@Route(path = RouteConsts.provider.packagesManager, name = "PackagesManager暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class PackagesManagerProviderImpl: IPackagesManagerProvider {
|
||||
override fun isCanPluggable(gameId: String?, packageName: String?): Boolean {
|
||||
return PackagesManager.isCanPluggable(gameId, packageName)
|
||||
@ -16,8 +13,4 @@ class PackagesManagerProviderImpl: IPackagesManagerProvider {
|
||||
override fun getFilterSameApkInstalledList(): ArrayList<GameInstall> {
|
||||
return PackagesManager.getFilterSameApkInstalledList()
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,11 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.filter.RegionSettingHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.entity.IpInfo
|
||||
import com.gh.gamecenter.feature.provider.IRegionSettingHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.regionSettingHelper, name = "RegionSettingHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
|
||||
override fun shouldThisGameDisplayMirrorInfo(gameId: String): Boolean {
|
||||
return RegionSettingHelper.shouldThisGameDisplayMirrorInfo(gameId)
|
||||
@ -33,8 +30,4 @@ class RegionSettingHelperProviderImpl : IRegionSettingHelperProvider {
|
||||
override fun shouldThisGameBeFiltered(gameId: String?): Boolean {
|
||||
return RegionSettingHelper.shouldThisGameBeFiltered(gameId)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,9 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.repository.ReservationRepository
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IReservationRepositoryProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.reservationRepository, name = "ReservationRepository暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ReservationRepositoryProviderImpl : IReservationRepositoryProvider {
|
||||
|
||||
override fun refreshReservations() {
|
||||
@ -16,8 +13,4 @@ class ReservationRepositoryProviderImpl : IReservationRepositoryProvider {
|
||||
override fun clearReservations() {
|
||||
ReservationRepository.clearReservations()
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -5,12 +5,12 @@ import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.ISearchTabUtilsProvider
|
||||
import com.gh.gamecenter.search.viewmodel.SearchTabViewModel
|
||||
|
||||
@Route(path = RouteConsts.provider.searchTabUtils, name = "SearchTabUtils暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class SearchTabUtilsProviderImpl : ISearchTabUtilsProvider {
|
||||
|
||||
override fun obtainParentViewModel(fragment: Fragment): ViewModel {
|
||||
@ -29,8 +29,4 @@ class SearchTabUtilsProviderImpl : ISearchTabUtilsProvider {
|
||||
null
|
||||
}
|
||||
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// no implement
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.ShareCardPicActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.ConcernEntity
|
||||
import com.gh.gamecenter.feature.provider.IShareCardPicProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.shareCardPicActivity, name = "ShareCardPicActivity暴露服务")
|
||||
class ShareCardPicProviderImpl : IShareCardPicProvider {
|
||||
override fun startShareCardPicActivity(context: Context, concernEntity: ConcernEntity, entrance: String) {
|
||||
ShareCardPicActivity.startShareCardPicActivity(context, concernEntity, entrance)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.ShareCardActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.ConcernEntity
|
||||
import com.gh.gamecenter.feature.provider.IShareCardProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.shareCardActivity, name = "ShareCardActivity暴露服务")
|
||||
class ShareCardProviderImpl : IShareCardProvider {
|
||||
override fun getIntent(context: Context, concernEntity: ConcernEntity, shareContent: String): Intent {
|
||||
return ShareCardActivity.getIntent(context, concernEntity, shareContent)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
@ -3,17 +3,11 @@ package com.gh.common.provider
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Parcelable
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.ShellActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IShellProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.shellActivity, name = "ShellActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class ShellProviderImpl : IShellProvider {
|
||||
override fun getSwitchInstallMethodIntent(context: Context, extraParcelable: Parcelable?): Intent =
|
||||
ShellActivity.getIntent(context, ShellActivity.Type.SWITCH_INSTALL_METHOD, extraParcelable)
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -2,19 +2,15 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.provider.ISimpleAnswerDetailProvider
|
||||
import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity
|
||||
|
||||
@Route(path = RouteConsts.provider.simpleAnswerDetail, name = "SimpleAnswerDetailActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class SimpleAnswerDetailProviderImpl : ISimpleAnswerDetailProvider {
|
||||
|
||||
override fun getIntent(context: Context, answerId: String, entrance: String, path: String): Intent {
|
||||
return SimpleAnswerDetailActivity.getIntent(context, answerId, entrance, path)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.provider.ISubjectProvider
|
||||
import com.gh.gamecenter.subject.SubjectActivity
|
||||
|
||||
@Route(path = RouteConsts.provider.subject, name = "SubjectActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class SubjectProviderImpl : ISubjectProvider {
|
||||
override fun startSubjectActivity(
|
||||
context: Context,
|
||||
@ -17,8 +17,4 @@ class SubjectProviderImpl : ISubjectProvider {
|
||||
) {
|
||||
SubjectActivity.startSubjectActivity(context, id, name, isOrder, null, entrance)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.feature.exposure.time.TimeUtil
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.ITimeUtilProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.timeUtil, name = "TimeUtil暴露服务")
|
||||
class TimeUtilProviderImpl : ITimeUtilProvider {
|
||||
|
||||
override fun currentTimeMillis() = TimeUtil.currentTimeMillis()
|
||||
|
||||
override fun currentTime() = TimeUtil.currentTime()
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IUpdateManagerProvider
|
||||
import com.gh.gamecenter.core.utils.ToastUtils
|
||||
import com.gh.gamecenter.update.UpdateHelper
|
||||
|
||||
@Route(path = RouteConsts.provider.updateManager, name = "UpdateManager暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class UpdateManagerProviderImpl: IUpdateManagerProvider {
|
||||
override fun checkUpdate(activity: FragmentActivity, ignoreSuppressOption: Boolean) {
|
||||
val dialog = DialogUtils.showWaitDialog(activity, "检查更新中...")
|
||||
@ -26,8 +23,4 @@ class UpdateManagerProviderImpl: IUpdateManagerProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -3,20 +3,16 @@ package com.gh.common.provider
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import androidx.annotation.RequiresApi
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.common.util.UsageStatsHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IUsageStatsHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.usageStatsHelper, name = "UsageStatsHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class UsageStatsHelperProviderImpl : IUsageStatsHelperProvider {
|
||||
@RequiresApi(Build.VERSION_CODES.LOLLIPOP_MR1)
|
||||
override fun checkForPermission(): Boolean = UsageStatsHelper.checkForPermission()
|
||||
override fun skipToUsageStats(context: Context, requestCode: Int) {
|
||||
UsageStatsHelper.skipToUsageStats(context, requestCode)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,11 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.feature.entity.InstallGameEntity
|
||||
import com.gh.gamecenter.feature.provider.IVHelperProvider
|
||||
import com.gh.vspace.VHelper
|
||||
|
||||
@Route(path = RouteConsts.provider.vhelper, name = "VHelper暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class VHelperProviderImpl: IVHelperProvider {
|
||||
override fun isVGameOn(): Boolean {
|
||||
return VHelper.isVGameOn()
|
||||
@ -20,8 +18,4 @@ class VHelperProviderImpl: IVHelperProvider {
|
||||
override fun launch(context: Context, packageName: String, ignoreGApps: Boolean, showLoading: Boolean) {
|
||||
VHelper.launch(context, packageName, ignoreGApps, showLoading)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,12 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IVisitManagerProvider
|
||||
import com.gh.gamecenter.manager.VisitManager
|
||||
|
||||
@Route(path = RouteConsts.provider.visitManager, name = "VisitManager暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class VisitManagerProviderImpl : IVisitManagerProvider {
|
||||
override fun updateOkhttpCache(context: Context, newsId: String) {
|
||||
VisitManager.updateOkhttpCache(context, newsId)
|
||||
@ -15,8 +15,4 @@ class VisitManagerProviderImpl : IVisitManagerProvider {
|
||||
override fun addUrl(ids: String) {
|
||||
VisitManager.getInstance().addUrl(ids)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -2,12 +2,10 @@ package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.gamecenter.WebActivity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IWebProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.webActivity, name = "WebActivity暴露服务")
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class WebProviderImpl : IWebProvider {
|
||||
override fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent {
|
||||
return WebActivity.getIntent(context, url, autoCompletionTitle)
|
||||
@ -40,8 +38,4 @@ class WebProviderImpl : IWebProvider {
|
||||
): Intent {
|
||||
return WebActivity.getIntentByNews(context, concernLink, concernGameName, concernId, entrance)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -1,23 +1,15 @@
|
||||
package com.gh.common.provider
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.gh.common.util.WechatBindHelper
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.entity.WechatConfigEntity
|
||||
import com.gh.gamecenter.core.provider.IWechatBindHelperProvider
|
||||
|
||||
@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务")
|
||||
class WechatHelperProviderImpl : IWechatBindHelperProvider<WechatConfigEntity> {
|
||||
@com.therouter.inject.ServiceProvider
|
||||
class WechatHelperProviderImpl : IWechatBindHelperProvider {
|
||||
|
||||
override fun getWechatConfig(callback: ((WechatConfigEntity) -> Unit)?) {
|
||||
override fun getWechatConfig(callback: ((Any) -> Unit)?) {
|
||||
WechatBindHelper.getWechatConfig {
|
||||
callback?.invoke(it)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun init(context: Context?) {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@ -52,7 +52,7 @@ public class CheckLoginUtils {
|
||||
}
|
||||
|
||||
if (context != null) {
|
||||
QuickLoginHelper.startLogin(context, entrance, callback);
|
||||
QuickLoginHelper.startLogin(context, entrance, null, callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import android.preference.PreferenceManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.therouter.TheRouter;
|
||||
import com.gh.ad.AdDelegateHelper;
|
||||
import com.gh.gamecenter.BuildConfig;
|
||||
import com.gh.gamecenter.common.constant.Constants;
|
||||
@ -55,7 +55,7 @@ public class DataUtils {
|
||||
}
|
||||
|
||||
private static void initSentry(Context context, String channel) {
|
||||
ISentryProvider sentryProvider = (ISentryProvider) ARouter.getInstance().build(RouteConsts.provider.sentry).navigation();
|
||||
ISentryProvider sentryProvider = TheRouter.get(ISentryProvider.class);
|
||||
if (sentryProvider != null) {
|
||||
sentryProvider.init(context, channel, BuildConfig.FLAVOR, BuildConfig.VERSION_NAME);
|
||||
}
|
||||
|
||||
@ -11,7 +11,6 @@ import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.os.bundleOf
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.ad.AdPluginDownloadHelper
|
||||
import com.gh.common.constant.Config
|
||||
import com.gh.common.exposure.ExposureManager.log
|
||||
@ -19,6 +18,7 @@ import com.gh.common.exposure.ExposureTraceUtils.appendTrace
|
||||
import com.gh.common.util.EntranceUtils.jumpActivity
|
||||
import com.gh.common.util.EntranceUtils.jumpActivityCompat
|
||||
import com.gh.gamecenter.*
|
||||
import com.gh.gamecenter.ShellActivity.Type
|
||||
import com.gh.gamecenter.amway.AmwayActivity
|
||||
import com.gh.gamecenter.category2.CategoryV2Activity
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
@ -56,7 +56,7 @@ import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
|
||||
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionHotListActivity
|
||||
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionListDetailActivity
|
||||
import com.gh.gamecenter.gamecollection.square.GameCollectionSquareActivity
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment
|
||||
import com.gh.gamecenter.gamedetail.entity.GameDetailTabEntity
|
||||
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarActivity
|
||||
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarManagementActivity
|
||||
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersSubscribedGameListActivity
|
||||
@ -69,7 +69,6 @@ import com.gh.gamecenter.minigame.MiniGameRecentlyPlayUseCase
|
||||
import com.gh.gamecenter.minigame.MiniGameSearchActivity
|
||||
import com.gh.gamecenter.minigame.qq.QGameHomeWrapperActivity
|
||||
import com.gh.gamecenter.newsdetail.NewsDetailActivity
|
||||
import com.gh.gamecenter.personalhome.UserHomeActivity
|
||||
import com.gh.gamecenter.personalhome.background.PersonalityBackgroundActivity
|
||||
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
|
||||
import com.gh.gamecenter.personalhome.home.UserHistoryViewModel
|
||||
@ -79,7 +78,6 @@ import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
|
||||
import com.gh.gamecenter.qa.subject.CommunitySubjectActivity
|
||||
import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.gh.gamecenter.SearchActivity
|
||||
import com.gh.gamecenter.servers.GameServerTestActivity
|
||||
import com.gh.gamecenter.servers.GameServersActivity
|
||||
import com.gh.gamecenter.servers.gametest2.GameServerTestV2Activity
|
||||
@ -100,6 +98,7 @@ import com.halo.assistant.fragment.WebFragment
|
||||
import com.lightgame.utils.Utils
|
||||
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
|
||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory
|
||||
import com.therouter.TheRouter
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import retrofit2.HttpException
|
||||
@ -180,7 +179,8 @@ object DirectUtils {
|
||||
"qa",
|
||||
"feedback",
|
||||
"toolkit",
|
||||
"float_window_game"
|
||||
"float_window_game",
|
||||
"archive"
|
||||
)
|
||||
|
||||
fun directToLinkPage(
|
||||
@ -570,6 +570,8 @@ object DirectUtils {
|
||||
}
|
||||
}
|
||||
|
||||
"archive" -> directToCloudArchive(context, linkEntity.link ?: "", linkEntity.text ?: "", "", entrance)
|
||||
|
||||
"" -> {
|
||||
// do nothing
|
||||
}
|
||||
@ -590,12 +592,16 @@ object DirectUtils {
|
||||
@JvmStatic
|
||||
fun directToQa(context: Context, text: String? = "", id: String) {
|
||||
if (id.isEmpty()) return
|
||||
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
|
||||
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, destination?.name ?: "")
|
||||
bundle.putString(KEY_NAVIGATION_TITLE, text)
|
||||
bundle.putString(KEY_QA_ID, id)
|
||||
jumpActivity(context, bundle)
|
||||
|
||||
TheRouter.build(RouteConsts.activity.qaActivity)
|
||||
.fillParams {
|
||||
it.putAll(bundle)
|
||||
}
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -604,12 +610,16 @@ object DirectUtils {
|
||||
@JvmStatic
|
||||
fun directToQaCollection(context: Context, text: String, id: String) {
|
||||
if (id.isEmpty()) return
|
||||
val destination = RouteConsts.activity.qaActivity.toDestinationClass()
|
||||
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, destination?.name ?: "")
|
||||
bundle.putString(KEY_NAVIGATION_TITLE, text)
|
||||
bundle.putString(KEY_QA_COLLECTION_ID, id)
|
||||
jumpActivity(context, bundle)
|
||||
|
||||
TheRouter.build(RouteConsts.activity.qaActivity)
|
||||
.fillParams {
|
||||
it.putAll(bundle)
|
||||
}
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -720,7 +730,7 @@ object DirectUtils {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToHomeActivity(context: Context, userId: String?, entrance: String? = null, path: String? = null) {
|
||||
context.startActivity(UserHomeActivity.getIntent(context, userId ?: "", entrance, path))
|
||||
directToHomeActivity(context, userId, entrance, path, 0)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -759,17 +769,20 @@ object DirectUtils {
|
||||
entrance: String? = null,
|
||||
path: String? = null
|
||||
) {
|
||||
|
||||
IntegralLogHelper.log("view_homepage", "个人主页")
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_USER_ID, userId)
|
||||
bundle.putString(KEY_TO, UserHomeActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_TYPE, UserHistoryViewModel.TYPE.fromValue(type).value)
|
||||
bundle.putString(KEY_GAME, gameType)
|
||||
bundle.putInt(KEY_POSITION, position ?: 0)
|
||||
jumpActivity(context, bundle)
|
||||
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.userHomeActivity)
|
||||
.appendQueryParameter(KEY_USER_ID, userId)
|
||||
.appendQueryParameter(KEY_TAB_INDEX, position.toString())
|
||||
.appendQueryParameter(KEY_PATH, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
.appendQueryParameter(KEY_COMMUNITY_TYPE, UserHistoryViewModel.TYPE.fromValue(type).value)
|
||||
.appendQueryParameter(KEY_GAME_TYPE, gameType)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
|
||||
@ -801,10 +814,10 @@ object DirectUtils {
|
||||
bundle.putString(KEY_GAMEID, id)
|
||||
if (!TextUtils.isEmpty(tab)) {
|
||||
when (tab) {
|
||||
"comment" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_RATING)
|
||||
"desc" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
"forum" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_BBS)
|
||||
"zone" -> bundle.putString(KEY_TARGET, GameDetailFragment.TAB_TRENDS)
|
||||
"comment" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_COMMENT)
|
||||
"desc" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
|
||||
"forum" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_BBS)
|
||||
"zone" -> bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_ZONE)
|
||||
}
|
||||
}
|
||||
if (traceEvent != null) {
|
||||
@ -849,7 +862,7 @@ object DirectUtils {
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putString(KEY_GAMEID, id)
|
||||
bundle.putBoolean(KEY_OPEN_VIDEO_STREAMING, true)
|
||||
bundle.putString(KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putString(KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -857,7 +870,7 @@ object DirectUtils {
|
||||
fun directToGameDetail(
|
||||
context: Context,
|
||||
id: String,
|
||||
defaultTab: String = GameDetailFragment.TAB_DESC,
|
||||
defaultTab: String = GameDetailTabEntity.TYPE_DETAIL,
|
||||
entrance: String? = null
|
||||
) {
|
||||
val bundle = Bundle()
|
||||
@ -1515,7 +1528,7 @@ object DirectUtils {
|
||||
response?.apply {
|
||||
if (zone.status == "on") {
|
||||
if (zone.style == "link") {
|
||||
directToGameDetail(context, gameId, GameDetailFragment.TAB_TRENDS, entrance)
|
||||
directToGameDetail(context, gameId, GameDetailTabEntity.TYPE_ZONE, entrance)
|
||||
} else {
|
||||
directToWebView(context, url, entrance)
|
||||
}
|
||||
@ -1626,11 +1639,11 @@ object DirectUtils {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToHelpAndFeedback(context: Context, bundle: Bundle? = null) {
|
||||
val destination = RouteConsts.activity.helpAndFeedbackActivity.toDestinationClass()
|
||||
val newBundle = Bundle()
|
||||
newBundle.putString(KEY_TO, destination?.name ?: "")
|
||||
bundle?.let { newBundle.putAll(it) }
|
||||
jumpActivityCompat(context, newBundle)
|
||||
TheRouter.build(RouteConsts.activity.helpAndFeedbackActivity)
|
||||
.fillParams {
|
||||
it.putAll(bundle)
|
||||
}
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
|
||||
@ -1727,8 +1740,7 @@ object DirectUtils {
|
||||
@JvmStatic
|
||||
fun directToConcernInfo(context: Context, entrance: String) {
|
||||
context.startActivity(
|
||||
(ARouter.getInstance().build(RouteConsts.provider.concernInfo)
|
||||
.navigation() as? IConcernInfoProvider)?.getIntent(context, entrance)
|
||||
TheRouter.get(IConcernInfoProvider::class.java)?.getIntent(context, entrance)
|
||||
)
|
||||
}
|
||||
|
||||
@ -1985,10 +1997,7 @@ object DirectUtils {
|
||||
return
|
||||
}
|
||||
|
||||
val qGameProvider = ARouter
|
||||
.getInstance()
|
||||
.build(RouteConsts.provider.qGame)
|
||||
.navigation() as? IQGameProvider
|
||||
val qGameProvider = TheRouter.get(IQGameProvider::class.java)
|
||||
|
||||
if (qGameProvider == null) return
|
||||
|
||||
@ -2037,8 +2046,14 @@ object DirectUtils {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun directToMessageCenter(defaultTabIndex: Int) {
|
||||
ARouter.getInstance().build(RouteConsts.activity.messageWrapperActivity)
|
||||
fun directToMessageCenter(defaultTabIndex: Int, source: String) {
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.messageWrapperActivity)
|
||||
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
|
||||
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
|
||||
.build()
|
||||
|
||||
TheRouter.build(uri.toString())
|
||||
.withInt(BaseActivity_TabLayout.PAGE_INDEX, defaultTabIndex)
|
||||
.navigation()
|
||||
}
|
||||
@ -2138,4 +2153,16 @@ object DirectUtils {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// 跳转云存档详情页
|
||||
@JvmStatic
|
||||
fun directToCloudArchive(context: Context, gameId: String, gameName: String, configUrl: String = "", entrance: String = "") {
|
||||
val bundle = Bundle()
|
||||
val gameEntity = GameEntity(id = gameId, name = gameName)
|
||||
bundle.putParcelable(KEY_GAME_ENTITY, gameEntity)
|
||||
bundle.putString(KEY_ARCHIVE_CONFIG_URL, configUrl)
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putBoolean(KEY_USE_ALTERNATIVE_LAYOUT, true)
|
||||
context.startActivity(ShellActivity.getIntent(context, Type.CLOUD_ARCHIVE, bundle))
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ package com.gh.common.util
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.common.repository.ReservationRepository
|
||||
import com.gh.gamecenter.WebActivity
|
||||
@ -231,7 +231,7 @@ object ReservationHelper {
|
||||
@JvmStatic
|
||||
fun getReserveRequestBody(game: GameEntity?, context: Context): RequestBody {
|
||||
val jPushId =
|
||||
(ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider)
|
||||
(TheRouter.get(IPushProvider::class.java))
|
||||
?.getRegistrationId(context) ?: ""
|
||||
var mirrorPosition = game?.getMirrorPosition() ?: 0
|
||||
if (mirrorPosition == -1) {
|
||||
|
||||
@ -2,7 +2,7 @@ package com.gh.common.util
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.common.iinterface.ISuperiorChain
|
||||
import com.gh.gamecenter.amway.AmwayFragment
|
||||
import com.gh.gamecenter.category2.CategoryV2Fragment
|
||||
@ -19,7 +19,7 @@ import com.gh.gamecenter.game.columncollection.detail.ColumnCollectionDetailFrag
|
||||
import com.gh.gamecenter.game.commoncollection.detail.CustomCommonCollectionDetailFragment
|
||||
import com.gh.gamecenter.gamecollection.hotlist.GameCollectionHotListWrapperFragment
|
||||
import com.gh.gamecenter.gamecollection.square.GameCollectionSquareFragment
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment
|
||||
import com.gh.gamecenter.gamedetail.GameDetailWrapperFragment
|
||||
import com.gh.gamecenter.info.InfoWrapperFragment
|
||||
import com.gh.gamecenter.libao.LibaoDetailFragment
|
||||
import com.gh.gamecenter.libao.LibaoFragment
|
||||
@ -88,7 +88,7 @@ object ViewPagerFragmentHelper {
|
||||
// 游戏详情页
|
||||
TYPE_GAME -> {
|
||||
bundle.putString(EntranceConsts.KEY_GAMEID, linkEntity.link)
|
||||
GameDetailFragment().with(bundle)
|
||||
GameDetailWrapperFragment().with(bundle)
|
||||
}
|
||||
// 我的光环
|
||||
TYPE_MY_HALO -> {
|
||||
@ -129,9 +129,7 @@ object ViewPagerFragmentHelper {
|
||||
}
|
||||
// 帮助与反馈
|
||||
TYPE_FEEDBACK -> {
|
||||
val helpAndFeedbackProvider =
|
||||
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
|
||||
.navigation() as? IHelpAndFeedbackProvider
|
||||
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
|
||||
if (helpAndFeedbackProvider != null) {
|
||||
helpAndFeedbackProvider.getHelpAndFeedbackFragment().with(bundle)
|
||||
} else {
|
||||
@ -151,11 +149,11 @@ object ViewPagerFragmentHelper {
|
||||
NewQuestionDetailFragment().with(bundle)
|
||||
}
|
||||
// 其他原来带Toolbar的Fragment
|
||||
else -> createToolbarWrapperFragment(parentFragment, bundle, linkEntity, isTabWrapper)
|
||||
else -> createToolbarWrapperFragment(bundle, linkEntity, isTabWrapper)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createToolbarWrapperFragment(parentFragment: Fragment?, bundle: Bundle, entity: LinkEntity, isTabWrapper: Boolean): Fragment {
|
||||
private fun createToolbarWrapperFragment(bundle: Bundle, entity: LinkEntity, isTabWrapper: Boolean): Fragment {
|
||||
var className = ReloadFragment::class.java.name
|
||||
|
||||
when (entity.type) {
|
||||
@ -250,9 +248,7 @@ object ViewPagerFragmentHelper {
|
||||
}
|
||||
// QA
|
||||
TYPE_QA -> {
|
||||
val helpAndFeedbackProvider =
|
||||
ARouter.getInstance().build(RouteConsts.provider.helpAndFeedback)
|
||||
.navigation() as? IHelpAndFeedbackProvider
|
||||
val helpAndFeedbackProvider = TheRouter.get(IHelpAndFeedbackProvider::class.java)
|
||||
|
||||
helpAndFeedbackProvider?.let {
|
||||
className = it.getHelpContainerFragmentClass()
|
||||
|
||||
@ -48,7 +48,7 @@ class FlexLinearLayout @JvmOverloads constructor(context: Context, attrs: Attrib
|
||||
ta.recycle()
|
||||
}
|
||||
|
||||
fun setTags(tags: ArrayList<TagStyleEntity>) {
|
||||
fun setTags(tags: List<TagStyleEntity>) {
|
||||
mTags.clear()
|
||||
mTotalCount = tags.size
|
||||
mTotalWidth = measuredWidth
|
||||
|
||||
@ -6,7 +6,7 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.therouter.router.Route;
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
|
||||
@ -6,11 +6,11 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.gh.base.DownloadToolbarActivity
|
||||
import com.gh.common.exposure.ExposureManager.log
|
||||
import com.gh.common.exposure.ExposureManager
|
||||
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.toArrayList
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
import com.gh.gamecenter.entity.GamePlatform
|
||||
@ -19,55 +19,82 @@ import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent.Companion.createEvent
|
||||
import com.gh.gamecenter.feature.exposure.ExposureType
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.gh.gamecenter.gamedetail.GameDetailWrapperFragment
|
||||
import com.gh.gamecenter.gamedetail.entity.GameDetailTabEntity
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
/**
|
||||
* Created by khy on 2017/3/24.
|
||||
* 游戏详情页
|
||||
*/
|
||||
@Route(
|
||||
path = RouteConsts.activity.gameDetailActivity,
|
||||
description = "游戏详情页"
|
||||
)
|
||||
class GameDetailActivity : DownloadToolbarActivity() {
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ID, description = "游戏 id", required = true)
|
||||
var gameId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ENTITY, description = "游戏摘要实体,如果你不懂这个是什么,那么不要用它,直接传入游戏 id 即可")
|
||||
var gameEntity: GameEntity? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_DEFAULT_TAB, description = "默认选中 tab 的类型(目前可选的有五个类型 `详情`, `专区`,`云存档`,`评价`,`论坛`),首次进入匹配并切换至对应 tab")
|
||||
var defaultTab: String = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, description = "跳转到评论 tab,首次进入直接跳转到评论 tab")
|
||||
var commentAsDefaultTab: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_LIBAO, description = "滚动到礼包区域,首次进入滚动到礼包区域")
|
||||
var scrollToLibao: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_SERVER, description = "滚动到开服表区域,首次进入滚动到开服表区域")
|
||||
var scrollToServer: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_OPEN_VIDEO_STREAMING, description = "打开视频流,首次进入打开视频流")
|
||||
var openVideoStreaming: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, description = "打开多版本窗口,首次进入打开多版本窗口")
|
||||
var openPlatformWindow: Boolean = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
|
||||
generateDataFromRoute()
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.transparentStatusBar(this)
|
||||
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, !mIsDarkModeOn)
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, GameDetailActivity::class.java, GameDetailFragment::class.java)
|
||||
return getTargetIntent(this, GameDetailActivity::class.java, GameDetailWrapperFragment::class.java)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.activity_game_detail
|
||||
}
|
||||
override fun getLayoutId() = R.layout.activity_game_detail
|
||||
|
||||
override fun showToolbarAtLeft(): Boolean {
|
||||
return true
|
||||
}
|
||||
override fun showToolbarAtLeft() = true
|
||||
override fun showDownloadMenu() = true
|
||||
|
||||
override fun showDownloadMenu(): Boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
HaloApp.remove(Constants.GAME_DETAIL_COME_IN)
|
||||
}
|
||||
|
||||
override fun getActivityNameInChinese(): String {
|
||||
return "游戏详情"
|
||||
}
|
||||
override fun getActivityNameInChinese() = "游戏详情"
|
||||
|
||||
override fun getBusinessId(): Pair<String, String> {
|
||||
val fragment = targetFragment as? GameDetailFragment?
|
||||
return if (fragment?.arguments != null) {
|
||||
Pair(fragment.requireArguments().getString(EntranceConsts.KEY_GAMEID) ?: "", "")
|
||||
return if (!gameId.isNullOrEmpty()) {
|
||||
Pair(gameId ?: "", "")
|
||||
} else {
|
||||
super.getBusinessId()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun attachBaseContext(newBase: Context) {
|
||||
super.attachBaseContext(object : ContextWrapper(newBase) {
|
||||
override fun getSystemService(name: String): Any? {
|
||||
@ -96,6 +123,18 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
)
|
||||
}
|
||||
|
||||
private fun generateDataFromRoute() {
|
||||
val bundle = intent.extras
|
||||
|
||||
intent?.putExtra(NORMAL_FRAGMENT_NAME, GameDetailWrapperFragment::class.java.canonicalName)
|
||||
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
|
||||
}
|
||||
|
||||
override fun onDarkModeChanged() {
|
||||
super.onDarkModeChanged()
|
||||
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, !mIsDarkModeOn)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
@ -131,9 +170,10 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
|
||||
if (traceEvent != null) {
|
||||
val clickEvent = createEvent(gameEntity, traceEvent.source, appendTrace(traceEvent), ExposureType.CLICK)
|
||||
log(clickEvent)
|
||||
ExposureManager.log(clickEvent)
|
||||
bundle.putParcelable(EntranceConsts.KEY_TRACE_EVENT, clickEvent)
|
||||
}
|
||||
|
||||
if (gameEntity != null && traceEvent != null && gameEntity.id != traceEvent.payload.gameId) {
|
||||
// 当游戏 ID 跟曝光 traceEvent 的游戏ID 不一样的时候更新 traceEvent 的游戏ID
|
||||
val (payload) = createEvent(
|
||||
@ -144,31 +184,35 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
)
|
||||
traceEvent.payload = payload
|
||||
}
|
||||
|
||||
if (defaultTab.isNotEmpty()) {
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, defaultTab)
|
||||
}
|
||||
|
||||
if (isSkipGameComment) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, true)
|
||||
bundle.putBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, true)
|
||||
}
|
||||
|
||||
if (scrollToLibao) {
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
|
||||
}
|
||||
|
||||
if (scrollToServer) {
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_SERVER, true)
|
||||
}
|
||||
bundle.putString(EntranceConsts.KEY_GAMEID, gameEntity?.id)
|
||||
|
||||
bundle.putString(EntranceConsts.KEY_GAME_ID, gameEntity?.id)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
bundle.putParcelable(GameEntity.TAG, gameEntity)
|
||||
context.startActivity(
|
||||
getTargetIntent(
|
||||
context,
|
||||
GameDetailActivity::class.java,
|
||||
GameDetailFragment::class.java,
|
||||
bundle
|
||||
)
|
||||
)
|
||||
bundle.putParcelable(EntranceConsts.KEY_GAME_ENTITY, gameEntity)
|
||||
|
||||
TheRouter
|
||||
.build(RouteConsts.activity.gameDetailActivity)
|
||||
.fillParams {
|
||||
it.putAll(bundle)
|
||||
}
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -178,7 +222,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
entrance: String?,
|
||||
traceEvent: ExposureEvent?
|
||||
) {
|
||||
startGameDetailActivity(context, gameId, entrance, -1, traceEvent = traceEvent)
|
||||
startGameDetailActivity(context, gameId, entrance, isSkipGameComment = false, traceEvent = traceEvent)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -186,7 +230,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
context: Context,
|
||||
gameId: String,
|
||||
entrance: String?,
|
||||
defaultTab: Int = -1,
|
||||
isSkipGameComment: Boolean = false,
|
||||
scrollToLibao: Boolean = false,
|
||||
openVideoStreaming: Boolean = false,
|
||||
@ -197,7 +240,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
context,
|
||||
gameId,
|
||||
entrance,
|
||||
defaultTab,
|
||||
isSkipGameComment,
|
||||
scrollToLibao,
|
||||
openVideoStreaming,
|
||||
@ -211,7 +253,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
|
||||
/**
|
||||
* @param gameId 游戏Id
|
||||
* @param defaultTab 默认定位到哪个tab
|
||||
* @param isSkipGameComment 是否跳转到评论tab
|
||||
* @param scrollToLibao 滚动到礼包区域
|
||||
* @param openVideoStreaming 是否打开视频流
|
||||
@ -225,7 +266,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
context: Context,
|
||||
gameId: String,
|
||||
entrance: String?,
|
||||
defaultTab: Int = -1,
|
||||
isSkipGameComment: Boolean = false,
|
||||
scrollToLibao: Boolean = false,
|
||||
openVideoStreaming: Boolean = false,
|
||||
@ -248,7 +288,7 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
appendTrace(traceEvent),
|
||||
ExposureType.CLICK
|
||||
)
|
||||
log(clickEvent)
|
||||
ExposureManager.log(clickEvent)
|
||||
bundle.putParcelable(EntranceConsts.KEY_TRACE_EVENT, clickEvent)
|
||||
}
|
||||
if (traceEvent != null && gameId != traceEvent.payload.gameId) {
|
||||
@ -261,15 +301,12 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
)
|
||||
traceEvent.payload = payload
|
||||
}
|
||||
if (defaultTab != -1) {
|
||||
bundle.putInt(EntranceConsts.KEY_TARGET, defaultTab)
|
||||
}
|
||||
if (isSkipGameComment) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, true)
|
||||
bundle.putBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, true)
|
||||
}
|
||||
if (openVideoStreaming) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_OPEN_VIDEO_STREAMING, true)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
|
||||
}
|
||||
if (openPlatformWindow) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, true)
|
||||
@ -283,10 +320,10 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
}
|
||||
}
|
||||
if (scrollToLibao) {
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailTabEntity.TYPE_DETAIL)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
|
||||
}
|
||||
bundle.putString(EntranceConsts.KEY_GAMEID, gameId)
|
||||
bundle.putString(EntranceConsts.KEY_GAME_ID, gameId)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
bundle.putParcelable(EntranceConsts.KEY_CUSTOM_PAGE_TRACK_DATA, customPageTrackData)
|
||||
bundle.putString(EntranceConsts.KEY_LAST_PAGE_ID, GlobalActivityManager.getLastPageEntity().pageId)
|
||||
@ -295,14 +332,13 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
EntranceConsts.KEY_LAST_PAGE_BUSINESS_ID,
|
||||
GlobalActivityManager.getLastPageEntity().pageBusinessId
|
||||
)
|
||||
context.startActivity(
|
||||
getTargetIntent(
|
||||
context,
|
||||
GameDetailActivity::class.java,
|
||||
GameDetailFragment::class.java,
|
||||
bundle
|
||||
)
|
||||
)
|
||||
|
||||
TheRouter
|
||||
.build(RouteConsts.activity.gameDetailActivity)
|
||||
.fillParams {
|
||||
it.putAll(bundle)
|
||||
}
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ import androidx.transition.*
|
||||
import androidx.viewpager.widget.PagerAdapter
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
|
||||
import com.facebook.drawee.backends.pipeline.Fresco
|
||||
import com.facebook.imagepipeline.core.ImagePipeline
|
||||
|
||||
@ -5,11 +5,12 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.os.Parcelable
|
||||
import android.view.View
|
||||
import com.gh.gamecenter.amway.AmwaySuccessFragment
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.base.fragment.BaseFragment
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.amway.AmwaySuccessFragment
|
||||
import com.gh.gamecenter.gamedetail.LibaoListFragment
|
||||
import com.gh.gamecenter.gamedetail.cloudarchive.CloudArchiveFragment
|
||||
import com.gh.gamecenter.gamedetail.libao.LibaoListFragment
|
||||
import com.halo.assistant.fragment.SwitchInstallMethodFragment
|
||||
import com.halo.assistant.fragment.user.ManuallyRealNameFragment
|
||||
import com.halo.assistant.fragment.user.RealNameInfoFragment
|
||||
@ -38,6 +39,7 @@ class ShellActivity : ToolBarActivity() {
|
||||
Type.REAL_NAME_INFO -> startFragment(RealNameInfoFragment().with(bundle))
|
||||
Type.MANUALLY_REAL_NAME -> startFragment(ManuallyRealNameFragment().with(extraData))
|
||||
Type.SIMPLE_LIBAO_LIST -> startFragment(LibaoListFragment.newInstance(extraData))
|
||||
Type.CLOUD_ARCHIVE -> startFragment(CloudArchiveFragment().with(extraData))
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,7 +74,8 @@ class ShellActivity : ToolBarActivity() {
|
||||
SWITCH_INSTALL_METHOD("switch_install_method"),
|
||||
REAL_NAME_INFO("real_name_info"),
|
||||
MANUALLY_REAL_NAME("manually_real_name"),
|
||||
SIMPLE_LIBAO_LIST("simple_libao_list");
|
||||
SIMPLE_LIBAO_LIST("simple_libao_list"),
|
||||
CLOUD_ARCHIVE("cloud_archive");
|
||||
|
||||
companion object {
|
||||
fun fromString(typeString: String): Type {
|
||||
|
||||
@ -445,24 +445,6 @@ public class SkipActivity extends BaseActivity {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if ("market".equals(uri.getScheme())) {
|
||||
String host = uri.getHost();
|
||||
String id = "";
|
||||
try {
|
||||
id = uri.getQueryParameter("id");
|
||||
} catch (UnsupportedOperationException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (host != null) {
|
||||
if ("details".equals(host)) {
|
||||
bundle = new Bundle();
|
||||
bundle.putString(KEY_TO, EntranceConsts.KEY_MARKET_DETAILS);
|
||||
bundle.putString(KEY_DATA, id);
|
||||
EntranceUtils.jumpActivity(this, bundle);
|
||||
} else {
|
||||
EntranceUtils.jumpActivity(this, new Bundle()); // 跳转至首页
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
107
app/src/main/java/com/gh/gamecenter/SkipCompatActivity.kt
Normal file
107
app/src/main/java/com/gh/gamecenter/SkipCompatActivity.kt
Normal file
@ -0,0 +1,107 @@
|
||||
package com.gh.gamecenter
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import com.therouter.router.Navigator
|
||||
import com.therouter.router.interceptor.NavigationCallback
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.common.util.EntranceUtils
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.utils.DialogHelper
|
||||
import com.gh.gamecenter.common.utils.dropSchemeAndHost
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.utils.Utils
|
||||
|
||||
class SkipCompatActivity : SkipActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
val uri = intent.data
|
||||
if (handleSkip(this, uri)) {
|
||||
intent.setData(null)
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
finish()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "SkipCompat"
|
||||
|
||||
const val HOST = "app"
|
||||
|
||||
const val SCHEME = "ghzhushou"
|
||||
const val MARKET = "market"
|
||||
|
||||
fun handleSkip(context: Context, uri: Uri?): Boolean {
|
||||
if (uri == null) return false
|
||||
|
||||
// Handle skip
|
||||
if (uri.scheme == SCHEME) {
|
||||
Utils.log(TAG, "handleSkip: $uri")
|
||||
|
||||
val host = uri.host
|
||||
if (host == HOST) {
|
||||
TheRouter
|
||||
.build(uri.dropSchemeAndHost())
|
||||
.navigation(context, object : NavigationCallback() {
|
||||
override fun onFound(postcard: Navigator) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onFound" )
|
||||
}
|
||||
|
||||
override fun onLost(postcard: Navigator, requestCode: Int) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onLost" )
|
||||
|
||||
if (HaloApp.getInstance().isAlreadyUpAndRunning) {
|
||||
// 在光环应用内时,显示不支持弹窗
|
||||
// 显示不支持弹窗
|
||||
DialogHelper.showUpgradeDialog(context)
|
||||
} else {
|
||||
// 在光环应用外跳转时,重定向至首页
|
||||
EntranceUtils.jumpActivity(context, Bundle())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onArrival(postcard: Navigator) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onArrival" )
|
||||
}
|
||||
|
||||
override fun onActivityCreated(postcard: Navigator, activity: Activity) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard.originalUrl} onActivityCreated" )
|
||||
}
|
||||
})
|
||||
|
||||
return true
|
||||
}
|
||||
} else if (uri.scheme == MARKET) {
|
||||
val host = uri.host
|
||||
var id = ""
|
||||
try {
|
||||
id = uri.getQueryParameter("id") ?: ""
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
if (host != null) {
|
||||
if ("details" == host) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(
|
||||
EntranceConsts.KEY_TO,
|
||||
EntranceConsts.KEY_MARKET_DETAILS
|
||||
)
|
||||
bundle.putString(EntranceConsts.KEY_DATA, id)
|
||||
EntranceUtils.jumpActivity(context, bundle)
|
||||
} else {
|
||||
EntranceUtils.jumpActivity(context, Bundle()) // 跳转至首页
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -14,8 +14,8 @@ import androidx.core.app.NotificationCompat
|
||||
import androidx.core.text.bold
|
||||
import androidx.core.text.buildSpannedString
|
||||
import androidx.core.text.color
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.router.Route
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.common.dialog.NewPrivacyPolicyDialogFragment
|
||||
import com.gh.common.util.DeviceTokenUtils
|
||||
import com.gh.common.util.DialogUtils
|
||||
@ -29,6 +29,7 @@ import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.tracker.TrackerLogger
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.iinterface.ISplashScreen
|
||||
import com.gh.gamecenter.core.provider.IAppProvider
|
||||
import com.gh.gamecenter.core.provider.IPackageUtilsProvider
|
||||
import com.gh.gamecenter.core.provider.IPushProvider
|
||||
@ -47,7 +48,7 @@ import java.util.*
|
||||
* 引导页面
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.splashActivity)
|
||||
class SplashScreenActivity : BaseActivity() {
|
||||
class SplashScreenActivity : BaseActivity(), ISplashScreen {
|
||||
|
||||
private var mSharedPreferences: SharedPreferences? = null
|
||||
private var mIsNewForThisVersion = false
|
||||
@ -136,9 +137,8 @@ class SplashScreenActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
private fun logAppLaunch() {
|
||||
val packageUtilsConfig =
|
||||
ARouter.getInstance().build(RouteConsts.provider.packageUtils).navigation() as? IPackageUtilsProvider
|
||||
val appProvider = ARouter.getInstance().build(RouteConsts.provider.app).navigation() as? IAppProvider
|
||||
val packageUtilsConfig = TheRouter.get(IPackageUtilsProvider::class.java)
|
||||
val appProvider = TheRouter.get(IAppProvider::class.java)
|
||||
val signatureHash = packageUtilsConfig?.getApkSignatureByPackageName(this, packageName)?.get(0)
|
||||
val sideLoadInfo = packageUtilsConfig?.getSideLoadedInfo()
|
||||
val trackEvent = JSONObject()
|
||||
@ -282,7 +282,7 @@ class SplashScreenActivity : BaseActivity() {
|
||||
SensorsBridge.init(HaloApp.getInstance(), HaloApp.getInstance().channel)
|
||||
SensorsBridge.setOAID(HaloApp.getInstance().oaid)
|
||||
|
||||
val pushProvider = ARouter.getInstance().build(RouteConsts.provider.push).navigation() as? IPushProvider
|
||||
val pushProvider = TheRouter.get(IPushProvider::class.java)
|
||||
val registrationId = pushProvider?.getRegistrationId(this)
|
||||
if (!registrationId.isNullOrEmpty()) {
|
||||
SensorsBridge.profileAppend(KEY_REGISTRATION_ID, registrationId)
|
||||
|
||||
@ -6,7 +6,7 @@ import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
|
||||
@ -19,8 +19,8 @@ import android.util.Base64;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.therouter.router.Route;
|
||||
import com.therouter.TheRouter;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.util.IntegralLogHelper;
|
||||
import com.gh.gamecenter.common.callback.BiCallback;
|
||||
@ -52,7 +52,7 @@ import java.io.ByteArrayOutputStream;
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.weiBoShareActivity)
|
||||
public class WeiBoShareActivity extends Activity implements WbShareCallback {
|
||||
private IAppProvider mAppProvider = (IAppProvider) ARouter.getInstance().build(RouteConsts.provider.app).navigation();
|
||||
private final IAppProvider mAppProvider = TheRouter.get(IAppProvider.class);
|
||||
|
||||
private static final String WEIBO_SCOPE = (
|
||||
"email,direct_messages_read,direct_messages_write,"
|
||||
|
||||
@ -2,6 +2,7 @@ package com.gh.gamecenter.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.Html;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
@ -12,6 +13,7 @@ import android.text.style.ClickableSpan;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
@ -20,9 +22,13 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
|
||||
import com.facebook.drawee.drawable.ScalingUtils;
|
||||
import com.facebook.drawee.generic.GenericDraweeHierarchyBuilder;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.common.util.DirectUtils;
|
||||
import com.gh.common.util.LibaoUtils;
|
||||
import com.gh.gamecenter.GameDetailActivity;
|
||||
import com.gh.gamecenter.ImageViewerActivity;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.adapter.viewholder.LibaoDetailContentViewHolder;
|
||||
import com.gh.gamecenter.adapter.viewholder.LibaoDetailTopViewHolder;
|
||||
@ -31,6 +37,7 @@ import com.gh.gamecenter.common.entity.SimpleGameEntity;
|
||||
import com.gh.gamecenter.common.entity.SuggestType;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.utils.ImageUtils;
|
||||
import com.gh.gamecenter.common.utils.PicassoImageGetter;
|
||||
import com.gh.gamecenter.common.viewholder.FooterViewHolder;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
@ -79,6 +86,7 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
private String mEntrance;
|
||||
private final int TYPE_FOOTER = 100;
|
||||
public LibaoDetailTopViewHolder libaoDetailTopViewHolder;
|
||||
private ArrayList<View> mImageViewList = new ArrayList<>();
|
||||
|
||||
public LibaoDetailAdapter(Context context, OnRequestCallBackListener onRequestCallBackListener,
|
||||
OnCodeScrollListener onCodeScrollListener, LibaoEntity libaoEntity,
|
||||
@ -317,6 +325,31 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
holder.binding.libaodetailContentLl.setVisibility(View.VISIBLE);
|
||||
holder.binding.libaodetailContent.setText(Html.fromHtml(mLibaoEntity.getContent()));
|
||||
}
|
||||
if (mLibaoEntity.getMaterials().isEmpty()) {
|
||||
holder.binding.horizontalScrollView.setVisibility(View.GONE);
|
||||
} else {
|
||||
holder.binding.horizontalScrollView.setVisibility(View.VISIBLE);
|
||||
holder.binding.imagesContainer.removeAllViews();
|
||||
mImageViewList.clear();
|
||||
for (int i = 0; i < mLibaoEntity.getMaterials().size(); i++) {
|
||||
String imageUrl = mLibaoEntity.getMaterials().get(i);
|
||||
SimpleDraweeView imageView = new SimpleDraweeView(mContext);
|
||||
imageView.setHierarchy(new GenericDraweeHierarchyBuilder(mContext.getResources())
|
||||
.setFadeDuration(500)
|
||||
.setPlaceholderImage(com.gh.gamecenter.common.R.drawable.occupy, ScalingUtils.ScaleType.FIT_XY)
|
||||
.build());
|
||||
ImageUtils.display(imageView, imageUrl);
|
||||
final int index = i;
|
||||
imageView.setOnClickListener(v -> {
|
||||
Intent intent = ImageViewerActivity.getIntent(mContext, mLibaoEntity.getMaterials(), index, mImageViewList, mEntrance);
|
||||
mContext.startActivity(intent);
|
||||
});
|
||||
mImageViewList.add(imageView);
|
||||
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(DisplayUtils.dip2px(24F), DisplayUtils.dip2px(24F));
|
||||
layoutParams.setMargins(i != 0 ? DisplayUtils.dip2px(16F) : 0, 0, 0, 0);
|
||||
holder.binding.imagesContainer.addView(imageView, layoutParams);
|
||||
}
|
||||
}
|
||||
if (mLibaoDetailEntity != null) {
|
||||
holder.binding.libaodetailTimeLl.setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
@ -31,7 +31,6 @@ import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.utils.NewFlatLogUtils
|
||||
import com.gh.gamecenter.core.runOnIoThread
|
||||
@ -44,8 +43,9 @@ import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.feature.view.DownloadButton
|
||||
import com.gh.gamecenter.feature.view.DownloadButton.ButtonStyle
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment
|
||||
import com.gh.gamecenter.gamedetail.GameDetailViewModel
|
||||
import com.gh.gamecenter.gamedetail.dialog.GamePermissionDialogFragment
|
||||
import com.gh.gamecenter.gamedetail.entity.GameDetailTabEntity
|
||||
import com.gh.gamecenter.teenagermode.TeenagerModeActivity.Companion.getIntent
|
||||
import com.gh.vspace.VHelper
|
||||
import com.lightgame.download.DownloadEntity
|
||||
@ -56,13 +56,15 @@ import java.io.File
|
||||
// 虽然叫 ViewHolder,但其实就是一个用来临时放 View 和相关操作的包裹类
|
||||
class DetailViewHolder(
|
||||
view: View,
|
||||
val viewModel: GameDetailViewModel?,
|
||||
val gameEntity: GameEntity,
|
||||
val isNewsDetail: Boolean, // 新闻详情不显示下载的游戏名, 只显示下载状态
|
||||
entrance: String?,
|
||||
name: String?,
|
||||
title: String?,
|
||||
val traceEvent: ExposureEvent?,
|
||||
val isSupportDualButton: Boolean = false // 是否支持双下载按钮,不支持的时候跟普通列表意义选用优先级高的那个来显示
|
||||
val isSupportDualButton: Boolean = false, // 是否支持双下载按钮,不支持的时候跟普通列表意义选用优先级高的那个来显示
|
||||
onDownloadClickAction: ((Boolean) -> Unit)? = null
|
||||
) {
|
||||
var context: Context
|
||||
var downloadBottom: View
|
||||
@ -115,7 +117,8 @@ class DetailViewHolder(
|
||||
mTitle = title ?: "",
|
||||
mAsVGame = false,
|
||||
mShowDualDownloadButton = gameDownloadMode == GameEntity.GAME_DOWNLOAD_BUTTON_MODE_DUAL,
|
||||
mTraceEvent = traceEvent
|
||||
mTraceEvent = traceEvent,
|
||||
onDownloadClickAction = onDownloadClickAction
|
||||
)
|
||||
|
||||
val vGameDownloadListener = OnDetailDownloadClickListener(
|
||||
@ -125,7 +128,8 @@ class DetailViewHolder(
|
||||
mTitle = title ?: "",
|
||||
mAsVGame = true,
|
||||
mShowDualDownloadButton = gameDownloadMode == GameEntity.GAME_DOWNLOAD_BUTTON_MODE_DUAL,
|
||||
mTraceEvent = traceEvent
|
||||
mTraceEvent = traceEvent,
|
||||
onDownloadClickAction = onDownloadClickAction
|
||||
)
|
||||
|
||||
// 不支持双下载按钮的情况时,优选一个下载方式显示
|
||||
@ -183,7 +187,8 @@ class DetailViewHolder(
|
||||
private val mTitle: String,
|
||||
private val mAsVGame: Boolean,
|
||||
private val mShowDualDownloadButton: Boolean,
|
||||
private val mTraceEvent: ExposureEvent?
|
||||
private val mTraceEvent: ExposureEvent?,
|
||||
private val onDownloadClickAction: ((Boolean) -> Unit)? = null
|
||||
) : View.OnClickListener {
|
||||
|
||||
private val mGameEntity: GameEntity = mViewHolder.gameEntity
|
||||
@ -276,7 +281,7 @@ class DetailViewHolder(
|
||||
showLandPageAddressDialogIfNeeded()
|
||||
}
|
||||
} else if ("toast" == offStatus) {
|
||||
EventBus.getDefault().post(EBReuse(GameDetailFragment.SKIP_RATING))
|
||||
mViewHolder.viewModel?.performTabSelected(GameDetailTabEntity.TYPE_COMMENT)
|
||||
ToastUtils.toast("该游戏因故暂不提供下载,具体详情可在相关评论中查看,敬请谅解~")
|
||||
showLandPageAddressDialogIfNeeded()
|
||||
}
|
||||
@ -295,6 +300,10 @@ class DetailViewHolder(
|
||||
DataLogUtils.uploadGameLog(mViewHolder.context, mGameEntity.id, mGameEntity.name, mEntrance)
|
||||
}
|
||||
|
||||
val buttonText = mViewHolder.downloadPb.text.ifEmpty { mViewHolder.overlayTv?.text ?: "" }
|
||||
val isUpdate = mViewHolder.context.getString(com.gh.gamecenter.feature.R.string.update_v) == buttonText || buttonText.contains(mViewHolder.context.getString(com.gh.gamecenter.feature.R.string.update))
|
||||
onDownloadClickAction?.invoke(isUpdate)
|
||||
|
||||
preDownload()
|
||||
}
|
||||
|
||||
|
||||
@ -2,17 +2,30 @@ package com.gh.gamecenter.cloudarchive
|
||||
|
||||
import android.app.Application
|
||||
import com.gh.gamecenter.common.baselist.ListViewModel
|
||||
import com.gh.gamecenter.common.utils.toRequestBody
|
||||
import com.gh.gamecenter.entity.ArchiveEntity
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.lightgame.utils.Utils
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.*
|
||||
import retrofit2.HttpException
|
||||
import java.io.IOException
|
||||
|
||||
open class BaseCloudArchiveViewModel(application: Application, private val mConfigUrl: String): ListViewModel<ArchiveEntity, ArchiveEntity>(application) {
|
||||
open class BaseCloudArchiveViewModel(
|
||||
application: Application,
|
||||
private val mGameId: String,
|
||||
private var mConfigUrl: String
|
||||
) : ListViewModel<ArchiveEntity, ArchiveEntity>(application) {
|
||||
private var mArchiveConfigStr = ""
|
||||
|
||||
init {
|
||||
getArchiveConfigString()
|
||||
if (mConfigUrl.isEmpty()) {
|
||||
getArchiveConfigUrl()
|
||||
} else {
|
||||
getArchiveConfigString()
|
||||
}
|
||||
}
|
||||
|
||||
// 通过url获取config字符串内容
|
||||
@ -41,6 +54,27 @@ open class BaseCloudArchiveViewModel(application: Application, private val mConf
|
||||
}
|
||||
}
|
||||
|
||||
// 获取游戏存档配置url
|
||||
private fun getArchiveConfigUrl() {
|
||||
val map = mapOf(
|
||||
"game_ids" to listOf(mGameId)
|
||||
)
|
||||
RetrofitManager.getInstance().newApi.getGamesArchiveConfigs(map.toRequestBody())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(object : com.gh.gamecenter.common.retrofit.Response<List<ArchiveEntity>>() {
|
||||
override fun onResponse(response: List<ArchiveEntity>?) {
|
||||
mConfigUrl = response?.find { it.gameId == mGameId }?.configUrl ?: return
|
||||
getArchiveConfigString()
|
||||
}
|
||||
|
||||
override fun onFailure(e: HttpException?) {
|
||||
super.onFailure(e)
|
||||
Utils.toast(getApplication(), "获取存档配置失败")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun provideDataObservable(page: Int): Observable<List<ArchiveEntity>>? = null
|
||||
|
||||
override fun mergeResultLiveData() {}
|
||||
|
||||
@ -8,7 +8,6 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.gh.common.util.NewFlatLogUtils
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse
|
||||
import com.gh.gamecenter.common.utils.toJson
|
||||
import com.gh.gamecenter.common.utils.toRequestBody
|
||||
import com.gh.gamecenter.core.utils.GsonUtils
|
||||
import com.gh.gamecenter.entity.ArchiveEntity
|
||||
@ -22,7 +21,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.CompositeDisposable
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.*
|
||||
import okhttp3.ResponseBody
|
||||
import retrofit2.HttpException
|
||||
|
||||
class CloudArchiveManagerViewModel(
|
||||
@ -30,7 +29,7 @@ class CloudArchiveManagerViewModel(
|
||||
val gameId: String,
|
||||
val gameName: String,
|
||||
configUrl: String
|
||||
) : BaseCloudArchiveViewModel(application, configUrl) {
|
||||
) : BaseCloudArchiveViewModel(application, gameId, configUrl) {
|
||||
|
||||
companion object {
|
||||
private const val SORT_TYPE_CREATE = "time.create:-1"
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
package com.gh.gamecenter.entity
|
||||
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
|
||||
@Entity
|
||||
data class HistoryGameDetailEntity(
|
||||
@PrimaryKey
|
||||
var id: String = "",
|
||||
var name: String? = "",
|
||||
)
|
||||
@ -1,7 +1,7 @@
|
||||
package com.gh.gamecenter.entity
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.provider.IConfigProvider
|
||||
import com.gh.gamecenter.feature.entity.*
|
||||
@ -93,7 +93,7 @@ open class VideoEntity(
|
||||
get() = _count ?: Count()
|
||||
|
||||
fun getThumb(): String {
|
||||
val configProvider = ARouter.getInstance().build(RouteConsts.provider.config).navigation() as? IConfigProvider
|
||||
val configProvider = TheRouter.get(IConfigProvider::class.java)
|
||||
return if (!configProvider?.getVideoSnapshotSuffix().isNullOrEmpty()) {
|
||||
"$url${configProvider?.getVideoSnapshotSuffix()},t_0,f_jpg,w_0,h_0,ar_auto"
|
||||
} else {
|
||||
|
||||
@ -709,7 +709,7 @@ class ForumDetailFragment : BaseLazyTabFragment(), IScrollable {
|
||||
} else {
|
||||
val fuliFragment = childFragmentManager.findFragmentByTag("${tag}$INDEX_TRENDS") ?: FuLiFragment()
|
||||
fuliFragment.arguments = bundleOf(
|
||||
GameEntity.TAG to game.toGameEntity(),
|
||||
EntranceConsts.KEY_GAME_ENTITY to game.toGameEntity(),
|
||||
EntranceConsts.KEY_ENTRANCE to mEntrance,
|
||||
EntranceConsts.KEY_PATH to TAB_TRENDS
|
||||
)
|
||||
|
||||
@ -8,7 +8,6 @@ import android.text.SpannableStringBuilder
|
||||
import android.view.View
|
||||
import com.facebook.drawee.view.SimpleDraweeView
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.common.util.LogUtils
|
||||
import com.gh.common.util.NewLogUtils
|
||||
import com.gh.common.view.ImageContainerView
|
||||
@ -17,22 +16,18 @@ import com.gh.gamecenter.ImageViewerActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.callback.ConfirmListener
|
||||
import com.gh.gamecenter.common.entity.AdditionalParamsEntity
|
||||
import com.gh.gamecenter.common.entity.CommunityEntity
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.utils.MtaHelper
|
||||
import com.gh.gamecenter.core.utils.SpanBuilder
|
||||
import com.gh.gamecenter.core.utils.ToastUtils
|
||||
import com.gh.gamecenter.databinding.CommunityAnswerItemBinding
|
||||
import com.gh.gamecenter.feature.entity.ForumVideoEntity
|
||||
import com.gh.gamecenter.eventbus.EBUserFollow
|
||||
import com.gh.gamecenter.forum.detail.ForumDetailActivity
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.qa.answer.BaseAnswerOrArticleItemViewHolder
|
||||
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
|
||||
import com.gh.gamecenter.feature.entity.AnswerEntity
|
||||
import com.gh.gamecenter.feature.entity.ArticleEntity
|
||||
import com.gh.gamecenter.feature.entity.CommunityItemData
|
||||
import com.gh.gamecenter.feature.entity.ForumVideoEntity
|
||||
import com.gh.gamecenter.forum.detail.ForumDetailActivity
|
||||
import com.gh.gamecenter.forum.home.ArticleItemVideoView.Companion.toArticleVideoData
|
||||
import com.gh.gamecenter.forum.search.CommunitySearchEventListener
|
||||
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEARCH_BUTTON_COMMENT
|
||||
@ -44,6 +39,9 @@ import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEA
|
||||
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEARCH_BUTTON_VIEW_IMAGE
|
||||
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.SEARCH_BUTTON_VIEW_USER_DETAIL
|
||||
import com.gh.gamecenter.forum.search.CommunitySearchEventListener.Companion.htmlToString
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.qa.answer.BaseAnswerOrArticleItemViewHolder
|
||||
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
|
||||
import com.gh.gamecenter.qa.entity.QuestionsDetailEntity
|
||||
import com.gh.gamecenter.qa.questions.invite.QuestionsInviteActivity
|
||||
import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
|
||||
@ -348,8 +346,8 @@ class ForumArticleAskItemViewHolder(
|
||||
.setReleaseWhenLossAudio(true)
|
||||
.setLooping(false)
|
||||
.setShowFullAnimation(false)
|
||||
.setEnlargeImageRes(R.drawable.ic_game_detail_enter_full_screen)
|
||||
.setShrinkImageRes(R.drawable.ic_game_detail_exit_full_screen)
|
||||
.setEnlargeImageRes(R.drawable.ic_video_enter_full_screen)
|
||||
.setShrinkImageRes(R.drawable.ic_video_exit_full_screen)
|
||||
.setVideoAllCallBack(object : GSYSampleCallBack() {
|
||||
override fun onQuitFullscreen(url: String?, vararg objects: Any) {
|
||||
orientationUtils.backToProtVideo()
|
||||
|
||||
@ -19,7 +19,7 @@ import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.OnScrollListener
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.common.util.CheckLoginUtils
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
@ -150,7 +150,7 @@ class FollowHomeFragment : LazyFragment(), IScrollable {
|
||||
KEY_LAUNCH_ALL_FOLLOW,
|
||||
this,
|
||||
object : ActivityResultContract<Unit, List<String>?>() {
|
||||
override fun createIntent(context: Context, input: Unit?): Intent {
|
||||
override fun createIntent(context: Context, input: Unit): Intent {
|
||||
return AllFollowedActivity.getIntent(context)
|
||||
}
|
||||
|
||||
@ -280,7 +280,6 @@ class FollowHomeFragment : LazyFragment(), IScrollable {
|
||||
requireContext(),
|
||||
it.id,
|
||||
"",
|
||||
-1,
|
||||
traceEvent = it.exposureEvent
|
||||
)
|
||||
})
|
||||
@ -309,15 +308,14 @@ class FollowHomeFragment : LazyFragment(), IScrollable {
|
||||
})
|
||||
|
||||
newDetailDestination.observe(viewLifecycleOwner, EventObserver {
|
||||
ARouter.getInstance().build(RouteConsts.activity.newsDetailActivity)
|
||||
TheRouter.build(RouteConsts.activity.newsDetailActivity)
|
||||
.withString(EntranceConsts.KEY_NEWSID, it)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "")
|
||||
.navigation(requireActivity())
|
||||
})
|
||||
|
||||
articleCommentDetailDestination.observe(viewLifecycleOwner, EventObserver {
|
||||
val messageDetailProvider = ARouter.getInstance().build(RouteConsts.provider.messageDetail)
|
||||
.navigation() as? IMessageDetailProvider
|
||||
val messageDetailProvider = TheRouter.get(IMessageDetailProvider::class.java)
|
||||
if (messageDetailProvider != null) {
|
||||
val intent = messageDetailProvider.getIntentById(requireContext(), it, -1, false, "")
|
||||
startActivity(intent)
|
||||
@ -340,10 +338,7 @@ class FollowHomeFragment : LazyFragment(), IScrollable {
|
||||
|
||||
updateOkhttpCacheAction.observe(viewLifecycleOwner, EventObserver {
|
||||
// 更新okhttp缓存数据
|
||||
val visitManagerProvider =
|
||||
ARouter.getInstance()
|
||||
.build(RouteConsts.provider.visitManager)
|
||||
.navigation() as? IVisitManagerProvider
|
||||
val visitManagerProvider = TheRouter.get(IVisitManagerProvider::class.java)
|
||||
visitManagerProvider?.updateOkhttpCache(requireContext(), it)
|
||||
})
|
||||
}
|
||||
|
||||
@ -3,18 +3,19 @@ package com.gh.gamecenter.game.horizontal
|
||||
import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.util.*
|
||||
import com.gh.common.util.DataCollectionUtils
|
||||
import com.gh.common.util.DownloadItemUtils
|
||||
import com.gh.common.util.NewLogUtils
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.utils.StringUtils
|
||||
import com.gh.gamecenter.entity.SubjectEntity
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.exposure.ExposureEvent
|
||||
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.subjectTypeToComponentStyle
|
||||
import com.gh.gamecenter.feature.minigame.MiniGameItemHelper
|
||||
import com.gh.gamecenter.gamedetail.detail.viewholder.BaseGameDetailItemViewHolder
|
||||
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.subjectTypeToComponentStyle
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
import com.lightgame.download.DownloadEntity
|
||||
|
||||
@ -22,7 +23,9 @@ class GameHorizontalAdapter(
|
||||
context: Context,
|
||||
private var mSubjectEntity: SubjectEntity,
|
||||
private var type: GameHorizontalListType = GameHorizontalListType.SubjectHorizontalType,
|
||||
private val trackColumnClick: Boolean = true
|
||||
private val trackColumnClick: Boolean = true,
|
||||
private val gameDetailTrackData: BaseGameDetailItemViewHolder.GameDetailModuleTrackData? = null,
|
||||
private val getGameStatus: (() -> String)? = null
|
||||
) : BaseRecyclerAdapter<GameHorizontalItemViewHolder>(context) {
|
||||
|
||||
var gameName = ""
|
||||
@ -85,6 +88,7 @@ class GameHorizontalAdapter(
|
||||
gameIcon.displayGameIcon(gameEntity)
|
||||
GameHorizontalSimpleItemViewHolder.setHorizontalNameAndGravity(gameName, gameEntity.name)
|
||||
downloadBtn.goneIf(!mSubjectEntity.showDownload)
|
||||
gameName.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(mContext))
|
||||
gameName.maxLines = if (mSubjectEntity.showDownload) 1 else 2
|
||||
}
|
||||
holder.bindGameHorizontalItem(gameEntity, mSubjectEntity)
|
||||
@ -111,20 +115,15 @@ class GameHorizontalAdapter(
|
||||
if (type == GameHorizontalListType.GameDetailHorizontalType) {
|
||||
DataCollectionUtils.uploadClick(mContext, path, "游戏详情", gameEntity.name)
|
||||
NewLogUtils.logGameDetailPopularClick(gameName, gameId, "game", gameEntity.name ?: "")
|
||||
SensorsBridge.trackGameDetailPagePopularClick(
|
||||
gameId = gameId,
|
||||
gameName = gameName,
|
||||
pageName = GlobalActivityManager.getCurrentPageEntity().pageName,
|
||||
pageId = GlobalActivityManager.getCurrentPageEntity().pageId,
|
||||
pageBusinessId = GlobalActivityManager.getCurrentPageEntity().pageBusinessId,
|
||||
lastPageName = GlobalActivityManager.getLastPageEntity().pageName,
|
||||
lastPageId = GlobalActivityManager.getLastPageEntity().pageId,
|
||||
lastPageBusinessId = GlobalActivityManager.getLastPageEntity().pageBusinessId,
|
||||
downloadStatus = game?.downloadStatusChinese ?: "",
|
||||
gameType = game?.categoryChinese ?: "",
|
||||
clickGameType = gameEntity.categoryChinese,
|
||||
clickGameName = gameEntity.name ?: "",
|
||||
clickGameId = gameEntity.id
|
||||
SensorsBridge.trackGameDetailModuleClick(
|
||||
gameDetailTrackData?.gameId,
|
||||
gameDetailTrackData?.gameName,
|
||||
gameDetailTrackData?.gameType,
|
||||
"右上角",
|
||||
gameDetailTrackData?.moduleType,
|
||||
gameDetailTrackData?.moduleName,
|
||||
gameDetailTrackData?.sequence,
|
||||
gameStatus = getGameStatus?.invoke()
|
||||
)
|
||||
if (!gameEntity.isMiniGame() && trackColumnClick) {
|
||||
SensorsBridge.trackColumnClick(
|
||||
|
||||
@ -3,7 +3,7 @@ package com.gh.gamecenter.game.upload
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
|
||||
@ -39,7 +39,6 @@ import com.gh.gamecenter.common.syncpage.SyncDataEntity
|
||||
import com.gh.gamecenter.common.syncpage.SyncFieldConstants
|
||||
import com.gh.gamecenter.common.syncpage.SyncPageRepository
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.view.SegmentedFilterView
|
||||
import com.gh.gamecenter.core.iinterface.IScrollable
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.databinding.FragmentGameCollectionDetailBinding
|
||||
@ -48,7 +47,6 @@ import com.gh.gamecenter.entity.GamesCollectionDetailEntity
|
||||
import com.gh.gamecenter.eventbus.EBDownloadStatus
|
||||
import com.gh.gamecenter.eventbus.EBPackage
|
||||
import com.gh.gamecenter.eventbus.EBUserFollow
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment
|
||||
import com.gh.gamecenter.home.video.ScrollCalculatorHelper
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.login.user.UserViewModel
|
||||
@ -187,12 +185,10 @@ class GameCollectionDetailFragment :
|
||||
root.layoutParams = this
|
||||
}
|
||||
orderSfv.setItemList(listOf("正序", "倒序"), 0)
|
||||
orderSfv.setOnCheckedCallback(object : SegmentedFilterView.OnCheckedCallback {
|
||||
override fun onItemCheck(position: Int) {
|
||||
getFilterVH()?.binding?.orderSfv?.performClick(position)
|
||||
updateFilterView()
|
||||
}
|
||||
})
|
||||
orderSfv.setOnCheckedCallback { position ->
|
||||
getFilterVH()?.binding?.orderSfv?.performClick(position)
|
||||
updateFilterView()
|
||||
}
|
||||
commentHintTv.text = "玩家评论"
|
||||
}
|
||||
}
|
||||
@ -741,7 +737,7 @@ class GameCollectionDetailFragment :
|
||||
if (activity != null && activity?.isFinishing != true) {
|
||||
startPlayLogic(isAutoPlay = true)
|
||||
}
|
||||
}, GameDetailFragment.INITIAL_DELAY)
|
||||
}, INITIAL_DELAY)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1209,4 +1205,8 @@ class GameCollectionDetailFragment :
|
||||
appbar.setExpanded(true)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val INITIAL_DELAY = 500L
|
||||
}
|
||||
}
|
||||
@ -13,15 +13,15 @@ import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentManager
|
||||
import com.gh.common.util.NewLogUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.observer.MuteCallback
|
||||
import com.gh.gamecenter.common.observer.VolumeObserver
|
||||
import com.gh.gamecenter.core.runOnIoThread
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.utils.debounceActionWithInterval
|
||||
import com.gh.gamecenter.common.utils.rxTimer
|
||||
import com.gh.gamecenter.common.utils.ImageUtils
|
||||
import com.gh.gamecenter.common.utils.NetworkUtils
|
||||
import com.gh.gamecenter.common.utils.debounceActionWithInterval
|
||||
import com.gh.gamecenter.common.utils.rxTimer
|
||||
import com.gh.gamecenter.core.runOnIoThread
|
||||
import com.gh.gamecenter.core.utils.MD5Utils
|
||||
import com.gh.gamecenter.entity.GamesCollectionDetailEntity
|
||||
import com.gh.gamecenter.home.video.ScrollCalculatorHelper
|
||||
@ -180,7 +180,7 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
|
||||
|
||||
private fun mute(isManual: Boolean = false) {
|
||||
viewModel?.videoIsMuted = true
|
||||
volume.setImageResource(R.drawable.ic_game_detail_volume_off)
|
||||
volume.setImageResource(R.drawable.ic_video_volume_off)
|
||||
CustomManager.getCustomManager(getKey()).isNeedMute = true
|
||||
if (isManual) {
|
||||
Utils.toast(context, "当前处于静音状态")
|
||||
@ -190,7 +190,7 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
|
||||
|
||||
private fun unMute(isManual: Boolean = false) {
|
||||
viewModel?.videoIsMuted = false
|
||||
volume.setImageResource(R.drawable.ic_game_detail_volume_on)
|
||||
volume.setImageResource(R.drawable.ic_video_volume_on)
|
||||
CustomManager.getCustomManager(getKey()).isNeedMute = false
|
||||
if (isManual) {
|
||||
logVideoEvent("video_game_collect_detail_mute_cancel")
|
||||
@ -278,9 +278,9 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
|
||||
if (mStartButton is ImageView) {
|
||||
val imageView = mStartButton as ImageView
|
||||
when (mCurrentState) {
|
||||
GSYVideoView.CURRENT_STATE_PLAYING -> imageView.setImageResource(R.drawable.ic_game_detail_pause)
|
||||
GSYVideoView.CURRENT_STATE_ERROR -> imageView.setImageResource(R.drawable.ic_game_detail_play)
|
||||
else -> imageView.setImageResource(R.drawable.ic_game_detail_play)
|
||||
GSYVideoView.CURRENT_STATE_PLAYING -> imageView.setImageResource(R.drawable.ic_video_pause)
|
||||
GSYVideoView.CURRENT_STATE_ERROR -> imageView.setImageResource(R.drawable.ic_video_play)
|
||||
else -> imageView.setImageResource(R.drawable.ic_video_play)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -314,11 +314,11 @@ class GameCollectionVideoView @JvmOverloads constructor(context: Context, attrs:
|
||||
}
|
||||
|
||||
override fun getEnlargeImageRes(): Int {
|
||||
return R.drawable.ic_game_detail_enter_full_screen
|
||||
return R.drawable.ic_video_enter_full_screen
|
||||
}
|
||||
|
||||
override fun getShrinkImageRes(): Int {
|
||||
return R.drawable.ic_game_detail_exit_full_screen
|
||||
return R.drawable.ic_video_exit_full_screen
|
||||
}
|
||||
|
||||
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
|
||||
|
||||
@ -1,51 +0,0 @@
|
||||
package com.gh.gamecenter.gamedetail
|
||||
|
||||
import android.content.Context
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.gamecenter.common.utils.safelyGetInRelease
|
||||
import com.gh.gamecenter.common.utils.toBinding
|
||||
import com.gh.gamecenter.common.utils.toColor
|
||||
import com.gh.gamecenter.core.utils.TimeUtils
|
||||
import com.gh.gamecenter.databinding.ItemGameDetailContentCardContentBinding
|
||||
import com.gh.gamecenter.gamedetail.entity.ContentCardEntity
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
|
||||
class GameDetailContentCardContentAdapter(
|
||||
context: Context,
|
||||
private val linkEntity: ContentCardEntity,
|
||||
private val isHighlightBg: Boolean = false
|
||||
) : BaseRecyclerAdapter<RecyclerView.ViewHolder>(context) {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder =
|
||||
GameDetailContentCardContentItemViewHolder(parent.toBinding())
|
||||
|
||||
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
|
||||
if (holder is GameDetailContentCardContentItemViewHolder) {
|
||||
holder.binding.root.setTextColor(
|
||||
if (isHighlightBg) com.gh.gamecenter.common.R.color.text_secondary.toColor(mContext) else com.gh.gamecenter.common.R.color.text_tertiary.toColor(
|
||||
mContext
|
||||
)
|
||||
)
|
||||
if (linkEntity.type == "func_server" && linkEntity.server != null && linkEntity.server?.calendar?.isNotEmpty() == true) {
|
||||
val calendarList = linkEntity.server!!.calendar
|
||||
val realPosition = position % calendarList.size
|
||||
calendarList.safelyGetInRelease(realPosition)?.let {
|
||||
val serverTime =
|
||||
if (TimeUtils.isToday(it.getTime()))
|
||||
it.getFormatTime("今天 HH:mm")
|
||||
else if (TimeUtils.isTomorrow(it.getTime()))
|
||||
it.getFormatTime("明天 HH:mm")
|
||||
else
|
||||
it.getFormatTime("MM-dd HH:mm")
|
||||
holder.binding.root.text = "$serverTime ${it.type}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = Int.MAX_VALUE
|
||||
|
||||
class GameDetailContentCardContentItemViewHolder(var binding: ItemGameDetailContentCardContentBinding) :
|
||||
RecyclerView.ViewHolder(binding.root)
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user