Compare commits
51 Commits
feat/GHZSC
...
fix/build_
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a48293bd8 | |||
| d0bf23ae48 | |||
| b2fde1e0af | |||
| ab1350ff46 | |||
| 7f991e29d4 | |||
| 40edf76aed | |||
| aaeb83c5df | |||
| 5739f0a800 | |||
| 10cc81e7fc | |||
| 60a50f5722 | |||
| 644881c14f | |||
| a0e43930a0 | |||
| aa5f6f4f24 | |||
| ab7668fd81 | |||
| c6f014c984 | |||
| c215bd195e | |||
| bb73598a87 | |||
| c6f70d1b4c | |||
| ce7f75976c | |||
| c8a7999990 | |||
| 0cd281a53c | |||
| e92d89d498 | |||
| a22858389b | |||
| e9d091043d | |||
| db4ac95094 | |||
| 13be47d440 | |||
| beee098cfe | |||
| d67aaf956b | |||
| 1ed9151b1f | |||
| 13f20f6883 | |||
| 78e320a192 | |||
| e51db47fad | |||
| ac02ea88b9 | |||
| f60004fc81 | |||
| 0cf39a82e2 | |||
| 315f244153 | |||
| f4bdc02d70 | |||
| aef39eb481 | |||
| dc2e7147d9 | |||
| fdcb6342bf | |||
| b0da4f8986 | |||
| f7cc906cc5 | |||
| 795fbabd90 | |||
| e770f8a359 | |||
| dd12b103be | |||
| 21f4a398d5 | |||
| 8dfb1644a8 | |||
| 9744b95126 | |||
| 009608165c | |||
| 98356a7dd7 | |||
| 8389041379 |
@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.SharedPreferences
|
||||
import android.graphics.drawable.Animatable
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
@ -13,11 +14,13 @@ import android.widget.TextView
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.therouter.TheRouter
|
||||
import com.facebook.drawee.controller.BaseControllerListener
|
||||
import com.facebook.drawee.view.SimpleDraweeView
|
||||
import com.facebook.imagepipeline.image.ImageInfo
|
||||
import com.gh.common.exposure.ExposureManager
|
||||
import com.gh.common.util.DirectUtils.directToLinkPage
|
||||
import com.gh.common.util.LogUtils
|
||||
import com.gh.common.util.NewFlatLogUtils.logOpenScreenAdSkip
|
||||
import com.gh.common.util.NewFlatLogUtils
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.MainActivity
|
||||
@ -59,6 +62,8 @@ object AdDelegateHelper {
|
||||
private val mGameSearchAdList: ArrayList<AdConfig> by lazy { arrayListOf() }
|
||||
private var mVGameLaunchAd: AdConfig? = null
|
||||
|
||||
private var ownerSplashAdLoadTime = 0L
|
||||
|
||||
val vGameLaunchAd: AdConfig?
|
||||
get() = mVGameLaunchAd
|
||||
|
||||
@ -76,6 +81,7 @@ object AdDelegateHelper {
|
||||
}
|
||||
|
||||
var isShowingSplashAd = false // 是否正在显示开屏广告
|
||||
var isOwnerSplashAdShown = false // 自有开屏广告是否展示
|
||||
var gameSearchKeyword = ""
|
||||
|
||||
fun initAdSdk(context: Context) {
|
||||
@ -302,6 +308,7 @@ object AdDelegateHelper {
|
||||
) {
|
||||
val hideCallback = {
|
||||
isShowingSplashAd = false
|
||||
isOwnerSplashAdShown = false
|
||||
hideAction.invoke()
|
||||
}
|
||||
if (mSplashAd != null) {
|
||||
@ -574,6 +581,8 @@ object AdDelegateHelper {
|
||||
handler: BaseActivity.BaseHandler,
|
||||
hideCallback: () -> Unit
|
||||
) {
|
||||
isOwnerSplashAdShown = false
|
||||
|
||||
val jumpBtn = startAdContainer.findViewById<TextView>(R.id.jumpBtn)
|
||||
val jumpDetailBtn: TextView = startAdContainer.findViewById(R.id.jumpDetailBtn)
|
||||
val adImage: SimpleDraweeView = startAdContainer.findViewById(R.id.adImage)
|
||||
@ -592,38 +601,62 @@ object AdDelegateHelper {
|
||||
)
|
||||
|
||||
adImage.visibleIf(true)
|
||||
ImageUtils.display(adImage, ad.img)
|
||||
ImageUtils.displayWithCallback(adImage, ad.img, true, object : BaseControllerListener<ImageInfo>() {
|
||||
override fun onSubmit(id: String?, callerContext: Any?) {
|
||||
super.onSubmit(id, callerContext)
|
||||
adImage.post {
|
||||
ownerSplashAdLoadTime = System.currentTimeMillis()
|
||||
NewFlatLogUtils.logSplashAdLoad(ad.id)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFinalImageSet(id: String?, imageInfo: ImageInfo?, animatable: Animatable?) {
|
||||
isOwnerSplashAdShown = true
|
||||
adImage.post {
|
||||
NewFlatLogUtils.logSplashAdShow(ad.id, System.currentTimeMillis() - ownerSplashAdLoadTime)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onFailure(id: String?, throwable: Throwable?) {
|
||||
super.onFailure(id, throwable)
|
||||
NewFlatLogUtils.logSplashAdFail(ad.id, "启动广告图加载失败")
|
||||
}
|
||||
})
|
||||
|
||||
if (ad.isImageType) {
|
||||
adVideo.visibleIf(false)
|
||||
} else {
|
||||
adVideo.visibleIf(true)
|
||||
adVideo.startPlay(ad.video.url)
|
||||
}
|
||||
startAdContainer.setOnClickListener {
|
||||
// 拦截点击事件传递
|
||||
}
|
||||
jumpBtn.setOnClickListener {
|
||||
handler.removeMessages(MainActivity.COUNTDOWN_AD)
|
||||
hideCallback.invoke()
|
||||
val linkEntity = ad.jump
|
||||
logOpenScreenAdSkip(
|
||||
ad.id,
|
||||
(if (linkEntity.text != null) linkEntity.text else "")!!,
|
||||
(if (linkEntity.type != null) linkEntity.type else "")!!,
|
||||
(if (linkEntity.link != null) linkEntity.link else "")!!
|
||||
)
|
||||
SensorsBridge.trackEvent(
|
||||
"SplashAdOwnSkip",
|
||||
"splash_ad_id",
|
||||
ad.id,
|
||||
"link_type",
|
||||
linkEntity.type ?: "",
|
||||
"link_id",
|
||||
linkEntity.link ?: "",
|
||||
"link_text",
|
||||
linkEntity.text ?: ""
|
||||
)
|
||||
it.debounceActionWithInterval(1000L) {
|
||||
if (!isOwnerSplashAdShown) {
|
||||
NewFlatLogUtils.logSplashAdFail(ad.id, "加载过程中点击跳过广告")
|
||||
}
|
||||
handler.removeMessages(MainActivity.COUNTDOWN_AD)
|
||||
hideCallback.invoke()
|
||||
val linkEntity = ad.jump
|
||||
NewFlatLogUtils.logOpenScreenAdSkip(
|
||||
ad.id,
|
||||
(if (linkEntity.text != null) linkEntity.text else "")!!,
|
||||
(if (linkEntity.type != null) linkEntity.type else "")!!,
|
||||
(if (linkEntity.link != null) linkEntity.link else "")!!
|
||||
)
|
||||
SensorsBridge.trackEvent(
|
||||
"SplashAdOwnSkip",
|
||||
"splash_ad_id",
|
||||
ad.id,
|
||||
"link_type",
|
||||
linkEntity.type ?: "",
|
||||
"link_id",
|
||||
linkEntity.link ?: "",
|
||||
"link_text",
|
||||
linkEntity.text ?: ""
|
||||
)
|
||||
}
|
||||
}
|
||||
val sources: MutableList<ExposureSource> = ArrayList()
|
||||
sources.add(ExposureSource("开屏广告", ad.id))
|
||||
|
||||
@ -44,6 +44,16 @@ class SplashAdVideoView @JvmOverloads constructor(
|
||||
return R.layout.layout_splash_ad_video
|
||||
}
|
||||
|
||||
override fun touchSurfaceMoveFullLogic(absDeltaX: Float, absDeltaY: Float) {
|
||||
// no nothing
|
||||
}
|
||||
|
||||
override fun onPrepared() {
|
||||
super.onPrepared()
|
||||
|
||||
visibility = VISIBLE
|
||||
}
|
||||
|
||||
override fun onAutoCompletion() {
|
||||
setStateAndUi(CURRENT_STATE_AUTO_COMPLETE);
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import android.app.Activity
|
||||
import android.content.Context
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.PackageChangeHelper
|
||||
import com.gh.common.util.TempCertificationUtils
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
|
||||
@ -25,6 +26,10 @@ class LandPageAddressHandler : DownloadChainHandler() {
|
||||
processEndCallback?.invoke(asVGame, null)
|
||||
}
|
||||
} else {
|
||||
val packageName = gameEntity.getApk().firstOrNull()?.packageName
|
||||
if (packageName?.isNotEmpty() == true) {
|
||||
PackageChangeHelper.addInstallPendingPackage(packageName)
|
||||
}
|
||||
DirectUtils.directToExternalBrowser(context, gameEntity.landPageAddressDialog!!.link!!)
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package com.gh.common.dialog
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.content.DialogInterface
|
||||
import android.content.pm.PackageInfo
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@ -19,7 +18,6 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.LogUtils
|
||||
import com.gh.common.util.PackageHelper
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
|
||||
@ -59,7 +57,6 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
private val mDuration = 3000
|
||||
private var mDisposable: Disposable? = null
|
||||
private var mAdapter: PackageCheckAdapter? = null
|
||||
private var mAllInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
|
||||
var gameEntity: GameEntity? = null
|
||||
var callBack: ConfirmListener? = null
|
||||
|
||||
@ -195,7 +192,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
if (binding.noRemindAgainCb.isChecked) {
|
||||
saveRecord(entity)
|
||||
}
|
||||
val isAllPackageInstalled = isAllPackageInstalled(mAllInstalledPackages, entity)
|
||||
val isAllPackageInstalled = isAllPackageInstalled(entity)
|
||||
if (isAllPackageInstalled) {
|
||||
mDismissByTouchInside = true
|
||||
callBack?.onConfirm()
|
||||
@ -299,7 +296,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
private fun getNotInstalledLink(packageDialogEntity: PackageDialogEntity): LinkEntity? {
|
||||
val links = LinkedHashSet<LinkEntity>()
|
||||
packageDialogEntity.detectionObjects.forEach { obj ->
|
||||
if (!checkDetectionsInstalled(mAllInstalledPackages, obj.packages)) {
|
||||
if (!checkDetectionsInstalled(obj.packages)) {
|
||||
obj.assignDownload.forEach {
|
||||
links.add(packageDialogEntity.links[it])
|
||||
}
|
||||
@ -325,9 +322,8 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
mAllInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
|
||||
gameEntity?.packageDialog?.let {
|
||||
if (isAllPackageInstalled(mAllInstalledPackages, it)) {
|
||||
if (isAllPackageInstalled(it)) {
|
||||
callBack?.onConfirm()
|
||||
dismissAllowingStateLoss()
|
||||
}
|
||||
@ -363,7 +359,6 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onEventMainThread(busFour: EBPackage) {
|
||||
if (busFour.isInstalledOrUninstalled()) {
|
||||
mAllInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
|
||||
mAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
@ -388,7 +383,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
val entity = entities[position]
|
||||
holder.binding.gameNameTv.text = entity.text
|
||||
if (position <= index) {
|
||||
val isAllInstalled = checkDetectionsInstalled(mAllInstalledPackages, entity.packages)
|
||||
val isAllInstalled = checkDetectionsInstalled(entity.packages)
|
||||
if (isAllInstalled) {
|
||||
holder.binding.statusTv.text = "已安装"
|
||||
holder.binding.statusTv.setTextColor(ContextCompat.getColor(context, com.gh.gamecenter.common.R.color.text_theme))
|
||||
@ -416,8 +411,7 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
return
|
||||
}
|
||||
|
||||
val allInstalledPackages = PackageHelper.getInstalledPackageNameList(HaloApp.getInstance().application, 0)
|
||||
if (isAllPackageInstalled(allInstalledPackages, packageDialogEntity)) {
|
||||
if (isAllPackageInstalled(packageDialogEntity)) {
|
||||
callBack.onConfirm()
|
||||
return
|
||||
}
|
||||
@ -453,13 +447,11 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
}
|
||||
|
||||
private fun checkDetectionsInstalled(
|
||||
allInstalledPackages: List<String>,
|
||||
packages: ArrayList<String>
|
||||
): Boolean {
|
||||
var isPackagesInstalled = false
|
||||
packages.forEach { packageName ->
|
||||
val isInstalled = allInstalledPackages.find { it == packageName } != null
|
||||
if (isInstalled) {
|
||||
if (PackageUtils.isInstalledFromAllPackage(HaloApp.getInstance(), packageName)) {
|
||||
isPackagesInstalled = true
|
||||
return@forEach
|
||||
}
|
||||
@ -469,17 +461,14 @@ class PackageCheckDialogFragment : BaseDialogFragment() {
|
||||
|
||||
|
||||
fun isAllPackageInstalled(
|
||||
allInstalledPackages: List<String>,
|
||||
packageDialogEntity: PackageDialogEntity
|
||||
): Boolean {
|
||||
var isAllInstalled = true
|
||||
packageDialogEntity.detectionObjects.forEach loop@{ obj ->
|
||||
if (!checkDetectionsInstalled(allInstalledPackages, obj.packages)) {
|
||||
isAllInstalled = false
|
||||
return isAllInstalled
|
||||
if (!checkDetectionsInstalled(obj.packages)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return isAllInstalled
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ import com.gh.gamecenter.common.entity.ErrorEntity
|
||||
import com.gh.gamecenter.core.utils.CurrentActivityHolder
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
import com.gh.gamecenter.databinding.DialogWechatBindingFailedBinding
|
||||
import com.gh.gamecenter.login.user.UserRepository
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.lightgame.utils.Utils
|
||||
|
||||
class WechatBindingFailedDialogFragment : BaseDialogFragment() {
|
||||
@ -48,10 +48,10 @@ class WechatBindingFailedDialogFragment : BaseDialogFragment() {
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
UserRepository.getInstance().loginUserInfo.observe(viewLifecycleOwner) {
|
||||
currentUserId = it.data.getShortUserId()
|
||||
binding.tvCurrentName.text = it.data.name
|
||||
binding.ivCurrentAvatar.displayAvatar(it.data.icon)
|
||||
UserManager.getInstance().userInfoEntity?.let {
|
||||
currentUserId = it.getShortUserId()
|
||||
binding.tvCurrentName.text = it.name ?: ""
|
||||
binding.ivCurrentAvatar.displayAvatar(it.icon)
|
||||
binding.tvUserId.text = getString(R.string.user_id, currentUserId)
|
||||
}
|
||||
|
||||
|
||||
@ -10,16 +10,12 @@ fun FragmentManager.popBackStackAllowStateLoss() {
|
||||
fun FragmentManager.popBackStackAllowStateLoss(id: Int, flags: Int) {
|
||||
if (!isStateSaved) {
|
||||
popBackStack(id, flags)
|
||||
} else {
|
||||
hook { popBackStack(id, flags) }
|
||||
}
|
||||
}
|
||||
|
||||
fun FragmentManager.popBackStackAllowStateLoss(name: String?, flags: Int) {
|
||||
if (!isStateSaved) {
|
||||
popBackStack(name, flags)
|
||||
} else {
|
||||
hook { popBackStack(name, flags) }
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,34 +25,9 @@ fun FragmentManager.popBackStackImmediateAllowStateLoss(id: Int, flags: Int) =
|
||||
if (!isStateSaved) {
|
||||
popBackStackImmediate(id, flags)
|
||||
} else {
|
||||
hook { popBackStackImmediate(id, flags) }
|
||||
false
|
||||
}
|
||||
|
||||
fun FragmentManager.popBackStackImmediateAllowStateLoss(name: String?, flags: Int): Boolean =
|
||||
if (!isStateSaved) {
|
||||
popBackStackImmediate(name, flags)
|
||||
} else {
|
||||
hook { popBackStackImmediate(name, flags) }
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过反射将FragmentManager的mStateSaved和mStopped设为false,否则Activity在回调onSavedInstance以后,
|
||||
* 调用Fragment的popBackStack和popBackStackImmediate方法会触发“java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState”的异常。
|
||||
* @see <a href="https://sentry.shanqu.cc/organizations/lightgame/issues/418688/?project=22">Sentry-418688</a>
|
||||
*/
|
||||
private fun <T> FragmentManager.hook(callback: FragmentManager.() -> T): T {
|
||||
val mStateSavedField = getField(this::class.java,"mStateSaved")
|
||||
val stateSaved = mStateSavedField.get(this);
|
||||
mStateSavedField.set(this, false)
|
||||
val mStoppedField = getField(this::class.java,"mStopped")
|
||||
val stopped = mStateSavedField.get(this);
|
||||
mStoppedField.set(this, false)
|
||||
val result = callback.invoke(this)
|
||||
mStateSavedField.set(this, stateSaved)
|
||||
mStoppedField.set(this, stopped)
|
||||
return result
|
||||
}
|
||||
|
||||
@Throws(NoSuchFieldException::class)
|
||||
private fun getField(clazz: Class<*>, name: String): Field {
|
||||
var cls: Class<*>? = clazz
|
||||
|
||||
@ -19,6 +19,7 @@ import com.gh.common.util.EntranceUtils.jumpActivity
|
||||
import com.gh.common.util.EntranceUtils.jumpActivityCompat
|
||||
import com.gh.gamecenter.*
|
||||
import com.gh.gamecenter.amway.AmwayActivity
|
||||
import com.gh.gamecenter.category2.CategoryV2Activity
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
@ -46,6 +47,7 @@ import com.gh.gamecenter.feature.provider.IConcernInfoProvider
|
||||
import com.gh.gamecenter.forum.detail.ForumDetailActivity
|
||||
import com.gh.gamecenter.forum.home.CommunityActivity
|
||||
import com.gh.gamecenter.forum.search.ForumOrUserSearchActivity
|
||||
import com.gh.gamecenter.game.columncollection.detail.ColumnCollectionDetailActivity
|
||||
import com.gh.gamecenter.game.columncollection.detail.ColumnCollectionDetailFragment
|
||||
import com.gh.gamecenter.game.commoncollection.detail.CustomCommonCollectionDetailActivity
|
||||
import com.gh.gamecenter.game.upload.GameSubmissionActivity
|
||||
@ -67,6 +69,11 @@ import com.gh.gamecenter.newsdetail.NewsDetailActivity
|
||||
import com.gh.gamecenter.personalhome.background.PersonalityBackgroundActivity
|
||||
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
|
||||
import com.gh.gamecenter.personalhome.home.UserHistoryViewModel
|
||||
import com.gh.gamecenter.qa.answer.detail.SimpleAnswerDetailActivity
|
||||
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
|
||||
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.servers.GameServerTestActivity
|
||||
import com.gh.gamecenter.servers.GameServersActivity
|
||||
@ -76,7 +83,9 @@ import com.gh.gamecenter.subject.SubjectActivity
|
||||
import com.gh.gamecenter.tag.TagsActivity
|
||||
import com.gh.gamecenter.toolbox.ToolBoxActivity
|
||||
import com.gh.gamecenter.video.data.VideoDataActivity
|
||||
import com.gh.gamecenter.video.detail.VideoDetailActivity
|
||||
import com.gh.gamecenter.video.detail.VideoDetailContainerViewModel
|
||||
import com.gh.gamecenter.video.game.GameVideoActivity
|
||||
import com.gh.gamecenter.video.videomanager.VideoManagerActivity
|
||||
import com.gh.gamecenter.wrapper.MainWrapperRepository
|
||||
import com.gh.gamecenter.wrapper.ToolbarWrapperActivity
|
||||
@ -671,27 +680,20 @@ object DirectUtils {
|
||||
showSubjectTab: Boolean = false
|
||||
) {
|
||||
if (id.isEmpty()) return
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.columnCollectionDetailActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance)
|
||||
.appendQueryParameter(KEY_COLLECTION_ID, id)
|
||||
.appendQueryParameter(KEY_COLUMN_NAME, columnName)
|
||||
.appendQueryParameter(KEY_BLOCK_ID, blockId)
|
||||
.appendQueryParameter(KEY_BLOCK_NAME, blockName)
|
||||
.appendQueryParameter(KEY_COLUMN_COLLECTION_STYLE, style)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(KEY_COLUMN_COLLECTION_STYLE, style)
|
||||
bundle.putInt(KEY_POSITION, position)
|
||||
bundle.putBoolean(KEY_SHOW_SUBJECT_TAB, showSubjectTab)
|
||||
if (exposureEvent != null) {
|
||||
bundle.putParcelableArrayList(KEY_EXPOSURE_SOURCE_LIST, ArrayList(exposureEvent.source))
|
||||
}
|
||||
}
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, ColumnCollectionDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putString(KEY_COLLECTION_ID, id)
|
||||
bundle.putString(KEY_COLUMNNAME, columnName)
|
||||
bundle.putString(KEY_BLOCK_ID, blockId)
|
||||
bundle.putString(KEY_BLOCK_NAME, blockName)
|
||||
bundle.putString(KEY_COLUMN_COLLECTION_STYLE, style)
|
||||
bundle.putInt(KEY_POSITION, position)
|
||||
bundle.putBoolean(KEY_SHOW_SUBJECT_TAB, showSubjectTab)
|
||||
if (exposureEvent != null) {
|
||||
bundle.putParcelableArrayList(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST, ArrayList(exposureEvent.source))
|
||||
}
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -743,7 +745,7 @@ object DirectUtils {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, NewsDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_NEWS_ID, id)
|
||||
bundle.putString(KEY_NEWSID, id)
|
||||
if (entrance?.contains("隐私政策") == true) {
|
||||
bundle.putBoolean(KEY_HIDE_USELESS_INFO, true)
|
||||
}
|
||||
@ -759,7 +761,7 @@ object DirectUtils {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, NewsDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_NEWS_ID, id)
|
||||
bundle.putString(KEY_NEWSID, id)
|
||||
bundle.putBoolean(KEY_HIDE_USELESS_INFO, hideUselessInfo)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
@ -896,15 +898,13 @@ object DirectUtils {
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToGameDetailVideoStreaming(context: Context, id: String, entrance: String? = null) {
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.gameVideoActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance)
|
||||
.appendQueryParameter(KEY_GAME_ID, id)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, GameVideoActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putString(KEY_GAMEID, id)
|
||||
bundle.putBoolean(KEY_OPEN_VIDEO_STREAMING, true)
|
||||
bundle.putString(KEY_TARGET, EntranceConsts.TAB_TYPE_DESC)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -1068,31 +1068,23 @@ object DirectUtils {
|
||||
|
||||
@JvmStatic
|
||||
fun directToToolbox(context: Context, gameId: String, toolboxUrl: String, entrance: String = ENTRANCE_BROWSER) {
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.toolBoxActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance)
|
||||
.appendQueryParameter(KEY_GAME_ID, gameId)
|
||||
.appendQueryParameter(KEY_URL, toolboxUrl)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance)
|
||||
bundle.putString(KEY_TO, ToolBoxActivity::class.java.name)
|
||||
bundle.putString(KEY_GAMEID, gameId)
|
||||
bundle.putString(KEY_URL, toolboxUrl)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun directToAnswerDetail(context: Context, id: String, entrance: String? = null, path: String? = null) {
|
||||
if (id.isEmpty()) return
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.answerDetailActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_ANSWER_ID, id)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, SimpleAnswerDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_ANSWER_ID, id)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -1104,17 +1096,13 @@ object DirectUtils {
|
||||
sourceEntrance: String = ""
|
||||
) {
|
||||
if (id.isEmpty()) return
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.questionDetailActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_QUESTIONS_ID, id)
|
||||
.appendQueryParameter(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, NewQuestionDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_QUESTIONS_ID, id)
|
||||
bundle.putString(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -1241,20 +1229,14 @@ object DirectUtils {
|
||||
path: String?,
|
||||
sourceEntrance: String = ""
|
||||
) {
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.articleDetailActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
.appendQueryParameter(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.fillParams {
|
||||
it.putParcelable(KEY_COMMUNITY_DATA, CommunityEntity(id = communityId!!))
|
||||
}
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_TO, ArticleDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
bundle.putString(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
bundle.putParcelable(KEY_COMMUNITY_DATA, CommunityEntity(id = communityId!!))
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -1267,21 +1249,14 @@ object DirectUtils {
|
||||
sourceEntrance: String = "",
|
||||
) {
|
||||
if (articleId.isNullOrEmpty()) return
|
||||
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.articleDetailActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
.appendQueryParameter(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.fillParams {
|
||||
it.putParcelable(KEY_COMMUNITY_DATA, community)
|
||||
}
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_TO, ArticleDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
bundle.putString(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
bundle.putParcelable(KEY_COMMUNITY_DATA, community)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1296,20 +1271,13 @@ object DirectUtils {
|
||||
path: String?
|
||||
) {
|
||||
if (subjectId.isEmpty()) return
|
||||
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.communitySubjectActivity)
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
.appendQueryParameter(KEY_COLUMN_ID, subjectId)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.fillParams {
|
||||
it.putParcelable(KEY_COMMUNITY_DATA, community)
|
||||
}
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_TO, CommunitySubjectActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(KEY_COLUMN_ID, subjectId)
|
||||
bundle.putParcelable(KEY_COMMUNITY_DATA, community)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -1319,17 +1287,17 @@ object DirectUtils {
|
||||
path: String? = "",
|
||||
sourceEntrance: String = ""
|
||||
) {
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.forumVideoDetailActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_VIDEO_ID, videoId)
|
||||
.appendQueryParameter(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.navigation(context)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, ForumVideoDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_VIDEO_ID, videoId);
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
jumpActivity(context, bundle)
|
||||
} else {
|
||||
DialogHelper.showVideoUnsupportedDialog(context)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1354,31 +1322,28 @@ object DirectUtils {
|
||||
isHomeVideo: Boolean = false,
|
||||
sourceEntrance: String = ""
|
||||
) {
|
||||
SensorsBridge.trackAccessVideoStreaming(sourceEntrance)
|
||||
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.videoDetailActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_VIDEO_ID, videoId)
|
||||
.appendQueryParameter(KEY_GAME_ID, gameId)
|
||||
.appendQueryParameter(KEY_ACTIVITY_NAME, act)
|
||||
.appendQueryParameter(KEY_PAGINATION_TYPE, paginationType)
|
||||
.appendQueryParameter(KEY_FIELD_ID, fieldId)
|
||||
.appendQueryParameter(KEY_SECTION_NAME, sectionName)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(KEY_ID, videoId)
|
||||
bundle.putString(KEY_REFERER, referer)
|
||||
bundle.putString(KEY_TYPE, type)
|
||||
bundle.putBoolean(KEY_SHOW_COMMENT, showComment)
|
||||
bundle.putString(KEY_LOCATION, fromLocation)
|
||||
bundle.putBoolean(KEY_IS_HOME_VIDEO, isHomeVideo)
|
||||
}
|
||||
.navigation(context)
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, VideoDetailActivity::class.java.name)
|
||||
bundle.putString(KEY_VIDEO_ID, videoId);
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_ID, videoId)
|
||||
bundle.putString(KEY_GAMEID, gameId)
|
||||
bundle.putString(KEY_LOCATION, fromLocation)
|
||||
bundle.putBoolean(KEY_SHOW_COMMENT, showComment)
|
||||
bundle.putString(KEY_REFERER, referer)
|
||||
bundle.putString(KEY_TYPE, type)
|
||||
bundle.putString(KEY_ACTIVITY_NAME, act)
|
||||
bundle.putString(KEY_PAGINATION_TYPE, paginationType)
|
||||
bundle.putString(KEY_FIELD_ID, fieldId)
|
||||
bundle.putString(KEY_SECTION_NAME, sectionName)
|
||||
bundle.putBoolean(KEY_IS_HOME_VIDEO, isHomeVideo)
|
||||
SensorsBridge.trackAccessVideoStreaming(sourceEntrance)
|
||||
jumpActivity(context, bundle)
|
||||
} else {
|
||||
DialogHelper.showVideoUnsupportedDialog(context)
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -1473,8 +1438,8 @@ object DirectUtils {
|
||||
) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putParcelable(KEY_VIDEO_LINK_ENTITY, linkEntity)
|
||||
bundle.putParcelable(KEY_SIMPLE_GAME_ENTITY, simpleGameEntity)
|
||||
bundle.putParcelable(VideoLinkEntity::class.java.simpleName, linkEntity)
|
||||
bundle.putParcelable(SimpleGameEntity::class.java.simpleName, simpleGameEntity)
|
||||
bundle.putString(KEY_TO, VideoManagerActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
jumpActivity(context, bundle)
|
||||
@ -1507,16 +1472,13 @@ object DirectUtils {
|
||||
@JvmStatic
|
||||
fun directToGameVideo(context: Context, gameId: String, entrance: String? = null, path: String? = "") {
|
||||
if (gameId.isEmpty()) return
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.gameVideoActivity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
.appendQueryParameter(KEY_PATH, path)
|
||||
.appendQueryParameter(KEY_GAME_ID, gameId)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putString(KEY_TO, GameVideoActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(KEY_GAMEID, gameId)
|
||||
// context.startActivity(GameVideoActivity.getIntent(context, gameId, entrance, path))
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -1541,23 +1503,16 @@ object DirectUtils {
|
||||
exposureEvent: ExposureEvent? = null,
|
||||
) {
|
||||
if (categoryId.isEmpty()) return
|
||||
|
||||
val uri = Uri.Builder()
|
||||
.path(RouteConsts.activity.categoryV2Activity)
|
||||
.appendQueryParameter(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
.appendQueryParameter(KEY_CATEGORY_ID, categoryId)
|
||||
.appendQueryParameter(KEY_CATEGORY_TITLE, categoryTitle)
|
||||
.build()
|
||||
|
||||
TheRouter
|
||||
.build(uri.toString())
|
||||
.fillParams {
|
||||
if (exposureEvent != null) it.putParcelableArrayList(
|
||||
KEY_EXPOSURE_SOURCE_LIST,
|
||||
ArrayList(exposureEvent.source)
|
||||
)
|
||||
}
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_TO, CategoryV2Activity::class.java.name)
|
||||
bundle.putString(KEY_CATEGORY_ID, categoryId)
|
||||
bundle.putString(KEY_CATEGORY_TITLE, categoryTitle)
|
||||
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
if (exposureEvent != null) bundle.putParcelableArrayList(
|
||||
KEY_EXPOSURE_SOURCE_LIST,
|
||||
ArrayList(exposureEvent.source)
|
||||
)
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -2778,4 +2778,34 @@ object NewFlatLogUtils {
|
||||
parseAndPutMeta()(this)
|
||||
}.let(::log)
|
||||
}
|
||||
|
||||
// 自有开屏广告加载
|
||||
fun logSplashAdLoad(id: String) {
|
||||
json {
|
||||
KEY_EVENT to "splash_ad_load"
|
||||
"ad_id" to id
|
||||
parseAndPutMeta()(this)
|
||||
}.let(::log)
|
||||
}
|
||||
|
||||
// 自有开屏广告展示
|
||||
fun logSplashAdShow(id: String, duration: Long) {
|
||||
json {
|
||||
KEY_EVENT to "splash_ad_show"
|
||||
"ad_id" to id
|
||||
"duration" to duration
|
||||
parseAndPutMeta()(this)
|
||||
}.let(::log)
|
||||
}
|
||||
|
||||
// 自有开屏广告加载/展示失败
|
||||
@JvmStatic
|
||||
fun logSplashAdFail(id: String, error: String) {
|
||||
json {
|
||||
KEY_EVENT to "splash_ad_fail"
|
||||
"ad_id" to id
|
||||
"error" to error
|
||||
parseAndPutMeta()(this)
|
||||
}.let(::log)
|
||||
}
|
||||
}
|
||||
@ -578,7 +578,6 @@ object PackageHelper {
|
||||
Utils.log(TAG, "refreshWrongInstallStatus 检查安装状态异常的应用")
|
||||
|
||||
val uninstalledButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
|
||||
val updatedButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
|
||||
|
||||
for (packageName in packageNameSet) {
|
||||
val installedVersionName = PackageUtils.getVersionNameByPackageName(packageName)
|
||||
@ -587,18 +586,9 @@ object PackageHelper {
|
||||
&& installedVersionName == null
|
||||
) {
|
||||
uninstalledButKeepingWrongStatusPackageNameSet.add(packageName)
|
||||
} else if (PackagesManager.isInstalled(packageName)
|
||||
&& installedVersionName != null
|
||||
&& !PackagesManager.isInstalledWithSpecificVersion(packageName, installedVersionName)
|
||||
) {
|
||||
updatedButKeepingWrongStatusPackageNameSet.add(packageName)
|
||||
}
|
||||
}
|
||||
|
||||
Utils.log(
|
||||
TAG,
|
||||
"refreshWrongInstallStatus 需要更新已更新状态的包数量为 ${updatedButKeepingWrongStatusPackageNameSet.size}"
|
||||
)
|
||||
Utils.log(
|
||||
TAG,
|
||||
"refreshWrongInstallStatus 需要移除已安装的包数量为 ${uninstalledButKeepingWrongStatusPackageNameSet.size}"
|
||||
@ -616,12 +606,6 @@ object PackageHelper {
|
||||
additionalWhiteListPackageNameSet.toString()
|
||||
)
|
||||
}
|
||||
|
||||
if (updatedButKeepingWrongStatusPackageNameSet.isNotEmpty()) {
|
||||
for (packageName in updatedButKeepingWrongStatusPackageNameSet) {
|
||||
PackageChangeHelper.addUpdate(packageName)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -635,7 +619,6 @@ object PackageHelper {
|
||||
|
||||
val installedButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
|
||||
val uninstalledButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
|
||||
val updatedButKeepingWrongStatusPackageNameSet: HashSet<String> = hashSetOf()
|
||||
|
||||
for (game in gameEntityList) {
|
||||
for (apk in game.getApk()) {
|
||||
@ -651,13 +634,6 @@ object PackageHelper {
|
||||
&& installedVersionName == null
|
||||
) {
|
||||
uninstalledButKeepingWrongStatusPackageNameSet.add(packageName)
|
||||
} else if (PackagesManager.isInstalled(packageName)
|
||||
&& installedVersionName != null
|
||||
&& !PackagesManager.isInstalledWithSpecificVersion(packageName, installedVersionName)
|
||||
&& !PackagesManager.isCanUpdate(game.id, packageName, false)
|
||||
) {
|
||||
cachedPkgNameAndGameEntityMap.put(packageName, game)
|
||||
updatedButKeepingWrongStatusPackageNameSet.add(packageName)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -666,10 +642,6 @@ object PackageHelper {
|
||||
TAG,
|
||||
"refreshWrongInstallStatus 需要更新已安装状态的包数量为 ${installedButKeepingWrongStatusPackageNameSet.size}"
|
||||
)
|
||||
Utils.log(
|
||||
TAG,
|
||||
"refreshWrongInstallStatus 需要更新已更新状态的包数量为 ${updatedButKeepingWrongStatusPackageNameSet.size}"
|
||||
)
|
||||
Utils.log(
|
||||
TAG,
|
||||
"refreshWrongInstallStatus 需要移除已安装的包数量为 ${uninstalledButKeepingWrongStatusPackageNameSet.size}"
|
||||
@ -699,12 +671,6 @@ object PackageHelper {
|
||||
additionalWhiteListPackageNameSet.toString()
|
||||
)
|
||||
}
|
||||
|
||||
if (updatedButKeepingWrongStatusPackageNameSet.isNotEmpty()) {
|
||||
for (packageName in updatedButKeepingWrongStatusPackageNameSet) {
|
||||
PackageChangeHelper.addUpdate(packageName, cachedPkgNameAndGameEntityMap.remove(packageName))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,28 +81,11 @@ object PackageLauncher {
|
||||
gameEntity: GameEntity? = null,
|
||||
packageName: String?
|
||||
) {
|
||||
|
||||
if (packageName.isNullOrEmpty()) {
|
||||
ToastUtils.toast("启动失败")
|
||||
return
|
||||
}
|
||||
|
||||
// 获取 GameInstall 实体,用于记录启动日志用
|
||||
val gameInstall = if (gameEntity != null) {
|
||||
GameInstall.transformGameInstall(gameEntity, packageName)
|
||||
} else {
|
||||
PackagesManager.getInstalledList().find { it.packageName == packageName }
|
||||
}
|
||||
|
||||
if (gameInstall != null) {
|
||||
NewFlatLogUtils.logGameLaunch(
|
||||
gameId = gameInstall.id ?: "unknown",
|
||||
gameName = gameInstall.name ?: "unknown",
|
||||
gameCategory = gameInstall.category ?: "unknown",
|
||||
downloadStatus = if (gameInstall.downloadStatus == "demo") "试玩" else "下载"
|
||||
)
|
||||
}
|
||||
|
||||
try {
|
||||
val intent = context.applicationContext.packageManager.getLaunchIntentForPackage(packageName)
|
||||
if (intent != null) {
|
||||
@ -113,6 +96,26 @@ object PackageLauncher {
|
||||
} catch (e: Exception) {
|
||||
ToastUtils.toast( "启动失败")
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取 GameInstall 实体,用于记录启动日志用
|
||||
val gameInstall = if (gameEntity != null) {
|
||||
GameInstall.transformGameInstall(gameEntity, packageName)
|
||||
} else {
|
||||
PackagesManager.getInstalledList().find { it.packageName == packageName }
|
||||
}
|
||||
|
||||
if (gameInstall != null) {
|
||||
NewFlatLogUtils.logGameLaunch(
|
||||
gameId = gameInstall.id ?: "unknown",
|
||||
gameName = gameInstall.name ?: "unknown",
|
||||
gameCategory = gameInstall.category ?: "unknown",
|
||||
downloadStatus = if (gameInstall.downloadStatus == "demo") "试玩" else "下载"
|
||||
)
|
||||
}
|
||||
} catch (e: RuntimeException) {
|
||||
// 都 DeadSystemException 了,还想啥日志上报
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -301,7 +301,7 @@ public class PackageUtils {
|
||||
Signature[] signatures = packageInfo.signatures;
|
||||
|
||||
// 使用幸运破解器破解安卓签名认证可能会出现不用签名也能装的情况,这里有可能是空的
|
||||
if (signatures[0] != null) {
|
||||
if (signatures.length > 0 && signatures[0] != null) {
|
||||
return parseSignature(signatures[0].toByteArray());
|
||||
} else {
|
||||
return new String[]{null, null};
|
||||
|
||||
@ -2,10 +2,12 @@ package com.gh.common.util
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.common.iinterface.ISuperiorChain
|
||||
import com.gh.gamecenter.amway.AmwayFragment
|
||||
import com.gh.gamecenter.category2.CategoryV2Fragment
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.entity.LinkEntity
|
||||
import com.gh.gamecenter.common.provider.IHelpAndFeedbackProvider
|
||||
import com.gh.gamecenter.discovery.DiscoveryFragment
|
||||
@ -36,7 +38,6 @@ import com.gh.gamecenter.toolbox.ToolboxFragment
|
||||
import com.gh.gamecenter.video.detail.HomeVideoFragment
|
||||
import com.gh.gamecenter.wrapper.ToolbarWrapperFragment
|
||||
import com.halo.assistant.fragment.WebFragment
|
||||
import com.therouter.TheRouter
|
||||
|
||||
/**
|
||||
* 通用跳转Fragment方法
|
||||
@ -181,7 +182,7 @@ object ViewPagerFragmentHelper {
|
||||
className = ColumnCollectionDetailFragment::class.java.name
|
||||
bundle.putString(EntranceConsts.KEY_COLLECTION_ID, entity.link)
|
||||
bundle.putInt(EntranceConsts.KEY_POSITION, 0)
|
||||
bundle.putString(EntranceConsts.KEY_COLUMN_NAME, entity.text)
|
||||
bundle.putString(EntranceConsts.KEY_COLUMNNAME, entity.text)
|
||||
bundle.putBoolean(EntranceConsts.KEY_IS_COLUMN_COLLECTION, true)
|
||||
bundle.putString(EntranceConsts.KEY_SUBJECT_TYPE, "tab")
|
||||
}
|
||||
@ -207,7 +208,7 @@ object ViewPagerFragmentHelper {
|
||||
TYPE_COMMON_COLLECTION -> {
|
||||
className = CustomCommonCollectionDetailFragment::class.java.name
|
||||
bundle.putString(EntranceConsts.KEY_COLLECTION_ID, entity.link)
|
||||
bundle.putString(EntranceConsts.KEY_COLUMN_NAME, entity.text)
|
||||
bundle.putString(EntranceConsts.KEY_COLUMNNAME, entity.text)
|
||||
}
|
||||
// web链接
|
||||
TYPE_WEB -> {
|
||||
@ -237,7 +238,7 @@ object ViewPagerFragmentHelper {
|
||||
// 文章
|
||||
TYPE_ARTICLE -> {
|
||||
className = NewsDetailFragment::class.java.name
|
||||
bundle.putString(EntranceConsts.KEY_NEWS_ID, entity.link)
|
||||
bundle.putString(EntranceConsts.KEY_NEWSID, entity.link)
|
||||
}
|
||||
// 社区专题
|
||||
TYPE_COMMUNITY_COLUMN -> {
|
||||
|
||||
@ -166,8 +166,13 @@ public class MainActivity extends BaseActivity {
|
||||
private final Handler handler = new Handler();
|
||||
private boolean mShouldShowAd = false; // 是否显示广告
|
||||
|
||||
private Bundle mTempSavedInstanceState;
|
||||
private boolean mFragmentIsCreated = false;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
mTempSavedInstanceState = savedInstanceState;
|
||||
|
||||
mShouldShowAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null
|
||||
&& !HaloApp.getInstance().isAlreadyUpAndRunning;
|
||||
HaloApp.getInstance().isAlreadyUpAndRunning = true;
|
||||
@ -175,21 +180,12 @@ public class MainActivity extends BaseActivity {
|
||||
mMainWrapperViewModel = new ViewModelProvider(this, new MainWrapperViewModel.Factory(HaloApp.getInstance()))
|
||||
.get(MainWrapperViewModel.class);
|
||||
|
||||
DisplayUtils.transparentStatusBar(this);
|
||||
DisplayUtils.updateGlobalScreen(this);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
setStatusBarColor(Color.TRANSPARENT);
|
||||
|
||||
Fragment fragmentFromFM = getSupportFragmentManager().findFragmentById(com.gh.gamecenter.selector.R.id.layout_activity_content);
|
||||
|
||||
mMainWrapperFragment = fragmentFromFM != null ? (MainWrapperFragment) fragmentFromFM : new MainWrapperFragment();
|
||||
if (savedInstanceState != null) {
|
||||
mMainWrapperFragment.setArguments(savedInstanceState);
|
||||
} else if (getIntent() != null) {
|
||||
mMainWrapperFragment.setArguments(getIntent().getExtras());
|
||||
}
|
||||
replaceFragment(mMainWrapperFragment);
|
||||
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
if (HaloApp.getInstance().isNewForThisVersion) {
|
||||
LunchType lunchType = HaloApp.getInstance().getLaunchType();
|
||||
@ -215,7 +211,6 @@ public class MainActivity extends BaseActivity {
|
||||
DataUtils.getGid();
|
||||
}
|
||||
|
||||
|
||||
mPackageViewModel = ViewModelProviders.of(this, new PackageViewModel.Factory()).get(PackageViewModel.class);
|
||||
|
||||
final boolean containsErrorMsg = com.gh.gamecenter.common.constant.Config.isContainsErrorMsg();
|
||||
@ -273,6 +268,7 @@ public class MainActivity extends BaseActivity {
|
||||
if (mShouldShowAd) {
|
||||
showAd();
|
||||
} else {
|
||||
doInitMainFragment(mTempSavedInstanceState);
|
||||
hideTextAd();
|
||||
hideSplashAd();
|
||||
}
|
||||
@ -328,6 +324,23 @@ public class MainActivity extends BaseActivity {
|
||||
CertificationSwitchHelper.getCertificationSwitch();
|
||||
}
|
||||
|
||||
private void doInitMainFragment(Bundle savedInstanceState) {
|
||||
if (mFragmentIsCreated) return;
|
||||
|
||||
mTempSavedInstanceState = null;
|
||||
Fragment fragmentFromFM = getSupportFragmentManager().findFragmentById(com.gh.gamecenter.selector.R.id.layout_activity_content);
|
||||
|
||||
mMainWrapperFragment = fragmentFromFM != null ? (MainWrapperFragment) fragmentFromFM : new MainWrapperFragment();
|
||||
if (savedInstanceState != null) {
|
||||
mMainWrapperFragment.setArguments(savedInstanceState);
|
||||
} else if (getIntent() != null) {
|
||||
mMainWrapperFragment.setArguments(getIntent().getExtras());
|
||||
}
|
||||
replaceFragment(mMainWrapperFragment);
|
||||
|
||||
mFragmentIsCreated = true;
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private void getTeenagerMode() {
|
||||
RetrofitManager.getInstance()
|
||||
@ -541,19 +554,31 @@ public class MainActivity extends BaseActivity {
|
||||
protected void handleMessage(Message msg) {
|
||||
super.handleMessage(msg);
|
||||
if (msg.what == COUNTDOWN_AD || msg.what == COUNTDOWN_SDK_AD) {
|
||||
mCountdownCount++;
|
||||
int maxCount;
|
||||
|
||||
if (msg.what == COUNTDOWN_AD) {
|
||||
maxCount = mCountdownMaxCount;
|
||||
} else {
|
||||
maxCount = COUNTDOWN_SDK_MAX_COUNT;
|
||||
}
|
||||
|
||||
// 读秒到一半的时候初始化 MainWrapperFragment
|
||||
if (mCountdownCount == maxCount / 2) {
|
||||
doInitMainFragment(mTempSavedInstanceState);
|
||||
}
|
||||
|
||||
mCountdownCount++;
|
||||
|
||||
if (maxCount < mCountdownCount) {
|
||||
AdDelegateHelper.INSTANCE.setShowingSplashAd(false);
|
||||
hideSplashAd();
|
||||
|
||||
if (msg.what == COUNTDOWN_AD && msg.obj instanceof StartupAdEntity) {
|
||||
StartupAdEntity ad = (StartupAdEntity) msg.obj;
|
||||
if (!AdDelegateHelper.INSTANCE.isOwnerSplashAdShown()) {
|
||||
com.gh.common.util.NewFlatLogUtils.logSplashAdFail(ad.getId(), "广告加载超时");
|
||||
}
|
||||
AdDelegateHelper.INSTANCE.setOwnerSplashAdShown(false);
|
||||
LinkEntity linkEntity = ad.getJump();
|
||||
SensorsBridge.trackEvent(
|
||||
"SplashAdOwnSkip",
|
||||
@ -633,10 +658,11 @@ public class MainActivity extends BaseActivity {
|
||||
ExtensionsKt.removeFromParent(startSdkAdIcpContainer, true);
|
||||
}
|
||||
|
||||
onSplashHidden();
|
||||
onAdHidden();
|
||||
}
|
||||
|
||||
private void onSplashHidden() {
|
||||
private void onAdHidden() {
|
||||
doInitMainFragment(mTempSavedInstanceState);
|
||||
// 通知全局弹窗可以进行显示
|
||||
AppExecutor.getUiExecutor().execute(GlobalPriorityChainHelper.INSTANCE::start);
|
||||
}
|
||||
@ -854,7 +880,9 @@ public class MainActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0 && !mMainWrapperFragment.onHandleBackPressed()) {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0
|
||||
&& mMainWrapperFragment != null
|
||||
&& !mMainWrapperFragment.onHandleBackPressed()) {
|
||||
DownloadEntity downloadEntity = null;
|
||||
for (DownloadEntity entity : DownloadManager.getInstance().getAllDownloadEntityExcludeSilentTask()) {
|
||||
if (entity.getStatus().equals(DownloadStatus.done)) {
|
||||
|
||||
@ -48,7 +48,7 @@ public class MessageDetailActivity extends ToolBarActivity {
|
||||
public static Intent getMessageDetailIntent(Context context, CommentEntity entity, String newsId) {
|
||||
Intent intent = new Intent(context, MessageDetailActivity.class);
|
||||
intent.putExtra("commentNum", -1);
|
||||
intent.putExtra(EntranceConsts.KEY_NEWS_ID, newsId);
|
||||
intent.putExtra(EntranceConsts.KEY_NEWSID, newsId);
|
||||
intent.putExtra("openSoftInput", true);
|
||||
intent.putExtra(CommentEntity.TAG, entity);
|
||||
|
||||
@ -66,7 +66,7 @@ public class MessageDetailActivity extends ToolBarActivity {
|
||||
|
||||
public static Intent getIntentById(Context context, String newsId, Integer commentNum, Boolean openSoftInput, String entrance) {
|
||||
Intent intent = new Intent(context, MessageDetailActivity.class);
|
||||
intent.putExtra(EntranceConsts.KEY_NEWS_ID, newsId);
|
||||
intent.putExtra(EntranceConsts.KEY_NEWSID, newsId);
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
intent.putExtra("commentNum", commentNum);
|
||||
intent.putExtra("openSoftInput", openSoftInput);
|
||||
@ -86,10 +86,10 @@ public class MessageDetailActivity extends ToolBarActivity {
|
||||
if (fragment.getArguments() != null) {
|
||||
Object concernEntity = HaloApp.get(ConcernEntity.TAG, false);
|
||||
Object commentEntity = fragment.requireArguments().getParcelable(CommentEntity.TAG);
|
||||
if (fragment.getArguments().getString(EntranceConsts.KEY_NEWS_ID) != null && commentEntity != null) {
|
||||
return new Pair(((CommentEntity) commentEntity).getId(), fragment.getArguments().getString(EntranceConsts.KEY_NEWS_ID));
|
||||
} else if (fragment.getArguments().getString(EntranceConsts.KEY_NEWS_ID) != null) {
|
||||
return new Pair(fragment.getArguments().getString(EntranceConsts.KEY_NEWS_ID), "");
|
||||
if (fragment.getArguments().getString(EntranceConsts.KEY_NEWSID) != null && commentEntity != null) {
|
||||
return new Pair(((CommentEntity) commentEntity).getId(), fragment.getArguments().getString(EntranceConsts.KEY_NEWSID));
|
||||
} else if (fragment.getArguments().getString(EntranceConsts.KEY_NEWSID) != null) {
|
||||
return new Pair(fragment.getArguments().getString(EntranceConsts.KEY_NEWSID), "");
|
||||
} else if (concernEntity != null) {
|
||||
return new Pair(((ConcernEntity) concernEntity).getId(), "");
|
||||
} else {
|
||||
|
||||
@ -329,6 +329,19 @@ open class SearchActivity : BaseActivity() {
|
||||
// MtaHelper.onEvent("游戏搜索", "主动搜索", newSearchKey)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
val newSearchKey = searchEt.text.toString().trim { it <= ' ' }
|
||||
if (newSearchKey.isBlank()) {
|
||||
try {
|
||||
popBackToFragment(SearchDefaultFragment::class.java.name)
|
||||
} catch (e: Exception) {
|
||||
// no implement
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun provideDao(): ISearchHistoryDao = SearchHistoryDao(this)
|
||||
|
||||
open fun updateDisplayType(type: DisplayType) {
|
||||
|
||||
@ -55,7 +55,7 @@ public class ShareCardActivity extends ToolBarActivity {
|
||||
bundle.putString(EntranceConsts.KEY_GAME_ICON_URL, concernEntity.getGameIcon());
|
||||
bundle.putString(EntranceConsts.KEY_SHARECONTENT, shareContent);
|
||||
if (concernEntity.getLink() == null) {
|
||||
bundle.putString(EntranceConsts.KEY_NEWS_ID, concernEntity.getId());
|
||||
bundle.putString(EntranceConsts.KEY_NEWSID, concernEntity.getId());
|
||||
}
|
||||
intent.putExtras(bundle);
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, "(资讯:关注[2-4])");
|
||||
@ -83,7 +83,7 @@ public class ShareCardActivity extends ToolBarActivity {
|
||||
gameName = extras.getString(EntranceConsts.KEY_GAMENAME);
|
||||
gameIconUrl = extras.getString(EntranceConsts.KEY_GAME_ICON_URL);
|
||||
shareContent = extras.getString(EntranceConsts.KEY_SHARECONTENT);
|
||||
newsId = extras.getString(EntranceConsts.KEY_NEWS_ID);
|
||||
newsId = extras.getString(EntranceConsts.KEY_NEWSID);
|
||||
|
||||
picName = "shareImg.jpg";
|
||||
|
||||
|
||||
@ -26,14 +26,14 @@ import com.facebook.drawee.controller.ControllerListener;
|
||||
import com.facebook.drawee.interfaces.DraweeController;
|
||||
import com.facebook.drawee.view.SimpleDraweeView;
|
||||
import com.facebook.imagepipeline.image.ImageInfo;
|
||||
import com.gh.common.util.MessageShareUtils;
|
||||
import com.gh.common.util.QRCodeUtils;
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.retrofit.ObservableUtil;
|
||||
import com.gh.gamecenter.common.utils.ImageUtils;
|
||||
import com.gh.common.util.MessageShareUtils;
|
||||
import com.gh.common.util.QRCodeUtils;
|
||||
import com.gh.gamecenter.core.utils.StringUtils;
|
||||
import com.gh.gamecenter.feature.entity.ConcernEntity;
|
||||
import com.gh.gamecenter.common.retrofit.ObservableUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -96,7 +96,7 @@ public class ShareCardPicActivity extends ToolBarActivity {
|
||||
bundle.putString(EntranceConsts.KEY_GAME_ICON_URL, concernEntity.getGameIcon());
|
||||
bundle.putString(EntranceConsts.KEY_SHARECONTENT, shareContent);
|
||||
if (concernEntity.getLink() == null) {
|
||||
bundle.putString(EntranceConsts.KEY_NEWS_ID, concernEntity.getId());
|
||||
bundle.putString(EntranceConsts.KEY_NEWSID, concernEntity.getId());
|
||||
}
|
||||
if (concernEntity.getImg() != null && concernEntity.getImg().size() > 0) {
|
||||
bundle.putStringArrayList(KEY_SHARE_ARRIMG, (ArrayList<String>) concernEntity.getImg());
|
||||
@ -121,7 +121,7 @@ public class ShareCardPicActivity extends ToolBarActivity {
|
||||
gameName = extras.getString(EntranceConsts.KEY_GAMENAME);
|
||||
gameIconUrl = extras.getString(EntranceConsts.KEY_GAME_ICON_URL);
|
||||
shareContent = extras.getString(EntranceConsts.KEY_SHARECONTENT);
|
||||
newsId = extras.getString(EntranceConsts.KEY_NEWS_ID);
|
||||
newsId = extras.getString(EntranceConsts.KEY_NEWSID);
|
||||
List<String> arrImg = extras.getStringArrayList(KEY_SHARE_ARRIMG);
|
||||
|
||||
picName = "shareImgPic.jpg";
|
||||
|
||||
@ -5,7 +5,6 @@ import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_PUSH;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ANSWER;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ARCHIVE_LOGIN;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_ARTICLE;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_CATEGORY;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COLUMN;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COLUMN_COLLECTION;
|
||||
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_COMMUNITY;
|
||||
@ -314,10 +313,7 @@ public class SkipActivity extends BaseActivity {
|
||||
String columnId = uri.getQueryParameter("column_id");
|
||||
DirectUtils.directToCommunityColumn(this, community, columnId, entrance, "");
|
||||
break;
|
||||
case HOST_CATEGORY:
|
||||
title = uri.getQueryParameter("title");
|
||||
DirectUtils.directCategoryV2(this, path, title, entrance, pathName, null);
|
||||
break;
|
||||
|
||||
case HOST_COLUMN_COLLECTION:
|
||||
DirectUtils.directToColumnCollection(this, path, -1, entrance, "", "", "", "", null,false);
|
||||
break;
|
||||
|
||||
@ -6,17 +6,17 @@ import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.entity.ToolBoxEntity
|
||||
import com.gh.gamecenter.common.utils.EnvHelper
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
import com.gh.gamecenter.feature.entity.ConcernEntity
|
||||
import com.gh.gamecenter.feature.entity.NewsEntity
|
||||
import com.gh.gamecenter.common.entity.ToolBoxEntity
|
||||
import com.halo.assistant.fragment.WebFragment
|
||||
import com.therouter.router.Route
|
||||
|
||||
@Route(path = RouteConsts.activity.webActivity)
|
||||
open class WebActivity : ToolBarActivity() {
|
||||
@ -193,7 +193,7 @@ open class WebActivity : ToolBarActivity() {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_URL, concernLink)
|
||||
bundle.putString(EntranceConsts.KEY_GAMENAME, concernGameName)
|
||||
bundle.putString(EntranceConsts.KEY_NEWS_ID, concernId)
|
||||
bundle.putString(EntranceConsts.KEY_NEWSID, concernId)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
return getTargetIntent(
|
||||
context,
|
||||
@ -208,7 +208,7 @@ open class WebActivity : ToolBarActivity() {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_URL, newsEntity.link)
|
||||
bundle.putString(EntranceConsts.KEY_GAMENAME, newsEntity.gameName)
|
||||
bundle.putString(EntranceConsts.KEY_NEWS_ID, newsEntity.id)
|
||||
bundle.putString(EntranceConsts.KEY_NEWSID, newsEntity.id)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
return getTargetIntent(
|
||||
context,
|
||||
|
||||
@ -328,7 +328,7 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
, StringUtils.buildString(mEntrance, "+(消息详情)")));
|
||||
} else {
|
||||
Intent intent = new Intent(mContext, NewsDetailActivity.class);
|
||||
intent.putExtra(EntranceConsts.KEY_NEWS_ID, mConcernEntity.getId());
|
||||
intent.putExtra(EntranceConsts.KEY_NEWSID, mConcernEntity.getId());
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, StringUtils.buildString(mEntrance, "+(消息详情)"));
|
||||
mContext.startActivity(intent);
|
||||
}
|
||||
|
||||
@ -194,6 +194,10 @@ class DetailViewHolder(
|
||||
if (mGameEntity.isLandPageAddressDialog() && !mGameEntity.isLandPageAddressDialogShowOnly()) {
|
||||
// 第三方落地页为开启状态并且展示状态不为“仅显示弹窗”,需要在点击确认后显示弹窗
|
||||
DialogUtils.showLandPageAddressDialog(mViewHolder.context, mGameEntity) {
|
||||
val packageName = mGameEntity.getApk().firstOrNull()?.packageName
|
||||
if (packageName?.isNotEmpty() == true) {
|
||||
PackageChangeHelper.addInstallPendingPackage(packageName)
|
||||
}
|
||||
DirectUtils.directToExternalBrowser(mViewHolder.context, mGameEntity.landPageAddressDialog!!.link!!)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.gh.gamecenter.authorization
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Application.ActivityLifecycleCallbacks
|
||||
import android.app.Dialog
|
||||
import android.content.Intent
|
||||
import android.os.Build
|
||||
@ -22,6 +24,7 @@ import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.login.user.UserRepository
|
||||
import com.gh.gamecenter.login.view.LoginActivity
|
||||
import com.gh.vspace.VHelper
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.utils.Utils
|
||||
|
||||
/**
|
||||
@ -139,7 +142,7 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
override fun onRestart() {
|
||||
super.onRestart()
|
||||
if (!CheckLoginUtils.isLogin()) {
|
||||
finish()
|
||||
finishAndRemoveTask()
|
||||
} else {
|
||||
initUserInfo()
|
||||
initData()
|
||||
@ -150,12 +153,12 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
private fun checkParam() {
|
||||
val uri = intent.data
|
||||
if (uri == null) {
|
||||
finish()
|
||||
finishAndRemoveTask()
|
||||
return
|
||||
}
|
||||
val host = uri.host
|
||||
if (host != "authorize") {
|
||||
finish()
|
||||
finishAndRemoveTask()
|
||||
return
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
@ -168,7 +171,7 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
gameName = uri.getQueryParameter(EntranceConsts.KEY_GAME_NAME) ?: ""
|
||||
gameUid = uri.getQueryParameter(EntranceConsts.KEY_UID)?.toIntOrNull() ?: -1
|
||||
if (mRemotePkgName == null) {
|
||||
finish()
|
||||
finishAndRemoveTask()
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -221,7 +224,7 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
val remotePkgName = mRemotePkgName
|
||||
if (remotePkgName == null) {
|
||||
logAuthResult(false)
|
||||
finish()
|
||||
finishAndRemoveTask()
|
||||
return
|
||||
}
|
||||
if (mToken.isEmpty()) {
|
||||
@ -242,13 +245,44 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
intent.putExtra(EntranceConsts.KEY_USER_NAME, username)
|
||||
intent.putExtra(EntranceConsts.KEY_USER_AVATAR, userAvatar)
|
||||
if (gameUid != -1 && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
sendBroadcastAsUser(intent, UserHandle.getUserHandleForUid(gameUid))
|
||||
try {
|
||||
sendBroadcastAsUser(intent, UserHandle.getUserHandleForUid(gameUid))
|
||||
} catch (e: Exception) {
|
||||
// 双开/分身游戏进行授权时,如果无 INTERACT_ACROSS_USERS 权限,则使用Activity传递授权结果
|
||||
authByActivity(intent)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
sendBroadcast(intent)
|
||||
}
|
||||
logAuthResult(true)
|
||||
backToLaunchApp()
|
||||
finish()
|
||||
finishAndRemoveTask()
|
||||
}
|
||||
|
||||
private fun authByActivity(intent: Intent) {
|
||||
intent.setClassName(mRemotePkgName!!, AUTHORIZATION_RESULT_ACTIVITY)
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
HaloApp.getInstance().registerActivityLifecycleCallbacks(object : ActivityLifecycleCallbacks {
|
||||
override fun onActivityCreated(activity: Activity, savedInstanceState: Bundle?) {}
|
||||
override fun onActivityStarted(activity: Activity) {}
|
||||
override fun onActivityResumed(activity: Activity) {}
|
||||
override fun onActivityPaused(activity: Activity) {}
|
||||
override fun onActivityStopped(activity: Activity) {
|
||||
if (activity == this@AuthorizationActivity) {
|
||||
HaloApp.getInstance().unregisterActivityLifecycleCallbacks(this)
|
||||
finishAndRemoveTask()
|
||||
}
|
||||
}
|
||||
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
|
||||
override fun onActivityDestroyed(activity: Activity) {
|
||||
if (activity == this@AuthorizationActivity) {
|
||||
HaloApp.getInstance().unregisterActivityLifecycleCallbacks(this)
|
||||
}
|
||||
}
|
||||
})
|
||||
startActivity(intent)
|
||||
logAuthResult(true)
|
||||
}
|
||||
|
||||
private fun logAuthResult(isSuccess: Boolean) {
|
||||
@ -277,7 +311,7 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
}
|
||||
|
||||
override fun onBackPressed() {
|
||||
super.onBackPressed()
|
||||
finishAndRemoveTask()
|
||||
|
||||
backToLaunchApp(false)
|
||||
|
||||
@ -292,6 +326,7 @@ class AuthorizationActivity : ToolBarActivity() {
|
||||
private const val BUTTON_TYPE_CONFIRM = "确定"
|
||||
private const val BUTTON_TYPE_BACK = "返回"
|
||||
private const val TYPE_PLUGIN = "plugin"
|
||||
private const val AUTHORIZATION_RESULT_ACTIVITY = "com.gh.plugin.AuthorizationResultActivity"
|
||||
}
|
||||
|
||||
}
|
||||
@ -6,30 +6,13 @@ import android.os.Bundle
|
||||
import com.gh.base.DownloadToolbarActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
/**
|
||||
* 新分类2.0
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.categoryV2Activity, description = "新分类2.0")
|
||||
class CategoryV2Activity : DownloadToolbarActivity() {
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_CATEGORY_ID, description = "分类ID", required = true)
|
||||
var categoryId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_CATEGORY_TITLE, description = "分类标题", required = true)
|
||||
var categoryTitle: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
@ -40,7 +23,7 @@ class CategoryV2Activity : DownloadToolbarActivity() {
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, CategoryV2Activity::class.java, CategoryV2Fragment::class.java, intent.extras)
|
||||
return getTargetIntent(this, CategoryV2Activity::class.java, CategoryV2Fragment::class.java)
|
||||
}
|
||||
|
||||
override fun isAutoResetViewBackgroundEnabled() = true
|
||||
@ -53,13 +36,11 @@ class CategoryV2Activity : DownloadToolbarActivity() {
|
||||
|
||||
companion object {
|
||||
fun getIntent(context: Context, catalogId: String, catalogTitle: String, entrance: String): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_CATEGORY_ID, catalogId)
|
||||
bundle.putString(EntranceConsts.KEY_CATEGORY_TITLE, catalogTitle)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_CATEGORY_ID, catalogId)
|
||||
bundle.putString(EntranceConsts.KEY_CATEGORY_TITLE, catalogTitle)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
return getTargetIntent(context, CategoryV2Activity::class.java, CategoryV2Fragment::class.java, bundle)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ import androidx.recyclerview.widget.RecyclerView
|
||||
import com.gh.common.exposure.IExposable
|
||||
import com.gh.common.util.DialogUtils
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.PackageChangeHelper
|
||||
import com.gh.common.util.PackageInstaller
|
||||
import com.gh.common.util.PackageLauncher
|
||||
import com.gh.download.DownloadManager
|
||||
@ -398,6 +399,10 @@ class UpdatableGameAdapter(private var mViewModel: UpdatableGameViewModel) :
|
||||
if (update.isLandPageAddressDialogShowOnly()) {
|
||||
updateOrPluggable(updateBtn, update, downloadEntity, pluginDesc)
|
||||
} else {
|
||||
val packageName = update.packageName
|
||||
if (packageName.isNotEmpty() == true) {
|
||||
PackageChangeHelper.addInstallPendingPackage(packageName)
|
||||
}
|
||||
DirectUtils.directToExternalBrowser(it.context, update.landPageAddressDialog!!.link!!)
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,6 +76,7 @@ import com.gh.gamecenter.eventbus.EBTopCommunityChanged
|
||||
import com.gh.gamecenter.eventbus.EBTypeChange
|
||||
import com.gh.gamecenter.feature.entity.AnswerEntity
|
||||
import com.gh.gamecenter.feature.entity.ForumVideoEntity
|
||||
import com.gh.gamecenter.feature.entity.GameEntity
|
||||
import com.gh.gamecenter.feature.entity.UserEntity
|
||||
import com.gh.gamecenter.forum.home.CommunityHomeFragment
|
||||
import com.gh.gamecenter.forum.moderator.ApplyModeratorActivity
|
||||
|
||||
@ -19,6 +19,7 @@ import androidx.lifecycle.Observer
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.RecyclerView.OnScrollListener
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.common.util.CheckLoginUtils
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
@ -53,7 +54,6 @@ import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.login.user.UserViewModel
|
||||
import com.gh.gamecenter.newsdetail.NewsShareDialog
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
import com.therouter.TheRouter
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
@ -309,7 +309,7 @@ class FollowHomeFragment : LazyFragment(), IScrollable {
|
||||
|
||||
newDetailDestination.observe(viewLifecycleOwner, EventObserver {
|
||||
TheRouter.build(RouteConsts.activity.newsDetailActivity)
|
||||
.withString(EntranceConsts.KEY_NEWS_ID, it)
|
||||
.withString(EntranceConsts.KEY_NEWSID, it)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "")
|
||||
.navigation(requireActivity())
|
||||
})
|
||||
|
||||
@ -4,41 +4,13 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
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.updateStatusBarColor
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
/**
|
||||
* 游戏专题合集详情页
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.columnCollectionDetailActivity, description = "专题合集详情")
|
||||
class ColumnCollectionDetailActivity : ToolBarActivity() {
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COLLECTION_ID, description = "合集ID", required = true)
|
||||
var collectionId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COLUMN_NAME, description = "专题名", required = true)
|
||||
var columnName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_BLOCK_ID, description = "板块ID")
|
||||
var blockId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_BLOCK_NAME, description = "板块名称")
|
||||
var blockName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COLUMN_COLLECTION_STYLE, description = "专题合集样式")
|
||||
var columnCollectionStyle: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
@ -60,6 +32,13 @@ class ColumnCollectionDetailActivity : ToolBarActivity() {
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
}
|
||||
|
||||
override fun getBusinessId(): Pair<String, String> = Pair(collectionId ?: "", "")
|
||||
override fun getBusinessId(): Pair<String, String> {
|
||||
val fragment = targetFragment as? ColumnCollectionDetailFragment?
|
||||
return if (fragment?.arguments != null) {
|
||||
Pair(fragment.requireArguments().getString(EntranceConsts.KEY_COLLECTION_ID) ?: "", "")
|
||||
} else {
|
||||
super.getBusinessId()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -86,6 +86,7 @@ import com.gh.gamecenter.home.video.ScrollCalculatorHelper
|
||||
import com.gh.gamecenter.login.user.UserViewModel
|
||||
import com.gh.gamecenter.newsdetail.NewsDetailActivity
|
||||
import com.gh.gamecenter.packagehelper.PackageViewModel
|
||||
import com.gh.gamecenter.SearchActivity
|
||||
import com.gh.gamecenter.simulatorgame.SimulatorGameActivity
|
||||
import com.gh.gamecenter.tag.TagsActivity
|
||||
import com.gh.gamecenter.video.detail.CustomManager
|
||||
|
||||
@ -239,7 +239,7 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable {
|
||||
viewModel.loadFirst(false)
|
||||
}
|
||||
}
|
||||
binding.reuseNoConnectionStub.inflate()
|
||||
binding.reuseNoConnectionStub.inflateOrShow()
|
||||
} else {
|
||||
noConnectionBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
@ -249,7 +249,7 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable {
|
||||
noDataBinding = ReuseNoneDataBinding.bind(inflated)
|
||||
noDataBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
binding.reuseNoDataStub.inflate()
|
||||
binding.reuseNoDataStub.inflateOrShow()
|
||||
} else {
|
||||
noDataBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
@ -304,7 +304,7 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable {
|
||||
}
|
||||
initSearchBar(it)
|
||||
}
|
||||
binding.reuseSearchBarStub.inflate()
|
||||
binding.reuseSearchBarStub.inflateOrShow()
|
||||
} else {
|
||||
initSearchBar(it)
|
||||
}
|
||||
|
||||
@ -53,6 +53,7 @@ class CustomHomeSlideListItemViewHolder(val binding: HomeSlideListItemCustomBind
|
||||
ImageUtils.displayWithCallback(
|
||||
binding.slideBackground,
|
||||
homeSlide.image,
|
||||
false,
|
||||
object : BaseControllerListener<ImageInfo>() {
|
||||
override fun onFinalImageSet(id: String?, imageInfo: ImageInfo?, animatable: Animatable?) {
|
||||
binding.bottomGradient.visibility = View.VISIBLE
|
||||
|
||||
@ -67,6 +67,7 @@ class CustomHomeSubSlideListItemViewHolder(val binding: HomeSubSlideListItemCust
|
||||
ImageUtils.displayWithCallback(
|
||||
binding.slideBackground,
|
||||
homeSlide.image,
|
||||
false,
|
||||
object : BaseControllerListener<ImageInfo>() {
|
||||
override fun onFinalImageSet(id: String?, imageInfo: ImageInfo?, animatable: Animatable?) {
|
||||
if (homeSlide.placeholderColor.isNotEmpty() && homeSlide.linkGame != null) {
|
||||
|
||||
@ -19,8 +19,9 @@ import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder;
|
||||
import com.gh.gamecenter.common.callback.OnRequestCallBackListener;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.common.utils.DialogHelper;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.utils.SensorsBridge;
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.view.BugFixedPopupWindow;
|
||||
import com.gh.gamecenter.common.viewholder.FooterViewHolder;
|
||||
import com.gh.gamecenter.core.utils.TimeUtils;
|
||||
@ -31,7 +32,6 @@ import com.gh.gamecenter.feature.entity.LibaoStatusEntity;
|
||||
import com.gh.gamecenter.feature.entity.MeEntity;
|
||||
import com.gh.gamecenter.feature.entity.UserDataLibaoEntity;
|
||||
import com.gh.gamecenter.feature.game.GameItemViewHolder;
|
||||
import com.gh.gamecenter.feature.utils.PlatformUtils;
|
||||
import com.gh.gamecenter.login.user.UserManager;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter;
|
||||
|
||||
@ -6,16 +6,13 @@ import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.therouter.router.Route;
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.feature.entity.LibaoEntity;
|
||||
import com.halo.assistant.HaloApp;
|
||||
import com.therouter.TheRouter;
|
||||
import com.therouter.router.Autowired;
|
||||
import com.therouter.router.Navigator;
|
||||
import com.therouter.router.Route;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
@ -23,27 +20,19 @@ import kotlin.Pair;
|
||||
* Created by khy on 2016/12/13.
|
||||
* 礼包详情
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.libaoDetailActivity, description = "礼包详情")
|
||||
@Route(path = RouteConsts.activity.libaoDetailActivity)
|
||||
public class LibaoDetailActivity extends ToolBarActivity {
|
||||
@Autowired(name = EntranceConsts.KEY_LIBAO_ID, description = "礼包ID", required = true)
|
||||
public String libaoId;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
public String entrance;
|
||||
@Override
|
||||
protected Intent provideNormalIntent() {
|
||||
return getTargetIntent(this, LibaoDetailActivity.class, LibaoDetailFragment.class, getIntent().getExtras());
|
||||
}
|
||||
|
||||
public static Intent getIntent(Context context, LibaoEntity libaoEntity, boolean isClickReceiveBtnIn, String entrance) {
|
||||
Navigator navigator = TheRouter.build(RouteConsts.activity.libaoDetailActivity)
|
||||
.fillParams(bundle -> {
|
||||
HaloApp.put(EntranceConsts.KEY_LIBAO_ENTITY, libaoEntity);
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putBoolean(EntranceConsts.KEY_IS_CLICK_RECEIVE_BTN, isClickReceiveBtnIn);
|
||||
return null;
|
||||
});
|
||||
return navigator.createIntent(context);
|
||||
Bundle bundle = new Bundle();
|
||||
HaloApp.put(LibaoEntity.TAG, libaoEntity);
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putBoolean(EntranceConsts.KEY_IS_CLICK_RECEIVE_BTN, isClickReceiveBtnIn);
|
||||
return getTargetIntent(context, LibaoDetailActivity.class, LibaoDetailFragment.class, bundle);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@ -53,19 +42,14 @@ public class LibaoDetailActivity extends ToolBarActivity {
|
||||
|
||||
@NonNull
|
||||
public static Intent getIntentById(Context context, String id, String entrance) {
|
||||
Navigator navigator = TheRouter.build(RouteConsts.activity.libaoDetailActivity)
|
||||
.fillParams(bundle -> {
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putString(EntranceConsts.KEY_LIBAO_ID, id);
|
||||
return null;
|
||||
});
|
||||
return navigator.createIntent(context);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putString(EntranceConsts.KEY_ID, id);
|
||||
return getTargetIntent(context, LibaoDetailActivity.class, LibaoDetailFragment.class, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
TheRouter.inject(this);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
ExtensionsKt.updateStatusBarColor(this, com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface);
|
||||
}
|
||||
@ -83,9 +67,9 @@ public class LibaoDetailActivity extends ToolBarActivity {
|
||||
libaoEntity = ((LibaoDetailFragment) getTargetFragment()).getLibaoEntity();
|
||||
}
|
||||
if (libaoEntity != null) {
|
||||
return new Pair<>(libaoEntity.getId(), "");
|
||||
} else if (libaoId != null) {
|
||||
return new Pair<>(libaoId, "");
|
||||
return new Pair(libaoEntity.getId(), "");
|
||||
} else if (getIntent().getStringExtra(EntranceConsts.KEY_ID) != null) {
|
||||
return new Pair(getIntent().getStringExtra(EntranceConsts.KEY_ID), "");
|
||||
} else {
|
||||
return super.getBusinessId();
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ public class LibaoDetailFragment extends ToolbarFragment implements LibaoDetailA
|
||||
@Override
|
||||
public void onSaveInstanceState(@NonNull Bundle outState) {
|
||||
super.onSaveInstanceState(outState);
|
||||
HaloApp.put(EntranceConsts.KEY_LIBAO_ENTITY, mAdapter.getLibaoEntity());
|
||||
HaloApp.put(LibaoEntity.TAG, mAdapter.getLibaoEntity());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -178,7 +178,7 @@ public class LibaoDetailFragment extends ToolbarFragment implements LibaoDetailA
|
||||
|
||||
mName = getString(R.string.libao_detail);
|
||||
setNavigationTitle(mName);
|
||||
mLibaoEntity = (LibaoEntity) HaloApp.get(EntranceConsts.KEY_LIBAO_ENTITY, false);
|
||||
mLibaoEntity = (LibaoEntity) HaloApp.get(LibaoEntity.TAG, false);
|
||||
isClickReceiveBtnIn = requireArguments().getBoolean(EntranceConsts.KEY_IS_CLICK_RECEIVE_BTN, false);
|
||||
if (mLibaoEntity != null) {
|
||||
mLibaoEntity.setClickReceiveBtnIn(isClickReceiveBtnIn);
|
||||
@ -204,7 +204,7 @@ public class LibaoDetailFragment extends ToolbarFragment implements LibaoDetailA
|
||||
});
|
||||
|
||||
if (mLibaoEntity == null) {
|
||||
String id = requireArguments().getString(EntranceConsts.KEY_LIBAO_ID);
|
||||
String id = requireArguments().getString(EntranceConsts.KEY_ID);
|
||||
if (!TextUtils.isEmpty(id)) {
|
||||
getLibaoDigest(id);
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ public class MessageDetailFragment extends ToolbarFragment implements OnCommentC
|
||||
mConcernEntity = (ConcernEntity) HaloApp.get(ConcernEntity.TAG, true);
|
||||
mCommentEntity = args.getParcelable(CommentEntity.TAG);
|
||||
|
||||
newsId = args.getString(EntranceConsts.KEY_NEWS_ID);
|
||||
newsId = args.getString(EntranceConsts.KEY_NEWSID);
|
||||
commentNum = args.getInt("commentNum", -1);
|
||||
|
||||
//复用问题 mConcernEntity对应的文章有可能和跳转之前的文章不一致
|
||||
|
||||
@ -7,6 +7,7 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.therouter.router.Route;
|
||||
import com.gh.base.DownloadToolbarActivity;
|
||||
import com.gh.gamecenter.WebActivity;
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts;
|
||||
@ -14,10 +15,6 @@ import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.core.utils.MtaHelper;
|
||||
import com.gh.gamecenter.feature.entity.NewsEntity;
|
||||
import com.therouter.TheRouter;
|
||||
import com.therouter.router.Autowired;
|
||||
import com.therouter.router.Navigator;
|
||||
import com.therouter.router.Route;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
@ -27,21 +24,9 @@ import kotlin.Pair;
|
||||
*
|
||||
* @author 黄壮华
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.newsDetailActivity, description = "新闻详情")
|
||||
@Route(path = RouteConsts.activity.newsDetailActivity)
|
||||
public class NewsDetailActivity extends DownloadToolbarActivity {
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_NEWS_ID, description = "新闻ID", required = true)
|
||||
public String newsId;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_NEWS_ENTITY, description = "新闻实体,如果你不懂这个是什么,那么不要用它,直接传入新闻ID即可")
|
||||
public NewsEntity newsEntity;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
public String entrance;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_IS_COLLECTION_NEWS, description = "是否收藏的文章")
|
||||
public boolean isCollectionNews;
|
||||
|
||||
/**
|
||||
* 启动新闻详情页面
|
||||
*/
|
||||
@ -50,14 +35,12 @@ public class NewsDetailActivity extends DownloadToolbarActivity {
|
||||
if (newsEntity != null && !TextUtils.isEmpty(newsEntity.getLink())) {
|
||||
context.startActivity(WebActivity.getIntentByNews(context, newsEntity, entrance));
|
||||
} else {
|
||||
TheRouter
|
||||
.build(RouteConsts.activity.newsDetailActivity)
|
||||
.fillParams(bundle -> {
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putParcelable(EntranceConsts.KEY_NEWS_ENTITY, newsEntity);
|
||||
return null;
|
||||
})
|
||||
.navigation(context);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putParcelable(NewsEntity.TAG, newsEntity);
|
||||
Intent intent = getTargetIntent(context, NewsDetailActivity.class, NewsDetailFragment.class, bundle);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,40 +53,32 @@ public class NewsDetailActivity extends DownloadToolbarActivity {
|
||||
Intent intent = WebActivity.getIntentByNews(context, newsEntity, entrance);
|
||||
context.startActivity(intent);
|
||||
} else {
|
||||
TheRouter
|
||||
.build(RouteConsts.activity.newsDetailActivity)
|
||||
.fillParams(bundle -> {
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putParcelable(EntranceConsts.KEY_NEWS_ENTITY, newsEntity);
|
||||
bundle.putBoolean(EntranceConsts.KEY_IS_COLLECTION_NEWS, true);
|
||||
return null;
|
||||
})
|
||||
.navigation(context);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putParcelable(NewsEntity.TAG, newsEntity);
|
||||
bundle.putBoolean(NewsDetailFragment.KEY_COLLECTIONNEWS, true);
|
||||
Intent intent = getTargetIntent(context, NewsDetailActivity.class, NewsDetailFragment.class, bundle);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Intent getIntentById(Context context, String newsId, boolean isCollectionNews, String entrance) {
|
||||
Navigator navigator = TheRouter.build(RouteConsts.activity.libaoDetailActivity)
|
||||
.fillParams(bundle -> {
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putBoolean(EntranceConsts.KEY_IS_COLLECTION_NEWS, isCollectionNews);
|
||||
bundle.putString(EntranceConsts.KEY_NEWS_ID, newsId);
|
||||
return null;
|
||||
});
|
||||
return navigator.createIntent(context);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putBoolean(NewsDetailFragment.KEY_COLLECTIONNEWS, isCollectionNews);
|
||||
bundle.putString(EntranceConsts.KEY_NEWSID, newsId);
|
||||
return getTargetIntent(context, NewsDetailActivity.class, NewsDetailFragment.class, bundle);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Intent getIntentById(Context context, String newsId, String entrance) {
|
||||
Navigator navigator = TheRouter.build(RouteConsts.activity.libaoDetailActivity)
|
||||
.fillParams(bundle -> {
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putString(EntranceConsts.KEY_NEWS_ID, newsId);
|
||||
return null;
|
||||
});
|
||||
return navigator.createIntent(context);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance);
|
||||
bundle.putString(EntranceConsts.KEY_NEWSID, newsId);
|
||||
return getTargetIntent(context, NewsDetailActivity.class, NewsDetailFragment.class, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -113,8 +88,6 @@ public class NewsDetailActivity extends DownloadToolbarActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
TheRouter.inject(this);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
ExtensionsKt.updateStatusBarColor(this, com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface);
|
||||
}
|
||||
@ -132,10 +105,15 @@ public class NewsDetailActivity extends DownloadToolbarActivity {
|
||||
|
||||
@Override
|
||||
public Pair<String, String> getBusinessId() {
|
||||
if (newsId != null) {
|
||||
return new Pair<>(newsId, "");
|
||||
NewsEntity newsEntity = null;
|
||||
Bundle bundle = getIntent().getBundleExtra(NORMAL_FRAGMENT_BUNDLE);
|
||||
if (bundle != null) {
|
||||
newsEntity = bundle.getParcelable(NewsEntity.TAG);
|
||||
}
|
||||
if (getIntent().getStringExtra(EntranceConsts.KEY_NEWSID) != null) {
|
||||
return new Pair(getIntent().getStringExtra(EntranceConsts.KEY_NEWSID), "");
|
||||
} else if (newsEntity != null) {
|
||||
return new Pair<>(newsEntity.getId(), "");
|
||||
return new Pair(newsEntity.getId(), "");
|
||||
} else {
|
||||
return super.getBusinessId();
|
||||
}
|
||||
|
||||
@ -99,6 +99,8 @@ public class NewsDetailFragment extends ToolbarFragment {
|
||||
|
||||
private NewsDetailAdapter adapter;
|
||||
|
||||
public static final String KEY_COLLECTIONNEWS = "isCollectionNews";
|
||||
|
||||
private boolean isSentReport = false;
|
||||
private boolean isSecondDown = false;
|
||||
private boolean mIsCollectionNews;
|
||||
@ -257,11 +259,11 @@ public class NewsDetailFragment extends ToolbarFragment {
|
||||
adapter = new NewsDetailAdapter(requireContext(), this, mHideUselessInfo, mEntrance);
|
||||
mDetailRv.setAdapter(adapter);
|
||||
|
||||
newsId = requireArguments().getString(EntranceConsts.KEY_NEWS_ID);
|
||||
mIsCollectionNews = requireArguments().getBoolean(EntranceConsts.KEY_IS_COLLECTION_NEWS, false);
|
||||
newsId = requireArguments().getString(EntranceConsts.KEY_NEWSID);
|
||||
mIsCollectionNews = requireArguments().getBoolean(KEY_COLLECTIONNEWS, false);
|
||||
|
||||
if (newsId == null) {
|
||||
mNewsEntity = requireArguments().getParcelable(EntranceConsts.KEY_NEWS_ENTITY);
|
||||
mNewsEntity = requireArguments().getParcelable(NewsEntity.TAG);
|
||||
if (mNewsEntity != null) {
|
||||
if (mNewsEntity.getType() != null) {
|
||||
setNavigationTitle(mNewsEntity.getType());
|
||||
|
||||
@ -35,17 +35,21 @@ class PackageFilterManager {
|
||||
|
||||
if (appendOnly) {
|
||||
// 添加因为异常而没能正常更新的包名列表
|
||||
finalPackageList.addAll(PackageRepository.mPendingPackageNameSet)
|
||||
synchronized(PackageRepository.mPendingPackageNameSet) {
|
||||
finalPackageList.addAll(PackageRepository.mPendingPackageNameSet)
|
||||
}
|
||||
}
|
||||
|
||||
RetrofitManager.getInstance()
|
||||
.newApi
|
||||
.postInstalledAppList(packageList.toRequestBody())
|
||||
.postInstalledAppList(finalPackageList.toRequestBody())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(object : BiResponse<PackageFilter>() {
|
||||
override fun onSuccess(data: PackageFilter) {
|
||||
mPackageKey = data.key
|
||||
PackageRepository.mPendingPackageNameSet.clear()
|
||||
synchronized(PackageRepository.mPendingPackageNameSet) {
|
||||
PackageRepository.mPendingPackageNameSet.removeAll(finalPackageList)
|
||||
}
|
||||
|
||||
val partialPackageList = arrayListOf<String>()
|
||||
|
||||
@ -78,7 +82,9 @@ class PackageFilterManager {
|
||||
super.onFailure(exception)
|
||||
|
||||
if (appendOnly) {
|
||||
PackageRepository.mPendingPackageNameSet.addAll(packageList)
|
||||
synchronized(PackageRepository.mPendingPackageNameSet) {
|
||||
PackageRepository.mPendingPackageNameSet.addAll(finalPackageList)
|
||||
}
|
||||
} else {
|
||||
if (exception is retrofit2.HttpException && exception.code() == 403) {
|
||||
// 403 代表 key 过期,需要重新获取
|
||||
|
||||
@ -85,7 +85,7 @@ object PackageRepository {
|
||||
_recentVaPlayedChanged.postValue(Unit)
|
||||
}
|
||||
val packageFilterManager = PackageFilterManager()
|
||||
var mPendingPackageNameSet = hashSetOf<String>() // 因遇到异常而等待下次操作更新的包名列表
|
||||
var mPendingPackageNameSet = Collections.synchronizedSet<String>(hashSetOf<String>()) // 因遇到异常而等待下次操作更新的包名列表
|
||||
var mValidPackageNameSet = hashSetOf<String>() // 已被收录的游戏包名列表
|
||||
|
||||
|
||||
|
||||
@ -701,7 +701,7 @@ class HaloPersonalFragment : BaseLazyFragment() {
|
||||
}
|
||||
|
||||
private fun inflateRealView() {
|
||||
mBinding.stub.inflate()
|
||||
mBinding.stub.inflateOrShow()
|
||||
|
||||
mStubBinding.statusBar.goneIf(Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP)
|
||||
mStubBinding.darkModeIv.goneIf(!(Config.getNightModeSetting()?.icon ?: false))
|
||||
|
||||
@ -10,6 +10,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
import com.gh.gamecenter.MainActivity
|
||||
import com.gh.gamecenter.common.entity.LinkEntity
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse
|
||||
import com.gh.gamecenter.common.retrofit.Response
|
||||
@ -18,15 +19,18 @@ import com.gh.gamecenter.entity.AddonLinkEntity
|
||||
import com.gh.gamecenter.entity.AppEntity
|
||||
import com.gh.gamecenter.entity.HaloAddonEntity
|
||||
import com.gh.gamecenter.entity.SignEntity
|
||||
import com.gh.gamecenter.eventbus.EBSkip
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.newsdetail.NewsDetailActivity
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.gh.gamecenter.subject.SubjectActivity
|
||||
import com.gh.gamecenter.wrapper.MainWrapperFragment
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.utils.Utils
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import okhttp3.ResponseBody
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import retrofit2.HttpException
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
@ -3,28 +3,15 @@ package com.gh.gamecenter.qa.answer.detail
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
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.common.utils.updateStatusBarColor
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
@Route(path = RouteConsts.activity.answerDetailActivity, description = "回答详情")
|
||||
/**
|
||||
* 回答详情
|
||||
*/
|
||||
class SimpleAnswerDetailActivity : ToolBarActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ANSWER_ID, description = "回答ID", required = true)
|
||||
var answerId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String? = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
@ -35,8 +22,7 @@ class SimpleAnswerDetailActivity : ToolBarActivity() {
|
||||
return getTargetIntent(
|
||||
this,
|
||||
SimpleAnswerDetailActivity::class.java,
|
||||
SimpleAnswerDetailFragment::class.java,
|
||||
intent.extras
|
||||
SimpleAnswerDetailFragment::class.java
|
||||
)
|
||||
}
|
||||
|
||||
@ -50,13 +36,16 @@ class SimpleAnswerDetailActivity : ToolBarActivity() {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getIntent(context: Context, answerId: String, entrance: String, path: String): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.answerDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_ANSWER_ID, answerId)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_ANSWER_ID, answerId)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
return getTargetIntent(
|
||||
context,
|
||||
SimpleAnswerDetailActivity::class.java,
|
||||
SimpleAnswerDetailFragment::class.java,
|
||||
bundle
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,66 +2,32 @@ package com.gh.gamecenter.qa.article.detail
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.therouter.router.Route
|
||||
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.entity.CommunityEntity
|
||||
import com.gh.gamecenter.entity.SpecialColumn
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
@Route(path = RouteConsts.activity.articleDetailActivity, description = "帖子详情")
|
||||
/**
|
||||
* 帖子详情
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.articleDetailActivity)
|
||||
class ArticleDetailActivity : ToolBarActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COMMUNITY_DATA, description = "论坛实体,如果你不懂这个是什么,那么不要用它,直接传入论坛ID和文章ID即可")
|
||||
var communityEntity: CommunityEntity? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COMMUNITY_ID, description = "论坛ID")
|
||||
var communityId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, description = "文章ID", required = true)
|
||||
var articleId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SOURCE_ENTRANCE, description = "入口埋点字段")
|
||||
var sourceEntrance: String? = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
if (communityEntity == null && communityId != null) {
|
||||
communityEntity = CommunityEntity(id = communityId ?: "").also {
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_DATA, it)
|
||||
}
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun getLayoutId() = R.layout.activity_amway
|
||||
|
||||
override fun getFragmentPlaceholderId() = R.id.placeholder
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, ArticleDetailActivity::class.java, ArticleDetailFragment::class.java, intent.extras)
|
||||
return getTargetIntent(this, ArticleDetailActivity::class.java, ArticleDetailFragment::class.java)
|
||||
}
|
||||
|
||||
override fun getBusinessId(): Pair<String, String> {
|
||||
return Pair(
|
||||
articleId ?: "",
|
||||
communityEntity?.id ?: ""
|
||||
targetFragment.arguments?.getString(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID) ?: "",
|
||||
targetFragment.arguments?.getParcelable<CommunityEntity>(EntranceConsts.KEY_COMMUNITY_DATA)?.id ?: ""
|
||||
)
|
||||
}
|
||||
|
||||
@ -80,16 +46,14 @@ class ArticleDetailActivity : ToolBarActivity() {
|
||||
specialColumn: SpecialColumn? = null,
|
||||
sourceEntrance: String = "",
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
bundle.putString(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
bundle.putParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
bundle.putParcelable(EntranceConsts.KEY_DATA, specialColumn)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, ArticleDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_DATA, specialColumn)
|
||||
return intent
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,16 +68,14 @@ class ArticleDetailActivity : ToolBarActivity() {
|
||||
path: String,
|
||||
sourceEntrance: String = "",
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
bundle.putParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
bundle.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, ArticleDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
intent.putExtra(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
return intent
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -126,16 +88,14 @@ class ArticleDetailActivity : ToolBarActivity() {
|
||||
path: String,
|
||||
sourceEntrance: String = "",
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
bundle.putString(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
bundle.putString(EntranceConsts.KEY_RECOMMEND_ID, recommendId)
|
||||
bundle.putParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, ArticleDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
intent.putExtra(EntranceConsts.KEY_RECOMMEND_ID, recommendId)
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
return intent
|
||||
}
|
||||
|
||||
/**
|
||||
@ -151,17 +111,15 @@ class ArticleDetailActivity : ToolBarActivity() {
|
||||
path: String,
|
||||
sourceEntrance: String = "",
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
bundle.putString(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
bundle.putParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
bundle.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
bundle.putString(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
bundle.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, ArticleDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_ARTICLE_ID, articleId)
|
||||
intent.putExtra(EntranceConsts.KEY_COMMUNITY_DATA, community)
|
||||
intent.putExtra(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
intent.putExtra(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
return intent
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,50 +2,30 @@ package com.gh.gamecenter.qa.questions.newdetail
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.therouter.router.Route
|
||||
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.entity.CommunityEntity
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
@Route(path = RouteConsts.activity.questionDetailActivity, description = "提问详情")
|
||||
/**
|
||||
* 提问详情
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.questionDetailActivity)
|
||||
class NewQuestionDetailActivity : ToolBarActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_QUESTIONS_ID, description = "提问ID", required = true)
|
||||
var questionId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SOURCE_ENTRANCE, description = "入口埋点字段")
|
||||
var sourceEntrance: String? = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun getLayoutId() = R.layout.activity_amway
|
||||
|
||||
override fun getFragmentPlaceholderId() = R.id.placeholder
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, NewQuestionDetailActivity::class.java, NewQuestionDetailFragment::class.java, intent.extras)
|
||||
return getTargetIntent(this, NewQuestionDetailActivity::class.java, NewQuestionDetailFragment::class.java)
|
||||
}
|
||||
|
||||
override fun getBusinessId(): Pair<String, String> {
|
||||
return Pair(
|
||||
questionId ?: "",
|
||||
targetFragment.arguments?.getString(EntranceConsts.KEY_QUESTIONS_ID) ?: "",
|
||||
targetFragment.arguments?.getParcelable<CommunityEntity>(EntranceConsts.KEY_COMMUNITY_DATA)?.id
|
||||
?: ""
|
||||
)
|
||||
@ -62,14 +42,12 @@ class NewQuestionDetailActivity : ToolBarActivity() {
|
||||
path: String,
|
||||
sourceEntrance: String = "",
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.questionDetailActivity)
|
||||
.fillParams {
|
||||
it.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
it.putString(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
it.putString(EntranceConsts.KEY_PATH, path)
|
||||
it.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, NewQuestionDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
return intent
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,15 +61,13 @@ class NewQuestionDetailActivity : ToolBarActivity() {
|
||||
path: String,
|
||||
sourceEntrance: String = ""
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.questionDetailActivity)
|
||||
.fillParams {
|
||||
it.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
it.putString(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
it.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
it.putString(EntranceConsts.KEY_PATH, path)
|
||||
it.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, NewQuestionDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
intent.putExtra(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
return intent
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -103,16 +79,14 @@ class NewQuestionDetailActivity : ToolBarActivity() {
|
||||
path: String,
|
||||
sourceEntrance: String = ""
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.questionDetailActivity)
|
||||
.fillParams {
|
||||
it.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
it.putString(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
it.putString(EntranceConsts.KEY_ANSWER_ID, answerId)
|
||||
it.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
it.putString(EntranceConsts.KEY_PATH, path)
|
||||
it.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, NewQuestionDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
intent.putExtra(EntranceConsts.KEY_ANSWER_ID, answerId)
|
||||
intent.putExtra(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
return intent
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -126,17 +100,15 @@ class NewQuestionDetailActivity : ToolBarActivity() {
|
||||
scrollToComment: Boolean = false,
|
||||
sourceEntrance: String = "",
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.questionDetailActivity)
|
||||
.fillParams {
|
||||
it.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
it.putString(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
it.putString(EntranceConsts.KEY_ANSWER_ID, answerId)
|
||||
it.putString(EntranceConsts.KEY_RECOMMEND_ID, recommendId)
|
||||
it.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, scrollToComment)
|
||||
it.putString(EntranceConsts.KEY_PATH, path)
|
||||
it.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, NewQuestionDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
intent.putExtra(EntranceConsts.KEY_ANSWER_ID, answerId)
|
||||
intent.putExtra(EntranceConsts.KEY_RECOMMEND_ID, recommendId)
|
||||
intent.putExtra(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, scrollToComment)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
return intent
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -148,16 +120,14 @@ class NewQuestionDetailActivity : ToolBarActivity() {
|
||||
path: String,
|
||||
sourceEntrance: String = ""
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.questionDetailActivity)
|
||||
.fillParams {
|
||||
it.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
it.putString(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
it.putString(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
|
||||
it.putBoolean(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
it.putString(EntranceConsts.KEY_PATH, path)
|
||||
it.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, NewQuestionDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_QUESTIONS_ID, questionId)
|
||||
intent.putExtra(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
|
||||
intent.putExtra(EntranceConsts.KEY_SCROLL_TO_COMMENT_AREA, true)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
return intent
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,47 +2,29 @@ package com.gh.gamecenter.qa.subject;
|
||||
|
||||
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.EntranceConsts;
|
||||
import com.gh.gamecenter.common.constant.RouteConsts;
|
||||
import com.gh.gamecenter.common.entity.CommunityEntity;
|
||||
import com.therouter.TheRouter;
|
||||
import com.therouter.router.Autowired;
|
||||
import com.therouter.router.Navigator;
|
||||
import com.therouter.router.Route;
|
||||
|
||||
/**
|
||||
* Created by khy on 10/04/18.
|
||||
* 社区专题
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.communitySubjectActivity, description = "社区专题")
|
||||
|
||||
public class CommunitySubjectActivity extends ToolBarActivity {
|
||||
@Autowired(name = EntranceConsts.KEY_COLUMN_ID, description = "专题ID", required = true)
|
||||
public String columnId;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_COMMUNITY_DATA, description = "论坛实体,如果你不懂这个是什么,那么不要用它,直接传入论坛ID和文章ID即可")
|
||||
public CommunityEntity communityEntity;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
public String entrance;
|
||||
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
public String path;
|
||||
|
||||
public static Intent getIntent(Context context, CommunityEntity community, String subjectId, String entrance, String path) {
|
||||
Navigator navigator = TheRouter.build(RouteConsts.activity.communitySubjectActivity)
|
||||
.fillParams(bundle -> {
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path));
|
||||
bundle.putString(EntranceConsts.KEY_COLUMN_ID, subjectId);
|
||||
bundle.putParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community);
|
||||
return null;
|
||||
});
|
||||
return navigator.createIntent(context);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path));
|
||||
bundle.putString(EntranceConsts.KEY_COLUMN_ID, subjectId);
|
||||
bundle.putParcelable(EntranceConsts.KEY_COMMUNITY_DATA, community);
|
||||
return getTargetIntent(context, CommunitySubjectActivity.class, AskSubjectFragment.class, bundle);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Intent provideNormalIntent() {
|
||||
return getTargetIntent(this, CommunitySubjectActivity.class, AskSubjectFragment.class, getIntent().getExtras());
|
||||
return getTargetIntent(this, CommunitySubjectActivity.class, AskSubjectFragment.class);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,37 +5,19 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout.PAGE_INDEX
|
||||
import com.gh.gamecenter.common.base.fragment.ToolbarFragment
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
/**
|
||||
* 视频贴详情
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.forumVideoDetailActivity, description = "视频贴详情")
|
||||
@Route(path = RouteConsts.activity.forumVideoDetailActivity)
|
||||
class ForumVideoDetailActivity : BaseActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_VIDEO_ID, description = "视频ID", required = true)
|
||||
var videoId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SOURCE_ENTRANCE, description = "入口埋点字段")
|
||||
var sourceEntrance: String? = ""
|
||||
|
||||
var containerFragment: Fragment? = null
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@ -43,8 +25,6 @@ class ForumVideoDetailActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
containerFragment = supportFragmentManager.findFragmentByTag(ForumVideoDetailFragment::class.java.name)
|
||||
@ -66,7 +46,13 @@ class ForumVideoDetailActivity : BaseActivity() {
|
||||
|
||||
override fun isAutoResetViewBackgroundEnabled(): Boolean = true
|
||||
|
||||
override fun getBusinessId(): Pair<String, String> = Pair(videoId ?: "", "")
|
||||
override fun getBusinessId(): Pair<String, String> {
|
||||
return if (containerFragment?.arguments != null) {
|
||||
Pair(containerFragment?.requireArguments()?.getString(EntranceConsts.KEY_VIDEO_ID) ?: "", "")
|
||||
} else {
|
||||
super.getBusinessId()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val VIDEO_PATCH_REQUEST = 100
|
||||
@ -117,18 +103,16 @@ class ForumVideoDetailActivity : BaseActivity() {
|
||||
scrollToComment: Boolean = false,
|
||||
sourceEntrance: String = ""
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_VIDEO_ID, videoId)
|
||||
bundle.putString(EntranceConsts.KEY_BBS_ID, bbsId)
|
||||
bundle.putString(EntranceConsts.KEY_RECOMMEND_ID, recommendId)
|
||||
bundle.putString(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
|
||||
bundle.putString(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
if (scrollToComment) {
|
||||
bundle.putInt(PAGE_INDEX, 1)
|
||||
}
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, ForumVideoDetailActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_VIDEO_ID, videoId)
|
||||
intent.putExtra(EntranceConsts.KEY_BBS_ID, bbsId)
|
||||
intent.putExtra(EntranceConsts.KEY_RECOMMEND_ID, recommendId)
|
||||
intent.putExtra(EntranceConsts.KEY_TOP_COMMENT_ID, topCommentId)
|
||||
intent.putExtra(EntranceConsts.KEY_SOURCE_ENTRANCE, sourceEntrance)
|
||||
if (scrollToComment) {
|
||||
intent.putExtra(PAGE_INDEX, 1)
|
||||
}
|
||||
return intent
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,51 +8,22 @@ import com.gh.base.DownloadToolbarActivity
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.exposure.ExposureSource
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
import com.gh.gamecenter.core.utils.MtaHelper
|
||||
import com.gh.gamecenter.entity.SubjectData
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
@Route(path = RouteConsts.activity.subjectActivity, description = "专题详情")
|
||||
/**
|
||||
* 专题详情
|
||||
*/
|
||||
open class SubjectActivity : DownloadToolbarActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SUBJECT_ID, description = "专题ID")
|
||||
var subjectId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SUBJECT_NAME, description = "专题名称")
|
||||
var subjectName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SUBJECT_DATA, description = "专题实体,如果你不懂这个是什么,那么不要用它,直接传入专题ID和专题名称即可")
|
||||
var subjectData: SubjectData? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_IS_AD_SUBJECT, description = "是否广告专题")
|
||||
var isAdSubject: Boolean = false
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String? = ""
|
||||
private var subjectData: SubjectData? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
if (subjectData == null && subjectId != null) {
|
||||
subjectData = SubjectData(subjectId = subjectId, subjectName = subjectName, isOrder = false).also {
|
||||
intent.putExtra(EntranceConsts.KEY_SUBJECT_DATA, it)
|
||||
}
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
subjectData = intent.getBundleExtra(NORMAL_FRAGMENT_BUNDLE)?.getParcelable(EntranceConsts.KEY_SUBJECT_DATA)
|
||||
?: SubjectData("", "", false)
|
||||
}
|
||||
|
||||
override fun showDownloadMenu() = true
|
||||
@ -64,8 +35,7 @@ open class SubjectActivity : DownloadToolbarActivity() {
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
val targetClass = if (isAdSubject) AdSubjectListFragment::class.java else SubjectFragment::class.java
|
||||
return getTargetIntent(this, SubjectActivity::class.java, targetClass, intent.extras)
|
||||
return getTargetIntent(this, SubjectActivity::class.java, SubjectFragment::class.java)
|
||||
}
|
||||
|
||||
override fun isAutoResetViewBackgroundEnabled() = true
|
||||
@ -103,21 +73,26 @@ open class SubjectActivity : DownloadToolbarActivity() {
|
||||
subjectType: SubjectData.SubjectType = SubjectData.SubjectType.NORMAL
|
||||
) {
|
||||
MtaHelper.onEvent("详情页面", "专题详情", name)
|
||||
TheRouter
|
||||
.build(RouteConsts.activity.subjectActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
val subjectData = SubjectData(subjectId = id, subjectName = name, isOrder = isOrder, subjectType = subjectType)
|
||||
bundle.putParcelable(EntranceConsts.KEY_SUBJECT_DATA, subjectData)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
if (exposureSourceList != null) {
|
||||
bundle.putParcelableArrayList(
|
||||
EntranceConsts.KEY_EXPOSURE_SOURCE_LIST,
|
||||
ArrayList(exposureSourceList)
|
||||
)
|
||||
}
|
||||
}
|
||||
.navigation(context)
|
||||
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
val subjectData = SubjectData(subjectId = id, subjectName = name, isOrder = isOrder, subjectType = subjectType)
|
||||
bundle.putParcelable(EntranceConsts.KEY_SUBJECT_DATA, subjectData)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
if (exposureSourceList != null) {
|
||||
bundle.putParcelableArrayList(
|
||||
EntranceConsts.KEY_EXPOSURE_SOURCE_LIST,
|
||||
ArrayList(exposureSourceList)
|
||||
)
|
||||
}
|
||||
context.startActivity(
|
||||
getTargetIntent(
|
||||
context,
|
||||
SubjectActivity::class.java,
|
||||
SubjectFragment::class.java,
|
||||
bundle
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@ -133,30 +108,33 @@ open class SubjectActivity : DownloadToolbarActivity() {
|
||||
exposureSourceList: ArrayList<ExposureSource>? = null,
|
||||
entrance: String?
|
||||
) {
|
||||
TheRouter
|
||||
.build(RouteConsts.activity.subjectActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putBoolean(EntranceConsts.KEY_IS_AD_SUBJECT, true)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
val subjectData =
|
||||
SubjectData(
|
||||
subjectId = "",
|
||||
adId = adId,
|
||||
codeId = codeId,
|
||||
subjectName = name,
|
||||
isOrder = false,
|
||||
isAdData = adIconActive
|
||||
)
|
||||
bundle.putParcelable(EntranceConsts.KEY_SUBJECT_DATA, subjectData)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
if (exposureSourceList != null) {
|
||||
bundle.putParcelableArrayList(
|
||||
EntranceConsts.KEY_EXPOSURE_SOURCE_LIST,
|
||||
ArrayList(exposureSourceList)
|
||||
)
|
||||
}
|
||||
}
|
||||
.navigation(context)
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
val subjectData =
|
||||
SubjectData(
|
||||
subjectId = "",
|
||||
adId = adId,
|
||||
codeId = codeId,
|
||||
subjectName = name,
|
||||
isOrder = false,
|
||||
isAdData = adIconActive
|
||||
)
|
||||
bundle.putParcelable(EntranceConsts.KEY_SUBJECT_DATA, subjectData)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
if (exposureSourceList != null) {
|
||||
bundle.putParcelableArrayList(
|
||||
EntranceConsts.KEY_EXPOSURE_SOURCE_LIST,
|
||||
ArrayList(exposureSourceList)
|
||||
)
|
||||
}
|
||||
context.startActivity(
|
||||
getTargetIntent(
|
||||
context,
|
||||
SubjectActivity::class.java,
|
||||
AdSubjectListFragment::class.java,
|
||||
bundle
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -85,7 +85,7 @@ class SubjectTabFragment : BaseFragment<Any>() {
|
||||
mBinding.subjectViewpager.post {
|
||||
mBinding.subjectViewpager.offscreenPageLimit = fragments.size
|
||||
var position = arguments?.getInt(EntranceConsts.KEY_POSITION, 0) ?: 0
|
||||
val columnName = arguments?.getString(EntranceConsts.KEY_COLUMN_NAME) ?: ""
|
||||
val columnName = arguments?.getString(EntranceConsts.KEY_COLUMNNAME) ?: ""
|
||||
if (columnName.isNotEmpty()) {
|
||||
position = subjectList.indexOfFirst { it.subjectName == columnName }
|
||||
}
|
||||
|
||||
@ -5,37 +5,17 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
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.updateStatusBarColor
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
|
||||
/**
|
||||
* 工具箱
|
||||
*/
|
||||
@Route(path = RouteConsts.activity.toolBoxActivity, description = "工具箱")
|
||||
class ToolBoxActivity : ToolBarActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ID, description = "游戏ID")
|
||||
var gameId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_URL, description = "工具箱链接")
|
||||
var url: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
}
|
||||
|
||||
override fun provideNormalIntent(): Intent {
|
||||
return getTargetIntent(this, ToolBoxActivity::class.java, ToolboxFragment::class.java, intent.extras)
|
||||
}
|
||||
|
||||
override fun onDarkModeChanged() {
|
||||
super.onDarkModeChanged()
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
|
||||
@ -1,52 +1,17 @@
|
||||
package com.gh.gamecenter.video.detail
|
||||
|
||||
import android.os.Bundle
|
||||
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.EntranceConsts.IS_DETAIL_PAGE
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts.IS_DETAIL_PAGE
|
||||
import java.util.*
|
||||
|
||||
@Route(path = RouteConsts.activity.videoDetailActivity, description = "旧视频页面")
|
||||
/**
|
||||
* 旧视频页面
|
||||
*/
|
||||
// 由于兼容性问题,本游戏详情页不应该被低于 Android 4.4 的设备打开
|
||||
class VideoDetailActivity : BaseActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_VIDEO_ID, description = "视频ID", required = true)
|
||||
var videoId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ACTIVITY_NAME, description = "活动名称")
|
||||
var activityName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_FIELD_ID, description = "板块ID")
|
||||
var fieldId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SECTION_NAME, description = "专题名")
|
||||
var sectionName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ID, description = "游戏ID")
|
||||
var gameId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PAGINATION_TYPE, description = "活动分页方式")
|
||||
var paginationType: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String? = ""
|
||||
|
||||
var uuid = UUID.randomUUID()
|
||||
var mContainerFragment: HomeVideoFragment? = null
|
||||
|
||||
@ -55,8 +20,6 @@ class VideoDetailActivity : BaseActivity() {
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
DisplayUtils.transparentStatusBar(this)
|
||||
|
||||
@ -8,36 +8,23 @@ import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.lifecycle.ViewModelProviders
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity
|
||||
import com.gh.gamecenter.common.base.adapter.FragmentAdapter
|
||||
import com.gh.gamecenter.GameDetailActivity
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.mvvm.Status
|
||||
import com.gh.gamecenter.core.utils.NumberUtils
|
||||
import com.gh.gamecenter.common.utils.observeNonNull
|
||||
import com.gh.gamecenter.common.utils.toColor
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
import com.gh.gamecenter.core.utils.NumberUtils
|
||||
import com.gh.gamecenter.databinding.ActivityVideoGameBinding
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
import com.gh.gamecenter.common.mvvm.Status
|
||||
|
||||
@Route(path = RouteConsts.activity.gameVideoActivity, description = "视频合集")
|
||||
/**
|
||||
* 视频合集
|
||||
*/
|
||||
class GameVideoActivity : ToolBarActivity() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ID, description = "游戏ID", required = true)
|
||||
var gameId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_ENTRANCE, description = "入口埋点字段(开发内部使用)")
|
||||
var entrance: String? = ""
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_PATH, description = "页面路径 (历史代码用到的,传不传都行)")
|
||||
var path: String? = ""
|
||||
|
||||
private lateinit var mBinding: ActivityVideoGameBinding
|
||||
private lateinit var mViewModel: GameVideoViewModel
|
||||
@ -47,7 +34,6 @@ class GameVideoActivity : ToolBarActivity() {
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
// toolbar & status bar
|
||||
@ -57,20 +43,21 @@ class GameVideoActivity : ToolBarActivity() {
|
||||
mBinding = ActivityVideoGameBinding.bind(mContentView)
|
||||
|
||||
// viewpager & tab content
|
||||
val gameId = intent.getStringExtra(EntranceConsts.KEY_GAMEID) ?: ""
|
||||
val titles = arrayListOf("最热", "最新")
|
||||
val fragments = ArrayList<Fragment>()
|
||||
|
||||
val tag = "android:switcher:${mBinding.viewpager.id}:"
|
||||
val hottest = supportFragmentManager.findFragmentByTag("${tag}0") ?: GameVideoFragment()
|
||||
val hottestBundle = Bundle()
|
||||
hottestBundle.putString(EntranceConsts.KEY_GAME_ID, gameId)
|
||||
hottestBundle.putString(EntranceConsts.KEY_GAMEID, gameId)
|
||||
hottestBundle.putString(EntranceConsts.KEY_SORT, "vote_recently:-1")
|
||||
hottest.arguments = hottestBundle
|
||||
fragments.add(hottest)
|
||||
|
||||
val newest = supportFragmentManager.findFragmentByTag("${tag}1") ?: GameVideoFragment()
|
||||
val newestBundle = Bundle()
|
||||
newestBundle.putString(EntranceConsts.KEY_GAME_ID, gameId)
|
||||
newestBundle.putString(EntranceConsts.KEY_GAMEID, gameId)
|
||||
newestBundle.putString(EntranceConsts.KEY_SORT, "time.upload:-1")
|
||||
newest.arguments = newestBundle
|
||||
fragments.add(newest)
|
||||
@ -103,7 +90,7 @@ class GameVideoActivity : ToolBarActivity() {
|
||||
mBinding.gameIcon.setOnClickListener {
|
||||
GameDetailActivity.startGameDetailActivity(
|
||||
this,
|
||||
gameId ?: "",
|
||||
gameId,
|
||||
BaseActivity.mergeEntranceAndPath(mEntrance, "视频合集")
|
||||
)
|
||||
}
|
||||
@ -135,12 +122,10 @@ class GameVideoActivity : ToolBarActivity() {
|
||||
|
||||
@JvmStatic
|
||||
fun getIntent(context: Context, gameId: String, entrance: String?, path: String?): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_GAME_ID, gameId)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, GameVideoActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_GAMEID, gameId)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
return intent
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.gh.gamecenter.video.upload.view
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.Bitmap
|
||||
@ -56,6 +57,8 @@ import com.google.android.flexbox.FlexboxLayout
|
||||
import com.lightgame.utils.Util_System_Keyboard
|
||||
import com.lightgame.utils.Utils
|
||||
import com.therouter.TheRouter
|
||||
import com.zhihu.matisse.Matisse
|
||||
import com.zhihu.matisse.internal.utils.PathUtils
|
||||
import org.json.JSONArray
|
||||
import java.io.File
|
||||
import java.io.FileOutputStream
|
||||
@ -117,7 +120,7 @@ class UploadVideoActivity : ToolBarActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
VideoPosterFragment.clearVideoCoverCache(this)
|
||||
mVideoLink = intent.getParcelableExtra(EntranceConsts.KEY_VIDEO_LINK_ENTITY)
|
||||
mVideoLink = intent.getParcelableExtra(VideoLinkEntity::class.java.simpleName)
|
||||
mEntranceLink = intent.getStringExtra(EntranceConsts.KEY_ENTRANCE_LINK) ?: ""
|
||||
mPath = intent.getStringExtra(EntranceConsts.KEY_PATH) ?: "其他"
|
||||
|
||||
@ -250,7 +253,7 @@ class UploadVideoActivity : ToolBarActivity() {
|
||||
mViewModel = ViewModelProviders.of(this).get(UploadVideoViewModel::class.java)
|
||||
mViewModel.videoDraft = intent.getParcelableExtra(VideoDraftEntity::class.java.simpleName)
|
||||
mViewModel.videoPatch = intent.getParcelableExtra(VideoEntity::class.java.simpleName)
|
||||
mViewModel.gameEntity = intent.getParcelableExtra(EntranceConsts.KEY_SIMPLE_GAME_ENTITY)
|
||||
mViewModel.gameEntity = intent.getParcelableExtra(SimpleGameEntity::class.java.simpleName)
|
||||
mViewModel.tagsLiveData.observe(this, Observer {
|
||||
createFlexContent(mBinding.gameTag, it, clickListener = { v, _ ->
|
||||
if (v is CheckedTextView) {
|
||||
@ -961,8 +964,8 @@ class UploadVideoActivity : ToolBarActivity() {
|
||||
val intent = Intent(context, UploadVideoActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceConsts.KEY_PATH, path)
|
||||
intent.putExtra(EntranceConsts.KEY_VIDEO_LINK_ENTITY, linkEntity)
|
||||
intent.putExtra(EntranceConsts.KEY_SIMPLE_GAME_ENTITY, simpleGameEntity)
|
||||
intent.putExtra(VideoLinkEntity::class.java.simpleName, linkEntity)
|
||||
intent.putExtra(SimpleGameEntity::class.java.simpleName, simpleGameEntity)
|
||||
intent.putExtra(EntranceConsts.KEY_PATH_VIDEO, videoPath)
|
||||
intent.putExtra(EntranceConsts.KEY_POSTER_PATH, poster)
|
||||
return intent
|
||||
|
||||
@ -7,62 +7,25 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.constant.EntranceConsts
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.common.utils.PermissionHelper
|
||||
import com.gh.gamecenter.common.utils.updateStatusBarColor
|
||||
import com.gh.gamecenter.core.utils.MtaHelper
|
||||
import com.gh.gamecenter.common.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.entity.VideoLinkEntity
|
||||
import com.gh.gamecenter.video.upload.view.UploadVideoActivity
|
||||
import com.therouter.TheRouter
|
||||
import com.therouter.router.Autowired
|
||||
import com.therouter.router.Route
|
||||
import com.zhihu.matisse.Matisse
|
||||
import com.zhihu.matisse.MimeType
|
||||
import com.zhihu.matisse.internal.utils.PathUtils
|
||||
|
||||
@Route(path = RouteConsts.activity.videoManagerActivity, description = "视频投稿")
|
||||
class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_TITLE, description = "标题")
|
||||
var title: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_CATEGORY_ID, description = "分类ID")
|
||||
var categoryId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_LINK, description = "只用于数据统计")
|
||||
var link: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_ID, description = "游戏ID")
|
||||
var gameId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_GAME_NAME, description = "游戏名称")
|
||||
var gameName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_TAG_ACTIVITY_ID, description = "活动标签ID")
|
||||
var tagActivityId: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_TAG_ACTIVITY_NAME, description = "活动标签名")
|
||||
var tagActivityName: String? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_VIDEO_LINK_ENTITY, description = "视频链接实体")
|
||||
var videoLink: VideoLinkEntity? = null
|
||||
|
||||
@JvmField
|
||||
@Autowired(name = EntranceConsts.KEY_SIMPLE_GAME_ENTITY, description = "游戏实体")
|
||||
var simpleGameEntity: SimpleGameEntity? = null
|
||||
private var mVideoLink: VideoLinkEntity? = null
|
||||
private var mSimpleGameEntity: SimpleGameEntity? = null
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
@ -70,12 +33,12 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
val uris = Matisse.obtainResult(data)
|
||||
if (uris.size > 0) {
|
||||
val videoPath = PathUtils.getPath(this, uris[0]) ?: ""
|
||||
val intent = if (videoLink != null) {
|
||||
val intent = if (mVideoLink != null) {
|
||||
UploadVideoActivity.getIntent(
|
||||
this,
|
||||
videoPath,
|
||||
videoLink!!,
|
||||
simpleGameEntity,
|
||||
mVideoLink!!,
|
||||
mSimpleGameEntity,
|
||||
mEntrance,
|
||||
"视频投稿",
|
||||
""
|
||||
@ -93,25 +56,19 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
TheRouter.inject(this)
|
||||
if (videoLink == null) {
|
||||
videoLink = VideoLinkEntity(title, categoryId, link, tagActivityId, tagActivityName)
|
||||
}
|
||||
if (simpleGameEntity == null) {
|
||||
simpleGameEntity = SimpleGameEntity(gameId ?: "", gameName ?: "")
|
||||
}
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
updateStatusBarColor(com.gh.gamecenter.common.R.color.ui_surface, com.gh.gamecenter.common.R.color.ui_surface)
|
||||
setNavigationTitle("视频投稿")
|
||||
setToolbarMenu(R.menu.menu_text)
|
||||
mVideoLink = intent.getParcelableExtra(VideoLinkEntity::class.java.simpleName)
|
||||
mSimpleGameEntity = intent.getParcelableExtra(SimpleGameEntity::class.java.simpleName)
|
||||
|
||||
val menuItem = getMenuItem(R.id.menu_text)
|
||||
val container = menuItem.actionView?.findViewById<View>(R.id.menu_text)
|
||||
val text = container?.findViewById<TextView>(R.id.layout_menu_text)
|
||||
text?.text = "上传视频"
|
||||
|
||||
if (videoLink != null) {
|
||||
if (mVideoLink != null) {
|
||||
onMenuItemClick(menuItem)
|
||||
}
|
||||
LogUtils.logVideoStreamingUpload("进入视频投稿页", "视频投稿", "", "")
|
||||
@ -164,11 +121,9 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
|
||||
@JvmStatic
|
||||
fun getIntent(context: Context, entrance: String?, path: String?): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, VideoManagerActivity::class.java)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
return intent
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@ -180,8 +135,8 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
): Bundle {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceConsts.KEY_PATH, path)
|
||||
bundle.putParcelable(EntranceConsts.KEY_VIDEO_LINK_ENTITY, linkEntity)
|
||||
bundle.putParcelable(EntranceConsts.KEY_SIMPLE_GAME_ENTITY, simpleGameEntity)
|
||||
bundle.putParcelable(VideoLinkEntity::class.java.simpleName, linkEntity)
|
||||
bundle.putParcelable(SimpleGameEntity::class.java.simpleName, simpleGameEntity)
|
||||
bundle.putString(EntranceConsts.KEY_TO, VideoManagerActivity::class.java.name)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
return bundle
|
||||
@ -199,12 +154,10 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
entrance: String?,
|
||||
path: String?
|
||||
): Intent {
|
||||
val navigator = TheRouter.build(RouteConsts.activity.articleDetailActivity)
|
||||
.fillParams { bundle ->
|
||||
bundle.putParcelable(EntranceConsts.KEY_VIDEO_LINK_ENTITY, linkEntity)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
}
|
||||
return navigator.createIntent(context)
|
||||
val intent = Intent(context, VideoManagerActivity::class.java)
|
||||
intent.putExtra(VideoLinkEntity::class.java.simpleName, linkEntity)
|
||||
intent.putExtra(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
return intent
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -162,7 +162,7 @@ abstract class BaseTabWrapperFragment : BaseLazyFragment(), IMultiTab {
|
||||
showLoading(true)
|
||||
}
|
||||
}
|
||||
noConnectionStub?.inflate()
|
||||
noConnectionStub?.inflateOrShow()
|
||||
} else {
|
||||
noConnectionBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
@ -178,7 +178,7 @@ abstract class BaseTabWrapperFragment : BaseLazyFragment(), IMultiTab {
|
||||
noDataBinding = ReuseNoneDataBinding.bind(inflated)
|
||||
noDataBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
noDataStub?.inflate()
|
||||
noDataStub?.inflateOrShow()
|
||||
} else {
|
||||
noDataBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
@ -194,7 +194,7 @@ abstract class BaseTabWrapperFragment : BaseLazyFragment(), IMultiTab {
|
||||
loadingBinding = ReuseLoadingBinding.bind(inflated)
|
||||
loadingBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
loadingStub?.inflate()
|
||||
loadingStub?.inflateOrShow()
|
||||
} else {
|
||||
loadingBinding?.root?.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
@ -65,7 +65,6 @@ class MainWrapperFragment : BaseBottomTabFragment<PieceBottomTabBinding>(), OnBa
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
mViewModel = viewModelProviderFromParent(MainWrapperViewModel.Factory(HaloApp.getInstance()))
|
||||
super.onCreate(savedInstanceState)
|
||||
DisplayUtils.transparentStatusBar(requireActivity())
|
||||
|
||||
initSkeleton()
|
||||
|
||||
|
||||
@ -968,7 +968,7 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
|
||||
setPullDownPushInternal(pullDownPush, pullDownPushHandler)
|
||||
}
|
||||
try {
|
||||
binding.autoVideoViewStub.inflate()
|
||||
binding.autoVideoViewStub.inflateOrShow()
|
||||
} catch (e: Exception) {
|
||||
SentryHelper.onEvent("VIEW_STUB_INFLATE_ERROR", "digest", e.localizedMessage)
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ class WebFragment : LazyFragment(), IScrollable {
|
||||
mForumName = args.getString(EntranceConsts.KEY_FORUM_NAME) ?: ""
|
||||
mAutoCompletionTitle = args.getBoolean(KEY_COMPLETION_TITLE, true)
|
||||
mNavigationTitle = args.getString(EntranceConsts.KEY_GAMENAME)
|
||||
newsId = args.getString(EntranceConsts.KEY_NEWS_ID)
|
||||
newsId = args.getString(EntranceConsts.KEY_NEWSID)
|
||||
mIsBackpressRequireConfirmation = args.getBoolean(KEY_REQUIRE_BACK_CONFIRMATION)
|
||||
mIsWebPageHandleBackPressed = args.getBoolean(KEY_LEAVE_WEB_PAGE_TO_HANDLE_BACK_PRESSED)
|
||||
mBackConfirmationContent = args.getString(KEY_BACK_CONFIRMATION_CONTENT)
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.gh.gamecenter.common.view.MaterializedRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<FrameLayout
|
||||
<com.gh.gamecenter.common.view.MaterializedFrameLayout
|
||||
android:id="@id/layout_activity_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
@ -97,4 +97,4 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
</com.gh.gamecenter.common.view.MaterializedRelativeLayout>
|
||||
@ -13,7 +13,6 @@
|
||||
android:id="@+id/adImage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:tint="#01000000"
|
||||
android:visibility="gone"
|
||||
app:actualImageScaleType="centerCrop"
|
||||
app:fadeDuration="0"
|
||||
@ -26,6 +25,7 @@
|
||||
android:id="@+id/ad_video"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/startAdIcpContainer"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@ -4,6 +4,7 @@ import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewStub
|
||||
import com.gh.gamecenter.common.R
|
||||
import com.gh.gamecenter.common.utils.inflateOrShow
|
||||
|
||||
/**
|
||||
* 这是在 BaseLazyFragment 之上添加了一些通用功能的抽象类
|
||||
@ -66,7 +67,7 @@ abstract class LazyFragment : BaseLazyFragment() {
|
||||
} else {
|
||||
mViewStub?.layoutResource = getRealLayoutId()
|
||||
mViewStub?.setOnInflateListener { _, inflatedView -> onRealLayoutInflated(inflatedView) }
|
||||
mViewStub?.inflate()?.let { mCachedView = it }
|
||||
mViewStub?.inflateOrShow()?.let { mCachedView = it }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ public class EntranceConsts {
|
||||
|
||||
public static final String KEY_TO = "to";
|
||||
public static final String KEY_NEXT_TO = "next_to";
|
||||
public static final String KEY_NEWS_ID = "news_id";
|
||||
public static final String KEY_NEWSID = "newsId";
|
||||
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";
|
||||
@ -31,8 +31,9 @@ public class EntranceConsts {
|
||||
public static final String HOST_USERHOME = "userhome";//个人主页
|
||||
public static final String HOST_VIDEO = "video";
|
||||
public static final String HOST_FORUM = "forum";
|
||||
public static final String HOST_CATEGORY = "category";
|
||||
public static final String HOST_COLUMN_COLLECTION = "column_collection";//专题合集
|
||||
public static final String HOST_COMMUNITY_QUESTION_LABEL_DETAIL = "community_question_label_detail";//问题标签详情
|
||||
public static final String HOST_COMMUNITY_COLUMN_DETAIL = "community_column_detail";//专栏详情
|
||||
public static final String HOST_BLOCK = "block";//板块
|
||||
public static final String HOST_SERVER_BLOCK = "server";//开服表板块
|
||||
public static final String HOST_AMWAY_BLOCK = "amway";//安利墙板块
|
||||
@ -158,7 +159,7 @@ public class EntranceConsts {
|
||||
public static final String KEY_PROLIST = "provinceList";
|
||||
public static final String KEY_ORDER = "order";
|
||||
public static final String KEY_TAGTYPE = "tagType";
|
||||
public static final String KEY_ANSWER_ID = "answer_id";
|
||||
public static final String KEY_ANSWER_ID = "answerId";
|
||||
public static final String KEY_ANSWER_CONTENT = "answerContent";
|
||||
public static final String KEY_QUESTIONS_ID = "questionsId";
|
||||
public static final String KEY_QUESTIONS_TITLE = "questionsTitle";
|
||||
@ -229,12 +230,12 @@ public class EntranceConsts {
|
||||
public static final String KEY_IS_HOME = "isHome";
|
||||
public static final String KEY_TAB_COUNT = "tab_count";
|
||||
public static final String KEY_WEB_SHARE = "webShare";
|
||||
public static final String KEY_ACTIVITY_NAME = "activity_name";//活动名称
|
||||
public static final String KEY_PAGINATION_TYPE = "pagination_type";//活动分页方式
|
||||
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_FIELD_ID = "field_id"; // 专区板块id
|
||||
public static final String KEY_SECTION_NAME = "section_name"; // 专区专题名
|
||||
public static final String KEY_COLUMN_NAME = "column_name";
|
||||
public static final String KEY_COLUMNNAME = "columnName";
|
||||
public static final String KEY_QA_ID = "qaId";
|
||||
public static final String KEY_QA_CONTENT_ID = "qaContentId";
|
||||
public static final String KEY_QA_CATEGORY_NAME = "qaCategoryName";
|
||||
@ -368,17 +369,4 @@ public class EntranceConsts {
|
||||
public static final String KEY_UID = "uid";
|
||||
|
||||
public static final String KEY_DISPLAY_TYPE = "display_type";
|
||||
|
||||
public static final String KEY_NEWS_ENTITY = "news_entity";
|
||||
public static final String KEY_IS_COLLECTION_NEWS = "is_collection_news";
|
||||
public static final String KEY_SUBJECT_ID = "subject_id";
|
||||
public static final String KEY_SUBJECT_NAME = "subject_name";
|
||||
public static final String KEY_IS_AD_SUBJECT = "is_ad_subject";
|
||||
public static final String KEY_LIBAO_ID = "libao_id";
|
||||
public static final String KEY_LIBAO_ENTITY = "libao_entity";
|
||||
public static final String KEY_VIDEO_LINK_ENTITY = "video_link_entity";
|
||||
public static final String KEY_SIMPLE_GAME_ENTITY = "simple_game_entity";
|
||||
public static final String KEY_TITLE = "title";
|
||||
public static final String KEY_TAG_ACTIVITY_ID = "tag_activity_id";
|
||||
public static final String KEY_TAG_ACTIVITY_NAME = "tag_activity_name";
|
||||
}
|
||||
|
||||
@ -7,7 +7,12 @@ object RouteConsts {
|
||||
const val cleanApkActivity = "/app/cleanApkActivity"
|
||||
const val gameSubmissionActivity = "/app/gameSubmissionActivity"
|
||||
const val imageViewerActivity = "/app/imageViewerActivity"
|
||||
const val newsDetailActivity = "/app/newsDetailActivity"
|
||||
const val ratingReplyActivity = "/app/ratingReplyActivity"
|
||||
const val questionDetailActivity = "/app/questionDetailActivity"
|
||||
const val articleDetailActivity = "/app/articleDetailActivity"
|
||||
const val forumVideoDetailActivity = "/app/forumVideoDetailActivity"
|
||||
const val libaoDetailActivity = "/app/libaoDetailActivity"
|
||||
const val fullScreenVideoActivity = "/app/FullScreenVideoActivity"
|
||||
const val videoCoverEditActivity = "/app/videoCoverEditActivity"
|
||||
|
||||
@ -22,21 +27,6 @@ object RouteConsts {
|
||||
const val quickLoginActivity = "/activity/quick_login_activity"
|
||||
const val securityActivity = "/activity/account_security"
|
||||
const val serversCalendarManagementActivity = "/activity/server_manager"
|
||||
const val newsDetailActivity = "/activity/news_detail"
|
||||
const val subjectActivity = "/activity/subject"
|
||||
const val libaoDetailActivity = "/activity/libao_detail"
|
||||
const val questionDetailActivity = "/activity/question_detail"
|
||||
const val answerDetailActivity = "/activity/answer_detail"
|
||||
const val articleDetailActivity = "/activity/article_detail"
|
||||
const val videoManagerActivity = "/activity/upload_video"
|
||||
const val forumVideoDetailActivity = "/activity/forum_video_detail"
|
||||
const val videoDetailActivity = "/activity/video_detail"
|
||||
const val gameVideoActivity = "/activity/game_video"
|
||||
const val communitySubjectActivity = "/activity/community_subject"
|
||||
const val categoryV2Activity = "/activity/category"
|
||||
const val columnCollectionDetailActivity = "/activity/column_collection"
|
||||
const val toolBoxActivity = "/activity/toolbox"
|
||||
|
||||
|
||||
const val aboutActivity = "/settings/AboutActivity"
|
||||
const val webActivity = "/setting/WebActivity"
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
package com.gh.gamecenter.common.utils
|
||||
|
||||
import androidx.core.util.Pools
|
||||
import com.facebook.drawee.controller.BaseControllerListener
|
||||
import com.facebook.drawee.view.SimpleDraweeView
|
||||
import com.facebook.imagepipeline.image.ImageInfo
|
||||
import com.facebook.imagepipeline.request.Postprocessor
|
||||
import com.gh.gamecenter.core.utils.SingletonHolder
|
||||
|
||||
class AsyncImageLoader private constructor() {
|
||||
|
||||
fun addAsyncImage(view: SimpleDraweeView?, url: String, loadAsAnimatedImage: Boolean, processor: Postprocessor?) {
|
||||
fun addAsyncImage(view: SimpleDraweeView?, url: String, loadAsAnimatedImage: Boolean, processor: Postprocessor?, controllerListener: BaseControllerListener<ImageInfo>?) {
|
||||
try {
|
||||
val loopThread = LoopThread.getInstance()
|
||||
val params = loopThread.obtainImageParams()
|
||||
@ -15,6 +17,7 @@ class AsyncImageLoader private constructor() {
|
||||
params.url = url
|
||||
params.loadAsAnimatedImage = loadAsAnimatedImage
|
||||
params.processor = processor
|
||||
params.controllerListener = controllerListener
|
||||
loopThread.addAsyncImage(params)
|
||||
} catch (e: InterruptedException) {
|
||||
e.printStackTrace()
|
||||
@ -86,7 +89,7 @@ class AsyncImageLoader private constructor() {
|
||||
|
||||
|
||||
private fun loadImage(params: ImageLoadParams, isIgnoreWidth: Boolean = false) {
|
||||
ImageUtils.display(params.view, params.url, params.loadAsAnimatedImage, params.processor, isIgnoreWidth)
|
||||
ImageUtils.display(params.view, params.url, params.loadAsAnimatedImage, params.processor, isIgnoreWidth, params.controllerListener)
|
||||
releaseImageParams(params)
|
||||
}
|
||||
|
||||
@ -105,6 +108,7 @@ class AsyncImageLoader private constructor() {
|
||||
loadAsAnimatedImage = false
|
||||
processor = null
|
||||
retryCount = 0
|
||||
controllerListener = null
|
||||
mImagePool.release(this)
|
||||
}
|
||||
}
|
||||
@ -120,5 +124,6 @@ class ImageLoadParams(
|
||||
var url: String = "",
|
||||
var loadAsAnimatedImage: Boolean = true,
|
||||
var processor: Postprocessor? = null,
|
||||
var retryCount: Int = 0
|
||||
var retryCount: Int = 0,
|
||||
var controllerListener: BaseControllerListener<ImageInfo>? = null,
|
||||
)
|
||||
@ -8,6 +8,7 @@ import android.graphics.Color
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Typeface
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Build
|
||||
import android.text.Html
|
||||
import android.text.Spannable
|
||||
import android.text.SpannableStringBuilder
|
||||
@ -22,9 +23,11 @@ import androidx.constraintlayout.widget.ConstraintSet
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import androidx.viewbinding.ViewBinding
|
||||
import com.therouter.TheRouter
|
||||
import com.gh.gamecenter.common.R
|
||||
import com.gh.gamecenter.common.base.TrackableDialog
|
||||
import com.gh.gamecenter.common.callback.ConfirmListener
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.databinding.DialogAlertDefaultBinding
|
||||
import com.gh.gamecenter.common.databinding.DialogGuideBinding
|
||||
import com.gh.gamecenter.common.databinding.DialogProgressBinding
|
||||
@ -38,7 +41,6 @@ import com.google.android.material.imageview.ShapeableImageView
|
||||
import com.lightgame.download.DownloadEntity
|
||||
import com.lightgame.utils.AppManager
|
||||
import com.lightgame.view.CheckableLinearLayout
|
||||
import com.therouter.TheRouter
|
||||
import splitties.systemservices.layoutInflater
|
||||
|
||||
object DialogHelper {
|
||||
@ -716,6 +718,18 @@ object DialogHelper {
|
||||
)
|
||||
}
|
||||
|
||||
fun showVideoUnsupportedDialog(context: Context) {
|
||||
showDialog(
|
||||
context,
|
||||
"提示",
|
||||
"抱歉,您当前系统版本过低,暂不支持视频功能",
|
||||
"我知道了",
|
||||
"",
|
||||
null,
|
||||
null
|
||||
)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun showDeleteDialog(
|
||||
context: Context,
|
||||
|
||||
@ -1698,4 +1698,12 @@ fun RecyclerView.tryToClearRecycler() {
|
||||
} catch (e: java.lang.Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun ViewStub.inflateOrShow(): View? =
|
||||
if (parent != null) {
|
||||
inflate()
|
||||
} else {
|
||||
visibility = View.VISIBLE
|
||||
null
|
||||
}
|
||||
@ -162,8 +162,10 @@ object ImageUtils {
|
||||
fun displayWithCallback(
|
||||
draweeView: SimpleDraweeView?,
|
||||
imageUrl: String?,
|
||||
noMemoryCache: Boolean = false,
|
||||
controllerListener: BaseControllerListener<ImageInfo>?
|
||||
) {
|
||||
if (noMemoryCache) draweeView?.setTag(TAG_NO_MEMORY_CACHE, true)
|
||||
displayInternal(
|
||||
view = draweeView,
|
||||
url = imageUrl,
|
||||
@ -319,7 +321,7 @@ object ImageUtils {
|
||||
val disableMemoryCache = view?.getTag(TAG_NO_MEMORY_CACHE) == true
|
||||
|
||||
if (view != null && width == 0 && !isIgnoreWidth) {
|
||||
AsyncImageLoader.getInstance().addAsyncImage(view, url, loadAsAnimatedImage, processor)
|
||||
AsyncImageLoader.getInstance().addAsyncImage(view, url, loadAsAnimatedImage, processor, controllerListener)
|
||||
return@execute
|
||||
}
|
||||
var lowResUrl = ""
|
||||
@ -367,9 +369,10 @@ object ImageUtils {
|
||||
url: String?,
|
||||
loadAsAnimatedImage: Boolean = true,
|
||||
processor: Postprocessor? = null,
|
||||
isIgnoreWidth: Boolean = false
|
||||
isIgnoreWidth: Boolean = false,
|
||||
controllerListener: BaseControllerListener<ImageInfo>? = null
|
||||
) {
|
||||
displayInternal(view, url, loadAsAnimatedImage, processor, isIgnoreWidth)
|
||||
displayInternal(view, url, loadAsAnimatedImage, processor, isIgnoreWidth, controllerListener)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -21,7 +21,7 @@ import java.util.concurrent.*
|
||||
*/
|
||||
object AppExecutor {
|
||||
|
||||
private const val CORE_POOL_SIZE = 3
|
||||
private const val CORE_POOL_SIZE = 6
|
||||
private const val MAX_POOL_SIZE = 32
|
||||
|
||||
@JvmStatic
|
||||
|
||||
@ -185,7 +185,9 @@ public class DisplayUtils {
|
||||
decor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
}
|
||||
|
||||
if (isKeepLowVersionMiui) {
|
||||
if (isKeepLowVersionMiui
|
||||
&& "miui".equals(Build.MANUFACTURER)
|
||||
&& Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
Class clazz = window.getClass();
|
||||
try {
|
||||
int darkModeFlag = 0;
|
||||
|
||||
@ -106,6 +106,9 @@ data class LibaoEntity(
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAG: String = "LibaoEntity"
|
||||
|
||||
fun createLibaoEntity(concernEntity: ConcernEntity, libaoStatusEntity: LibaoStatusEntity): LibaoEntity {
|
||||
val libaoEntity = LibaoEntity()
|
||||
libaoEntity.id = concernEntity.id
|
||||
|
||||
@ -5,6 +5,7 @@ import android.os.Parcelable
|
||||
import androidx.room.Entity
|
||||
import androidx.room.PrimaryKey
|
||||
import com.google.gson.annotations.SerializedName
|
||||
import java.util.*
|
||||
|
||||
@Entity
|
||||
class NewsEntity : Parcelable, Cloneable {
|
||||
@ -89,6 +90,8 @@ class NewsEntity : Parcelable, Cloneable {
|
||||
|
||||
companion object {
|
||||
|
||||
const val TAG: String = "NewsEntity"
|
||||
|
||||
fun deepCopy(list: List<NewsEntity>?): List<NewsEntity>? {
|
||||
if (list == null) return null
|
||||
val copy = ArrayList<NewsEntity>()
|
||||
|
||||
@ -575,8 +575,9 @@ public class UserRepository {
|
||||
@Override
|
||||
public void onApiFailure(ApiResponse<UserInfoEntity> e) {
|
||||
super.onApiFailure(e);
|
||||
mLoginObsResponseUserInfo.postValue(e);
|
||||
if (loginTag != null) {
|
||||
mLoginObsResponseUserInfo.postValue(e);
|
||||
|
||||
IErrorHelperProvider errorHelper = TheRouter.get(IErrorHelperProvider.class);
|
||||
if (errorHelper != null) {
|
||||
errorHelper.handleLoginError(mContext, e.getHttpException(), loginTag.toChinese(), false);
|
||||
|
||||
@ -19,6 +19,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.therouter.TheRouter;
|
||||
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
|
||||
import com.gh.gamecenter.common.base.fragment.ToolbarFragment;
|
||||
import com.gh.gamecenter.common.callback.OnRequestCallBackListener;
|
||||
@ -57,7 +58,6 @@ import com.gh.gamecenter.message.R;
|
||||
import com.gh.gamecenter.message.databinding.FragmentInfoConcernBinding;
|
||||
import com.gh.gamecenter.message.retrofit.RetrofitManager;
|
||||
import com.gh.gamecenter.message.utils.NewFlatLogUtils;
|
||||
import com.therouter.TheRouter;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
@ -470,7 +470,7 @@ public class ConcernFragment extends ToolbarFragment implements SwipeRefreshLayo
|
||||
}
|
||||
IAppProvider appProvider = TheRouter.get(IAppProvider.class);
|
||||
if (appProvider != null && entity != null) {
|
||||
appProvider.put(EntranceConsts.KEY_LIBAO_ENTITY, entity);
|
||||
appProvider.put(LibaoEntity.TAG, entity);
|
||||
}
|
||||
TheRouter.build(RouteConsts.activity.libaoDetailActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, buildEntrance(position))
|
||||
@ -513,7 +513,7 @@ public class ConcernFragment extends ToolbarFragment implements SwipeRefreshLayo
|
||||
startActivityForResult(intent, NEWS_MESSAGE_ARTICLE_REQUEST);
|
||||
} else {
|
||||
TheRouter.build(RouteConsts.activity.newsDetailActivity)
|
||||
.withString(EntranceConsts.KEY_NEWS_ID, concernEntity.getId())
|
||||
.withString(EntranceConsts.KEY_NEWSID, concernEntity.getId())
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, buildEntrance(position))
|
||||
.navigation(requireActivity(), NEWS_MESSAGE_ARTICLE_REQUEST);
|
||||
}
|
||||
|
||||
@ -667,7 +667,7 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
|
||||
);
|
||||
if (view.getId() == R.id.message_original) {
|
||||
TheRouter.build(RouteConsts.activity.newsDetailActivity)
|
||||
.withString(EntranceConsts.KEY_NEWS_ID, entity.getArticle().getId())
|
||||
.withString(EntranceConsts.KEY_NEWSID, entity.getArticle().getId())
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
.navigation();
|
||||
} else if (view.getId() == R.id.message_item) {
|
||||
@ -695,7 +695,7 @@ public class MessageItemViewHolder extends BaseRecyclerViewHolder<MessageEntity>
|
||||
);
|
||||
if (view.getId() == R.id.message_original) {
|
||||
TheRouter.build(RouteConsts.activity.newsDetailActivity)
|
||||
.withString(EntranceConsts.KEY_NEWS_ID, entity.getArticle().getId())
|
||||
.withString(EntranceConsts.KEY_NEWSID, entity.getArticle().getId())
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
.navigation();
|
||||
} else if (view.getId() == R.id.message_item) {
|
||||
|
||||
@ -548,7 +548,7 @@ class MessageListAdapter(
|
||||
"新闻" -> if (!TextUtils.isEmpty(data.id)) {
|
||||
TheRouter.build(RouteConsts.activity.newsDetailActivity)
|
||||
.withString(EntranceConsts.KEY_ENTRANCE, "(消息-公告)")
|
||||
.withString(EntranceConsts.KEY_NEWS_ID, data.id)
|
||||
.withString(EntranceConsts.KEY_NEWSID, data.id)
|
||||
.navigation()
|
||||
}
|
||||
|
||||
|
||||
Submodule ndownload updated: 02ad0aa911...edeefdffa6
@ -16,7 +16,7 @@ git checkout module_sensors_data/build.gradle
|
||||
|
||||
# 开启 mapping 上传
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sed -i '' '1 a plugins { id "io.sentry.android.gradle" version "3.7.0" } ' app/build.gradle
|
||||
sed -i '' "1s|^|plugins { id \"io.sentry.android.gradle\" version \"3.7.0\" }\n|" app/build.gradle
|
||||
else
|
||||
sed -i '1 a plugins { id "io.sentry.android.gradle" version "3.7.0" }' app/build.gradle
|
||||
fi
|
||||
@ -77,7 +77,7 @@ done
|
||||
if [ $BUILD_WITH_INIT_GRADLE == false ]; then
|
||||
./gradlew assemble${BUILD_VARIANT_ENV}${BUILD_VARIANT_REGION^}Release -PBUILD_PUSH_TYPE=${BUILD_PUSH_TYPE}
|
||||
else
|
||||
./gradlew assemble${BUILD_VARIANT_ENV}${BUILD_VARIANT_REGION^}Release -I init.gradle -PBUILD_PUSH_TYPE=${BUILD_PUSH_TYPE}
|
||||
./gradlew assemble${BUILD_VARIANT_ENV}${BUILD_VARIANT_REGION^}Release -I init.gradle -PBUILD_PUSH_TYPE=${BUILD_PUSH_TYPE} --no-daemon
|
||||
fi
|
||||
|
||||
mkdir -p release-app/${versionName}_${versionCode}
|
||||
|
||||
@ -165,7 +165,7 @@ if [ "${sdk_platform}" != "" ]; then
|
||||
echo "光环助手_${versionName}_${versionCode}_神马推广包_${git_sha}_${build_time}"
|
||||
cp -R app/build/outputs/apk/smCn/release/app-sm-cn-release.apk "${apk_release_path}"
|
||||
fi
|
||||
updateChannelIfNeeded "${output}/${apk_release_path}"
|
||||
updateChannelIfNeeded "${apk_release_path}"
|
||||
|
||||
else
|
||||
apk_release_path="${output}/${PACKAGE_NAME}_${versionName}_${versionCode}_${MODULE_VERSION}_${va_version}_${unix_timestamp}_${buildType}.apk"
|
||||
|
||||
2
vasdk
2
vasdk
Submodule vasdk updated: 267757b094...af3c440926
Reference in New Issue
Block a user