Compare commits
5 Commits
v5.38.5-11
...
feat/GHZSC
| Author | SHA1 | Date | |
|---|---|---|---|
| 1bffb4b25d | |||
| 0c1d1d72f2 | |||
| a5039ba682 | |||
| 43d92cf037 | |||
| bd0eb7eafd |
@ -2,6 +2,7 @@
|
||||
apply plugin: 'com.android.application'
|
||||
apply plugin: 'kotlin-android' // kotlin
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
|
||||
import groovy.xml.XmlUtil
|
||||
@ -121,10 +122,9 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
arg("AROUTER_GENERATE_DOC", "enable")
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
@ -376,7 +376,7 @@ dependencies {
|
||||
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}"
|
||||
@ -426,7 +426,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("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
|
||||
implementation project(':ndownload')
|
||||
implementation project(':vspace-bridge:vspace')
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -22,6 +22,7 @@ import com.gh.gamecenter.ImageViewerActivity
|
||||
import com.gh.gamecenter.WebActivity
|
||||
import com.gh.gamecenter.common.callback.BiCallback
|
||||
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.entity.NotificationUgc
|
||||
import com.gh.gamecenter.common.exposure.ExposureSource
|
||||
@ -140,10 +141,11 @@ class DefaultJsApi(
|
||||
@JavascriptInterface
|
||||
fun login(msg: Any) {
|
||||
if (NetworkUtils.isQuickLoginEnabled(context)) {
|
||||
QuickLoginHelper.startLogin(context, "浏览器")
|
||||
QuickLoginHelper.startLogin(context, "浏览器", false)
|
||||
} else {
|
||||
val intent = LoginActivity.getIntent(context, "浏览器")
|
||||
context.startActivity(intent)
|
||||
ARouter.getInstance().build(RouteConsts.activity.loginActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "浏览器")
|
||||
.navigation(context)
|
||||
}
|
||||
}
|
||||
|
||||
@ -380,8 +382,11 @@ class DefaultJsApi(
|
||||
|
||||
@JavascriptInterface
|
||||
fun bindPhone(msg: Any) {
|
||||
val intent = SettingBridge.getBindPhoneNormalIntent(context, false)
|
||||
context.startActivity(intent)
|
||||
ARouter.getInstance().build(RouteConsts.activity.bindPhoneActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "浏览器")
|
||||
.withBoolean(EntranceConsts.KEY_REQUIRE_LOGIN, true)
|
||||
.withBoolean(EntranceConsts.KEY_CHANGE_PHONE, false)
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
|
||||
@ -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!!)
|
||||
|
||||
@ -103,7 +103,6 @@ class AccelerateNotificationHandler(priority: Int) : PriorityChainHandler(priori
|
||||
context = activity,
|
||||
gameId = gameEntity.id,
|
||||
entrance = "首页插件上架弹窗",
|
||||
defaultTab = -1,
|
||||
isSkipGameComment = false,
|
||||
scrollToLibao = false,
|
||||
openVideoStreaming = false,
|
||||
|
||||
@ -54,7 +54,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
|
||||
context: Context,
|
||||
gameId: String,
|
||||
entrance: String?,
|
||||
defaultTab: Int,
|
||||
isSkipGameComment: Boolean,
|
||||
scrollToLibao: Boolean,
|
||||
openVideoStreaming: Boolean,
|
||||
@ -65,7 +64,6 @@ class GameDetailProviderImpl : IGameDetailProvider {
|
||||
context,
|
||||
gameId,
|
||||
entrance,
|
||||
defaultTab,
|
||||
isSkipGameComment,
|
||||
scrollToLibao,
|
||||
openVideoStreaming,
|
||||
|
||||
@ -52,7 +52,7 @@ public class CheckLoginUtils {
|
||||
}
|
||||
|
||||
if (context != null) {
|
||||
QuickLoginHelper.startLogin(context, entrance, callback);
|
||||
QuickLoginHelper.startLogin(context, entrance, false, callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.gh.common.constant.Config;
|
||||
import com.gh.common.filter.RegionSetting;
|
||||
@ -40,6 +41,8 @@ import com.gh.gamecenter.adapter.ReportReasonAdapter;
|
||||
import com.gh.gamecenter.common.base.TrackableDialog;
|
||||
import com.gh.gamecenter.common.callback.CancelListener;
|
||||
import com.gh.gamecenter.common.callback.ConfirmListener;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
import com.gh.gamecenter.common.databinding.DialogAlertDefaultBinding;
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity;
|
||||
import com.gh.gamecenter.common.entity.SuggestType;
|
||||
@ -1292,8 +1295,11 @@ public class DialogUtils {
|
||||
|
||||
binding.bindPhoneBtn.setOnClickListener(v -> {
|
||||
dialog.dismiss();
|
||||
Intent intent = SettingBridge.INSTANCE.getBindPhoneNormalIntent(finalContext, false);
|
||||
finalContext.startActivity(intent);
|
||||
|
||||
ARouter.getInstance().build(RouteConsts.activity.bindPhoneActivity)
|
||||
.withBoolean(EntranceConsts.KEY_CHANGE_PHONE, false)
|
||||
.withBoolean(EntranceConsts.KEY_REQUIRE_LOGIN, true)
|
||||
.navigation(finalContext);
|
||||
});
|
||||
|
||||
binding.cancelBtn.setOnClickListener(v -> dialog.dismiss());
|
||||
|
||||
@ -56,7 +56,6 @@ 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.fuli.kaifu.ServersCalendarActivity
|
||||
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarManagementActivity
|
||||
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersSubscribedGameListActivity
|
||||
@ -69,7 +68,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
|
||||
@ -380,9 +378,11 @@ object DirectUtils {
|
||||
)
|
||||
|
||||
"mobile_bind" -> {
|
||||
CheckLoginUtils.checkLogin(context, entrance) {
|
||||
context.startActivity(SettingBridge.getBindPhoneNormalIntent(context, false))
|
||||
}
|
||||
ARouter.getInstance().build(RouteConsts.activity.bindPhoneActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
.withBoolean(EntranceConsts.KEY_REQUIRE_LOGIN, true)
|
||||
.withBoolean(EntranceConsts.KEY_CHANGE_PHONE, false)
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
"authentication" -> {
|
||||
@ -718,7 +718,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
|
||||
@ -757,17 +757,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()
|
||||
|
||||
ARouter.getInstance()
|
||||
.build(uri)
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
|
||||
@ -799,10 +802,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, EntranceConsts.TAB_TYPE_RATING)
|
||||
"desc" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
|
||||
"forum" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_BBS)
|
||||
"zone" -> bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_TRENDS)
|
||||
}
|
||||
}
|
||||
if (traceEvent != null) {
|
||||
@ -847,7 +850,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, EntranceConsts.TAB_TYPE_DESC)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@ -855,7 +858,7 @@ object DirectUtils {
|
||||
fun directToGameDetail(
|
||||
context: Context,
|
||||
id: String,
|
||||
defaultTab: String = GameDetailFragment.TAB_DESC,
|
||||
defaultTab: String = EntranceConsts.TAB_TYPE_DESC,
|
||||
entrance: String? = null
|
||||
) {
|
||||
val bundle = Bundle()
|
||||
@ -1513,7 +1516,7 @@ object DirectUtils {
|
||||
response?.apply {
|
||||
if (zone.status == "on") {
|
||||
if (zone.style == "link") {
|
||||
directToGameDetail(context, gameId, GameDetailFragment.TAB_TRENDS, entrance)
|
||||
directToGameDetail(context, gameId, EntranceConsts.TAB_TYPE_TRENDS, entrance)
|
||||
} else {
|
||||
directToWebView(context, url, entrance)
|
||||
}
|
||||
@ -2032,8 +2035,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()
|
||||
|
||||
ARouter.getInstance().build(uri)
|
||||
.withInt(BaseActivity_TabLayout.PAGE_INDEX, defaultTabIndex)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
@ -5,12 +5,17 @@ import android.content.ContextWrapper
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
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.base.activity.ToolBarActivity.NORMAL_FRAGMENT_BUNDLE
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity.NORMAL_FRAGMENT_NAME
|
||||
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
|
||||
@ -20,15 +25,54 @@ 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
|
||||
|
||||
/**
|
||||
* Created by khy on 2017/3/24.
|
||||
* 游戏详情页
|
||||
*/
|
||||
@Route(
|
||||
path = RouteConsts.activity.gameDetailActivity,
|
||||
name = "游戏详情页"
|
||||
)
|
||||
class GameDetailActivity : DownloadToolbarActivity() {
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ID, desc = "游戏 id", required = true)
|
||||
var gameId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ENTITY, desc = "游戏摘要实体,如果你不懂这个是什么,那么不要用它,直接传入游戏 id 即可")
|
||||
var gameEntity: GameEntity? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, desc = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_DEFAULT_TAB, desc = "默认选中 tab 的类型(目前可选的有五个类型 `详情`, `专区`,`云存档`,`评价`,`论坛`),首次进入匹配并切换至对应 tab")
|
||||
var defaultTab: String = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, desc = "跳转到评论 tab,首次进入直接跳转到评论 tab")
|
||||
var commentAsDefaultTab: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_LIBAO, desc = "滚动到礼包区域,首次进入滚动到礼包区域")
|
||||
var scrollToLibao: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SCROLL_TO_SERVER, desc = "滚动到开服表区域,首次进入滚动到开服表区域")
|
||||
var scrollToServer: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_OPEN_VIDEO_STREAMING, desc = "打开视频流,首次进入打开视频流")
|
||||
var openVideoStreaming: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, desc = "打开多版本窗口,首次进入打开多版本窗口")
|
||||
var openPlatformWindow: Boolean = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
ARouter.getInstance().inject(this)
|
||||
|
||||
generateDataFromRoute()
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.transparentStatusBar(this)
|
||||
}
|
||||
@ -37,37 +81,21 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
return getTargetIntent(this, GameDetailActivity::class.java, GameDetailFragment::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 +124,13 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
)
|
||||
}
|
||||
|
||||
private fun generateDataFromRoute() {
|
||||
val bundle = intent.extras
|
||||
|
||||
intent?.putExtra(NORMAL_FRAGMENT_NAME, GameDetailFragment::class.java.canonicalName)
|
||||
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic
|
||||
@ -131,9 +166,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 +180,33 @@ 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, EntranceConsts.TAB_TYPE_DESC)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, true)
|
||||
}
|
||||
|
||||
if (scrollToServer) {
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
|
||||
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)
|
||||
|
||||
ARouter.getInstance()
|
||||
.build(RouteConsts.activity.gameDetailActivity)
|
||||
.with(bundle)
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -178,7 +216,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 +224,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
context: Context,
|
||||
gameId: String,
|
||||
entrance: String?,
|
||||
defaultTab: Int = -1,
|
||||
isSkipGameComment: Boolean = false,
|
||||
scrollToLibao: Boolean = false,
|
||||
openVideoStreaming: Boolean = false,
|
||||
@ -197,7 +234,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
context,
|
||||
gameId,
|
||||
entrance,
|
||||
defaultTab,
|
||||
isSkipGameComment,
|
||||
scrollToLibao,
|
||||
openVideoStreaming,
|
||||
@ -211,7 +247,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
|
||||
/**
|
||||
* @param gameId 游戏Id
|
||||
* @param defaultTab 默认定位到哪个tab
|
||||
* @param isSkipGameComment 是否跳转到评论tab
|
||||
* @param scrollToLibao 滚动到礼包区域
|
||||
* @param openVideoStreaming 是否打开视频流
|
||||
@ -225,7 +260,6 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
context: Context,
|
||||
gameId: String,
|
||||
entrance: String?,
|
||||
defaultTab: Int = -1,
|
||||
isSkipGameComment: Boolean = false,
|
||||
scrollToLibao: Boolean = false,
|
||||
openVideoStreaming: Boolean = false,
|
||||
@ -248,7 +282,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 +295,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, EntranceConsts.TAB_TYPE_DESC)
|
||||
}
|
||||
if (openPlatformWindow) {
|
||||
bundle.putBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW, true)
|
||||
@ -283,10 +314,10 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
}
|
||||
}
|
||||
if (scrollToLibao) {
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, GameDetailFragment.TAB_DESC)
|
||||
bundle.putString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
|
||||
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 +326,11 @@ class GameDetailActivity : DownloadToolbarActivity() {
|
||||
EntranceConsts.KEY_LAST_PAGE_BUSINESS_ID,
|
||||
GlobalActivityManager.getLastPageEntity().pageBusinessId
|
||||
)
|
||||
context.startActivity(
|
||||
getTargetIntent(
|
||||
context,
|
||||
GameDetailActivity::class.java,
|
||||
GameDetailFragment::class.java,
|
||||
bundle
|
||||
)
|
||||
)
|
||||
|
||||
ARouter.getInstance()
|
||||
.build(RouteConsts.activity.gameDetailActivity)
|
||||
.with(bundle)
|
||||
.navigation(context)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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()); // 跳转至首页
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
105
app/src/main/java/com/gh/gamecenter/SkipCompatActivity.kt
Normal file
105
app/src/main/java/com/gh/gamecenter/SkipCompatActivity.kt
Normal file
@ -0,0 +1,105 @@
|
||||
package com.gh.gamecenter
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.Postcard
|
||||
import com.alibaba.android.arouter.facade.callback.NavigationCallback
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.common.util.EntranceUtils
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.utils.DialogHelper
|
||||
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) {
|
||||
ARouter.getInstance()
|
||||
.build(uri)
|
||||
.navigation(context, object : NavigationCallback {
|
||||
override fun onFound(postcard: Postcard?) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard?.uri} onFound" )
|
||||
}
|
||||
|
||||
override fun onLost(postcard: Postcard?) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard?.uri} onLost" )
|
||||
|
||||
if (HaloApp.getInstance().isAlreadyUpAndRunning) {
|
||||
// 在光环应用内时,显示不支持弹窗
|
||||
// 显示不支持弹窗
|
||||
DialogHelper.showUpgradeDialog(context)
|
||||
} else {
|
||||
// 在光环应用外跳转时,重定向至首页
|
||||
EntranceUtils.jumpActivity(context, Bundle())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onArrival(postcard: Postcard?) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard?.uri} onArrival" )
|
||||
}
|
||||
|
||||
override fun onInterrupt(postcard: Postcard?) {
|
||||
Utils.log(TAG, "navigate to postcard ${postcard?.uri} onInterrupt" )
|
||||
}
|
||||
})
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -3,12 +3,16 @@ package com.gh.gamecenter.authorization
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.Postcard
|
||||
import com.alibaba.android.arouter.facade.callback.NavigationCallback
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.common.util.CheckLoginUtils
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.common.util.NewFlatLogUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.ImageUtils
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
@ -19,6 +23,7 @@ import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.login.view.LoginActivity
|
||||
import com.gh.vspace.VHelper
|
||||
import com.lightgame.utils.Utils
|
||||
import com.volcengine.tos.internal.util.SigningUtils.authorization
|
||||
|
||||
/**
|
||||
* @author : liujiarui
|
||||
@ -180,7 +185,9 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
block()
|
||||
} else {
|
||||
Utils.toast(this, "需要登录")
|
||||
startActivity(LoginActivity.getIntent(this, "光环助手授权登陆"))
|
||||
ARouter.getInstance().build(RouteConsts.activity.loginActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "光环助手授权登陆")
|
||||
.navigation(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
)
|
||||
|
||||
@ -280,7 +280,6 @@ class FollowHomeFragment : LazyFragment(), IScrollable {
|
||||
requireContext(),
|
||||
it.id,
|
||||
"",
|
||||
-1,
|
||||
traceEvent = it.exposureEvent
|
||||
)
|
||||
})
|
||||
|
||||
@ -438,7 +438,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
val args = arguments ?: Bundle()
|
||||
mAutoDownload = args.getBoolean(EntranceConsts.KEY_AUTO_DOWNLOAD)
|
||||
mTraceEvent = args.getParcelable(EntranceConsts.KEY_TRACE_EVENT)
|
||||
mSkipGameComment = args.getBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT)
|
||||
mSkipGameComment = args.getBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB)
|
||||
mIsOpenPlatformWindow = args.getBoolean(EntranceConsts.KEY_OPEN_PLATFORM_WINDOW)
|
||||
|
||||
mSkeleton = Skeleton.bind(mBinding.listSkeleton)
|
||||
@ -451,11 +451,11 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
.load(R.layout.fragment_gamedetail_skeleton)
|
||||
.show()
|
||||
|
||||
val gameId = args.getString(EntranceConsts.KEY_GAMEID) ?: ""
|
||||
val gameId = args.getString(EntranceConsts.KEY_GAME_ID) ?: ""
|
||||
val factory = GameDetailViewModel.Factory(
|
||||
HaloApp.getInstance().application,
|
||||
gameId,
|
||||
args.getParcelable(GameEntity.TAG)
|
||||
args.getParcelable(EntranceConsts.KEY_GAME_ENTITY)
|
||||
)
|
||||
mViewModel = viewModelProviderFromParent(factory, gameId)
|
||||
mPackageViewModel = viewModelProvider(PackageViewModel.Factory())
|
||||
@ -464,8 +464,8 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
mBodyBinding.gamedetailVp.doOnPageSelected { position ->
|
||||
if (!isAdded) return@doOnPageSelected
|
||||
|
||||
val bbsPosition = getTabPositionFromTabType(TAB_BBS)
|
||||
val trendsPosition = getTabPositionFromTabType(TAB_TRENDS)
|
||||
val bbsPosition = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_BBS)
|
||||
val trendsPosition = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_TRENDS)
|
||||
|
||||
if (mNewGameDetailEntity?.bbsTab != null && position == bbsPosition) {
|
||||
DirectUtils.directToLinkPage(
|
||||
@ -482,7 +482,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
}, 200)
|
||||
} else if (mNewGameDetailEntity?.zone != null && mNewGameDetailEntity?.zone?.style != "default" && position == trendsPosition && mNewGameDetailEntity?.bbsTab != null) {
|
||||
// 跳转论坛-专区
|
||||
val entrance = if (mDestinationTab == getTabPositionFromTabType(TAB_TRENDS)) {
|
||||
val entrance = if (mDestinationTab == getTabPositionFromTabType(EntranceConsts.TAB_TYPE_TRENDS)) {
|
||||
if (mEntrance.contains("搜索")) "搜索页面" else "其他"
|
||||
} else "游戏详情页"
|
||||
mNewGameDetailEntity?.bbsTab?.link?.let {
|
||||
@ -839,7 +839,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
DetailDownloadUtils.updateViewHolder(viewHolder)
|
||||
|
||||
mDestinationTab =
|
||||
getTabPositionFromTabType(arguments?.getString(EntranceConsts.KEY_TARGET, TAB_DESC) ?: TAB_DESC)
|
||||
getTabPositionFromTabType(arguments?.getString(EntranceConsts.KEY_TARGET, EntranceConsts.TAB_TYPE_DESC) ?: EntranceConsts.TAB_TYPE_DESC)
|
||||
|
||||
// destinationTab 的优先级最高,关注和关联关注在它的后面
|
||||
if (mDestinationTab != -1) {
|
||||
@ -1015,7 +1015,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
}
|
||||
|
||||
val bundle = Bundle()
|
||||
bundle.putParcelable(GameEntity.TAG, mGameEntity)
|
||||
bundle.putParcelable(EntranceConsts.KEY_GAME_ENTITY, mGameEntity)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mEntrance)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, scrollToLibao)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_SERVER, scrollToServer)
|
||||
@ -1031,21 +1031,21 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
mTabTitleList.clear()
|
||||
|
||||
val tag = "android:switcher:${mBodyBinding.gamedetailVp.id}:"
|
||||
val descFragment = childFragmentManager.findFragmentByTag("${tag}$TAB_DESC") ?: DescFragment()
|
||||
val descFragment = childFragmentManager.findFragmentByTag("${tag}${EntranceConsts.TAB_TYPE_DESC}") ?: DescFragment()
|
||||
descFragment.arguments = bundle
|
||||
mFragmentsList.add(descFragment)
|
||||
mTabTitleList.add(getString(R.string.game_detail_desc))
|
||||
mTabTypeList.add(TAB_DESC)
|
||||
mTabTypeList.add(EntranceConsts.TAB_TYPE_DESC)
|
||||
|
||||
if (data.showArchive) {
|
||||
val cloudArchiveFragment =
|
||||
childFragmentManager.findFragmentByTag("${tag}${TAB_ARCHIVE}") ?: CloudArchiveFragment()
|
||||
childFragmentManager.findFragmentByTag("${tag}${EntranceConsts.TAB_TYPE_ARCHIVE}") ?: CloudArchiveFragment()
|
||||
bundle.putParcelable(EntranceConsts.KEY_GAME, mGameEntity ?: GameEntity())
|
||||
bundle.putString(EntranceConsts.KEY_ARCHIVE_CONFIG_URL, data.archiveTab.configUrl)
|
||||
cloudArchiveFragment.arguments = bundle
|
||||
mFragmentsList.add(cloudArchiveFragment)
|
||||
mTabTitleList.add(getString(R.string.game_detail_cloud_archive))
|
||||
mTabTypeList.add(TAB_ARCHIVE)
|
||||
mTabTypeList.add(EntranceConsts.TAB_TYPE_ARCHIVE)
|
||||
|
||||
NewFlatLogUtils.logCloudArchiveGameDetailTabRelated(
|
||||
"cloud_save_tab_show",
|
||||
@ -1055,13 +1055,13 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
}
|
||||
|
||||
if (data.showComment) {
|
||||
val ratingFragment = childFragmentManager.findFragmentByTag("${tag}${TAB_RATING}") ?: RatingFragment()
|
||||
bundle.putBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT, mSkipGameComment)
|
||||
val ratingFragment = childFragmentManager.findFragmentByTag("${tag}${EntranceConsts.TAB_TYPE_RATING}") ?: RatingFragment()
|
||||
bundle.putBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB, mSkipGameComment)
|
||||
bundle.putBoolean(EntranceConsts.KEY_DIRECT_COMMENT, data.directComment)
|
||||
ratingFragment.arguments = bundle
|
||||
mFragmentsList.add(ratingFragment)
|
||||
mTabTitleList.add(getString(R.string.game_detail_comment))
|
||||
mTabTypeList.add(TAB_RATING)
|
||||
mTabTypeList.add(EntranceConsts.TAB_TYPE_RATING)
|
||||
}
|
||||
|
||||
data.zone?.let {
|
||||
@ -1072,7 +1072,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
mFragmentsList.add(Fragment())
|
||||
} else if (it.style == "link") {
|
||||
//显示web页面
|
||||
val webFragment = childFragmentManager.findFragmentByTag("${tag}${TAB_TRENDS}") ?: WebFragment()
|
||||
val webFragment = childFragmentManager.findFragmentByTag("${tag}${EntranceConsts.TAB_TYPE_TRENDS}") ?: WebFragment()
|
||||
val webBundle = Bundle()
|
||||
webBundle.putString(EntranceConsts.KEY_ENTRANCE, "游戏专区")
|
||||
webBundle.putString(EntranceConsts.KEY_URL, it.link)
|
||||
@ -1080,7 +1080,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
webFragment.arguments = webBundle
|
||||
mFragmentsList.add(webFragment)
|
||||
} else {
|
||||
val fuliFragment = childFragmentManager.findFragmentByTag("${tag}${TAB_TRENDS}") ?: FuLiFragment()
|
||||
val fuliFragment = childFragmentManager.findFragmentByTag("${tag}${EntranceConsts.TAB_TYPE_TRENDS}") ?: FuLiFragment()
|
||||
fuliFragment.arguments = bundle
|
||||
mFragmentsList.add(fuliFragment)
|
||||
}
|
||||
@ -1089,7 +1089,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
} else {
|
||||
mTabTitleList.add(getString(R.string.game_detail_dongtai))
|
||||
}
|
||||
mTabTypeList.add(TAB_TRENDS)
|
||||
mTabTypeList.add(EntranceConsts.TAB_TYPE_TRENDS)
|
||||
}
|
||||
|
||||
var isShowBbs = true
|
||||
@ -1103,7 +1103,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
if (isShowBbs && mGameEntity?.shouldUseMirrorInfo() == false) {
|
||||
mFragmentsList.add(Fragment())
|
||||
mTabTitleList.add(getString(R.string.game_detail_bbs))
|
||||
mTabTypeList.add(TAB_BBS)
|
||||
mTabTypeList.add(EntranceConsts.TAB_TYPE_BBS)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1116,7 +1116,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
gamedetailVp.doOnPageSelected {
|
||||
logTabClick(it)
|
||||
}
|
||||
gamedetailVp.currentItem = getTabPositionFromTabType(TAB_DESC)
|
||||
gamedetailVp.currentItem = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_DESC)
|
||||
|
||||
mBodyBinding.tabLayout.setupWithViewPager(gamedetailVp)
|
||||
mBodyBinding.tabIndicator.setupWithTabLayout(mBodyBinding.tabLayout)
|
||||
@ -1125,7 +1125,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
for (i in 0 until mBodyBinding.tabLayout.tabCount) {
|
||||
val tab = mBodyBinding.tabLayout.getTabAt(i) ?: continue
|
||||
val tabTitle = if (tab.text != null) tab.text.toString() else ""
|
||||
if (data.showArchive && i == getTabPositionFromTabType(TAB_ARCHIVE)) {
|
||||
if (data.showArchive && i == getTabPositionFromTabType(EntranceConsts.TAB_TYPE_ARCHIVE)) {
|
||||
tab.customView = getArchiveTabView(tabTitle)
|
||||
tab.view.run {
|
||||
clipChildren = false
|
||||
@ -1258,7 +1258,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
|
||||
if (mNewGameDetailEntity!!.showComment) {
|
||||
if (mSkipGameComment) {
|
||||
tabPerformClick(getTabPositionFromTabType(TAB_RATING))
|
||||
tabPerformClick(getTabPositionFromTabType(EntranceConsts.TAB_TYPE_RATING))
|
||||
mBodyBinding.gamedetailAppbar.setExpanded(false)
|
||||
mSkipGameComment = false
|
||||
}
|
||||
@ -1759,13 +1759,13 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onEventMainThread(reuse: EBReuse) {
|
||||
if (SKIP_DESC == reuse.type) {
|
||||
tabPerformClick(getTabPositionFromTabType(TAB_DESC))
|
||||
tabPerformClick(getTabPositionFromTabType(EntranceConsts.TAB_TYPE_DESC))
|
||||
} else if (OPEN_APPBAR == reuse.type && !mIsTouchScreen) {
|
||||
mBodyBinding.gamedetailAppbar.setExpanded(true, true)
|
||||
} else if (SKIP_FULI == reuse.type) {
|
||||
tabPerformClick(getTabPositionFromTabType(TAB_TRENDS))
|
||||
tabPerformClick(getTabPositionFromTabType(EntranceConsts.TAB_TYPE_TRENDS))
|
||||
} else if (SKIP_RATING == reuse.type) {
|
||||
tabPerformClick(getTabPositionFromTabType(TAB_RATING))
|
||||
tabPerformClick(getTabPositionFromTabType(EntranceConsts.TAB_TYPE_RATING))
|
||||
} else if (CLOSE_APPBAR == reuse.type && !mIsTouchScreen) {
|
||||
mBodyBinding.gamedetailAppbar.setExpanded(false, true)
|
||||
} else if ("download" == reuse.type) {
|
||||
@ -2012,8 +2012,8 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
}
|
||||
|
||||
private fun tabPerformClick(position: Int) {
|
||||
val trendsTabPosition = getTabPositionFromTabType(TAB_TRENDS)
|
||||
val bbsTabPosition = getTabPositionFromTabType(TAB_BBS)
|
||||
val trendsTabPosition = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_TRENDS)
|
||||
val bbsTabPosition = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_BBS)
|
||||
|
||||
when (position) {
|
||||
trendsTabPosition -> {
|
||||
@ -2023,7 +2023,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
) {
|
||||
performJumpContentCard("func_zone", position)
|
||||
} else {
|
||||
mBodyBinding.gamedetailVp.currentItem = getTabPositionFromTabType(TAB_TRENDS)
|
||||
mBodyBinding.gamedetailVp.currentItem = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_TRENDS)
|
||||
}
|
||||
}
|
||||
|
||||
@ -2031,7 +2031,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
if (!mTabTitleList.contains(getString(R.string.game_detail_bbs))) {
|
||||
performJumpContentCard("func_bbs", position)
|
||||
} else {
|
||||
mBodyBinding.gamedetailVp.currentItem = getTabPositionFromTabType(TAB_BBS)
|
||||
mBodyBinding.gamedetailVp.currentItem = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_BBS)
|
||||
}
|
||||
}
|
||||
|
||||
@ -2072,11 +2072,11 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
val entrance = if (mEntrance.contains("论坛详情")) "论坛" else "游戏"
|
||||
mGameEntity?.run {
|
||||
when (mTabTypeList[position]) {
|
||||
TAB_DESC -> {
|
||||
EntranceConsts.TAB_TYPE_DESC -> {
|
||||
NewLogUtils.logGameDetailTabClick(name ?: "", id, "详情")
|
||||
}
|
||||
|
||||
TAB_TRENDS -> {
|
||||
EntranceConsts.TAB_TYPE_TRENDS -> {
|
||||
NewLogUtils.logGameDetailTabClick(
|
||||
"view_game_detail_special_area_tab",
|
||||
entrance,
|
||||
@ -2087,7 +2087,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
NewLogUtils.logGameDetailTabClick(name ?: "", id, "专区")
|
||||
}
|
||||
|
||||
TAB_ARCHIVE -> {
|
||||
EntranceConsts.TAB_TYPE_ARCHIVE -> {
|
||||
NewFlatLogUtils.logCloudArchiveGameDetailTabRelated(
|
||||
"cloud_save_tab_click",
|
||||
mGameEntity?.id ?: "",
|
||||
@ -2106,12 +2106,12 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
)
|
||||
}
|
||||
|
||||
TAB_RATING -> {
|
||||
EntranceConsts.TAB_TYPE_RATING -> {
|
||||
NewLogUtils.logGameDetailTabClick("view_game_detail_comment_tab", entrance, id, gameType, bbsId)
|
||||
NewLogUtils.logGameDetailTabClick(name ?: "", id, "评论")
|
||||
}
|
||||
|
||||
TAB_BBS -> {
|
||||
EntranceConsts.TAB_TYPE_BBS -> {
|
||||
NewLogUtils.logGameDetailTabClick(name ?: "", id, "论坛")
|
||||
}
|
||||
}
|
||||
@ -2367,7 +2367,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
|
||||
private fun updateArchiveTabUI() {
|
||||
mBodyBinding.tabLayout.run {
|
||||
val archivePosition = getTabPositionFromTabType(TAB_ARCHIVE)
|
||||
val archivePosition = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_ARCHIVE)
|
||||
getTabAt(archivePosition)?.customView?.findViewById<ImageView>(R.id.newIv)?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
@ -2384,7 +2384,7 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
override fun onBackPressed(): Boolean {
|
||||
mOrientationUtils?.backToProtVideo()
|
||||
|
||||
val trendsTabPosition = getTabPositionFromTabType(TAB_TRENDS)
|
||||
val trendsTabPosition = getTabPositionFromTabType(EntranceConsts.TAB_TYPE_TRENDS)
|
||||
|
||||
if (mBodyBinding.gamedetailVp.currentItem == trendsTabPosition
|
||||
&& mFragmentsList[trendsTabPosition] is WebFragment
|
||||
@ -2647,12 +2647,6 @@ class GameDetailFragment : BaseLazyFragment(), IScrollable {
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAB_DESC = "详情"
|
||||
const val TAB_TRENDS = "专区"
|
||||
const val TAB_ARCHIVE = "云存档"
|
||||
const val TAB_RATING = "评价"
|
||||
const val TAB_BBS = "论坛"
|
||||
|
||||
const val SKIP_DESC = "skipDesc"
|
||||
const val SKIP_FULI = "skipFuli"
|
||||
const val SKIP_RATING = "skipRatting"
|
||||
|
||||
@ -116,7 +116,7 @@ class DescFragment: LazyFragment(), IScrollable {
|
||||
}
|
||||
|
||||
override fun onFragmentFirstVisible() {
|
||||
mGameEntity = arguments?.getParcelable(GameEntity.TAG)
|
||||
mGameEntity = arguments?.getParcelable(EntranceConsts.KEY_GAME_ENTITY)
|
||||
openVideoStreaming = arguments?.getBoolean(EntranceConsts.KEY_OPEN_VIDEO_STREAMING, false) ?: false
|
||||
mScrollToLibao = arguments?.getBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO, false) ?: false
|
||||
mScrollToServer = arguments?.getBoolean(EntranceConsts.KEY_SCROLL_TO_SERVER, false) ?: false
|
||||
|
||||
@ -59,7 +59,7 @@ class FuLiFragment : LazyFragment(), IScrollable {
|
||||
}
|
||||
|
||||
override fun onFragmentFirstVisible() {
|
||||
val gameEntity = arguments?.getParcelable(GameEntity.TAG) as? GameEntity
|
||||
val gameEntity = arguments?.getParcelable(EntranceConsts.KEY_GAME_ENTITY) as? GameEntity
|
||||
val gameDetailFactory =
|
||||
GameDetailViewModel.Factory(HaloApp.getInstance().application, gameEntity?.id, gameEntity)
|
||||
shouldScroolToLibao = arguments?.getBoolean(EntranceConsts.KEY_SCROLL_TO_LIBAO) ?: false
|
||||
|
||||
@ -52,7 +52,6 @@ class GameDetailAnswerAdapter(
|
||||
val path = "游戏详情-动态"
|
||||
holder.bindAnswerItem(entity, mEntrance, path)
|
||||
holder.binding.title.setOnClickListener {
|
||||
HaloApp.put(Constants.GAME_DETAIL_COME_IN, true)
|
||||
MtaHelper.onEvent("进入问答", "游戏详情", mViewModel.gameCommunity?.name + "+" + mViewModel.game?.name)
|
||||
if ("community_article" == entity.type) {
|
||||
MtaHelper.onEvent("游戏详情_新", "点击社区文章", mViewModel.game?.name + "+" + entity.questions.title)
|
||||
@ -81,7 +80,6 @@ class GameDetailAnswerAdapter(
|
||||
|
||||
}
|
||||
holder.itemView.setOnClickListener {
|
||||
HaloApp.put(Constants.GAME_DETAIL_COME_IN, true)
|
||||
MtaHelper.onEvent("进入问答", "游戏详情", mViewModel.gameCommunity?.name + "+" + mViewModel.game?.name)
|
||||
if ("community_article" == entity.type) {
|
||||
MtaHelper.onEvent("游戏详情_新", "点击社区文章", mViewModel.game?.name + "+" + entity.questions.title)
|
||||
|
||||
@ -18,7 +18,7 @@ class RatingFoldActivity : ToolBarActivity() {
|
||||
@JvmStatic
|
||||
fun getIntent(context: Context, game: GameEntity, entrance: String, path: String): Intent {
|
||||
val bundle = Bundle()
|
||||
bundle.putParcelable(GameEntity.TAG, game)
|
||||
bundle.putParcelable(EntranceConsts.KEY_GAME_ENTITY, game)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
bundle.putSerializable(EntranceConsts.KEY_LOCATION, RatingViewModel.RatingType.FOLD_RATING)
|
||||
return getTargetIntent(context, RatingFoldActivity::class.java, RatingFragment::class.java, bundle)
|
||||
|
||||
@ -91,7 +91,7 @@ class RatingFragment : LazyListFragment<RatingComment, RatingViewModel>(), IScro
|
||||
override fun provideListViewModel(): RatingViewModel {
|
||||
val factory = RatingViewModel.Factory(
|
||||
HaloApp.getInstance().application,
|
||||
arguments?.getParcelable(GameEntity.TAG)!!, mRatingType!!
|
||||
arguments?.getParcelable(EntranceConsts.KEY_GAME_ENTITY)!!, mRatingType!!
|
||||
)
|
||||
return ViewModelProviders.of(this, factory).get(RatingViewModel::class.java)
|
||||
}
|
||||
@ -109,7 +109,7 @@ class RatingFragment : LazyListFragment<RatingComment, RatingViewModel>(), IScro
|
||||
override fun onFragmentPause() {
|
||||
super.onFragmentPause()
|
||||
|
||||
val game = arguments?.getParcelable<GameEntity>(GameEntity.TAG)
|
||||
val game = arguments?.getParcelable<GameEntity>(EntranceConsts.KEY_GAME_ENTITY)
|
||||
val stayTime = (System.currentTimeMillis() - startPageTime) / 1000
|
||||
NewLogUtils.logGameDetailTabOrCommentDetailPause(
|
||||
"jump_game_detail_comment_tab",
|
||||
@ -128,7 +128,7 @@ class RatingFragment : LazyListFragment<RatingComment, RatingViewModel>(), IScro
|
||||
super.onFragmentFirstVisible()
|
||||
|
||||
val horizontalPadding = com.gh.gamecenter.common.R.dimen.game_detail_item_horizontal_padding.toPx()
|
||||
mSkipGameComment = arguments?.getBoolean(EntranceConsts.KEY_SKIP_GAME_COMMENT)
|
||||
mSkipGameComment = arguments?.getBoolean(EntranceConsts.KEY_COMMENT_AS_DEFAULT_TAB)
|
||||
mListRv?.setPadding(horizontalPadding, 0, horizontalPadding, 0)
|
||||
mListRefresh?.setBackgroundColor(ContextCompat.getColor(requireContext(), com.gh.gamecenter.common.R.color.transparent))
|
||||
mListRefresh?.isEnabled = mRatingType != RatingViewModel.RatingType.RATING
|
||||
|
||||
@ -131,7 +131,7 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
|
||||
return
|
||||
}
|
||||
setToolbarMenu(R.menu.menu_game_comment)
|
||||
mGame = intent.getParcelableExtra(GameEntity.TAG) ?: GameEntity(id = "")
|
||||
mGame = intent.getParcelableExtra(EntranceConsts.KEY_GAME_ENTITY) ?: GameEntity(id = "")
|
||||
mFromAmway = intent.getBooleanExtra(EntranceConsts.KEY_AMWAY, false)
|
||||
mIsSkipSuccessPage = intent.getBooleanExtra(EntranceConsts.KEY_SKIP_SUCCESS_PAGE, false)
|
||||
mComment = intent.getParcelableExtra(RatingComment::class.java.simpleName)
|
||||
@ -659,7 +659,7 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
|
||||
isSkipSuccessPage: Boolean = true
|
||||
): Intent {
|
||||
val intent = Intent(context, RatingEditActivity::class.java)
|
||||
intent.putExtra(GameEntity.TAG, game)
|
||||
intent.putExtra(EntranceConsts.KEY_GAME_ENTITY, game)
|
||||
intent.putExtra(EntranceConsts.KEY_RATING_STAR_COUNT, starCount)
|
||||
intent.putExtra(EntranceConsts.KEY_AMWAY, fromAmway)
|
||||
intent.putExtra(EntranceConsts.KEY_SKIP_SUCCESS_PAGE, isSkipSuccessPage)
|
||||
@ -670,7 +670,7 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
|
||||
|
||||
fun getPatchIntent(context: Context, game: GameEntity, comment: RatingComment): Intent {
|
||||
val intent = Intent(context, RatingEditActivity::class.java)
|
||||
intent.putExtra(GameEntity.TAG, game)
|
||||
intent.putExtra(EntranceConsts.KEY_GAME_ENTITY, game)
|
||||
intent.putExtra(RatingComment::class.java.simpleName, comment)
|
||||
return intent
|
||||
}
|
||||
|
||||
@ -298,8 +298,7 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable {
|
||||
requireContext(),
|
||||
game.id,
|
||||
entrance,
|
||||
-1,
|
||||
traceEvent = game.exposureEvent
|
||||
traceEvent = game.exposureEvent,
|
||||
)
|
||||
}
|
||||
|
||||
@ -402,8 +401,7 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable {
|
||||
requireContext(),
|
||||
gameId = gameId,
|
||||
entrance = "自定义页面",
|
||||
defaultTab = -1,
|
||||
traceEvent = exposureEvent
|
||||
traceEvent = exposureEvent,
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
@ -14,6 +14,7 @@ import com.gh.gamecenter.GameDetailActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.baselist.ListAdapter
|
||||
import com.gh.gamecenter.common.baselist.LoadType
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.ItemViewType
|
||||
import com.gh.gamecenter.common.exposure.ExposureSource
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
@ -280,7 +281,7 @@ class MyFollowedGameViewHolder(var binding: ItemFollowedGameBinding) : RecyclerV
|
||||
binding.root.context,
|
||||
gameEntity,
|
||||
entrance,
|
||||
defaultTab = GameDetailFragment.TAB_TRENDS
|
||||
defaultTab = EntranceConsts.TAB_TYPE_TRENDS
|
||||
)
|
||||
}
|
||||
} else {
|
||||
@ -306,7 +307,7 @@ class MyFollowedGameViewHolder(var binding: ItemFollowedGameBinding) : RecyclerV
|
||||
binding.root.context,
|
||||
gameEntity,
|
||||
entrance,
|
||||
defaultTab = GameDetailFragment.TAB_BBS
|
||||
defaultTab = EntranceConsts.TAB_TYPE_BBS
|
||||
)
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -183,6 +183,11 @@ class HaloPersonalFragment : BaseLazyFragment() {
|
||||
}
|
||||
}
|
||||
mStubBinding.personalMsg -> {
|
||||
// 优先进入有数字提醒的消息tab,其次是有红点提醒的游戏动态,最后是没有提醒的消息tab
|
||||
val defaultTabIndex = if ((mUnreadViewModel.messageUnreadCountLiveData.value?.message
|
||||
?: 0) < 1 && mUnreadViewModel.zixunConcernLiveData.value == true
|
||||
) 0 else 1
|
||||
|
||||
if (CheckLoginUtils.isLogin()) {
|
||||
NewFlatLogUtils.logHaloSelfClick("右上角", "消息中心")
|
||||
SensorsBridge.trackHaloSelfClick(
|
||||
@ -197,16 +202,11 @@ class HaloPersonalFragment : BaseLazyFragment() {
|
||||
"我的"
|
||||
)
|
||||
SensorsBridge.trackMessageCenterClick()
|
||||
|
||||
// 优先进入有数字提醒的消息tab,其次是有红点提醒的游戏动态,最后是没有提醒的消息tab
|
||||
val defaultTabIndex = if ((mUnreadViewModel.messageUnreadCountLiveData.value?.message
|
||||
?: 0) < 1 && mUnreadViewModel.zixunConcernLiveData.value == true
|
||||
) 0 else 1
|
||||
DirectUtils.directToMessageCenter(defaultTabIndex)
|
||||
} else {
|
||||
NewFlatLogUtils.logHaloSelfLogin()
|
||||
CheckLoginUtils.checkLogin(context, "我的光环-消息") {}
|
||||
}
|
||||
|
||||
DirectUtils.directToMessageCenter(defaultTabIndex, "我的光环-消息")
|
||||
}
|
||||
mStubBinding.personalUserIcon,
|
||||
mStubBinding.personalUserName -> {
|
||||
|
||||
@ -1,43 +1,56 @@
|
||||
package com.gh.gamecenter.personalhome
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
|
||||
/**
|
||||
* 个人主页
|
||||
*/
|
||||
@Route(
|
||||
path = RouteConsts.activity.userHomeActivity,
|
||||
name = "个人主页"
|
||||
)
|
||||
class UserHomeActivity : ToolBarActivity() {
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, UserHomeActivity::class.java, UserHomeFragment::class.java)
|
||||
}
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_USER_ID, desc = "用户 id (长 id 或短 id 均可)", required = true)
|
||||
var userId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_TAB_INDEX, desc = "默认选中 tab 的序号,可选值 0 游戏,1 发布")
|
||||
var selectedTabIndex: Int = 0
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COMMUNITY_TYPE, desc = "默认选中的社区内容 tab 类型,可选值 all: 全部, video: 视频, community_article: 帖子, answer: 回答, question: 问题")
|
||||
var selectedCommunityType: String = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_TYPE, desc = "默认选中的游戏 tab 类型,可选值 game_collection: 游戏单, played_game: 玩过, comment: 评价")
|
||||
var selectedGameType: String = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, desc = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
// 注入 arouter 参数
|
||||
ARouter.getInstance().inject(this)
|
||||
|
||||
// 桥接 arouter 和原有入参
|
||||
generateDataFromRoute()
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
hideToolbar(true)
|
||||
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, false)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getIntent(context: Context, userId: String, entrance: String?, path: String?): Intent {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_USER_ID, userId)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
return getTargetIntent(context, UserHomeActivity::class.java, UserHomeFragment::class.java, bundle)
|
||||
}
|
||||
}
|
||||
|
||||
override fun getBusinessId(): Pair<String, String> {
|
||||
return Pair(targetFragment.arguments?.getString(EntranceConsts.KEY_USER_ID) ?: "", "")
|
||||
return Pair(userId ?: "", "")
|
||||
}
|
||||
|
||||
override fun isAutoResetViewBackgroundEnabled(): Boolean = true
|
||||
@ -48,4 +61,11 @@ class UserHomeActivity : ToolBarActivity() {
|
||||
listOf(R.id.allType, R.id.videoType, R.id.articleType, R.id.questionType, R.id.answerType, R.id.tab_title)
|
||||
)
|
||||
}
|
||||
|
||||
private fun generateDataFromRoute() {
|
||||
val bundle = intent.extras
|
||||
|
||||
intent?.putExtra(NORMAL_FRAGMENT_NAME, UserHomeFragment::class.java.canonicalName)
|
||||
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
|
||||
}
|
||||
}
|
||||
@ -93,7 +93,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
}
|
||||
|
||||
mHomeBinding?.container?.setZoomView(mHomeBinding?.userBackgroundContainer)
|
||||
// mHomeBinding?.userBadge?.visibleIf(mUserHomeViewModel.userId == UserManager.getInstance().userId)
|
||||
|
||||
mUserHomeViewModel.userInfo.observeNonNull(this) {
|
||||
// 区分是数据初始化还是数据更新
|
||||
@ -117,7 +116,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
|
||||
updateUserInfo(it)
|
||||
updateTab(it)
|
||||
trackMtaEvent(it.name)
|
||||
} else {
|
||||
updateUserInfo(it)
|
||||
}
|
||||
@ -298,9 +296,9 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
}
|
||||
|
||||
private fun updateTab(personalData: PersonalEntity) {
|
||||
val keyPosition = arguments?.getInt(EntranceConsts.KEY_POSITION, -1) ?: -1
|
||||
val type = UserHistoryViewModel.TYPE.fromValue(arguments?.getString(EntranceConsts.KEY_TYPE))
|
||||
val gameType = arguments?.getString(EntranceConsts.KEY_GAME) ?: "game_collection"
|
||||
val keyPosition = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
|
||||
val type = UserHistoryViewModel.TYPE.fromValue(arguments?.getString(EntranceConsts.KEY_COMMUNITY_TYPE))
|
||||
val gameType = arguments?.getString(EntranceConsts.KEY_GAME_TYPE) ?: "game_collection"
|
||||
val count = personalData.count
|
||||
val position = if (keyPosition > -1) {
|
||||
keyPosition
|
||||
@ -335,7 +333,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
FragmentAdapter(childFragmentManager, mFragmentList, titleList)
|
||||
mHomeBinding?.viewpager?.currentItem = position
|
||||
mHomeBinding?.viewpager?.doOnPageSelected {
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", titleList[it])
|
||||
if (it == 1) (mFragmentList[1] as UserHistoryFragment).onScrollStateChanged()
|
||||
}
|
||||
mHomeBinding?.tabLayout?.setupWithViewPager(mHomeBinding?.viewpager)
|
||||
@ -362,19 +359,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
return view
|
||||
}
|
||||
|
||||
private fun trackMtaEvent(name: String? = "") {
|
||||
MtaHelper.onEvent(
|
||||
"个人主页",
|
||||
mPath,
|
||||
StringUtils.combineTwoString(name, mUserHomeViewModel.userId)
|
||||
)
|
||||
MtaHelper.onEvent(
|
||||
"个人主页",
|
||||
"不区分位置",
|
||||
StringUtils.combineTwoString(name, mUserHomeViewModel.userId)
|
||||
)
|
||||
}
|
||||
|
||||
private fun updateUnreadInfo(messageEntity: MessageUnreadEntity) {
|
||||
if (mUserHomeViewModel.userId == UserManager.getInstance().userId) {
|
||||
BindingAdapters.setMessageUnread(mHomeBinding?.userFansCountHint, messageEntity.fans)
|
||||
@ -557,7 +541,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
log("view_pendant", "头像挂件页")
|
||||
}
|
||||
if (mUserHomeViewModel.userId == UserManager.getInstance().userId) {
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", "头像")
|
||||
startActivity(AvatarBorderActivity.getIntent(requireContext()))
|
||||
} else {
|
||||
startActivity(
|
||||
@ -575,7 +558,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
|
||||
userFollowerContainer.setOnClickListener {
|
||||
IntegralLogHelper.log("click_follow", LOCATION)
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", "关注数")
|
||||
startActivity(
|
||||
FollowersActivity.getIntent(
|
||||
requireContext(),
|
||||
@ -587,7 +569,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
}
|
||||
userFansContainer.setOnClickListener {
|
||||
IntegralLogHelper.log("click_follower", LOCATION)
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", "粉丝数")
|
||||
requireContext().startActivity(
|
||||
FansActivity.getIntent(
|
||||
requireContext(),
|
||||
@ -599,7 +580,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
}
|
||||
userVoteContainer.setOnClickListener {
|
||||
IntegralLogHelper.log("click_like", LOCATION)
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", "赞同数")
|
||||
Utils.toast(
|
||||
requireContext(),
|
||||
"共获得 " + NumberUtils.transSimpleCount(personalData?.count?.vote!!) + " 赞同"
|
||||
@ -607,7 +587,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
}
|
||||
userEditBtn.setOnClickListener {
|
||||
IntegralLogHelper.log("click_edit", LOCATION)
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", "编辑按钮")
|
||||
requireContext().startActivity(UserInfoActivity.getIntent(requireContext()))
|
||||
}
|
||||
userConcernContainer.setOnClickListener {
|
||||
@ -617,7 +596,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
buttonName = "关注"
|
||||
)
|
||||
ifLogin("个人主页-关注-[关注]") {
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", "关注按钮")
|
||||
mUserHomeViewModel.follow()
|
||||
}
|
||||
}
|
||||
@ -629,7 +607,6 @@ class UserHomeFragment : ToolbarFragment() {
|
||||
buttonName = "已关注"
|
||||
)
|
||||
ifLogin("个人主页-关注-[关注]") {
|
||||
MtaHelper.onEvent("个人主页详情", "个人主页详情", "关注按钮")
|
||||
DialogHelper.showDialog(
|
||||
requireContext(),
|
||||
"取消关注",
|
||||
|
||||
@ -30,7 +30,6 @@ import com.gh.gamecenter.common.base.fragment.BaseFragment
|
||||
import com.gh.gamecenter.common.base.fragment.ToolbarFragment
|
||||
import com.gh.gamecenter.common.callback.ConfirmListener
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.Constants.GAME_DETAIL_COME_IN
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.entity.NormalShareEntity
|
||||
import com.gh.gamecenter.common.entity.SuggestType
|
||||
@ -594,7 +593,6 @@ open class AnswerDetailFragment : ToolbarFragment() {
|
||||
when (menuItem.itemId) {
|
||||
R.id.menu_more -> mViewModel.answerDetail?.let { showMoreItemDialog(it) }
|
||||
R.id.menu_question_and_answer -> {
|
||||
HaloApp.remove(GAME_DETAIL_COME_IN)
|
||||
val community = mViewModel.answerDetail?.community
|
||||
MtaHelper.onEvent(
|
||||
"进入问答",
|
||||
@ -1132,8 +1130,6 @@ open class AnswerDetailFragment : ToolbarFragment() {
|
||||
(requireActivity() as ToolBarActivity).clearMenu()
|
||||
|
||||
initMenu(R.menu.menu_answer)
|
||||
val itemMenu = getItemMenu(R.id.menu_question_and_answer)
|
||||
itemMenu.isVisible = HaloApp.get(GAME_DETAIL_COME_IN, false) != null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ import com.gh.gamecenter.adapter.viewholder.GameViewHolder
|
||||
import com.gh.gamecenter.adapter.viewholder.SearchHistoryViewHolder
|
||||
import com.gh.gamecenter.common.baselist.ListAdapter
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.ItemViewType
|
||||
import com.gh.gamecenter.common.exposure.ExposureSource
|
||||
import com.gh.gamecenter.common.json.json
|
||||
@ -250,7 +251,7 @@ class SearchGameIndexAdapter(
|
||||
StringUtils.buildString(
|
||||
entrance, "+(搜索-列表[", key, "=", "$type=",
|
||||
(holder.adapterPosition + 1).toString(), "])"
|
||||
), GameDetailFragment.TAB_TRENDS, traceEvent = exposureEvent
|
||||
), EntranceConsts.TAB_TYPE_TRENDS, traceEvent = exposureEvent
|
||||
)
|
||||
|
||||
gameEntity.run {
|
||||
@ -326,7 +327,7 @@ class SearchGameIndexAdapter(
|
||||
StringUtils.buildString(
|
||||
entrance, "+(搜索-列表[", key, "=", "$type=",
|
||||
(holder.adapterPosition + 1).toString(), "])"
|
||||
), GameDetailFragment.TAB_BBS, traceEvent = exposureEvent
|
||||
), EntranceConsts.TAB_TYPE_BBS, traceEvent = exposureEvent
|
||||
)
|
||||
|
||||
gameEntity.run {
|
||||
|
||||
@ -25,6 +25,7 @@ import com.gh.gamecenter.adapter.viewholder.SearchGameFooterViewHolder
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager
|
||||
import com.gh.gamecenter.common.baselist.ListAdapter
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.ItemViewType
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.common.entity.SuggestType
|
||||
@ -580,7 +581,7 @@ class SearchGameResultAdapter(
|
||||
StringUtils.buildString(
|
||||
entrance, "+(搜索-列表[", key, "=", "$type=",
|
||||
(position + 1).toString(), "])"
|
||||
), GameDetailFragment.TAB_TRENDS, traceEvent = exposureEvent
|
||||
), EntranceConsts.TAB_TYPE_TRENDS, traceEvent = exposureEvent
|
||||
)
|
||||
|
||||
gameEntity.run {
|
||||
@ -656,7 +657,7 @@ class SearchGameResultAdapter(
|
||||
StringUtils.buildString(
|
||||
entrance, "+(搜索-列表[", key, "=", "$type=",
|
||||
(position + 1).toString(), "])"
|
||||
), GameDetailFragment.TAB_BBS, traceEvent = exposureEvent
|
||||
), EntranceConsts.TAB_TYPE_BBS, traceEvent = exposureEvent
|
||||
)
|
||||
|
||||
gameEntity.run {
|
||||
|
||||
@ -44,11 +44,4 @@ object SettingBridge {
|
||||
fun getAboutIntent(context: Context?, isUpdate: Boolean): Intent {
|
||||
return mSettingProvider?.getAboutIntent(context, isUpdate) ?: Intent(context, MainActivity::class.java)
|
||||
}
|
||||
|
||||
fun getBindPhoneNormalIntent(context: Context, isChangePhone: Boolean): Intent {
|
||||
return mSettingProvider?.getBindPhoneNormalIntent(context, isChangePhone) ?: Intent(
|
||||
context,
|
||||
MainActivity::class.java
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -187,7 +187,7 @@ class VoteAdapter(
|
||||
EntranceConsts.HOST_GAME -> {
|
||||
startGameDetailActivity(
|
||||
mContext,
|
||||
link.link!!, entrance, -1,
|
||||
link.link!!, entrance,
|
||||
isSkipGameComment = false,
|
||||
scrollToLibao = false,
|
||||
openVideoStreaming = false,
|
||||
|
||||
@ -361,21 +361,16 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
|
||||
|
||||
R.id.actionbar_notification -> {
|
||||
DataCollectionUtils.uploadClick(activity, "消息图标", "主页")
|
||||
CheckLoginUtils.checkLogin(requireContext(), "(工具栏)") {
|
||||
NewLogUtils.logMessageInformBellClick(
|
||||
messageUnread?.visibility == View.VISIBLE,
|
||||
"首页"
|
||||
)
|
||||
SensorsBridge.trackMessageCenterClick()
|
||||
// 优先进入有数字提醒的消息tab,其次是有红点提醒的游戏动态,最后是没有提醒的消息tab
|
||||
var defaultTabIndex = 1
|
||||
val messageUnreadCount = unreadViewModel.messageUnreadCountLiveData.value
|
||||
val isConcernUnread = unreadViewModel.zixunConcernLiveData.value
|
||||
if ((messageUnreadCount == null || messageUnreadCount.message < 1) && isConcernUnread == true) {
|
||||
defaultTabIndex = 0
|
||||
}
|
||||
DirectUtils.directToMessageCenter(defaultTabIndex)
|
||||
NewLogUtils.logMessageInformBellClick(messageUnread?.visibility == View.VISIBLE, "首页")
|
||||
SensorsBridge.trackMessageCenterClick()
|
||||
// 优先进入有数字提醒的消息tab,其次是有红点提醒的游戏动态,最后是没有提醒的消息tab
|
||||
var defaultTabIndex = 1
|
||||
val messageUnreadCount = unreadViewModel.messageUnreadCountLiveData.value
|
||||
val isConcernUnread = unreadViewModel.zixunConcernLiveData.value
|
||||
if ((messageUnreadCount == null || messageUnreadCount.message < 1) && isConcernUnread == true) {
|
||||
defaultTabIndex = 0
|
||||
}
|
||||
DirectUtils.directToMessageCenter(defaultTabIndex, "(工具栏)")
|
||||
}
|
||||
|
||||
R.id.actionbar_teenager_model -> {
|
||||
|
||||
13
build.gradle
13
build.gradle
@ -1,10 +1,6 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
apply from: 'dependencies.gradle'
|
||||
apply from: 'vspace-bridge/config.gradle'
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.7.20'
|
||||
ext.kotlin_version = '1.9.24'
|
||||
ext.shadow_version = '1.0.5'
|
||||
repositories {
|
||||
google()
|
||||
@ -29,6 +25,12 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.google.devtools.ksp' version '1.9.24-1.0.20' apply false
|
||||
}
|
||||
apply from: 'dependencies.gradle'
|
||||
apply from: 'vspace-bridge/config.gradle'
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven {
|
||||
@ -57,6 +59,7 @@ allprojects {
|
||||
maven { url 'https://developer.hihonor.com/repo' }
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
buildscript {
|
||||
ext {
|
||||
kotlinVersion = "1.7.20"
|
||||
kotlinVersion = "1.9.24"
|
||||
}
|
||||
repositories {
|
||||
maven {url 'https://maven.aliyun.com/repository/public'}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
ext {
|
||||
//Android
|
||||
buildToolsVersion = "30.0.3"
|
||||
buildToolsVersion = "34.0.0"
|
||||
compileSdkVersion = 34
|
||||
minSdkVersion = 21
|
||||
|
||||
@ -26,7 +26,7 @@ ext {
|
||||
lifeCycle = "2.5.1"
|
||||
lifeCycleExtensions = "2.2.0"
|
||||
asynclayoutinflater = "1.0.0"
|
||||
room = "2.4.3"
|
||||
room = "2.6.1"
|
||||
workManager = "2.6.0"
|
||||
viewpager2 = "1.0.0"
|
||||
ktx = "1.2.0"
|
||||
@ -119,6 +119,7 @@ ext {
|
||||
|
||||
autoServiceVersion = "1.0-rc7"
|
||||
arouterVersion = "1.5.1"
|
||||
arouterKspCompilerVersion = "1.9.20-1.0.7"
|
||||
|
||||
composeVersion = "1.2.1"
|
||||
activityComposeVersion = "1.6.0"
|
||||
|
||||
@ -2,6 +2,7 @@ plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -28,10 +29,8 @@ android {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,5 +41,6 @@ dependencies {
|
||||
|
||||
implementation "com.aliyun.ams:alicloud-android-push:$acloudPush"
|
||||
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
}
|
||||
@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -13,14 +14,10 @@ android {
|
||||
versionName rootProject.ext.versionName
|
||||
|
||||
buildConfigField "String", "API_HOST", "\"${API_HOST}\""
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@ -49,7 +46,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
|
||||
@ -6,6 +6,7 @@ if (isRelease.toBoolean()) {
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -47,10 +48,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@ -83,7 +82,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
if (!isRelease.toBoolean()) {
|
||||
implementation "androidx.multidex:multidex:${multiDex}"
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -18,10 +19,8 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
@ -47,7 +46,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
|
||||
@ -6,6 +6,7 @@ if (isRelease.toBoolean()) {
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -49,10 +50,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
@ -80,11 +79,8 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
if (!isRelease.toBoolean()) {
|
||||
implementation "androidx.multidex:multidex:${multiDex}"
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -14,10 +15,8 @@ android {
|
||||
versionName rootProject.ext.versionName
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@ -39,7 +38,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
|
||||
@ -6,6 +6,7 @@ if (isRelease.toBoolean()) {
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -42,10 +43,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@ -78,7 +77,9 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
if (!isRelease.toBoolean()) {
|
||||
implementation "androidx.multidex:multidex:${multiDex}"
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -26,10 +27,8 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
@ -52,7 +51,8 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
|
||||
@ -18,7 +18,6 @@ import cn.com.chinatelecom.account.api.CtAuth
|
||||
import cn.jiguang.verifysdk.api.*
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
|
||||
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.databinding.SetWaitDialogBinding
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
@ -82,7 +81,7 @@ object LoginHelper {
|
||||
}
|
||||
}
|
||||
|
||||
fun loginAuth(context: Context, entrance: String, callback: (() -> Unit)?) {
|
||||
fun loginAuth(context: Context, entrance: String, fromLoginInterceptor: Boolean, callback: (() -> Unit)?) {
|
||||
runOnUiThread {
|
||||
val dialogContext = DialogHelper.checkDialogContext(context)
|
||||
if (dialogContext is Activity && dialogContext.isFinishing) return@runOnUiThread
|
||||
@ -100,7 +99,7 @@ object LoginHelper {
|
||||
}
|
||||
|
||||
isDarkMode = DarkModeUtils.isDarkModeOn(context)
|
||||
setUiConfig(context, callback)
|
||||
setUiConfig(context, fromLoginInterceptor, callback)
|
||||
val settings = LoginSettings()
|
||||
settings.isAutoFinish = false
|
||||
settings.timeout = 5 * 1000
|
||||
@ -152,12 +151,12 @@ object LoginHelper {
|
||||
when (code) {
|
||||
LOGIN_AUTH_CODE_SUCCESS -> {
|
||||
loginToken = content
|
||||
getLoginProvider()?.startQuickLoginHelperPageFromQuickLogin(content, context, callback)
|
||||
getLoginProvider()?.startQuickLoginHelperPageFromQuickLogin(content, context, fromLoginInterceptor, callback)
|
||||
}
|
||||
|
||||
LOGIN_AUTH_CODE_FAILURE -> {
|
||||
dismissDialog()
|
||||
getLoginProvider()?.startCodeLoginPageFromQuickLogin(openAuthPageSuccess, context, callback)
|
||||
getLoginProvider()?.startCodeLoginPageFromQuickLogin(openAuthPageSuccess, context, fromLoginInterceptor, callback)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -172,7 +171,7 @@ object LoginHelper {
|
||||
}
|
||||
}
|
||||
|
||||
private fun setUiConfig(context: Context, callback: (() -> Unit)?) {
|
||||
private fun setUiConfig(context: Context, fromLoginInterceptor: Boolean, callback: (() -> Unit)?) {
|
||||
backgroundView = getLoginProvider()?.createQuickLoginBackgroundView(context)
|
||||
val beanArrayList: MutableList<PrivacyBean> = ArrayList()
|
||||
beanArrayList.add(PrivacyBean("用户协议", com.gh.gamecenter.common.R.string.disclaimer_url.toResString(), ", "))
|
||||
@ -231,15 +230,15 @@ object LoginHelper {
|
||||
.setPrivacyMarginL(40) //隐私条款距离手机左右边缘的边距
|
||||
.setPrivacyMarginR(40)
|
||||
// 添加自定义布局
|
||||
.addBottomView(getCustomView(context, callback)) { _, _ -> }
|
||||
.addBottomView(getCustomView(context, fromLoginInterceptor, callback)) { _, _ -> }
|
||||
.setStatusBarDarkMode(false)
|
||||
.build()
|
||||
JVerificationInterface.setCustomUIWithConfig(uiConfig)
|
||||
|
||||
}
|
||||
|
||||
private fun getCustomView(context: Context, callback: (() -> Unit)?): View? {
|
||||
return getLoginProvider()?.createCustomView(context, callback)
|
||||
private fun getCustomView(context: Context, fromLoginInterceptor: Boolean, callback: (() -> Unit)?): View? {
|
||||
return getLoginProvider()?.createCustomView(context, fromLoginInterceptor, callback)
|
||||
?.also { root ->
|
||||
root.doOnAttach {
|
||||
initView(it)
|
||||
|
||||
@ -21,8 +21,8 @@ class QuickLoginProviderImpl : IQuickLoginProvider {
|
||||
LoginHelper.preLogin(context)
|
||||
}
|
||||
|
||||
override fun startLogin(context: Context, entrance: String, callback: (() -> Unit)?) {
|
||||
LoginHelper.loginAuth(context, entrance, callback)
|
||||
override fun startLogin(context: Context, entrance: String, fromLoginInterceptor: Boolean, callback: (() -> Unit)?) {
|
||||
LoginHelper.loginAuth(context, entrance, fromLoginInterceptor, callback)
|
||||
}
|
||||
|
||||
override fun isOpenMobileData(context: Context): Boolean {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
apply plugin: "com.android.library"
|
||||
apply plugin: "org.jetbrains.kotlin.android"
|
||||
apply plugin: "kotlin-kapt"
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
|
||||
@ -26,15 +26,13 @@ android {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
|
||||
implementation "io.sentry:sentry-android:${sentry}"
|
||||
implementation "io.sentry:sentry-android-fragment:${sentry}"
|
||||
|
||||
@ -79,6 +79,12 @@ android.enableJetifier=true
|
||||
kapt.use.worker.api = true
|
||||
kapt.incremental.apt = true
|
||||
|
||||
#ksp 编译
|
||||
#ksp.incremental=true
|
||||
#ksp.incremental.log=true
|
||||
# track classpath
|
||||
#ksp.incremental.intermodule=true
|
||||
|
||||
# 数据绑定增量注解处理
|
||||
android.databinding.incremental=true
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-parcelize'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -38,10 +39,8 @@ android {
|
||||
viewBinding true
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -61,13 +60,11 @@ android {
|
||||
|
||||
dependencies {
|
||||
api fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
api "androidx.constraintlayout:constraintlayout:${constraintLayout}"
|
||||
api "androidx.asynclayoutinflater:asynclayoutinflater:${asynclayoutinflater}"
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
api "com.louiscad.splitties:splitties-views-dsl:${splitties}"
|
||||
api "com.louiscad.splitties:splitties-views-dsl-constraintlayout:${splitties}"
|
||||
api "com.github.nichbar:AndroidRomChecker:${romChecker}"
|
||||
@ -80,7 +77,7 @@ dependencies {
|
||||
api "com.tencent.mm.opensdk:wechat-sdk-android-without-mta:${mta}"
|
||||
api "androidx.room:room-runtime:${room}"
|
||||
api "androidx.room:room-rxjava2:${room}"
|
||||
kapt "androidx.room:room-compiler:${room}"
|
||||
ksp("androidx.room:room-compiler:${room}")
|
||||
api "androidx.collection:collection-ktx:${collection}"
|
||||
api "androidx.activity:activity:${activity}"
|
||||
api "androidx.activity:activity-ktx:${activity}"
|
||||
@ -102,8 +99,5 @@ dependencies {
|
||||
api "com.google.android:flexbox:${flexbox}"
|
||||
api "com.blankj:utilcodex:${blankjUtilCodex}"
|
||||
|
||||
debugApi "com.squareup.okio:okio:2.2.2"
|
||||
debugApi "junit:junit:4.12"
|
||||
|
||||
api(project(path: ":module_core"))
|
||||
}
|
||||
@ -39,6 +39,7 @@ import androidx.lifecycle.Lifecycle;
|
||||
import com.alibaba.android.arouter.core.LogisticsCenter;
|
||||
import com.alibaba.android.arouter.exception.NoRouteFoundException;
|
||||
import com.alibaba.android.arouter.facade.Postcard;
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.LanguageUtils;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
@ -106,7 +107,8 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements IBus
|
||||
public final int MAX_BUNDLE_SIZE = 300;
|
||||
|
||||
@NonNull
|
||||
protected String mEntrance;
|
||||
@Autowired(name = KEY_ENTRANCE, desc = "入口(埋点相关的字段,开发内部使用)")
|
||||
public String mEntrance;
|
||||
|
||||
private boolean mIsExistLogoutDialog;
|
||||
protected boolean mIsDarkModeOn;
|
||||
@ -455,7 +457,7 @@ public abstract class BaseActivity extends BaseAppCompatActivity implements IBus
|
||||
, () -> {
|
||||
if (NetworkUtils.isQuickLoginEnabled(BaseActivity.this)) {
|
||||
IQuickLoginProvider quickLoginConfig = (IQuickLoginProvider) ARouter.getInstance().build(RouteConsts.provider.quickLogin).navigation();
|
||||
quickLoginConfig.startLogin(BaseActivity.this, "你的账号已在另外一台设备登录多设备-重新登录", null);
|
||||
quickLoginConfig.startLogin(BaseActivity.this, "你的账号已在另外一台设备登录多设备-重新登录", false, null);
|
||||
} else {
|
||||
ARouter.getInstance().build(RouteConsts.activity.loginActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "你的账号已在另外一台设备登录多设备-重新登录")
|
||||
|
||||
@ -25,8 +25,6 @@ public class Constants {
|
||||
|
||||
public static final String SHOULD_SHOW_VIDEO_MOBILE_WARNING = "should_show_video_mobile_warning";
|
||||
|
||||
public static final String GAME_DETAIL_COME_IN = "game_detail_come_in"; // 从游戏详情进入
|
||||
|
||||
public static final String EB_QUIT_LOGIN = "quit_login";
|
||||
|
||||
public static final String EB_GAME_DETAIL = "eb_game_detail";
|
||||
|
||||
@ -11,8 +11,8 @@ public class EntranceConsts {
|
||||
public static final String KEY_TO = "to";
|
||||
public static final String KEY_NEXT_TO = "next_to";
|
||||
public static final String KEY_NEWSID = "newsId";
|
||||
public static final String KEY_GAMEID = "gameId";
|
||||
public static final String KEY_GAME_ID = "game_id";
|
||||
public static final String KEY_GAMEID = KEY_GAME_ID;
|
||||
public static final String KEY_ID = "id";
|
||||
public static final String KEY_URL = "url";
|
||||
public static final String KEY_BUNDLE = "bundle";
|
||||
@ -117,6 +117,10 @@ public class EntranceConsts {
|
||||
public static final String KEY_PLATFORM = "platform";
|
||||
public static final String KEY_GAME_NAME = "game_name";
|
||||
|
||||
public static final String KEY_GAME_ENTITY = "game_entity";
|
||||
|
||||
public static final String KEY_DEFAULT_TAB = "default_tab";
|
||||
|
||||
public static final String KEY_PLATFORMS = "platforms";
|
||||
public static final String KEY_PLATFORMS_AUTO_DOWNLOAD = "platform_auto_download";
|
||||
public static final String KEY_GAME_INFO = "game_info";
|
||||
@ -176,12 +180,13 @@ public class EntranceConsts {
|
||||
public static final String KEY_CATEGORY_TITLE = "category_title";
|
||||
public static final String KEY_BLOCK_DATA = "blockData";
|
||||
public static final String KEY_ASK_TAG = "askTag";
|
||||
public static final String KEY_SCROLL_TO_LIBAO = "libao";
|
||||
public static final String KEY_SCROLL_TO_LIBAO = "scroll_to_libao";
|
||||
public static final String KEY_SCROLL_TO_SERVER = "scroll_to_server";
|
||||
public static final String KEY_ASK_COLUMN_TAG = "askColumnTag";
|
||||
public static final String KEY_COMMUNITY_ID = "community_id";
|
||||
public static final String KEY_COMMUNITY_NAME = "community_name";
|
||||
public static final String KEY_COMMUNITY_DATA = "communityData";
|
||||
public static final String KEY_COMMUNITY_TYPE = "community_type";
|
||||
public static final String KEY_TRACE_EVENT = "trace_event";
|
||||
public static final String KEY_SUBJECT_DATA = "subjectData";
|
||||
public static final String KEY_SUBJECT_TYPE = "subjectType";
|
||||
@ -199,8 +204,8 @@ public class EntranceConsts {
|
||||
public static final String KEY_SCROLL_TO_COMMENT_AREA = "scroll_to_comment_area";
|
||||
public static final String KEY_RATING_STAR_COUNT = "ratingStarCount";
|
||||
public static final String KEY_QUESTION_MODERATOR_PATCH = "questionModeratorPatch";
|
||||
public static final String KEY_SKIP_GAME_COMMENT = "skipGameComment";
|
||||
public static final String KEY_OPEN_PLATFORM_WINDOW = "openPlatformWindow";
|
||||
public static final String KEY_COMMENT_AS_DEFAULT_TAB = "comment_as_default_tab";
|
||||
public static final String KEY_OPEN_PLATFORM_WINDOW = "open_platform_window";
|
||||
public static final String KEY_OPEN_KEYBOARD = "openKeyboard";
|
||||
public static final String KEY_PATH_VIDEO = "pathVideo";
|
||||
public static final String KEY_VIDEO_ID = "videoId";
|
||||
@ -215,7 +220,7 @@ public class EntranceConsts {
|
||||
public static final String KEY_COLLECTION_NAME = "collectionName";
|
||||
public static final String KEY_NAVIGATION_TITLE = "navigationTitle";
|
||||
public static final String KEY_IMAGE_CROP_RATIO = "imageCropRatio";
|
||||
public static final String KEY_OPEN_VIDEO_STREAMING = "openVideoStreaming";
|
||||
public static final String KEY_OPEN_VIDEO_STREAMING = "open_video_streaming";
|
||||
public static final String KEY_REFERER = "referer";
|
||||
public static final String KEY_UUID = "uuid";
|
||||
public static final String KEY_IS_HOME_VIDEO = "isHomeVideo";
|
||||
@ -225,6 +230,7 @@ public class EntranceConsts {
|
||||
public static final String KEY_ACTIVITY_NAME = "activityName";//活动名称
|
||||
public static final String KEY_PAGINATION_TYPE = "paginationType";//活动分页方式
|
||||
public static final String KEY_REQUIRE_REDIRECT = "require_redirect"; // 标记需要再跳转
|
||||
public static final String KEY_REQUIRE_LOGIN = "require_login"; // 标记需要登录
|
||||
public static final String KEY_FIELD_ID = "field_id"; // 专区板块id
|
||||
public static final String KEY_SECTION_NAME = "section_name"; // 专区专题名
|
||||
public static final String KEY_COLUMNNAME = "columnName";
|
||||
@ -351,4 +357,12 @@ public class EntranceConsts {
|
||||
public static final String KEY_SHOW_ADD_GAMES_DIALOG = "show_add_games_dialog";
|
||||
|
||||
public static final String KEY_IS_AUTO_LOAD = "key_is_auto_load";
|
||||
|
||||
public static final String TAB_TYPE_DESC = "详情";
|
||||
public static final String TAB_TYPE_TRENDS = "专区";
|
||||
public static final String TAB_TYPE_ARCHIVE = "云存档";
|
||||
public static final String TAB_TYPE_RATING = "评价";
|
||||
public static final String TAB_TYPE_BBS = "论坛";
|
||||
|
||||
public static final int VALUE_LOGIN_REQUEST_CODE = 343;
|
||||
}
|
||||
|
||||
@ -15,6 +15,10 @@ object RouteConsts {
|
||||
const val libaoDetailActivity = "/app/libaoDetailActivity"
|
||||
const val fullScreenVideoActivity = "/app/FullScreenVideoActivity"
|
||||
|
||||
const val gameDetailActivity = "/activity/game_detail"
|
||||
|
||||
const val userHomeActivity = "/activity/user_home"
|
||||
|
||||
const val aboutActivity = "/settings/AboutActivity"
|
||||
const val webActivity = "/setting/WebActivity"
|
||||
const val weiBoShareActivity = "/setting/weiBoShareActivity"
|
||||
@ -28,6 +32,8 @@ object RouteConsts {
|
||||
const val suggestionActivity = "/help/SuggestionActivity"
|
||||
|
||||
const val messageWrapperActivity = "/message/messageWrapperActivity"
|
||||
|
||||
const val quickLoginActivity = "/login/quick_login_activity"
|
||||
}
|
||||
|
||||
object fragment {
|
||||
@ -132,4 +138,14 @@ object RouteConsts {
|
||||
const val quickLogin = "/quickLogin/quickLogin"
|
||||
}
|
||||
|
||||
object Interceptor {
|
||||
const val LOGIN_INTERCEPTOR = "loginInterceptor"
|
||||
}
|
||||
|
||||
object QueryParams {
|
||||
const val REQUIRE_LOGIN = "require_login"
|
||||
const val SOURCE = "source"
|
||||
const val KEY_FROM_INTERCEPTOR = "from_interceptor";
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,6 +2,7 @@ plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -17,11 +18,8 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
@ -43,10 +41,6 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
api "androidx.core:core-ktx:${core}"
|
||||
api "androidx.recyclerview:recyclerview:${recyclerView}"
|
||||
api "androidx.appcompat:appcompat:${appCompat}"
|
||||
@ -83,7 +77,8 @@ dependencies {
|
||||
})
|
||||
|
||||
api "com.alibaba:arouter-api:$arouterVersion"
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
api project(':libraries:LGLibrary')
|
||||
api project(':libraries:QQShare')
|
||||
|
||||
@ -19,9 +19,9 @@ interface ILoginProvider : IProvider {
|
||||
|
||||
fun createQuickLoginBackgroundView(context: Context): View
|
||||
|
||||
fun startQuickLoginHelperPageFromQuickLogin(loginToken: String, context: Context, callback: (() -> Unit)?)
|
||||
fun startQuickLoginHelperPageFromQuickLogin(loginToken: String, context: Context, fromLoginInterceptor: Boolean, callback: (() -> Unit)?)
|
||||
|
||||
fun startCodeLoginPageFromQuickLogin(openAuthPageSuccess: Boolean, context: Context, callback: (() -> Unit)?)
|
||||
fun startCodeLoginPageFromQuickLogin(openAuthPageSuccess: Boolean, context: Context, fromLoginInterceptor: Boolean, callback: (() -> Unit)?)
|
||||
|
||||
fun createCustomView(context: Context, callback: (() -> Unit)?): View
|
||||
fun createCustomView(context: Context, fromLoginInterceptor: Boolean, callback: (() -> Unit)?): View
|
||||
}
|
||||
@ -11,7 +11,7 @@ interface IQuickLoginProvider : IProvider {
|
||||
|
||||
fun preLogin(context: Context)
|
||||
|
||||
fun startLogin(context: Context, entrance: String, callback: (() -> Unit)?)
|
||||
fun startLogin(context: Context, entrance: String, fromLoginInterceptor: Boolean, callback: (() -> Unit)?)
|
||||
|
||||
fun isOpenMobileData(context: Context): Boolean
|
||||
|
||||
|
||||
@ -10,8 +10,6 @@ interface ISettingProvider : IProvider {
|
||||
|
||||
fun getSecurityIntent(context: Context, entrance: String, isLogoutStyle: Boolean): Intent?
|
||||
|
||||
fun getBindPhoneNormalIntent(context: Context, isChangePhone: Boolean): Intent?
|
||||
|
||||
fun getAboutIntent(context: Context?, isUpdate: Boolean): Intent?
|
||||
|
||||
}
|
||||
@ -3,6 +3,7 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-parcelize'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -13,8 +14,6 @@ android {
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode rootProject.ext.versionCode
|
||||
versionName rootProject.ext.versionName
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
@ -22,10 +21,8 @@ android {
|
||||
dataBinding true
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -44,6 +41,7 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
|
||||
@ -1051,7 +1051,6 @@ data class GameEntity(
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG: String = "GameEntity"
|
||||
const val CHECK_MIRROR_INFO_INTERVAL = 10 * 1000 // 检查镜像更新间隔 10s
|
||||
|
||||
private const val GAME_DOWNLOAD_BUTTON_MODE_UNKNOWN = 0
|
||||
|
||||
@ -30,7 +30,6 @@ interface IGameDetailProvider : IProvider {
|
||||
context: Context,
|
||||
gameId: String,
|
||||
entrance: String?,
|
||||
defaultTab: Int = -1,
|
||||
isSkipGameComment: Boolean = false,
|
||||
scrollToLibao: Boolean = false,
|
||||
openVideoStreaming: Boolean = false,
|
||||
|
||||
@ -3,6 +3,7 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-parcelize'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -23,10 +24,8 @@ android {
|
||||
viewBinding true
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -46,11 +45,8 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common"))
|
||||
implementation(project(path: ":module_core_feature"))
|
||||
|
||||
@ -0,0 +1,78 @@
|
||||
package com.gh.gamecenter.login.interceptor
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import com.alibaba.android.arouter.facade.Postcard
|
||||
import com.alibaba.android.arouter.facade.annotation.Interceptor
|
||||
import com.alibaba.android.arouter.facade.callback.InterceptorCallback
|
||||
import com.alibaba.android.arouter.facade.template.IInterceptor
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.NetworkUtils
|
||||
import com.gh.gamecenter.core.utils.CurrentActivityHolder
|
||||
import com.gh.gamecenter.login.HaloApp
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.login.utils.QuickLoginHelper
|
||||
import com.lightgame.utils.AppManager
|
||||
import com.lightgame.utils.Utils
|
||||
|
||||
@Interceptor(name = RouteConsts.Interceptor.LOGIN_INTERCEPTOR, priority = 1)
|
||||
class LoginInterceptor : IInterceptor {
|
||||
|
||||
override fun process(
|
||||
postcard: Postcard?,
|
||||
callback: InterceptorCallback?
|
||||
) {
|
||||
Utils.log(TAG, "loginInterceptor about to intercept ${postcard?.uri}")
|
||||
|
||||
if (postcard?.uri?.getQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN) != "true") {
|
||||
callback?.onContinue(postcard)
|
||||
} else {
|
||||
if (TextUtils.isEmpty(UserManager.getInstance().getToken())) {
|
||||
pendingPostcard = postcard
|
||||
|
||||
val currentActivity = CurrentActivityHolder.getCurrentActivity()
|
||||
|
||||
if (currentActivity != null
|
||||
&& NetworkUtils.isQuickLoginEnabled(HaloApp.getInstance())) {
|
||||
QuickLoginHelper.startLogin(currentActivity, "浏览器", true)
|
||||
} else {
|
||||
ARouter.getInstance().build(RouteConsts.activity.loginActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, postcard.path)
|
||||
.withBoolean(RouteConsts.QueryParams.KEY_FROM_INTERCEPTOR, true)
|
||||
.navigation()
|
||||
}
|
||||
} else {
|
||||
// 如果已经登录不拦截
|
||||
callback?.onContinue(postcard)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun init(context: Context?) {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "LoginInterceptor"
|
||||
|
||||
private var pendingPostcard: Postcard? = null
|
||||
|
||||
/**
|
||||
* 回调登录成功事件,执行被拦截的重定向
|
||||
*/
|
||||
fun onLoginSuccess() {
|
||||
pendingPostcard?.navigation()
|
||||
pendingPostcard = null
|
||||
}
|
||||
|
||||
/**
|
||||
* 回调登录取消事件,置空 pendingPostcard
|
||||
*/
|
||||
fun onLoginCancel() {
|
||||
pendingPostcard = null
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -52,21 +52,23 @@ class LoginProviderImpl : ILoginProvider {
|
||||
override fun startQuickLoginHelperPageFromQuickLogin(
|
||||
loginToken: String,
|
||||
context: Context,
|
||||
fromLoginInterceptor: Boolean,
|
||||
callback: (() -> Unit)?
|
||||
) {
|
||||
QuickLoginHelper.startQuickLoginHelperPage(LoginTag.oauth, loginToken, context, callback)
|
||||
QuickLoginHelper.startQuickLoginHelperPage(LoginTag.oauth, loginToken, context, fromLoginInterceptor, callback)
|
||||
}
|
||||
|
||||
override fun startCodeLoginPageFromQuickLogin(
|
||||
openAuthPageSuccess: Boolean,
|
||||
context: Context,
|
||||
fromLoginInterceptor: Boolean,
|
||||
callback: (() -> Unit)?
|
||||
) {
|
||||
QuickLoginHelper.startCodeLoginPage(openAuthPageSuccess, context, callback)
|
||||
QuickLoginHelper.startCodeLoginPage(openAuthPageSuccess, fromLoginInterceptor, context, callback)
|
||||
}
|
||||
|
||||
override fun createCustomView(context: Context, callback: (() -> Unit)?): View {
|
||||
return QuickLoginHelper.createCustomView(context, callback)
|
||||
override fun createCustomView(context: Context, fromLoginInterceptor: Boolean, callback: (() -> Unit)?): View {
|
||||
return QuickLoginHelper.createCustomView(context, fromLoginInterceptor, callback)
|
||||
}
|
||||
|
||||
override fun init(context: Context?) = Unit
|
||||
|
||||
@ -5,17 +5,15 @@ import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.text.*
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.provider.IEntranceUtilsProvider
|
||||
import com.gh.gamecenter.core.provider.IQuickLoginProvider
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.login.databinding.LayoutQuickLoginBinding
|
||||
import com.gh.gamecenter.login.interceptor.LoginInterceptor
|
||||
import com.gh.gamecenter.login.user.LoginTag
|
||||
import com.gh.gamecenter.login.view.LoginActivity
|
||||
import com.gh.gamecenter.login.view.QuickLoginHelperActivity
|
||||
@ -56,35 +54,42 @@ object QuickLoginHelper {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun startLogin(context: Context, entrance: String, callback: (() -> Unit)? = null) {
|
||||
getQuickLoginProvider()?.startLogin(context, entrance, callback)
|
||||
fun startLogin(context: Context, entrance: String, fromLoginInterceptor: Boolean, callback: (() -> Unit)? = null) {
|
||||
val quickLoginProvider = getQuickLoginProvider()
|
||||
|
||||
if (quickLoginProvider == null && fromLoginInterceptor) {
|
||||
LoginInterceptor.onLoginCancel()
|
||||
return
|
||||
}
|
||||
|
||||
quickLoginProvider?.startLogin(context, entrance, fromLoginInterceptor, callback)
|
||||
}
|
||||
|
||||
fun createCustomView(context: Context, callback: (() -> Unit)?): View {
|
||||
fun createCustomView(context: Context, fromLoginInterceptor: Boolean, callback: (() -> Unit)?): View {
|
||||
return LayoutQuickLoginBinding.inflate(LayoutInflater.from(context)).apply {
|
||||
closeBtn.setOnClickListener {
|
||||
finishAuthActivity()
|
||||
}
|
||||
changeLoginBtn.setOnClickListener {
|
||||
startCodeLoginPage(true, context, callback)
|
||||
startCodeLoginPage(true, fromLoginInterceptor, context, callback)
|
||||
NewFlatLogUtils.logFastLoginRelatedShow("mobile_number_verification_show")
|
||||
}
|
||||
qqBtn.setOnClickListener {
|
||||
getQuickLoginProvider()?.checkPolicyAndContinue(context) {
|
||||
startQuickLoginHelperPage(LoginTag.qq, context = context, callback = callback)
|
||||
startQuickLoginHelperPage(LoginTag.qq, context = context, fromLoginInterceptor = fromLoginInterceptor, callback = callback)
|
||||
NewFlatLogUtils.logFastLoginChoice("QQ")
|
||||
}
|
||||
|
||||
}
|
||||
wechatBtn.setOnClickListener {
|
||||
getQuickLoginProvider()?.checkPolicyAndContinue(context) {
|
||||
startQuickLoginHelperPage(LoginTag.wechat, context = context, callback = callback)
|
||||
startQuickLoginHelperPage(LoginTag.wechat, context = context, fromLoginInterceptor = fromLoginInterceptor, callback = callback)
|
||||
NewFlatLogUtils.logFastLoginChoice("微信")
|
||||
}
|
||||
}
|
||||
weiboBtn.setOnClickListener {
|
||||
getQuickLoginProvider()?.checkPolicyAndContinue(context) {
|
||||
startQuickLoginHelperPage(LoginTag.weibo, context = context, callback = callback)
|
||||
startQuickLoginHelperPage(LoginTag.weibo, context = context, fromLoginInterceptor = fromLoginInterceptor, callback = callback)
|
||||
NewFlatLogUtils.logFastLoginChoice("微博")
|
||||
}
|
||||
}
|
||||
@ -93,20 +98,12 @@ object QuickLoginHelper {
|
||||
}
|
||||
|
||||
// 打开验证码登录页
|
||||
fun startCodeLoginPage(openAuthPageSuccess: Boolean, context: Context, callback: (() -> Unit)?) {
|
||||
AppManager.getInstance().recentActiveActivity?.run {
|
||||
val entranceUtilsProvider = ARouter.getInstance()
|
||||
.build(RouteConsts.provider.entranceUtils)
|
||||
.navigation() as? IEntranceUtilsProvider
|
||||
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, if (openAuthPageSuccess) ENTRANCE_DEFAULT else entrance)
|
||||
bundle.putBoolean(EntranceConsts.KEY_FROM_QUICK_LOGIN, openAuthPageSuccess)
|
||||
bundle.putString(EntranceConsts.KEY_TO, LoginActivity::class.java.name)
|
||||
entranceUtilsProvider?.jumpActivityWithCallback(context, bundle) {
|
||||
callback?.invoke()
|
||||
}
|
||||
}
|
||||
fun startCodeLoginPage(openAuthPageSuccess: Boolean, fromLoginInterceptor: Boolean, context: Context, callback: (() -> Unit)?) {
|
||||
ARouter.getInstance().build(RouteConsts.activity.loginActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
.withBoolean(RouteConsts.QueryParams.KEY_FROM_INTERCEPTOR, fromLoginInterceptor)
|
||||
.withBoolean(EntranceConsts.KEY_FROM_QUICK_LOGIN, openAuthPageSuccess)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
// 打开快速登录辅助页
|
||||
@ -114,24 +111,24 @@ object QuickLoginHelper {
|
||||
loginTag: LoginTag,
|
||||
loginToken: String = "",
|
||||
context: Context,
|
||||
fromLoginInterceptor: Boolean,
|
||||
callback: (() -> Unit)?
|
||||
) {
|
||||
val entranceUtilsProvider = ARouter.getInstance()
|
||||
.build(RouteConsts.provider.entranceUtils)
|
||||
.navigation() as? IEntranceUtilsProvider
|
||||
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
bundle.putSerializable(EntranceConsts.KET_TYPE, loginTag)
|
||||
bundle.putString(EntranceConsts.KEY_TO, QuickLoginHelperActivity::class.java.name)
|
||||
if (loginTag == LoginTag.oauth) {
|
||||
bundle.putString(EntranceConsts.KEY_DATA, loginToken)
|
||||
}
|
||||
|
||||
entranceUtilsProvider?.jumpActivityWithCallback(context, bundle) {
|
||||
callback?.invoke()
|
||||
}
|
||||
|
||||
ARouter.getInstance()
|
||||
.build(RouteConsts.provider.quickLogin)
|
||||
.withBoolean(RouteConsts.QueryParams.KEY_FROM_INTERCEPTOR, fromLoginInterceptor)
|
||||
.withSerializable(EntranceConsts.KET_TYPE, loginTag)
|
||||
.apply {
|
||||
if (loginTag == LoginTag.oauth) {
|
||||
withString(EntranceConsts.KEY_DATA, loginToken)
|
||||
}
|
||||
if (context is Activity) {
|
||||
navigation(context, EntranceConsts.VALUE_LOGIN_REQUEST_CODE)
|
||||
} else {
|
||||
navigation(context)
|
||||
}
|
||||
}
|
||||
// TODO 处理 activityResult
|
||||
}
|
||||
|
||||
fun isLoginAuthPage(activity: Activity): Boolean {
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
package com.gh.gamecenter.login.view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
@ -19,26 +18,28 @@ import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
@Route(path = RouteConsts.activity.loginActivity)
|
||||
public class LoginActivity extends ToolBarActivity {
|
||||
|
||||
@Autowired(name = RouteConsts.QueryParams.KEY_FROM_INTERCEPTOR, desc = "是否来自拦截器,用于根据页面结果判断是否需要触发拦截器的回调")
|
||||
public boolean fromInterceptor;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, desc = "入口(埋点相关的字段)")
|
||||
public String entrance;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_FROM_QUICK_LOGIN, desc = "是否来自快速登录")
|
||||
public String fromQuickLogin;
|
||||
|
||||
@Override
|
||||
protected Intent provideNormalIntent() {
|
||||
return getTargetIntent(this, LoginActivity.class, LoginFragment.class);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Intent getIntent(Context context, String entrance) {
|
||||
return getIntent(context, entrance, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Intent getIntent(Context context, String entrance, boolean isFromQuickLogin) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putBoolean(EntranceConsts.KEY_FROM_QUICK_LOGIN, isFromQuickLogin);
|
||||
return getTargetIntent(context, LoginActivity.class, LoginFragment.class, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// 注入 arouter 参数
|
||||
ARouter.getInstance().inject(this);
|
||||
|
||||
// 桥接 arouter 和原有入参
|
||||
generateDataFromRoute();
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
hideToolbar(true);
|
||||
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, !mIsDarkModeOn);
|
||||
@ -54,4 +55,11 @@ public class LoginActivity extends ToolBarActivity {
|
||||
super.onDarkModeChanged();
|
||||
DisplayUtils.setStatusBarColor(this, com.gh.gamecenter.common.R.color.transparent, !mIsDarkModeOn);
|
||||
}
|
||||
|
||||
private void generateDataFromRoute() {
|
||||
Bundle bundle = getIntent().getExtras();
|
||||
|
||||
getIntent().putExtra(NORMAL_FRAGMENT_NAME, LoginFragment.class);
|
||||
getIntent().putExtra(NORMAL_FRAGMENT_BUNDLE, bundle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,13 +42,13 @@ import com.gh.gamecenter.core.provider.IWebProvider;
|
||||
import com.gh.gamecenter.core.utils.ClickUtils;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
import com.gh.gamecenter.core.utils.EmptyCallback;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.gamecenter.core.utils.PatternUtils;
|
||||
import com.gh.gamecenter.login.HaloApp;
|
||||
import com.gh.gamecenter.login.R;
|
||||
import com.gh.gamecenter.login.databinding.FragmentLoginBinding;
|
||||
import com.gh.gamecenter.login.entity.LoginTokenEntity;
|
||||
import com.gh.gamecenter.login.entity.UserInfoEntity;
|
||||
import com.gh.gamecenter.login.interceptor.LoginInterceptor;
|
||||
import com.gh.gamecenter.login.user.LoginTag;
|
||||
import com.gh.gamecenter.login.user.UserManager;
|
||||
import com.gh.gamecenter.login.user.UserViewModel;
|
||||
@ -87,6 +87,7 @@ public class LoginFragment
|
||||
private String mServiceId;
|
||||
|
||||
private boolean mIsFromQuickLogin = false;
|
||||
private boolean mIsFromInterceptor = false;
|
||||
private final int THIRD_PARTY_LOGIN_CLICK_DIFF = 3000;
|
||||
|
||||
@Override
|
||||
@ -135,6 +136,7 @@ public class LoginFragment
|
||||
|
||||
if (getArguments() != null) {
|
||||
mIsFromQuickLogin = getArguments().getBoolean(EntranceConsts.KEY_FROM_QUICK_LOGIN, false);
|
||||
mIsFromInterceptor = getArguments().getBoolean(RouteConsts.QueryParams.KEY_FROM_INTERCEPTOR, false);
|
||||
}
|
||||
|
||||
final UserViewModel.Factory factory = new UserViewModel.Factory(HaloApp.getInstance());
|
||||
@ -215,7 +217,6 @@ public class LoginFragment
|
||||
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
MtaHelper.onEvent("我的光环_新", "登录页面", "隐私政策");
|
||||
IWebProvider webActivity = (IWebProvider) ARouter.getInstance().build(RouteConsts.provider.webActivity).navigation();
|
||||
Intent intent = webActivity.getWebIntent(requireContext(), requireContext().getString(com.gh.gamecenter.common.R.string.privacy_policy_title), requireContext().getString(com.gh.gamecenter.common.R.string.privacy_policy_url));
|
||||
if (intent != null) {
|
||||
@ -235,7 +236,6 @@ public class LoginFragment
|
||||
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
MtaHelper.onEvent("我的光环_新", "登录页面", "用户协议");
|
||||
IWebProvider webActivity = (IWebProvider) ARouter.getInstance().build(RouteConsts.provider.webActivity).navigation();
|
||||
Intent intent = webActivity.getWebIntent(requireContext(), requireContext().getString(com.gh.gamecenter.common.R.string.disclaimer_title), requireContext().getString(com.gh.gamecenter.common.R.string.disclaimer_url));
|
||||
if (intent != null) {
|
||||
@ -252,7 +252,6 @@ public class LoginFragment
|
||||
if (id == R.id.checkIv) {
|
||||
mBinding.checkIv.setChecked(!mBinding.checkIv.isChecked());
|
||||
} else if (id == R.id.login_captcha) {
|
||||
MtaHelper.onEvent("我的光环_新", "登录页面", "获取验证码");
|
||||
final String phoneNum = mBinding.loginPhoneEt.getText().toString().trim().replaceAll(" ", "");
|
||||
if (PatternUtils.isPhoneNum(phoneNum) && phoneNum.length() == 11) {
|
||||
checkPolicyAndContinue(() -> {
|
||||
@ -264,26 +263,22 @@ public class LoginFragment
|
||||
toast("请输入正确的手机号");
|
||||
}
|
||||
} else if (id == R.id.login_phone_btn) {
|
||||
MtaHelper.onEvent("我的光环_新", "登录页面", "点击登录");
|
||||
loginByMobile();
|
||||
} else if (id == R.id.login_qq_btn) {
|
||||
if (!ClickUtils.isFastDoubleClick(id, THIRD_PARTY_LOGIN_CLICK_DIFF)) {
|
||||
checkPolicyAndContinue(() -> {
|
||||
MtaHelper.onEvent("我的光环_新", "登录页面", "QQ登录");
|
||||
LoginHelper.loginWithQQ(this, requireActivity());
|
||||
});
|
||||
}
|
||||
} else if (id == R.id.login_weibo_btn) {
|
||||
if (!ClickUtils.isFastDoubleClick(id, THIRD_PARTY_LOGIN_CLICK_DIFF)) {
|
||||
checkPolicyAndContinue(() -> {
|
||||
MtaHelper.onEvent("我的光环_新", "登录页面", "微博登录");
|
||||
LoginHelper.loginWithWeibo(this, requireActivity());
|
||||
});
|
||||
}
|
||||
} else if (id == R.id.login_wechat_btn) {
|
||||
if (!ClickUtils.isFastDoubleClick(id, THIRD_PARTY_LOGIN_CLICK_DIFF)) {
|
||||
checkPolicyAndContinue(() -> {
|
||||
MtaHelper.onEvent("我的光环_新", "登录页面", "微信登录");
|
||||
LoginHelper.loginWithWechat(this);
|
||||
});
|
||||
}
|
||||
@ -448,7 +443,12 @@ public class LoginFragment
|
||||
ARouter.getInstance().build(RouteConsts.activity.bindPhoneActivity)
|
||||
.withBoolean(EntranceConsts.KEY_FROM_LOGIN, true)
|
||||
.withBoolean(EntranceConsts.KEY_CHANGE_PHONE, false)
|
||||
.withBoolean(RouteConsts.QueryParams.KEY_FROM_INTERCEPTOR, mIsFromInterceptor)
|
||||
.navigation();
|
||||
} else {
|
||||
if (mIsFromQuickLogin) {
|
||||
LoginInterceptor.Companion.onLoginSuccess();
|
||||
}
|
||||
}
|
||||
}
|
||||
// 防止UserManager数据丢失后重复登录
|
||||
@ -480,6 +480,7 @@ public class LoginFragment
|
||||
mBaseHandler.removeCallbacksAndMessages(null);
|
||||
if (!UserManager.getInstance().isLoggedIn()) {
|
||||
EventBus.getDefault().post(new EBReuse(Constants.EB_QUIT_LOGIN));
|
||||
LoginInterceptor.Companion.onLoginCancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,6 +8,8 @@ import android.text.TextUtils
|
||||
import androidx.activity.viewModels
|
||||
import androidx.core.view.WindowCompat
|
||||
import androidx.lifecycle.Observer
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.fragment.WaitingDialogFragment
|
||||
@ -29,13 +31,15 @@ import com.gh.gamecenter.login.utils.NewFlatLogUtils
|
||||
import com.gh.gamecenter.login.utils.QuickLoginHelper
|
||||
import org.json.JSONObject
|
||||
|
||||
|
||||
/**
|
||||
* 快速登录辅助页,此页面为透明页面,用于执行各快速登录流程
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.quickLoginActivity, name = "快速登录辅助页 (开发内部使用)")
|
||||
class QuickLoginHelperActivity : BaseActivity(), LoginHelper.LoginCallback, Observer<ApiResponse<UserInfoEntity>> {
|
||||
|
||||
private var mLoginTag: LoginTag? = null
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, desc = "一键登录的类型 (开发内部使用)")
|
||||
var loginTag: LoginTag? = null
|
||||
|
||||
private var mLoginDialog: WaitingDialogFragment? = null
|
||||
private val mUserViewModel: UserViewModel by viewModels { UserViewModel.Factory(HaloApp.getInstance()) }
|
||||
|
||||
@ -56,12 +60,7 @@ class QuickLoginHelperActivity : BaseActivity(), LoginHelper.LoginCallback, Obse
|
||||
}
|
||||
|
||||
private fun handleLoginType() {
|
||||
mLoginTag = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
|
||||
intent?.getSerializableExtra(EntranceConsts.KET_TYPE) as? LoginTag
|
||||
} else {
|
||||
intent?.getSerializableExtra(EntranceConsts.KET_TYPE, LoginTag::class.java)
|
||||
}
|
||||
when (mLoginTag ?: finish()) {
|
||||
when (loginTag ?: finish()) {
|
||||
LoginTag.qq -> LoginHelper.loginWithQQ(this, this)
|
||||
LoginTag.wechat -> LoginHelper.loginWithWechat(this)
|
||||
LoginTag.weibo -> LoginHelper.loginWithWeibo(this, this)
|
||||
@ -146,14 +145,17 @@ class QuickLoginHelperActivity : BaseActivity(), LoginHelper.LoginCallback, Obse
|
||||
if (UserManager.getInstance().isLoggedIn) {
|
||||
QuickLoginHelper.finishAuthActivity()
|
||||
}
|
||||
} else if ((response?.httpException != null || response?.throwable != null) && mLoginTag == LoginTag.oauth) {
|
||||
} else if ((response?.httpException != null || response?.throwable != null) && loginTag == LoginTag.oauth) {
|
||||
NewFlatLogUtils.logFastLoginResult("失败")
|
||||
// 一键登录失败,关闭当前页,关闭授权页,切换到短信验证码登录
|
||||
if (!isSmsCodePageStarted) {
|
||||
isSmsCodePageStarted = true
|
||||
finish()
|
||||
QuickLoginHelper.finishAuthActivity()
|
||||
startActivity(LoginActivity.getIntent(this, QuickLoginHelper.ENTRANCE_DEFAULT, true))
|
||||
ARouter.getInstance().build(RouteConsts.activity.loginActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, QuickLoginHelper.ENTRANCE_DEFAULT)
|
||||
.withBoolean(EntranceConsts.KEY_FROM_QUICK_LOGIN, true)
|
||||
.navigation(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ if (isRelease.toBoolean()) {
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -49,10 +50,8 @@ android {
|
||||
viewBinding true
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -78,7 +77,9 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
if (!isRelease.toBoolean()) {
|
||||
implementation "androidx.multidex:multidex:${multiDex}"
|
||||
}
|
||||
@ -91,7 +92,4 @@ dependencies {
|
||||
implementation(project(':module_core_feature')) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
|
||||
}
|
||||
@ -973,7 +973,6 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
|
||||
context,
|
||||
entity.getGame().getId(),
|
||||
BaseActivity.mergeEntranceAndPath(entrance, path),
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
|
||||
@ -610,7 +610,6 @@ class MessageListAdapter(
|
||||
mContext,
|
||||
data.id ?: "",
|
||||
"",
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
|
||||
@ -3,6 +3,7 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.sensorsdata.analytics.android'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -17,10 +18,8 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
flavorDimensions("env")
|
||||
@ -102,13 +101,11 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation "com.sensorsdata.analytics.android:SensorsAnalyticsSDK:$sensorsDataVersion"
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
}
|
||||
@ -6,6 +6,7 @@ if (isRelease.toBoolean()) {
|
||||
apply plugin: 'org.jetbrains.kotlin.android'
|
||||
apply plugin: 'kotlin-kapt'
|
||||
apply plugin: 'kotlin-parcelize'
|
||||
apply plugin: 'com.google.devtools.ksp'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
@ -45,10 +46,8 @@ android {
|
||||
viewBinding true
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -75,7 +74,9 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
if (!isRelease.toBoolean()) {
|
||||
implementation "androidx.multidex:multidex:${multiDex}"
|
||||
}
|
||||
@ -90,8 +91,4 @@ dependencies {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
implementation "com.lg:gid:${gid}"
|
||||
|
||||
testImplementation 'junit:junit:4.13.2'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
|
||||
}
|
||||
@ -21,10 +21,6 @@ class SettingProviderImpl : ISettingProvider {
|
||||
return SecurityActivity.getIntent(context, entrance, isLogoutStyle)
|
||||
}
|
||||
|
||||
override fun getBindPhoneNormalIntent(context: Context, isChangePhone: Boolean): Intent {
|
||||
return BindPhoneActivity.getNormalIntent(context, isChangePhone)
|
||||
}
|
||||
|
||||
override fun getAboutIntent(context: Context?, isUpdate: Boolean): Intent {
|
||||
return AboutActivity.getIntent(context, isUpdate)
|
||||
}
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
package com.gh.gamecenter.setting.view.security
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import com.alibaba.android.arouter.facade.annotation.Autowired
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
@ -16,7 +17,29 @@ import com.gh.gamecenter.setting.entity.ConflictUserEntity
|
||||
@Route(path = RouteConsts.activity.bindPhoneActivity)
|
||||
class BindPhoneActivity : ToolBarActivity() {
|
||||
|
||||
@Autowired(name = RouteConsts.QueryParams.KEY_FROM_INTERCEPTOR, desc = "是否从拦截器跳转")
|
||||
@JvmField
|
||||
var isFromInterceptor: Boolean = false
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_CHANGE_PHONE, desc = "是否是更换手机号")
|
||||
@JvmField
|
||||
var isChangePhone: Boolean = false
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_CONFLICT_PHONE, desc = "冲突手机号")
|
||||
@JvmField
|
||||
var conflictPhone: String? = null
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_CONFLICT_USER, desc = "冲突用户")
|
||||
@JvmField
|
||||
var conflictUser: ConflictUserEntity? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
// 注入 arouter 参数
|
||||
ARouter.getInstance().inject(this)
|
||||
|
||||
// 桥接 arouter 和原有入参
|
||||
generateDataFromRoute()
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
@ -29,45 +52,19 @@ class BindPhoneActivity : ToolBarActivity() {
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, BindPhoneActivity::class.java, BindPhoneFragment::class.java)
|
||||
private fun generateDataFromRoute() {
|
||||
val bundle = intent.extras
|
||||
|
||||
if (TextUtils.isEmpty(conflictPhone)) {
|
||||
intent?.putExtra(NORMAL_FRAGMENT_NAME, BindPhoneFragment::class.java.canonicalName)
|
||||
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
|
||||
} else {
|
||||
intent?.putExtra(NORMAL_FRAGMENT_NAME, BindPhoneConflictFragment::class.java.canonicalName)
|
||||
intent?.putExtra(NORMAL_FRAGMENT_BUNDLE, bundle)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val RESULT_FINISH_CODE = 411
|
||||
|
||||
@JvmStatic
|
||||
fun getNormalIntent(context: Context, isChangePhone: Boolean): Intent {
|
||||
return getIntent(context, isFromLogin = false, isChangePhone = isChangePhone)
|
||||
}
|
||||
|
||||
// 第三方登录成功跳转绑定手机专用
|
||||
@JvmStatic
|
||||
fun getLoginSuccessIntent(context: Context): Intent {
|
||||
return getIntent(context, isFromLogin = true, isChangePhone = false)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getIntent(context: Context, isFromLogin: Boolean, isChangePhone: Boolean): Intent {
|
||||
val bundle = Bundle()
|
||||
bundle.putBoolean(EntranceConsts.KEY_FROM_LOGIN, isFromLogin)
|
||||
bundle.putBoolean(EntranceConsts.KEY_CHANGE_PHONE, isChangePhone)
|
||||
return getTargetIntent(context, BindPhoneActivity::class.java, BindPhoneFragment::class.java, bundle)
|
||||
}
|
||||
|
||||
// 绑定或者换绑手机号过程中出现手机号冲突专用
|
||||
@JvmStatic
|
||||
fun getBindPhoneConflictIntent(context: Context, phoneNum: String, conflictUser: ConflictUserEntity): Intent {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_CONFLICT_PHONE, phoneNum)
|
||||
bundle.putParcelable(EntranceConsts.KEY_CONFLICT_USER, conflictUser)
|
||||
return getTargetIntent(
|
||||
context,
|
||||
BindPhoneActivity::class.java,
|
||||
BindPhoneConflictFragment::class.java,
|
||||
bundle
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -16,6 +16,7 @@ import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.core.provider.IDialogUtilsProvider
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.login.interceptor.LoginInterceptor
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.setting.R
|
||||
import com.gh.gamecenter.setting.databinding.FragmentBindPhoneBinding
|
||||
@ -121,10 +122,12 @@ class BindPhoneFragment : ToolbarFragment() {
|
||||
if (phoneNum.length >= 11) {
|
||||
hidePhoneNum = phoneNum.substring(0, 3) + "****" + phoneNum.substring(7, 11)
|
||||
}
|
||||
startActivityForResult(
|
||||
BindPhoneActivity.getBindPhoneConflictIntent(requireContext(), hidePhoneNum, user),
|
||||
0
|
||||
)
|
||||
|
||||
ARouter.getInstance().build(RouteConsts.activity.bindPhoneActivity)
|
||||
.withBoolean(EntranceConsts.KEY_CHANGE_PHONE, true)
|
||||
.withString(EntranceConsts.KEY_CONFLICT_PHONE, hidePhoneNum)
|
||||
.withParcelable(EntranceConsts.KEY_CONFLICT_USER, user)
|
||||
.navigation(context)
|
||||
})
|
||||
|
||||
mViewModel.finishLiveData.observe(viewLifecycleOwner, Observer { isSuccess ->
|
||||
@ -318,4 +321,11 @@ class BindPhoneFragment : ToolbarFragment() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onParentActivityFinish() {
|
||||
super.onParentActivityFinish()
|
||||
|
||||
// 尝试回调登录拦截器的登录成功回调
|
||||
LoginInterceptor.onLoginSuccess()
|
||||
}
|
||||
}
|
||||
@ -86,7 +86,9 @@ dependencies {
|
||||
if (!isRelease.toBoolean()) {
|
||||
implementation "androidx.multidex:multidex:$multiDex"
|
||||
}
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
plugins {
|
||||
id 'com.android.library'
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-parcelize'
|
||||
}
|
||||
|
||||
@ -20,12 +19,6 @@ android {
|
||||
dataBinding true
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
consumerProguardFiles 'proguard-rules.pro'
|
||||
|
||||
@ -3,6 +3,7 @@ plugins {
|
||||
id 'org.jetbrains.kotlin.android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-parcelize'
|
||||
id 'com.google.devtools.ksp'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -37,10 +38,8 @@ android {
|
||||
dataBinding true
|
||||
}
|
||||
|
||||
kapt {
|
||||
arguments {
|
||||
arg("AROUTER_MODULE_NAME", project.name)
|
||||
}
|
||||
ksp {
|
||||
arg("AROUTER_MODULE_NAME", project.getName())
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
@ -90,7 +89,9 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
kapt "com.alibaba:arouter-compiler:$arouterVersion"
|
||||
ksp("com.github.JailedBird:ArouterKspCompiler:${arouterKspCompilerVersion}")
|
||||
kapt "com.google.auto.service:auto-service:${autoServiceVersion}"
|
||||
|
||||
implementation(project(path: ":module_common")) {
|
||||
exclude group: 'androidx.swiperefreshlayout'
|
||||
}
|
||||
|
||||
2
vasdk
2
vasdk
Submodule vasdk updated: a13dc8061e...421ba6ca72
Submodule vspace-bridge updated: 398a6c0872...11bbe92dfe
Reference in New Issue
Block a user