Compare commits

...

32 Commits

Author SHA1 Message Date
c6f70d1b4c fix: va_core进程没有启动导致aidl的NPE问题。 2025-01-14 16:23:01 +08:00
0cd281a53c Merge branch 'hotfix/va-relative' into 'release'
fix: 手机不支持armeabi-v7a架构时,根据游戏来选择架构

See merge request halo/android/assistant-android!2037
2025-01-10 18:01:24 +08:00
e92d89d498 fix: 手机不支持armeabi-v7a架构时,根据游戏来选择架构 2025-01-10 17:44:03 +08:00
a22858389b chore: 版本更新至 5.38.7 2025-01-10 13:55:24 +08:00
e9d091043d Merge branch 'hotfix/va-relative' into 'release'
feat: 同步商业版VA,修复权限问题。

See merge request halo/android/assistant-android!2036
2025-01-10 11:25:46 +08:00
db4ac95094 feat: 同步商业版VA,修复权限问题。
fix: 实名认证超大UI问题
fix: sentry va relative log.
2025-01-10 11:24:45 +08:00
13be47d440 Merge branch 'fix/search-page-crash' into 'release'
fix:https://sentry.shanqu.cc/organizations/lightgame/issues/423398/?project=22

See merge request halo/android/assistant-android!2035
2025-01-10 11:21:43 +08:00
beee098cfe fix:https://sentry.shanqu.cc/organizations/lightgame/issues/423398/?project=22 2025-01-10 11:17:26 +08:00
d67aaf956b Merge branch 'feat/GHZSCY-7046' into 'release'
feat: 补充启动广告图相关广告加载事件埋点—客户端 https://jira.shanqu.cc/browse/GHZSCY-7046

See merge request halo/android/assistant-android!2034
2025-01-09 17:29:21 +08:00
1ed9151b1f feat: 补充启动广告图相关广告加载事件埋点—客户端 https://jira.shanqu.cc/browse/GHZSCY-7046 2025-01-09 16:43:54 +08:00
13f20f6883 Merge branch 'hotfix/v5.38.6-1116/ad_view_background' into 'release'
fix: 还原自有开屏广告的背景颜色 https://jira.shanqu.cc/browse/GHZSCY-7360

See merge request halo/android/assistant-android!2033
2025-01-09 15:28:06 +08:00
78e320a192 fix: 还原自有开屏广告的背景颜色 https://jira.shanqu.cc/browse/GHZSCY-7360 2025-01-09 15:27:34 +08:00
e51db47fad Merge branch 'cherry-pick-f8a26ece' into 'release'
Merge branch 'fix/GHZSCY-7277' into 'dev'

See merge request halo/android/assistant-android!2032
2025-01-09 15:24:18 +08:00
ac02ea88b9 Merge branch 'fix/GHZSCY-7277' into 'dev'
修复错误的下载错误提示 https://jira.shanqu.cc/browse/GHZSCY-7277

See merge request halo/android/assistant-android!2025

(cherry picked from commit f8a26ece01)

54ee3ea3 fix: 游戏下载异常提示 https://jira.shanqu.cc/browse/GHZSCY-7277

Co-authored-by: 陈君陶 <chenjuntao@ghzhushou.com>
2025-01-09 15:23:53 +08:00
f60004fc81 Merge branch 'feat/GHZSCY-7359' into 'release'
需求合并

See merge request halo/android/assistant-android!2031
2025-01-09 15:05:29 +08:00
0cf39a82e2 Merge branch 'fix/viewstub_crashes' into 'release'
fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/422108/events/?project=22 https://sentry.shanqu.cc/organizations/lightgame/issues/425087/?project=22

See merge request halo/android/assistant-android!2030
2025-01-09 15:03:51 +08:00
315f244153 fix:【光环助手】包名检测及搜索页面在深色模式下的显示问题 https://jira.shanqu.cc/browse/GHZSCY-6985 2025-01-09 14:54:37 +08:00
f4bdc02d70 fix: 【光环助手】深色模式显示问题 https://jira.shanqu.cc/browse/GHZSCY-7121 2025-01-09 14:54:17 +08:00
aef39eb481 feat: 样式组件优化汇总—客户端 https://jira.shanqu.cc/browse/GHZSCY-6866 2025-01-09 14:53:37 +08:00
dc2e7147d9 fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/422108/events/?project=22 https://sentry.shanqu.cc/organizations/lightgame/issues/425087/?project=22 2025-01-09 14:49:58 +08:00
fdcb6342bf Merge branch 'hotfix/v5.38.6-1116/crashes' into 'release'
修复部分 5.38.6 线上闪退

See merge request halo/android/assistant-android!2029
2025-01-09 14:37:49 +08:00
b0da4f8986 Merge branch 'hotfix/v5.38.6-1116/blank_ad_view' into 'release'
fix: 优化开屏广告的显示,提高线程池的 core 线程数,限制视频开屏广告的触摸控制

See merge request halo/android/assistant-android!2028
2025-01-09 14:37:40 +08:00
f7cc906cc5 fix: 优化开屏广告的显示,提高线程池的 core 线程数,限制视频开屏广告的触摸控制 2025-01-09 14:37:40 +08:00
795fbabd90 Merge branch 'hotfix/v5.38.6-1116/login_culprit' into 'release'
修复`我的光环`页面在用户信息接口异常时的显示问题 https://jira.shanqu.cc/browse/GHZSCY-7340

See merge request halo/android/assistant-android!2027
2025-01-09 14:34:25 +08:00
e770f8a359 fix: 修复安装完成后更新安装信息时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/395511 2025-01-09 11:49:38 +08:00
dd12b103be fix: 捕抓上报游戏启动日志的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/406179 2025-01-09 09:59:32 +08:00
21f4a398d5 fix: 处理数组越界闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/408904 2025-01-09 09:45:22 +08:00
8dfb1644a8 fix: 登录状态显示问题 https://jira.shanqu.cc/browse/GHZSCY-7340 2025-01-07 17:48:53 +08:00
9744b95126 Merge branch 'fix/viewstub_crash' into 'release'
fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/423818/?project=22

See merge request halo/android/assistant-android!2019
2024-12-27 15:14:25 +08:00
009608165c Merge branch 'fix-issues-421826' into 'release'
fix:https://sentry.shanqu.cc/organizations/lightgame/issues/421826/?project=22

See merge request halo/android/assistant-android!2018
2024-12-27 14:02:39 +08:00
98356a7dd7 fix: 修复ViewStub偶发闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/423818/?project=22 2024-12-27 13:56:10 +08:00
8389041379 fix:https://sentry.shanqu.cc/organizations/lightgame/issues/421826/?project=22 2024-12-27 13:49:29 +08:00
72 changed files with 521 additions and 241 deletions

View File

@ -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.alibaba.android.arouter.launcher.ARouter
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) {
@ -303,6 +309,7 @@ object AdDelegateHelper {
) {
val hideCallback = {
isShowingSplashAd = false
isOwnerSplashAdShown = false
hideAction.invoke()
}
if (mSplashAd != null) {
@ -575,6 +582,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)
@ -593,38 +602,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))

View File

@ -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);

View File

@ -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)
}

View File

@ -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

View File

@ -53,6 +53,7 @@ object DownloadObserver {
private const val CORE_EVENT_DOWNLOAD_COMPLETE_LOGGED = "CORE_EVENT_DOWNLOAD_COMPLETE_LOGGED"
private val mRetryableHashMap = hashMapOf<String, Boolean>()
private val mRetryableProgressMap = hashMapOf<String, Long>()
/**
* 当下载任务是 预约上线提醒 触发的,则所有弹窗均不显示
@ -146,7 +147,8 @@ object DownloadObserver {
|| DownloadStatus.timeout == status
) {
if (mRetryableHashMap[downloadEntity.url] == true
&& NetworkUtils.isWifiConnected(HaloApp.getInstance().application)
&& (NetworkUtils.isWifiConnected(HaloApp.getInstance().application)
|| NDownloadBridge.isDownloadViaTrafficAllowed(downloadEntity))
) {
downloadManager.resumeDownload(downloadEntity.url)
mRetryableHashMap[downloadEntity.url] = false
@ -257,6 +259,7 @@ object DownloadObserver {
}
mRetryableHashMap.remove(downloadEntity.url)
mRetryableProgressMap.remove(downloadEntity.url)
EventBus.getDefault().post(EBDownloadStatus("done", "", "", "", downloadEntity.packageName, ""))
}
@ -264,7 +267,9 @@ object DownloadObserver {
DownloadNotificationHelper.addOrUpdateDownloadNotification(downloadEntity)
// 如果已下载大小发生变化,表示成功恢复下载,则重置重试标记
if (status == DownloadStatus.downloading) {
if (status == DownloadStatus.downloading
&& downloadEntity.progress != mRetryableProgressMap[downloadEntity.url]) {
mRetryableProgressMap[downloadEntity.url] = downloadEntity.progress
mRetryableHashMap[downloadEntity.url] = true
}
}

View File

@ -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)
}
}

View File

@ -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 了,还想啥日志上报
}
}
}

View File

@ -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};

View File

@ -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)) {

View File

@ -312,6 +312,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) {

View File

@ -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)
}

View File

@ -6,6 +6,8 @@ import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toBinding
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.databinding.RecyclerContentLabelLaneItemBinding
import com.gh.gamecenter.home.custom.model.CustomPageData
@ -28,6 +30,10 @@ class ContentLabelLaneAdapter(
override fun onBindViewHolder(holder: ContentLabelChildViewHolder, position: Int) {
val item = getItem(position)
with(holder.binding) {
vBackground.background = R.drawable.bg_shape_content_label_lane_item.toDrawable(context)
tvTitle.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(context))
tvSubTitle.setTextColor(com.gh.gamecenter.common.R.color.primary_theme.toColor(context))
ivIcon.goneIf(item.image.isBlank()){
ivIcon.displayGameIcon(item.image, null, null)
}

View File

@ -363,7 +363,7 @@ class CommonContentHomeSlideWithCardsUi(
homeSlideCardItemBinding.cardIv.visibility = View.VISIBLE
// 防止重复加载图片导致闪烁
if (homeSubSlide.image != cardIv.getTag(R.string.tag_img_url_id)) {
ImageUtils.display(cardIv, homeSubSlide.image, false, AlphaGradientProcess())
ImageUtils.display(cardIv, homeSubSlide.image, true, AlphaGradientProcess())
cardIv.setTag(R.string.tag_img_url_id, homeSubSlide.image)
}
ConstraintSet().apply {
@ -398,7 +398,7 @@ class CommonContentHomeSlideWithCardsUi(
descTv.text = homeSubSlide.cardDesc
// 防止重复加载图片导致闪烁
if (homeSubSlide.image != cardIv.getTag(R.string.tag_img_url_id)) {
ImageUtils.display(cardIv, homeSubSlide.image, false, AlphaGradientProcess())
ImageUtils.display(cardIv, homeSubSlide.image, true, AlphaGradientProcess())
cardIv.setTag(R.string.tag_img_url_id, homeSubSlide.image)
}
ConstraintSet().apply {

View File

@ -193,9 +193,6 @@ class CustomGameItemViewHolder(
adLabelTv: TextView? = null,
canShowSubTitle: Boolean
) {
if (entity.id == gameSubtitleTv.getTag(com.gh.gamecenter.common.R.string.tag_game_name_id)) return
gameSubtitleTv.setTag(com.gh.gamecenter.common.R.string.tag_game_name_id, entity.id)
var showSubtitle = false
var showAdvancedDownload = false
if (canShowSubTitle && entity.serverLabel == null && entity.subtitle.isNotEmpty() && !entity.advanceDownload) {
@ -215,6 +212,9 @@ class CustomGameItemViewHolder(
setColor("#${entity.subtitleStyle?.background}".hexStringToIntColor())
}
}
} else {
setTextColor(com.gh.gamecenter.common.R.color.text_secondary.toColor(context))
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
}
}
}
@ -227,6 +227,10 @@ class CustomGameItemViewHolder(
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
}
}
if (entity.id == gameSubtitleTv.getTag(com.gh.gamecenter.common.R.string.tag_game_name_id)) return
gameSubtitleTv.setTag(com.gh.gamecenter.common.R.string.tag_game_name_id, entity.id)
if (showSubtitle || showAdvancedDownload) {
val minWidth =
if (showSubtitle) SUBTITLE_MIN_WIDTH.dip2px() else if (showAdvancedDownload) ADVANCED_DOWNLOAD_WIDTH.dip2px() else 0

View File

@ -109,7 +109,9 @@ class CustomHomeGameItemViewHolder(
item.linkColumn?.id ?: ""
)
}
binding.gameBrief.text = game.recommendText
binding.gameBrief.goneIf(game.recommendText.isEmpty()) {
binding.gameBrief.text = game.recommendText
}
binding.gameImage.visibleIf(game.showImage) {
if (game.isWechatMiniGame()) {
ImageUtils.display(binding.gameImage, game.banner)

View File

@ -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

View File

@ -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) {

View File

@ -41,6 +41,8 @@ class AutomaticVideoView @JvmOverloads constructor(context: Context, attrs: Attr
var thumbImage: SimpleDraweeView = findViewById(R.id.thumbImage)
var containerView: RadiusCardView = findViewById(R.id.container)
var detailBtn: TextView? = null
var isMute = true
private var mIsFirstPlay = true
private var mMuteDisposable: Disposable? = null
private var mMaskDisposable: Disposable? = null
private val mUUID = UUID.randomUUID().toString()
@ -89,10 +91,11 @@ class AutomaticVideoView @JvmOverloads constructor(context: Context, attrs: Attr
mVideoAllCallBack.onClickStartThumb(mOriginUrl, mTitle, this)
}
prepareVideo()
val topVideoVoiceStatus = SPUtils.getBoolean(Constants.SP_VIDEO_PLAY_MUTE, true)
if (topVideoVoiceStatus) {
violenceUpdateMuteStatus()
if (mIsFirstPlay) {
isMute = SPUtils.getBoolean(Constants.SP_VIDEO_PLAY_MUTE, true)
mIsFirstPlay = false
}
violenceUpdateMuteStatus()
resetDetailMask()
}
@ -106,15 +109,21 @@ class AutomaticVideoView @JvmOverloads constructor(context: Context, attrs: Attr
mMuteDisposable?.dispose()
mMuteDisposable = null
}
mute()
if (isMute) {
mute()
} else {
unMute()
}
}
}
fun mute() {
isMute = true
CustomManager.getCustomManager(getKey()).isNeedMute = true
}
fun unMute() {
isMute = false
CustomManager.getCustomManager(getKey()).isNeedMute = false
}

View File

@ -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 过期,需要重新获取

View File

@ -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>() // 已被收录的游戏包名列表

View File

@ -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))

View File

@ -9,6 +9,7 @@ import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.fragment.BaseFragment
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.databinding.FragmentSearchTabBinding
import com.gh.gamecenter.feature.entity.SettingsEntity
import com.gh.gamecenter.search.SearchGameResultFragment
@ -43,7 +44,7 @@ class SearchTabFragment : BaseFragment<Any>() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
location = arguments?.getString(EntranceConsts.KEY_LOCATION) ?: ""
with(activityViewModel) {
searchKeyAndType.observe(this@SearchTabFragment) { (key, type) ->
@ -121,6 +122,17 @@ class SearchTabFragment : BaseFragment<Any>() {
}
override fun onDarkModeChanged() {
super.onDarkModeChanged()
if (::binding.isInitialized) {
binding.tabLayout.setTabTextColors(
com.gh.gamecenter.common.R.color.text_primary.toColor(requireContext()),
com.gh.gamecenter.common.R.color.text_theme.toColor(requireContext())
)
}
}
companion object {
fun newInstance(location: String) =

View File

@ -160,7 +160,7 @@ abstract class BaseTabWrapperFragment : BaseLazyFragment(), IMultiTab {
showLoading(true)
}
}
noConnectionStub?.inflate()
noConnectionStub?.inflateOrShow()
} else {
noConnectionBinding?.root?.visibility = View.VISIBLE
}
@ -176,7 +176,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
}
@ -192,7 +192,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
}

View File

@ -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()

View File

@ -43,6 +43,8 @@ import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.observer.MuteCallback
import com.gh.gamecenter.common.observer.VolumeObserver
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.TabIndicatorView
import com.gh.gamecenter.core.iinterface.IScrollable
@ -163,6 +165,20 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
private val twoLinesTabToolbarHeight = 48F.dip2px()
private var autoVideoView: AutomaticVideoView? = null
private val volumeObserver by lazy {
VolumeObserver(object : MuteCallback {
override fun onMute(isMute: Boolean) {
if (::binding.isInitialized) {
binding.muteIv.setImageResource(if (isMute) R.drawable.ic_basic_offsound else R.drawable.ic_basic_onsound)
}
if (isMute) {
autoVideoView?.mute()
} else {
autoVideoView?.unMute()
}
}
})
}
private var searchStyle: BottomTab.SearchStyle? = null
set(value) {
@ -957,7 +973,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)
}
@ -1022,6 +1038,7 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
ImageUtils.display(gameImageIv, imgUrl)
}
autoVideoView?.onVideoReset()
muteIv.isVisible = video != null
autoVideoView?.goneIf(video == null) {
if (autoVideoView?.isInPlayingState == false) {
GSYVideoOptionBuilder()
@ -1040,6 +1057,17 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
headerContainer.performClick()
}
}
var videoVoiceStatus = SPUtils.getBoolean(Constants.SP_VIDEO_PLAY_MUTE, true)
muteIv.setImageResource(if (videoVoiceStatus) R.drawable.ic_basic_offsound else R.drawable.ic_basic_onsound)
muteIv.setDebouncedClickListener {
videoVoiceStatus = !videoVoiceStatus
muteIv.setImageResource(if (videoVoiceStatus) R.drawable.ic_basic_offsound else R.drawable.ic_basic_onsound)
if (videoVoiceStatus) {
autoVideoView?.mute()
} else {
autoVideoView?.unMute()
}
}
}
}
}
@ -1054,6 +1082,19 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
pullDownPushHandler?.doPreProcess(this as? ISmartRefresh, popupPush)
}
private fun observeVolume() {
context?.applicationContext?.contentResolver?.registerContentObserver(
android.provider.Settings.System.CONTENT_URI,
true,
volumeObserver
)
}
private fun unObserveVolume() {
context?.applicationContext?.contentResolver?.unregisterContentObserver(volumeObserver)
}
private fun updateRefreshHeaderStyle(force: Boolean = false) {
if (lightRefreshHeaderStyle == isDisplayingLightContent && !force) return
lightRefreshHeaderStyle = isDisplayingLightContent
@ -1098,6 +1139,7 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
} else {
resumePullDownPushVideo()
}
observeVolume()
}
}
}
@ -1111,6 +1153,7 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
if (!videoUrl.isNullOrEmpty()) {
ScrollCalculatorHelper.savePlaySchedule(MD5Utils.getContentMD5(videoUrl), currentPosition)
}
unObserveVolume()
}
}
}
@ -1126,8 +1169,7 @@ class SearchToolbarTabWrapperFragment : BaseTabWrapperFragment(), ISearchToolbar
if (position != 0L) {
autoVideoView?.seekTo(position)
autoVideoView?.onVideoResume(false)
val topVideoVoiceStatus = SPUtils.getBoolean(Constants.SP_VIDEO_PLAY_MUTE, true)
if (topVideoVoiceStatus) {
if (autoVideoView?.isMute == true) {
autoVideoView?.mute()
} else {
autoVideoView?.unMute()

View File

@ -41,6 +41,8 @@ import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.observer.MuteCallback
import com.gh.gamecenter.common.observer.VolumeObserver
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.MD5Utils
@ -108,6 +110,20 @@ class ToolbarWrapperFragment : LazyFragment(), ToolbarController, ISmartRefresh,
private var mLightToolbar = false
private var mAutoFinishTwoLevelHandler: Handler? = null
private var mAutoFinishTwoLevelCallback: (() -> Unit)? = null
private val mVolumeObserver by lazy {
VolumeObserver(object : MuteCallback {
override fun onMute(isMute: Boolean) {
if (::mBinding.isInitialized) {
mBinding.muteIv.setImageResource(if (isMute) R.drawable.ic_basic_offsound else R.drawable.ic_basic_onsound)
if (isMute) {
mBinding.autoVideoView.mute()
} else {
mBinding.autoVideoView.unMute()
}
}
}
})
}
private lateinit var mElapsedHelper: TimeElapsedHelper
@ -227,6 +243,7 @@ class ToolbarWrapperFragment : LazyFragment(), ToolbarController, ISmartRefresh,
gameImageIv.goneIf(video != null) {
ImageUtils.display(gameImageIv, imgUrl)
}
muteIv.isVisible = video != null
autoVideoView.goneIf(video == null) {
if (!autoVideoView.isInPlayingState) {
GSYVideoOptionBuilder()
@ -258,6 +275,17 @@ class ToolbarWrapperFragment : LazyFragment(), ToolbarController, ISmartRefresh,
headerContainer.performClick()
}
}
var videoVoiceStatus = SPUtils.getBoolean(Constants.SP_VIDEO_PLAY_MUTE, true)
muteIv.setImageResource(if (videoVoiceStatus) R.drawable.ic_basic_offsound else R.drawable.ic_basic_onsound)
muteIv.setDebouncedClickListener {
videoVoiceStatus = !videoVoiceStatus
muteIv.setImageResource(if (videoVoiceStatus) R.drawable.ic_basic_offsound else R.drawable.ic_basic_onsound)
if (videoVoiceStatus) {
autoVideoView.mute()
} else {
autoVideoView.unMute()
}
}
}
}
}
@ -271,6 +299,18 @@ class ToolbarWrapperFragment : LazyFragment(), ToolbarController, ISmartRefresh,
pullDownPushHandler?.doPreProcess(this as? ISmartRefresh, popupPush)
}
private fun observeVolume() {
context?.applicationContext?.contentResolver?.registerContentObserver(
android.provider.Settings.System.CONTENT_URI,
true,
mVolumeObserver
)
}
private fun unObserveVolume() {
context?.applicationContext?.contentResolver?.unregisterContentObserver(mVolumeObserver)
}
override fun onFragmentPause() {
super.onFragmentPause()
DownloadManager.getInstance().removeObserver(mDataWatcher)
@ -738,6 +778,7 @@ class ToolbarWrapperFragment : LazyFragment(), ToolbarController, ISmartRefresh,
} else {
resumePullDownPushVideo()
}
observeVolume()
}
}
}
@ -751,6 +792,7 @@ class ToolbarWrapperFragment : LazyFragment(), ToolbarController, ISmartRefresh,
if (videoUrl.isNotEmpty()) {
ScrollCalculatorHelper.savePlaySchedule(MD5Utils.getContentMD5(videoUrl), currentPosition)
}
unObserveVolume()
}
}
}
@ -766,8 +808,7 @@ class ToolbarWrapperFragment : LazyFragment(), ToolbarController, ISmartRefresh,
if (position != 0L) {
autoVideoView.seekTo(position)
autoVideoView.onVideoResume(false)
val topVideoVoiceStatus = SPUtils.getBoolean(Constants.SP_VIDEO_PLAY_MUTE, true)
if (topVideoVoiceStatus) {
if (autoVideoView.isMute) {
autoVideoView.mute()
} else {
autoVideoView.unMute()

View File

@ -416,7 +416,7 @@ object NDownloadBridge : InnerDownloadListener, IErrorRetryHandler {
}, GlobalDownloadConfig.ERROR_RETRY_INTERVAL)
}
private fun isDownloadViaTrafficAllowed(downloadEntity: DownloadEntity?): Boolean {
fun isDownloadViaTrafficAllowed(downloadEntity: DownloadEntity?): Boolean {
val mNetworkMobileStatus = "2G3G4G5G"
val networkStatus: String? = downloadEntity?.meta?.get(DownloadEntity.NETWORK_STATUS_KEY)
Utils.log("download network status$networkStatus")

View File

@ -2,5 +2,5 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="6dp" />
<solid android:color="@color/text_f9f9f9" />
<solid android:color="@color/ui_container_1" />
</shape>

View File

@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M11.183,5.778C11.51,5.511 12,5.744 12,6.165V8.909C12,9.461 12.448,9.909 13,9.909C13.552,9.909 14,9.461 14,8.909V6.165C14,4.056 11.549,2.895 9.917,4.23L8.756,5.181C8.328,5.53 8.265,6.16 8.615,6.588C8.965,7.015 9.595,7.078 10.022,6.728L11.183,5.778Z"
android:fillColor="#000000"/>
<path
android:pathData="M20.66,7C20.384,6.522 19.772,6.358 19.294,6.634C18.816,6.91 18.652,7.522 18.928,8C19.63,9.216 20,10.596 20,12C20,12.92 19.841,13.83 19.534,14.69C19.349,15.21 19.62,15.782 20.14,15.968C20.66,16.153 21.232,15.882 21.418,15.362C21.802,14.287 22,13.15 22,12C22,10.245 21.538,8.52 20.66,7Z"
android:fillColor="#000000"/>
<path
android:pathData="M17.796,10.447C17.653,9.914 17.104,9.597 16.571,9.74C16.037,9.883 15.721,10.431 15.864,10.965C15.967,11.35 16.012,11.748 15.998,12.143C15.978,12.695 16.409,13.159 16.961,13.179C17.513,13.198 17.976,12.767 17.996,12.215C18.017,11.622 17.951,11.026 17.796,10.447Z"
android:fillColor="#000000"/>
<path
android:pathData="M2.224,4.869C2.572,4.441 3.202,4.376 3.631,4.724L19.631,17.724C20.059,18.072 20.124,18.702 19.776,19.131C19.428,19.559 18.798,19.624 18.369,19.276L14,15.726V17.835C14,19.944 11.549,21.105 9.917,19.77L7.143,17.5H5C3.343,17.5 2,16.157 2,14.5V9.5C2,8.476 2.513,7.571 3.297,7.03L2.369,6.276C1.941,5.928 1.876,5.298 2.224,4.869ZM5.106,8.5L12,14.101V17.835C12,18.256 11.51,18.489 11.183,18.222L8.133,15.726C7.955,15.58 7.731,15.5 7.5,15.5H5C4.448,15.5 4,15.052 4,14.5V9.5C4,8.948 4.448,8.5 5,8.5H5.106Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
</vector>

View File

@ -0,0 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M9.917,4.23C11.549,2.895 14,4.056 14,6.165V17.835C14,19.944 11.549,21.105 9.917,19.77L7.143,17.5H5C3.343,17.5 2,16.157 2,14.5V9.5C2,7.843 3.343,6.5 5,6.5H7.143L9.917,4.23ZM12,6.165C12,5.744 11.51,5.511 11.183,5.778L8.133,8.274C7.955,8.42 7.731,8.5 7.5,8.5H5C4.448,8.5 4,8.948 4,9.5V14.5C4,15.052 4.448,15.5 5,15.5H7.5C7.731,15.5 7.955,15.58 8.133,15.726L11.183,18.222C11.51,18.489 12,18.257 12,17.835V6.165Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
<path
android:pathData="M16.571,9.74C17.104,9.597 17.653,9.914 17.796,10.447C18.068,11.464 18.068,12.536 17.796,13.553C17.653,14.086 17.104,14.403 16.571,14.26C16.037,14.117 15.721,13.569 15.864,13.035C16.045,12.357 16.045,11.643 15.864,10.965C15.721,10.431 16.037,9.883 16.571,9.74Z"
android:fillColor="#000000"/>
<path
android:pathData="M20.66,7C20.384,6.522 19.772,6.358 19.294,6.634C18.816,6.91 18.652,7.522 18.928,8C19.63,9.216 20,10.596 20,12C20,13.404 19.63,14.784 18.928,16C18.652,16.478 18.816,17.09 19.294,17.366C19.772,17.642 20.384,17.478 20.66,17C21.538,15.48 22,13.755 22,12C22,10.245 21.538,8.52 20.66,7Z"
android:fillColor="#000000"/>
</vector>

View File

@ -3,7 +3,7 @@
<item android:id="@android:id/background">
<shape>
<solid android:color="@color/text_f9f9f9" />
<solid android:color="@color/ui_container_1" />
<corners
android:bottomLeftRadius="0dp"

View File

@ -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>

View File

@ -62,16 +62,16 @@
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:layout_marginStart="4dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:visibility="visible"
tools:text="副标题" />
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>
<ImageView

View File

@ -76,15 +76,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:text="副标题" />
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary" />
<TextView
android:id="@+id/recent_played_tag"

View File

@ -79,15 +79,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
@ -38,15 +37,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView

View File

@ -13,11 +13,11 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:tabBackground="@color/ui_surface"
app:tabIndicator="@drawable/search_tab_indicator"
app:tabIndicatorHeight="3dp"
app:tabPaddingEnd="12dp"
app:tabPaddingStart="12dp"
app:tabTextColor="@color/text_primary"
app:tabSelectedTextColor="@color/text_theme" />
<androidx.viewpager.widget.ViewPager

View File

@ -102,15 +102,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>
@ -164,6 +163,19 @@
app:lottie_loop="true"
app:lottie_repeatMode="restart" />
<ImageView
android:id="@+id/muteIv"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="24dp"
android:padding="4dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_basic_offsound"
app:tint="@color/text_instance" />
<FrameLayout
android:id="@+id/headerBackground"
android:layout_width="0dp"

View File

@ -107,15 +107,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>
@ -169,6 +168,19 @@
app:lottie_loop="true"
app:lottie_repeatMode="restart" />
<ImageView
android:id="@+id/muteIv"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_marginEnd="12dp"
android:layout_marginBottom="24dp"
android:padding="4dp"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_basic_offsound"
app:tint="@color/text_instance" />
<View
android:id="@+id/headerBackground"
android:layout_width="0dp"

View File

@ -53,16 +53,15 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:visibility="visible"
tools:text="副标题" />
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>
<TextView

View File

@ -88,15 +88,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题副标题副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView

View File

@ -56,16 +56,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_toRightOf="@id/home2_game_nameAndsize"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView

View File

@ -57,15 +57,15 @@
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginLeft="8dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:layout_marginStart="8dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -57,15 +57,15 @@
android:id="@+id/gameSubtitleTv"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginLeft="8dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:layout_marginStart="8dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -63,15 +63,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView

View File

@ -103,15 +103,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView

View File

@ -66,15 +66,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -43,14 +43,14 @@
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="16dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -103,15 +103,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -56,15 +56,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -76,15 +76,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:text="副标题" />
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary" />
<TextView
android:id="@+id/recent_played_tag"

View File

@ -75,15 +75,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -74,15 +74,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
@ -57,15 +56,15 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:layout_marginStart="4dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
@ -60,15 +59,15 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:layout_marginStart="4dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -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"

View File

@ -10,6 +10,7 @@
android:id="@+id/cv_banner_container"
android:layout_width="0dp"
android:layout_height="0dp"
app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="8dp"
app:cardElevation="0dp"
app:layout_constraintDimensionRatio="41:11"

View File

@ -78,15 +78,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题副标题副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView

View File

@ -7,8 +7,8 @@ ext {
targetSdkVersion = 30
// application info (每个大版本之间的 versionCode 增加 20)
versionCode = 1116
versionName = "5.38.6"
versionCode = 1117
versionName = "5.38.7"
applicationId = "com.gh.gamecenter"
applicationIdGat = "com.gh.gamecenter.intl"

View File

@ -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 }
}
}

View File

@ -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,
)

View File

@ -1704,4 +1704,12 @@ fun RecyclerView.tryToClearRecycler() {
} catch (e: java.lang.Exception) {
e.printStackTrace()
}
}
}
fun ViewStub.inflateOrShow(): View? =
if (parent != null) {
inflate()
} else {
visibility = View.VISIBLE
null
}

View File

@ -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)
}
/**

View File

@ -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

View File

@ -1072,7 +1072,7 @@ data class GameEntity(
val showImage: Boolean
get() {
if (!DISPLAY_CONTENT_IMAGE.equals(displayContent, true)) {
if (!DISPLAY_CONTENT_IMAGE.equals(displayContent, true) && topVideo != null) {
return false
}
return (isWechatMiniGame() && banner.isNotBlank()) || homeSetting.image.isNotBlank()

View File

@ -148,9 +148,6 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
forceShowSubtitle: Boolean = false,
modificationCallback: (() -> Unit)? = null
) {
if (entity.id == gameSubtitleTv.getTag(com.gh.gamecenter.common.R.string.tag_game_name_id)) return
gameSubtitleTv.setTag(com.gh.gamecenter.common.R.string.tag_game_name_id, entity.id)
var showSubtitle = false
var showAdvancedDownload = false
if ((entity.serverLabel == null && entity.subtitle.isNotEmpty() && !entity.advanceDownload) || (forceShowSubtitle && entity.subtitle.isNotEmpty())) {
@ -170,6 +167,9 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
setColor("#${entity.subtitleStyle?.background}".hexStringToIntColor())
}
}
} else {
setTextColor(com.gh.gamecenter.common.R.color.text_secondary.toColor(context))
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
}
}
}
@ -182,6 +182,10 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
}
}
if (entity.id == gameSubtitleTv.getTag(com.gh.gamecenter.common.R.string.tag_game_name_id)) return
gameSubtitleTv.setTag(com.gh.gamecenter.common.R.string.tag_game_name_id, entity.id)
if (showSubtitle || showAdvancedDownload) {
val minWidth =
if (showSubtitle) SUBTITLE_MIN_WIDTH.dip2px() else if (showAdvancedDownload) ADVANCED_DOWNLOAD_WIDTH.dip2px() else 0
@ -238,9 +242,6 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
adLabelTv: TextView? = null,
canShowTitle: Boolean
) {
if (entity.id == gameSubtitleTv.getTag(com.gh.gamecenter.common.R.string.tag_game_name_id)) return
gameSubtitleTv.setTag(com.gh.gamecenter.common.R.string.tag_game_name_id, entity.id)
var showSubtitle = false
var showAdvancedDownload = false
if (canShowTitle && entity.serverLabel == null && entity.subtitle.isNotEmpty() && !entity.advanceDownload) {
@ -260,6 +261,9 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
setColor("#${entity.subtitleStyle?.background}".hexStringToIntColor())
}
}
} else {
setTextColor(com.gh.gamecenter.common.R.color.text_secondary.toColor(context))
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
}
}
}
@ -272,6 +276,10 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
}
}
if (entity.id == gameSubtitleTv.getTag(com.gh.gamecenter.common.R.string.tag_game_name_id)) return
gameSubtitleTv.setTag(com.gh.gamecenter.common.R.string.tag_game_name_id, entity.id)
if (showSubtitle || showAdvancedDownload) {
val minWidth =
if (showSubtitle) SUBTITLE_MIN_WIDTH.dip2px() else if (showAdvancedDownload) ADVANCED_DOWNLOAD_WIDTH.dip2px() else 0

View File

@ -76,16 +76,15 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:visibility="visible"
tools:text="副标题副标题副标题" />
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题副标题副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
<TextView
android:id="@+id/recent_played_tag"

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/reuse_listview_item_style"
@ -53,15 +52,15 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:layout_marginStart="4dp"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

View File

@ -580,8 +580,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 = (IErrorHelperProvider) ARouter.getInstance().build(RouteConsts.provider.errorHelper).navigation();
if (errorHelper != null) {
errorHelper.handleLoginError(mContext, e.getHttpException(), loginTag.toChinese(), false);

View File

@ -55,15 +55,14 @@
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:background="@drawable/bg_advance_download_game_subtitle"
tools:text="副标题副标题副标题副标题副标题副标题副标题副标题副标题"
tools:textColor="@color/text_secondary"
tools:visibility="visible" />
</LinearLayout>

2
vasdk

Submodule vasdk updated: 0a83d50210...56a5d9bd8d