feat: 消息通知:极光推送本地化—客户端 https://jira.shanqu.cc/browse/GHZSCY-6945

This commit is contained in:
叶子维
2024-12-24 11:41:36 +08:00
parent d775e804fd
commit 14cf39f10b
44 changed files with 518 additions and 121 deletions

View File

@ -639,6 +639,7 @@
<activity
android:name="com.gh.gamecenter.SkipCompatActivity"
android:exported="true"
android:launchMode="singleTask"
android:theme="@style/Theme.AppCompat.Light.Fullscreen.Transparent">
<intent-filter>
<data android:scheme="ghzhushou" />

View File

@ -2,18 +2,16 @@ package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider
import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
@com.therouter.inject.ServiceProvider
class GameCollectionDetailProviderImpl : IGameCollectionDetailProvider {
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean): Intent {
return GameCollectionDetailActivity.getIntent(context, gameCollectionId, isFromSquare)
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean, entrance: String): Intent {
return GameCollectionDetailActivity.getIntent(context, gameCollectionId, isFromSquare, entrance)
}
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String): Intent {
return GameCollectionDetailActivity.getSpecifiedCommentIntent(context, gameCollectionId, topCommentId)
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String, entrance: String): Intent {
return GameCollectionDetailActivity.getSpecifiedCommentIntent(context, gameCollectionId, topCommentId, entrance)
}
}

View File

@ -11,7 +11,6 @@ import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
import com.therouter.TheRouter
import com.gh.ad.AdPluginDownloadHelper
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureManager.log
@ -57,7 +56,6 @@ 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.fuli.kaifu.ServersCalendarActivity
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersCalendarManagementActivity
import com.gh.gamecenter.gamedetail.fuli.kaifu.ServersSubscribedGameListActivity
import com.gh.gamecenter.gamedetail.history.HistoryApkListActivity
import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity
@ -77,7 +75,6 @@ import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
import com.gh.gamecenter.qa.subject.CommunitySubjectActivity
import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.SearchActivity
import com.gh.gamecenter.servers.GameServerTestActivity
import com.gh.gamecenter.servers.GameServersActivity
import com.gh.gamecenter.servers.gametest2.GameServerTestV2Activity
@ -98,6 +95,7 @@ import com.halo.assistant.fragment.WebFragment
import com.lightgame.utils.Utils
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.therouter.TheRouter
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import retrofit2.HttpException
@ -178,7 +176,23 @@ object DirectUtils {
"qa",
"feedback",
"toolkit",
"float_window_game"
"float_window_game",
"my_halo",
"my_game",
"server_manager",
"receiving_information",
"game_archive",
"game_dynamics",
"game_upload",
"certification",
"wechat_reminder",
"apk_clean",
"personal_center",
"video_upload",
"account_security",
"simulator",
"teen_mode",
"message_center",
)
fun directToLinkPage(
@ -383,8 +397,8 @@ object DirectUtils {
}
}
"authentication" -> {
context.startActivity(ShellActivity.getIntent(context, ShellActivity.Type.REAL_NAME_INFO, null))
"authentication", "certification" -> {
directToRealName(context)
}
"user_background" -> {
@ -442,7 +456,7 @@ object DirectUtils {
} ?: ""
}
"halo_tab" -> directToHomeMyHaloTab(context)
"my_halo", "halo_tab" -> directToHomeMyHaloTab(context)
"common_collection" -> directToCommonCollectionDetail(
context,
@ -524,7 +538,8 @@ object DirectUtils {
ToolbarWrapperActivity.getMultiTabNavIntent(
context,
linkEntity.link ?: "",
linkEntity.text ?: ""
linkEntity.text ?: "",
entrance
)
)
@ -532,16 +547,20 @@ object DirectUtils {
ToolbarWrapperActivity.getCustomPageIntent(
context,
linkEntity.link ?: "",
linkEntity.text ?: ""
linkEntity.text ?: "",
entrance
)
)
// 选中首页底部 tab
"bottom_tab" -> {
val intent = Intent(context, MainActivity::class.java).apply {
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
}
if (HaloApp.getInstance().isRunningForeground) {
val intent = Intent(context, MainActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
context.startActivity(intent)
} else {
jumpActivity(context, Bundle())
}
if (linkEntity is LaunchRedirect) {
MainWrapperRepository.getInstance().sendSelectTabEvent(linkEntity)
@ -568,6 +587,32 @@ object DirectUtils {
}
}
"my_game" -> directToMyGame(0, entrance)
"server_manager" -> directToServersCalendarManagement(entrance)
"receiving_information" -> directToDeliveryInfo(entrance)
"game_archive" -> directToGameArchive(entrance)
"game_dynamics" -> directToConcernInfo(context, entrance)
"wechat_reminder" -> CheckLoginUtils.checkLogin(context, entrance) {
context.startActivity(WebActivity.getBindWechatIntent(context))
}
"apk_clean" -> directToCleanApk(context, entrance)
"personal_center" -> directToUserInfo(entrance)
"simulator" -> directToSimulatorGame(entrance)
"account_security" -> directToAccountSecurity(entrance)
"teen_mode" -> directToTeenMode(entrance)
"message_center" -> directToMessageCenter(0, entrance)
"" -> {
// do nothing
}
@ -2083,13 +2128,17 @@ object DirectUtils {
/**
* 跳转到开服订阅页面
* @param context 上下文
*/
@JvmStatic
fun directToServersCalendarManagement(context: Context, entrance: String) {
CheckLoginUtils.checkLogin(context, entrance) {
context.startActivity(ServersCalendarManagementActivity.getIntent(context))
}
fun directToServersCalendarManagement(entrance: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.serversCalendarManagementActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, entrance)
.build()
TheRouter.build(uri.toString())
.navigation()
}
fun directToSearch(
@ -2149,4 +2198,100 @@ object DirectUtils {
)
}
}
@JvmStatic
fun directToMyGame(defaultTabIndex: Int, source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.myGameActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.withInt(BaseActivity_TabLayout.PAGE_INDEX, defaultTabIndex)
.navigation()
}
@JvmStatic
fun directToDeliveryInfo(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.deliveryInfoActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToGameArchive(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.gameArchiveListActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToSimulatorGame(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.simulatorGameActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToTeenMode(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.teenagerModeActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToUserInfo(source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.userInfoActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.navigation()
}
@JvmStatic
fun directToCleanApk(context: Context, source: String) {
val uri = Uri.Builder()
.path(RouteConsts.activity.cleanApkActivity)
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
PermissionHelper.checkManageAllFilesOrStoragePermissionBeforeAction(context) {
TheRouter.build(uri.toString())
.navigation()
}
}
@JvmStatic
fun directToAccountSecurity(source: String, isLogoutStyle: Boolean = false) {
val uri = Uri.Builder()
.path(RouteConsts.activity.securityActivity)
.appendQueryParameter(RouteConsts.QueryParams.REQUIRE_LOGIN, "true")
.appendQueryParameter(RouteConsts.QueryParams.SOURCE, source)
.build()
TheRouter.build(uri.toString())
.withString(KEY_ENTRANCE, source)
.withBoolean(KEY_DISPLAY_TYPE, isLogoutStyle)
.navigation()
}
}

View File

@ -62,16 +62,16 @@ import com.gh.gamecenter.common.base.activity.BaseActivity;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.entity.CommunityEntity;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.entity.LaunchRedirect;
import com.gh.gamecenter.common.entity.SimpleGameEntity;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.entity.SubjectData;
import com.gh.gamecenter.entity.SubjectRecommendEntity;
import com.gh.gamecenter.entity.VideoLinkEntity;
import com.gh.gamecenter.feature.minigame.MiniGameItemHelper;
import com.gh.gamecenter.feature.utils.PlatformUtils;
import com.gh.gamecenter.login.view.LoginActivity;
import com.gh.gamecenter.feature.minigame.MiniGameItemHelper;
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel;
import com.gh.gamecenter.video.videomanager.VideoManagerActivity;
import com.gh.vspace.VHelper;
@ -356,8 +356,8 @@ public class SkipActivity extends BaseActivity {
if (!TextUtils.isEmpty(dataString)) {
byte[] linkData = Base64.decode(dataString, Base64.DEFAULT);
String linkDataString = new String(linkData, "UTF-8");
LinkEntity le = GsonUtils.INSTANCE.getGson().fromJson(linkDataString, LinkEntity.class);
DirectUtils.directToLinkPage(this, le, entrance, "", "");
LaunchRedirect launchRedirect = GsonUtils.fromJson(linkDataString, LaunchRedirect.class);
DirectUtils.directToLinkPage(this, launchRedirect, entrance, "", "");
}
} catch (Exception e) {
e.printStackTrace();

View File

@ -4,12 +4,15 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.halo.assistant.fragment.user.UserInfoFragment
import com.therouter.router.Route
/**
* 编辑资料
*/
@Route(
path = RouteConsts.activity.userInfoActivity,
description = "个人中心"
)
class UserInfoActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
@ -17,6 +20,14 @@ class UserInfoActivity : 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,
UserInfoActivity::class.java,
UserInfoFragment::class.java
)
}
companion object {
fun getIntent(context: Context?): Intent? {
return getTargetIntent(

View File

@ -132,6 +132,13 @@ class GamesCollectionAdapter(
)
mExposureEventArray?.put(position, exposureEvent)
val path = when (mViewModel.type) {
GamesCollectionFragment.TYPE_COLLECT -> "我的收藏-游戏单"
GamesCollectionFragment.TYPE_HISTORY -> "浏览记录-游戏单"
GamesCollectionFragment.TYPE_USER -> "个人主页-游戏单"
else -> ""
}
holder.binding.run {
ImageUtils.display(poster, itemEntity.cover)
nameTv.text = itemEntity.title
@ -249,12 +256,6 @@ class GamesCollectionAdapter(
}
userIcon.setOnClickListener {
val path = when (mViewModel.type) {
GamesCollectionFragment.TYPE_COLLECT -> "我的收藏-游戏单"
GamesCollectionFragment.TYPE_HISTORY -> "浏览记录-游戏单"
GamesCollectionFragment.TYPE_USER -> "个人主页-游戏单"
else -> ""
}
DirectUtils.directToHomeActivity(mContext, itemEntity.user?.id, "", path)
}
userName.setOnClickListener { userIcon.performClick() }
@ -266,7 +267,8 @@ class GamesCollectionAdapter(
mContext,
itemEntity.id,
isScrollToCommentArea = true,
exposureSourceList = ArrayList(exposureEvent.source)
exposureSourceList = ArrayList(exposureEvent.source),
entrance = path
)
)
}
@ -329,7 +331,8 @@ class GamesCollectionAdapter(
GameCollectionDetailActivity.getIntent(
mContext,
itemEntity.id,
exposureSourceList = ArrayList(exposureEvent.source)
exposureSourceList = ArrayList(exposureEvent.source),
entrance = path
)
)
} else {

View File

@ -4,14 +4,18 @@ import android.os.Bundle
import android.view.View
import androidx.lifecycle.ViewModelProviders
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.baselist.LazyListFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.KEY_SHOW_SUBJECT_TAB
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.observeNonNull
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.databinding.FragmentColumnCollectionDetailBinding
import com.gh.gamecenter.entity.GameColumnCollection
import com.gh.gamecenter.entity.SubjectData
import com.gh.gamecenter.subject.tab.SubjectTabFragment
@ -55,11 +59,37 @@ class ColumnCollectionDetailFragment : LazyListFragment<LinkEntity, ColumnCollec
mListViewModel.getGameColumnCollection()
mListViewModel.columnCollection.observeNonNull(this) {
setNavigationTitle(it.name)
mCachedView?.setBackgroundColor(com.gh.gamecenter.common.R.color.ui_surface.toColor(requireContext()))
logPageShow(it)
}
}
private fun logPageShow(entity: GameColumnCollection) {
val tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
val bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
mBaseHandler.postDelayed({
SensorsBridge.trackEvent("ColumnCollectionDetailPageShow", json {
"column_collection_name" to entity.name
"column_collection_id" to entity.id
"page_name" to GlobalActivityManager.getCurrentPageEntity().pageName
"page_id" to GlobalActivityManager.getCurrentPageEntity().pageId
"page_business_id" to GlobalActivityManager.getCurrentPageEntity().pageBusinessId
"last_page_name" to GlobalActivityManager.getLastPageEntity().pageName
"last_page_id" to GlobalActivityManager.getLastPageEntity().pageId
"last_page_business_id" to GlobalActivityManager.getLastPageEntity().pageBusinessId
"bottom_tab" to bottomTabName
"several_tab_page_name" to multiTabNavName
"several_tab_page_id" to multiTabNavId
"position" to tabIndex
"tab_content" to tabName
"source_entrance" to mEntrance
})
}, 3000L)
}
override fun onChanged(list: MutableList<LinkEntity>?) {
if (list != null && list.isNotEmpty()) {
showSubjectTab(list)

View File

@ -11,18 +11,22 @@ import com.gh.common.exposure.ExposureListener
import com.gh.common.exposure.IExposable
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.baselist.LazyListFragment
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.entity.LinkEntity
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.viewModelProvider
import com.gh.gamecenter.common.view.FixGridLayoutManager
import com.gh.gamecenter.common.view.GridSpacingItemDecoration
import com.gh.gamecenter.common.view.VerticalItemDecoration
import com.gh.gamecenter.databinding.FragmentListBaseSkeletonBinding
import com.gh.gamecenter.entity.CommonCollectionEntity
import com.gh.gamecenter.home.custom.model.CustomPageItem
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMMON_CONTENT_COLLECTION_LAYOUT_HORIZONTAL_SLIDE_BANNER
@ -120,6 +124,8 @@ class CustomCommonCollectionDetailFragment : LazyListFragment<LinkEntity, Custom
}
mListRv?.removeItemDecorationAt(0)
mListRv?.addItemDecoration(itemDecoration)
logPageShow(it)
}
mListViewModel.loadExceptionLiveData.observe(viewLifecycleOwner) {
if (it != null && it.code() == 404) {
@ -154,6 +160,32 @@ class CustomCommonCollectionDetailFragment : LazyListFragment<LinkEntity, Custom
})
}
private fun logPageShow(entity: CommonCollectionEntity) {
val tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
val bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
mBaseHandler.postDelayed({
SensorsBridge.trackEvent("LinkContentCollectionDetailPageShow", json {
"link_content_collection_name" to entity.name
"link_content_collection_id" to entity.id
"page_name" to GlobalActivityManager.getCurrentPageEntity().pageName
"page_id" to GlobalActivityManager.getCurrentPageEntity().pageId
"page_business_id" to GlobalActivityManager.getCurrentPageEntity().pageBusinessId
"last_page_name" to GlobalActivityManager.getLastPageEntity().pageName
"last_page_id" to GlobalActivityManager.getLastPageEntity().pageId
"last_page_business_id" to GlobalActivityManager.getLastPageEntity().pageBusinessId
"bottom_tab" to bottomTabName
"several_tab_page_name" to multiTabNavName
"several_tab_page_id" to multiTabNavId
"position" to tabIndex
"tab_content" to tabName
"source_entrance" to mEntrance
})
}, 3000L)
}
override fun getItemDecoration(): RecyclerView.ItemDecoration =
when (mCollectionStyle) {
"1-2" ->

View File

@ -49,21 +49,24 @@ class GameCollectionDetailActivity : ToolBarActivity() {
fun getIntent(
context: Context,
gameCollectionId: String,
isFromSquare: Boolean = false
isFromSquare: Boolean = false,
entrance: String = ""
): Intent {
return getIntent(context, gameCollectionId, "", isFromSquare, false)
return getIntent(context, gameCollectionId, "", isFromSquare, false, entrance = entrance)
}
@JvmStatic
fun getSpecifiedCommentIntent(
context: Context,
gameCollectionId: String,
topCommentId: String
topCommentId: String,
entrance: String
): Intent {
return getIntent(
context, gameCollectionId, topCommentId,
isFromSquare = false,
isScrollToCommentArea = true
isScrollToCommentArea = true,
entrance = entrance
)
}
@ -74,13 +77,15 @@ class GameCollectionDetailActivity : ToolBarActivity() {
topCommentId: String = "",
isFromSquare: Boolean = false,
isScrollToCommentArea: Boolean = false,
exposureSourceList: ArrayList<ExposureSource>? = null
exposureSourceList: ArrayList<ExposureSource>? = null,
entrance: String = ""
): Intent {
val bundle = Bundle()
bundle.putString(EntranceConsts.KEY_GAME_COLLECTION_ID, gameCollectionId)
bundle.putString(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
bundle.putBoolean(EntranceConsts.KEY_IS_FROM_SQUARE, isFromSquare)
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, isScrollToCommentArea)
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
if (exposureSourceList != null) {
bundle.putParcelableArrayList(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST, exposureSourceList)
}

View File

@ -851,6 +851,7 @@ class GameCollectionDetailFragment :
trackEvent.put("game_collect_title", mGameCollectionTitle)
trackEvent.put("game_collect_id", mGameCollectionId)
trackEvent.put("stay_length", mElapsedHelper?.elapsedTime)
trackEvent.put("source_entrance", mEntrance)
} catch (e: JSONException) {
e.printStackTrace()
}

View File

@ -6,6 +6,7 @@ import androidx.recyclerview.widget.DefaultItemAnimator
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.exposure.ExposureListener
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.baselist.ListFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.exposure.ExposureSource
@ -58,6 +59,7 @@ class GameCollectionHotListFragment : ListFragment<GameCollectionListItemData, G
if (requireActivity() is GameCollectionListDetailActivity) {
mBasicExposureSourceList.add(ExposureSource("游戏单合集", mGameCollectionListEntity?.id ?: ""))
mBasicExposureSourceList.add(ExposureSource("合集详情", ""))
logPageShow()
} else {
mBasicExposureSourceList.add(ExposureSource("游戏单热榜", ""))
mBasicExposureSourceList.add(ExposureSource("游戏单合集", mGameCollectionListEntity?.id ?: ""))
@ -68,6 +70,32 @@ class GameCollectionHotListFragment : ListFragment<GameCollectionListItemData, G
}
}
private fun logPageShow() {
val tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
val bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
mBaseHandler.postDelayed({
SensorsBridge.trackEvent("GameListCollectionDetailPageShow", json {
"game_list_collection_name" to mGameCollectionListEntity?.name
"game_list_collection_id" to mGameCollectionListEntity?.id
"page_name" to GlobalActivityManager.getCurrentPageEntity().pageName
"page_id" to GlobalActivityManager.getCurrentPageEntity().pageId
"page_business_id" to GlobalActivityManager.getCurrentPageEntity().pageBusinessId
"last_page_name" to GlobalActivityManager.getLastPageEntity().pageName
"last_page_id" to GlobalActivityManager.getLastPageEntity().pageId
"last_page_business_id" to GlobalActivityManager.getLastPageEntity().pageBusinessId
"bottom_tab" to bottomTabName
"several_tab_page_name" to multiTabNavName
"several_tab_page_id" to multiTabNavId
"position" to tabIndex
"tab_content" to tabName
"source_entrance" to mEntrance
})
}, 3000L)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
if (mListRefresh != null) {
mListRefresh!!.setColorSchemeResources(com.gh.gamecenter.common.R.color.primary_theme)

View File

@ -76,7 +76,8 @@ class MyGameCollectionViewHolder(
binding.root.context.startActivity(
GameCollectionDetailActivity.getIntent(
binding.root.context,
entity.id
entity.id,
entrance = path
)
)
} else {

View File

@ -596,7 +596,8 @@ class GameCollectionSquareAdapter(
context,
gamesCollectionEntity.id,
isFromSquare = true,
exposureSourceList = ArrayList(exposureSource)
exposureSourceList = ArrayList(exposureSource),
entrance = "游戏单广场"
)
)
}

View File

@ -6,11 +6,14 @@ import android.os.Bundle
import androidx.fragment.app.Fragment
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.therouter.router.Route
/**
* 开服订阅
*/
@Route(
path = RouteConsts.activity.serversCalendarManagementActivity,
description = "开服订阅"
)
class ServersCalendarManagementActivity : BaseActivity_TabLayout() {
override fun onCreate(savedInstanceState: Bundle?) {

View File

@ -496,7 +496,8 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable {
pageLocation.tabPosition,
pageLocation.tabContent,
pageLocation.pageId,
pageLocation.pageName
pageLocation.pageName,
mEntrance
)
viewModel.loadData()

View File

@ -19,6 +19,7 @@ import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout.PAGE_INDEX
import com.gh.gamecenter.common.base.adapter.FragmentAdapter
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.BugFixedPopupWindow
import com.gh.gamecenter.common.view.TabIndicatorView
@ -28,10 +29,12 @@ import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.databinding.PopupMyGameGuideBinding
import com.gh.gamecenter.gamecollection.publish.GameCollectionEditActivity
import com.google.android.material.tabs.TabLayout
import com.therouter.router.Route
/**
* 我的游戏
*/
@Route(
path = RouteConsts.activity.myGameActivity,
description = "我的游戏"
)
class MyGameActivity : BaseActivity() {
private val viewModel by viewModels<MyGameActivityViewModel>()

View File

@ -3,13 +3,16 @@ package com.gh.gamecenter.personal
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.therouter.router.Route
/**
* 收货信息
*/
@Route(
path = RouteConsts.activity.deliveryInfoActivity,
description = "收货信息"
)
class DeliveryInfoActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {

View File

@ -217,7 +217,7 @@ class HaloPersonalBannerAdapter(context: Context) : BaseRecyclerAdapter<Recycler
}
"开服管理" -> {// 开服管理
DirectUtils.directToServersCalendarManagement(mContext, "我的光环-活动位")
DirectUtils.directToServersCalendarManagement("我的光环-活动位")
}
else -> {

View File

@ -209,7 +209,7 @@ class HaloPersonalFunctionAdapter(context: Context) : BaseRecyclerAdapter<Recycl
}
"开服管理" -> {// 开服管理
DirectUtils.directToServersCalendarManagement(mContext, "我的光环-更多功能")
DirectUtils.directToServersCalendarManagement("我的光环-更多功能")
}
else -> {

View File

@ -243,7 +243,7 @@ class HaloPersonalRecommendAdapter(val context: Context) : BaseRecyclerAdapter<R
}
"开服管理" -> {// 开服管理
DirectUtils.directToServersCalendarManagement(mContext, "我的光环-推荐位")
DirectUtils.directToServersCalendarManagement("我的光环-推荐位")
}
else -> {

View File

@ -1,16 +1,15 @@
package com.gh.gamecenter.qa.editor
import android.content.Context
import android.webkit.JavascriptInterface
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.core.AppExecutor
import com.gh.common.util.*
import com.gh.common.util.DirectUtils
import com.gh.common.view.RichEditor
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.utils.clickToastByStatus
import com.gh.gamecenter.common.utils.tryWithDefaultCatch
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.entity.MyVideoEntity
import com.gh.gamecenter.gamecollection.detail.GameCollectionDetailActivity
import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity
@ -61,7 +60,7 @@ class OnLinkClickListener(
)
}
"game_collection" -> {
context.startActivity(GameCollectionDetailActivity.getIntent(context, insertEntity.id ?: ""))
context.startActivity(GameCollectionDetailActivity.getIntent(context, insertEntity.id ?: "", entrance = entrance))
}
"video" -> {
DirectUtils.directToVideoDetail(context, insertEntity.id ?: "", entrance, "$path-链接")

View File

@ -7,12 +7,15 @@ import android.view.View
import androidx.fragment.app.Fragment
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.therouter.router.Route
/**
* 游戏存档
*/
@Route(
path = RouteConsts.activity.gameArchiveListActivity,
description = "游戏存档"
)
class GameArchiveListActivity : BaseActivity_TabLayout() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

View File

@ -116,7 +116,8 @@ class SearchGameListFragment : LazyFragment() {
context = requireContext(),
itemId,
topCommentId = "",
exposureSourceList = exposureSourceList.toArrayList()
exposureSourceList = exposureSourceList.toArrayList(),
entrance = "游戏单搜索"
)
)
})

View File

@ -4,11 +4,14 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.therouter.router.Route
/**
* 模拟器游戏
*/
@Route(
path = RouteConsts.activity.simulatorGameActivity,
description = "模拟器游戏"
)
class SimulatorGameActivity : ToolBarActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
@ -19,6 +22,10 @@ class SimulatorGameActivity : ToolBarActivity() {
override fun isAutoResetViewBackgroundEnabled() = true
override fun provideNormalIntent(): Intent {
return getTargetIntent(this, SimulatorGameActivity::class.java, SimulatorGameFragment::class.java)
}
override fun onDarkModeChanged() {
super.onDarkModeChanged()
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)

View File

@ -5,8 +5,11 @@ import androidx.fragment.app.Fragment
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProviders
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.base.fragment.LazyFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.core.utils.PageSwitchDataHelper
import com.gh.gamecenter.databinding.FragmentSubjectBinding
import com.gh.gamecenter.entity.SubjectSettingEntity
@ -54,10 +57,37 @@ open class SubjectFragment : LazyFragment() {
if (!isColumnCollection) {// 专题合集详情子页面不需要显示专题名称
// 获取专题名称
mViewModel?.subjectNameLD?.observe(this, Observer {
mViewModel?.subjectNameLD?.observe(this) {
setNavigationTitle(it)
})
}
logPageShow()
}
}
private fun logPageShow() {
val tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
val bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
mBaseHandler.postDelayed({
SensorsBridge.trackEvent("ColumnDetailPageShow", json {
"game_column_name" to mViewModel?.subjectData?.subjectName
"game_column_id" to mViewModel?.subjectData?.subjectId
"page_name" to GlobalActivityManager.getCurrentPageEntity().pageName
"page_id" to GlobalActivityManager.getCurrentPageEntity().pageId
"page_business_id" to GlobalActivityManager.getCurrentPageEntity().pageBusinessId
"last_page_name" to GlobalActivityManager.getLastPageEntity().pageName
"last_page_id" to GlobalActivityManager.getLastPageEntity().pageId
"last_page_business_id" to GlobalActivityManager.getLastPageEntity().pageBusinessId
"bottom_tab" to bottomTabName
"several_tab_page_name" to multiTabNavName
"several_tab_page_id" to multiTabNavId
"position" to tabIndex
"tab_content" to tabName
"source_entrance" to mEntrance
})
}, 3000L)
}
override fun initRealView() {

View File

@ -6,11 +6,14 @@ import android.os.Bundle
import androidx.fragment.app.Fragment
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.therouter.router.Route
/**
* 青少年模式
*/
@Route(
path = RouteConsts.activity.teenagerModeActivity,
description = "青少年模式"
)
class TeenagerModeActivity : BaseActivity() {
private var mContainerFragment: Fragment? = null

View File

@ -142,7 +142,9 @@ abstract class BaseTabWrapperFragment : BaseLazyFragment(), IMultiTab {
"several_tab_page_name",
multiTabNavName,
"several_tab_page_id",
multiTabNavId
multiTabNavId,
"source_entrance",
mEntrance
)
}
}

View File

@ -46,21 +46,21 @@ class ToolbarWrapperActivity : BaseActivity() {
}
companion object {
fun getMultiTabNavIntent(context: Context, multiTabNavId: String, multiTabNavName: String): Intent {
fun getMultiTabNavIntent(context: Context, multiTabNavId: String, multiTabNavName: String, entrance: String): Intent {
val intent = Intent(context, ToolbarWrapperActivity::class.java)
intent.putExtra(EntranceConsts.KEY_MULTI_TAB_NAV_ID, multiTabNavId)
intent.putExtra(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, multiTabNavName)
intent.putExtra(EntranceConsts.KEY_NAVIGATION_TITLE, multiTabNavName)
intent.putExtra(EntranceConsts.KEY_ENTRANCE, "多tab导航页")
intent.putExtra(EntranceConsts.KEY_ENTRANCE, entrance)
return intent
}
fun getCustomPageIntent(context: Context, pageId: String, pageName: String): Intent {
fun getCustomPageIntent(context: Context, pageId: String, pageName: String, entrance: String): Intent {
val intent = Intent(context, ToolbarWrapperActivity::class.java)
intent.putExtra(EntranceConsts.KEY_CUSTOM_PAGE_ID, pageId)
intent.putExtra(EntranceConsts.KEY_CUSTOM_PAGE_NAME, pageName)
intent.putExtra(EntranceConsts.KEY_NAVIGATION_TITLE, pageName)
intent.putExtra(EntranceConsts.KEY_ENTRANCE, "自定义页面")
intent.putExtra(EntranceConsts.KEY_ENTRANCE, entrance)
return intent
}
}

View File

@ -17,8 +17,6 @@ import androidx.lifecycle.ProcessLifecycleOwner;
import androidx.multidex.MultiDexApplication;
import androidx.webkit.WebViewCompat;
import com.gh.gamecenter.login.interceptor.LoginInterceptor;
import com.therouter.TheRouter;
import com.facebook.imageformat.DefaultImageFormats;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.facebook.imagepipeline.core.ImagePipelineFactory;
@ -56,6 +54,7 @@ import com.gh.gamecenter.common.utils.DeviceUtils;
import com.gh.gamecenter.common.utils.EnvHelper;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.core.AppExecutor;
import com.gh.gamecenter.core.iinterface.IApplication;
import com.gh.gamecenter.core.provider.IFlavorProvider;
@ -63,6 +62,7 @@ import com.gh.gamecenter.core.provider.IPushProvider;
import com.gh.gamecenter.core.provider.IQGameProvider;
import com.gh.gamecenter.core.utils.GsonUtils;
import com.gh.gamecenter.core.utils.SPUtils;
import com.gh.gamecenter.login.interceptor.LoginInterceptor;
import com.gh.gamecenter.login.user.UserManager;
import com.gh.gamecenter.login.user.UserRepository;
import com.gh.gamecenter.login.utils.QuickLoginHelper;
@ -83,6 +83,9 @@ import com.lightgame.utils.Utils;
import com.llew.huawei.verifier.LoadedApkHuaWei;
import com.shuyu.gsyvideoplayer.cache.CacheFactory;
import com.shuyu.gsyvideoplayer.player.PlayerFactory;
import com.therouter.TheRouter;
import com.therouter.TheRouterKt;
import com.therouter.router.NavigatorKt;
import java.lang.reflect.Method;
import java.util.List;
@ -94,9 +97,6 @@ import io.reactivex.schedulers.Schedulers;
import tv.danmaku.ijk.media.exo2.Exo2PlayerManager;
import tv.danmaku.ijk.media.exo2.ExoPlayerCacheManager;
import com.therouter.TheRouterKt;
import com.therouter.router.NavigatorKt;
public class HaloApp extends MultiDexApplication {
private static HaloApp mInstance;
@ -473,7 +473,13 @@ public class HaloApp extends MultiDexApplication {
*/
private void initPushEngine() {
IPushProvider pushProvider = TheRouter.get(IPushProvider.class);
if (pushProvider != null) pushProvider.initialize(this);
if (pushProvider != null) {
pushProvider.initialize(this);
pushProvider.setOnPushOpenedCallback((id, title, content, linkType, linkId) -> {
SensorsBridge.trackJiGuangPushClick(id, title, content, linkType, linkId);
return null;
});
}
}
/**

View File

@ -1,9 +1,7 @@
package com.gh.gamecenter.acloud.push.provider
import android.content.Context
import com.therouter.router.Route
import com.gh.gamecenter.acloud.push.ACloudPushHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPushProvider
import io.reactivex.Single
@ -45,5 +43,7 @@ class ACloudPushProviderImpl : IPushProvider {
// do nothing
}
override fun setOnPushOpenedCallback(callback: (String, String, String, String) -> Unit) {
// do nothing
}
}

View File

@ -2,17 +2,20 @@ package com.gh.gamecenter.jg.push
import android.annotation.SuppressLint
import android.content.Context
import android.net.Uri
import android.os.Build
import android.util.Base64
import cn.jiguang.api.utils.JCollectionAuth
import cn.jpush.android.api.JPushInterface
import com.therouter.TheRouter
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.singleToMain
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.core.provider.IAppProvider
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.jg.push.retrofit.RetrofitManager
import com.lightgame.utils.Utils
import com.therouter.TheRouter
object JPushHelper {
const val TAG = "JPushHelper"
@ -20,11 +23,14 @@ object JPushHelper {
private var badgeCount = 0 // 角标计数
var onPushOpenedCallback: ((String, String, String, String, String) -> Unit)? = null
fun init(applicationContext: Context) {
// 关闭SDK自启动 (https://docs.jiguang.cn/jverification/guideline/jghgzy)
JCollectionAuth.enableAutoWakeup(applicationContext, false)
JPushInterface.setSmartPushEnable(applicationContext, false)
JPushInterface.setLinkMergeEnable(applicationContext, false)
JPushInterface.setNotificationCallBackEnable(applicationContext, true)
JPushInterface.setDebugMode(BuildConfig.DEBUG)
JPushInterface.init(applicationContext)
@ -73,4 +79,19 @@ object JPushHelper {
badgeCount = 0
JPushInterface.setBadgeNumber(applicationContext, badgeCount)
}
fun onNotifyMessageOpened(
id: String,
title: String,
content: String,
deepLink: String,
) {
val uri = Uri.parse(deepLink)
val dataString = uri.getQueryParameter("data") ?: return
val linkData: ByteArray = Base64.decode(dataString, Base64.DEFAULT)
val linkDataString = String(linkData, charset("UTF-8"))
val link = GsonUtils.fromJson(linkDataString, LinkEntity::class.java)
onPushOpenedCallback?.invoke(id, title, content, link.type ?: "", link.link ?: "")
}
}

View File

@ -1,8 +1,6 @@
package com.gh.gamecenter.jg.push.provider
import android.content.Context
import com.therouter.router.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IPushProvider
import com.gh.gamecenter.jg.push.HaloApp
import com.gh.gamecenter.jg.push.JPushHelper
@ -51,4 +49,7 @@ class JGPushProviderImpl : IPushProvider {
JPushHelper.cleanBadgeNumber(applicationContext)
}
override fun setOnPushOpenedCallback(callback: (String, String, String, String, String) -> Unit) {
JPushHelper.onPushOpenedCallback = callback
}
}

View File

@ -24,6 +24,12 @@ class HaloJPushMessageReceiver: JPushMessageReceiver() {
Utils.log(TAG, "onNotifyMessageOpened: $message")
JPushHelper.subtractBadgeNumber(context.applicationContext)
JPushHelper.onNotifyMessageOpened(
message.msgId ?: "",
message.notificationTitle ?: "",
message.notificationContent ?: "",
message.deeplink ?: ""
)
}
override fun onNotifyMessageDismiss(context: Context, message: NotificationMessage) {

View File

@ -1,8 +1,8 @@
package com.gh.gamecenter.common.constant;
import com.therouter.TheRouter;
import com.gh.gamecenter.core.provider.IPackageUtilsProvider;
import com.gh.gamecenter.core.utils.TimeUtils;
import com.therouter.TheRouter;
public class Constants {
@ -350,7 +350,7 @@ public class Constants {
public static final String[] REPORT_LIST = new String[]{"垃圾广告营销", "恶意攻击谩骂", "淫秽色情信息", "违法有害信息", "其他原因"};
public static final String[] FEEDBACK_REASON_LIST = new String[]{"重复推荐", "不感兴趣", "与推荐描述不符", "已经玩过了", "游戏质量差", "游戏太旧"};
public static final String ENTRANCE_UNKNOWN = "(unknown)";
public static final String ENTRANCE_UNKNOWN = "其他";
public static final String DEFAULT_TEXT_WRAPPER = "\\{\\{(.+?)\\}\\}|###(.+?)###";

View File

@ -367,4 +367,6 @@ public class EntranceConsts {
public static final String TAB_TYPE_BBS = "论坛";
public static final String KEY_UID = "uid";
public static final String KEY_DISPLAY_TYPE = "display_type";
}

View File

@ -18,7 +18,15 @@ object RouteConsts {
const val gameDetailActivity = "/activity/game_detail"
const val userHomeActivity = "/activity/user_home"
const val userInfoActivity = "/activity/user_info"
const val teenagerModeActivity = "/activity/teen_mode"
const val myGameActivity = "/activity/my_game"
const val deliveryInfoActivity = "/activity/receiving_information"
const val simulatorGameActivity = "/activity/simulator"
const val gameArchiveListActivity = "/activity/game_archive"
const val quickLoginActivity = "/activity/quick_login_activity"
const val securityActivity = "/activity/account_security"
const val serversCalendarManagementActivity = "/activity/server_manager"
const val aboutActivity = "/settings/AboutActivity"
const val webActivity = "/setting/WebActivity"

View File

@ -1,14 +1,13 @@
package com.gh.gamecenter.common.utils
import android.app.Application
import com.therouter.TheRouter
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.entity.SensorsEvent
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.core.provider.ISensorsProvider
import com.gh.gamecenter.core.utils.SPUtils
import com.therouter.TheRouter
import org.json.JSONObject
/**
@ -306,6 +305,7 @@ object SensorsBridge {
private const val EVENT_CANCEL_APPOINTMENT_AUTOMATIC_DOWNLOAD = "CancelAppointmentAutomaticDownload"
private const val EVENT_APPOINTMENT_GAME_ONLINE_DIALOG_SHOW = "AppointmentGameOnlineDialogShow"
private const val EVENT_APPOINTMENT_GAME_ONLINE_DIALOG_CLICK = "AppointmentGameOnlineDialogClick"
private const val EVENT_JIGUANG_PUSH_CLICK = "JiGuangPushClick"
private var mIsSensorsEnabled = false
@ -3620,7 +3620,8 @@ object SensorsBridge {
position: Int,
tabContent: String,
customPageId: String,
customPageName: String
customPageName: String,
sourceEntrance: String
) {
val json = json {
KEY_BOTTOM_TAB to bottomTab
@ -3630,6 +3631,7 @@ object SensorsBridge {
KEY_TAB_CONTENT to tabContent
KEY_CUSTOM_PAGE_ID to customPageId
KEY_CUSTOM_PAGE_NAME to customPageName
KEY_SOURCE_ENTRANCE to sourceEntrance
}
trackEvent(EVENT_VIEW_CUSTOM_PAGE, json)
}
@ -5025,4 +5027,27 @@ object SensorsBridge {
trackEvent(EVENT_SEARCH_DISCOVERY_CLICK, json)
}
/**
* 事件IDJiGuangPushClick
* 事件名称:极光推送点击事件
* 触发时机:点击极光推送时触发
*/
@JvmStatic
fun trackJiGuangPushClick(
id: String,
title: String,
content: String,
linkType: String,
linkId: String,
) {
val json = json {
"message_id" to id
KEY_LINK_TEXT to title
"link_content" to content
KEY_LINK_TYPE to linkType
KEY_LINK_ID to linkId
}
trackEvent(EVENT_JIGUANG_PUSH_CLICK, json)
}
}

View File

@ -59,4 +59,10 @@ interface IPushProvider {
* @param applicationContext 上下文
*/
fun cleanBadgeNumber(applicationContext: Context)
/**
* 设置推送打开回调
* @param callback 回调
*/
fun setOnPushOpenedCallback(callback: (String, String, String, String, String) -> Unit)
}

View File

@ -8,12 +8,14 @@ interface IGameCollectionDetailProvider {
fun getIntent(
context: Context,
gameCollectionId: String,
isFromSquare: Boolean = false
isFromSquare: Boolean = false,
entrance: String
): Intent?
fun getSpecifiedCommentIntent(
context: Context,
gameCollectionId: String,
topCommentId: String
topCommentId: String,
entrance: String
): Intent?
}

View File

@ -11,7 +11,6 @@ import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.fragment.app.FragmentActivity;
import com.therouter.TheRouter;
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder;
import com.gh.gamecenter.common.base.activity.BaseActivity;
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout;
@ -20,11 +19,13 @@ 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.CommunityEntity;
import com.gh.gamecenter.common.exposure.ExposureSource;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ImageUtils;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.common.utils.TextHelper;
import com.gh.gamecenter.core.provider.IDirectProvider;
import com.gh.gamecenter.core.provider.IWebProvider;
import com.gh.gamecenter.core.utils.ClickUtils;
import com.gh.gamecenter.core.utils.DisplayUtils;
@ -33,9 +34,7 @@ import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.feature.entity.MessageEntity;
import com.gh.gamecenter.feature.entity.Questions;
import com.gh.gamecenter.feature.entity.UserEntity;
import com.gh.gamecenter.common.exposure.ExposureSource;
import com.gh.gamecenter.feature.provider.ICommentDetailProvider;
import com.gh.gamecenter.core.provider.IDirectProvider;
import com.gh.gamecenter.feature.provider.ICommentUtilsProvider;
import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider;
import com.gh.gamecenter.feature.provider.IGameDetailProvider;
@ -49,6 +48,7 @@ import com.gh.gamecenter.message.entity.MessageFold;
import com.gh.gamecenter.message.retrofit.RetrofitManager;
import com.gh.gamecenter.message.utils.NewLogUtils;
import com.lightgame.utils.Utils;
import com.therouter.TheRouter;
import java.util.ArrayList;
import java.util.List;
@ -1169,7 +1169,8 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
context.startActivity(gameCollectionDetailProvider.getSpecifiedCommentIntent(
context,
entity.getGameList().getId(),
entity.getComment().getId()
entity.getComment().getId(),
"消息中心"
));
}
break;
@ -1192,7 +1193,8 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
intent = gameCollectionDetailProvider.getSpecifiedCommentIntent(
context,
entity.getGameList().getId(),
entity.getComment().getId()
entity.getComment().getId(),
"消息中心"
);
} else {
intent = newCommentDetailProvider.getGameCollectionCommentIntent(
@ -1251,7 +1253,8 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
context.startActivity(gameCollectionDetailProvider.getIntent(
context,
entity.getGameList().getId(),
false
false,
"消息中心"
));
}
break;

View File

@ -11,7 +11,6 @@ import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import com.therouter.TheRouter
import com.facebook.drawee.generic.RoundingParams
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.gamecenter.common.baselist.ListAdapter
@ -41,6 +40,7 @@ import com.gh.gamecenter.message.entity.MessageKeFuEntity.ServiceEntity
import com.gh.gamecenter.message.entity.MessageLinkEntity
import com.google.android.flexbox.FlexboxLayout
import com.lightgame.utils.Utils
import com.therouter.TheRouter
class MessageListAdapter(
context: Context,
@ -73,7 +73,7 @@ class MessageListAdapter(
MessageItemViewHolder.messageItemClickSkip(
view,
data as MessageEntity,
"", "", "",
"消息中心", "", "",
mGameId, mGameName, mGameType, mType
)
}

View File

@ -9,12 +9,12 @@ import com.gh.gamecenter.feature.provider.IGameCollectionDetailProvider
@com.therouter.inject.ServiceProvider
class GameCollectionDetailProviderImpl : IGameCollectionDetailProvider {
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean): Intent? {
override fun getIntent(context: Context, gameCollectionId: String, isFromSquare: Boolean, entrance: String): Intent? {
ToastUtils.toast("调用->GameCollectionDetailProviderImpl.getIntent")
return null
}
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String): Intent? {
override fun getSpecifiedCommentIntent(context: Context, gameCollectionId: String, topCommentId: String, entrance: String): Intent? {
ToastUtils.toast("调用->GameCollectionDetailProviderImpl.getSpecifiedCommentIntent")
return null
}

View File

@ -9,7 +9,10 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material.Icon
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
@ -17,7 +20,6 @@ import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.res.imageResource
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.therouter.TheRouter
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
@ -33,9 +35,15 @@ import com.gh.gamecenter.setting.compose.ui.component.SettingItem
import com.gh.gamecenter.setting.compose.ui.component.SettingTopAppBar
import com.gh.gamecenter.setting.compose.ui.component.Space
import com.gh.gamecenter.setting.compose.ui.theme.HaloTheme
import com.therouter.TheRouter
import com.therouter.router.Route
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
@Route(
path = RouteConsts.activity.securityActivity,
description = "帐号安全"
)
class ComposeSecurityActivity : ComposeBaseActivity() {
private var mBindPhoneText by mutableStateOf("")
@ -52,7 +60,7 @@ class ComposeSecurityActivity : ComposeBaseActivity() {
backgroundColor = HaloTheme.colors.background
) {
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
if (!intent.getBooleanExtra(DISPLAY_TYPE, false)) {
if (!intent.getBooleanExtra(EntranceConsts.KEY_DISPLAY_TYPE, false)) {
val registerType = when (UserManager.getInstance().userInfoEntity?.registerType) {
"qq" -> "QQ"
"wechat" -> "微信"
@ -157,12 +165,10 @@ class ComposeSecurityActivity : ComposeBaseActivity() {
companion object {
const val INSERT_MOBILE_CODE = 411
private const val DISPLAY_TYPE = "display_type"
fun getIntent(context: Context, entrance: String, isLogoutStyle: Boolean = false): Intent {
return Intent(context, ComposeSecurityActivity::class.java).apply {
putExtra(EntranceConsts.KEY_ENTRANCE, entrance)
putExtra(DISPLAY_TYPE, isLogoutStyle)
putExtra(EntranceConsts.KEY_DISPLAY_TYPE, isLogoutStyle)
}
}
}