Compare commits

..

4 Commits

Author SHA1 Message Date
cef4526b35 stash 2025-04-08 17:33:06 +08:00
0e9301f4dc chore: unify dependency version 2025-04-07 17:14:29 +08:00
8436b2e3aa feat: init sample page 2025-04-07 17:05:26 +08:00
c57af24811 feat: revamped apk manager 2025-03-13 11:01:51 +08:00
194 changed files with 1894 additions and 2715 deletions

View File

@ -515,6 +515,7 @@ dependencies {
}
implementation(project(':feature:media_select'))
implementation(project(':feature:apk_manager'))
implementation(project(":module_va_api"))
implementation(project(":va-archive-common"))

View File

@ -77,7 +77,6 @@
### TEA
-keep class com.gh.gamecenter.TeaHelper { *; }
-keep class com.bytedance.ads.convert.broadcast.common.EncryptionTools {*;}
### EasyFloat
-keep class com.lzf.easyfloat.* {*;}

Binary file not shown.

View File

@ -71,10 +71,6 @@
<!-- 适配 双开/分身 游戏授权登录 -->
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" />
<!-- 日历 -->
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-sdk tools:overrideLibrary="
com.shuyu.gsyvideoplayer,
com.shuyu.gsyvideoplayer.lib,
@ -87,29 +83,9 @@
tv.danmaku.ijk.media.exo2,
pl.droidsonroids.gif,
com.lzf.easyfloat,
com.airbnb.lottie.compose,
androidx.compose.ui.platform,
androidx.compose.material.icons,
androidx.activity.compose,
androidx.compose.ui.tooling,
androidx.compose.ui.tooling.data,
androidx.compose.material.ripple,
androidx.compose.foundation,
androidx.compose.animation,
androidx.compose.foundation.layout,
androidx.compose.ui.text,
androidx.compose.ui.graphics,
androidx.compose.ui.unit,
androidx.compose.ui.util,
androidx.compose.ui.geometry,
androidx.compose.runtime.saveable,
androidx.compose.animation.core,
androidx.constraintlayout.compose,
androidx.compose.ui.test.manifest,
com.bytedance.sdk.openadsdk,
com.bykv.vk.openvk,
com.bytedance.tools,
androidx.compose.ui.tooling.preview,
com.tencent.qqmini,
com.tencent.qqmini.minigame.external,
com.tencent.qqmini.minigame.opensdk,

View File

@ -180,12 +180,12 @@ object AdDelegateHelper {
config.ownerAd?.startAd?.let { it.id = config.ownerAd.id }
// HarmonyOS 2.2.0 版本不展示第三方开屏广告 (因为会引起奇怪的闪退)
// if (MetaUtil.getRom().name == "HarmonyOS"
// && MetaUtil.getRom().versionName == "2.2.0"
// && config.displayRule.adSource == "third_party_ads") {
//
// return
// }
if (MetaUtil.getRom().name == "HarmonyOS"
&& MetaUtil.getRom().versionName == "2.2.0"
&& config.displayRule.adSource == "third_party_ads") {
return
}
mSplashAd = config
}

View File

@ -3,8 +3,6 @@ package com.gh.common
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.util.Base64
import android.view.View
import android.webkit.JavascriptInterface
@ -13,7 +11,6 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import com.gh.common.exposure.ExposureManager
import com.gh.common.util.*
import com.gh.common.util.LogUtils
@ -21,7 +18,6 @@ import com.gh.download.DownloadManager
import com.gh.download.PackageObserver
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.Constants
@ -81,7 +77,7 @@ import java.util.*
class DefaultJsApi(
var context: Context,
val entrance: String = "",
private val mFragment: Fragment? = null,
private var mFragment: Fragment? = null,
private var mBbsId: String? = "",
private var mOriginUrl: String? = "",
private val mForumName: String? = "",
@ -98,8 +94,6 @@ class DefaultJsApi(
private var mDownloadHandler: CompletionHandler<Any>? = null // 下载信息回调
private var mExposureEvent: ExposureEvent? = null // 活动曝光实体
private val handler = Handler(Looper.getMainLooper())
init {
if (mFragment != null) {
EventBus.getDefault().register(this)
@ -246,12 +240,6 @@ class DefaultJsApi(
VHelper.launch(context, packageName)
}
} else {
val wechatPkgName = "com.tencent.mm"
if (packageName == wechatPkgName && !PackageUtils.isInstalled(context, wechatPkgName)) {
// 如果是微信客户端,需要检查是否安装微信
ToastUtils.showToast(R.string.wechat_app_not_install_tips.toResString())
return@runOnUiThread
}
PackageLauncher.launchApp(context, packageName = packageName)
}
}
@ -514,44 +502,6 @@ class DefaultJsApi(
}
}
@JavascriptInterface
fun saveWechatQRCode(msg: Any) {
val base64StringData = msg.toString()
runOnUiThread {
(context as? FragmentActivity)?.checkStoragePermissionBeforeAction {
runOnIoThread {
val base64String = base64StringData.replace("data:image/png;base64", "")
tryWithDefaultCatch {
val imageFile =
File(HaloApp.getInstance().cacheDir.absolutePath + File.separator + System.currentTimeMillis() + ".png")
val decodedString = Base64.decode(base64String, Base64.DEFAULT)
val bos = BufferedOutputStream(FileOutputStream(imageFile))
bos.write(decodedString)
bos.flush()
bos.close()
ImageUtils.saveImageToFile(imageFile, "", true) {
// 这里是 ui 线程
// 保存微信二维码成功1s 以后跳转微信
if (mFragment != null && mFragment.lifecycle.currentState.isAtLeast(Lifecycle.State.STARTED)) {
handler.removeCallbacksAndMessages(null)
handler.postDelayed({
val wechatPkgName = "com.tencent.mm"
if (!PackageUtils.isInstalled(context, wechatPkgName)) {
ToastUtils.showToast(R.string.wechat_app_not_install_tips.toResString())
return@postDelayed
}
PackageLauncher.launchApp(context, packageName = wechatPkgName)
}, 1000)
}
}
}
}
}
}
}
@JavascriptInterface
fun loginWithCallback(msg: Any, handler: CompletionHandler<Any>) {
mLoginHandler = handler
@ -848,8 +798,6 @@ class DefaultJsApi(
}
EventBus.getDefault().unregister(this@DefaultJsApi)
handler.removeCallbacksAndMessages(null)
}
}

View File

@ -1,10 +1,5 @@
package com.gh.common.databind;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_SELLING_POINT;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_TEST;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_TYPE;
import static com.gh.gamecenter.entity.SubjectEntity.SUBJECT_TAG_UPDATE;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
@ -53,7 +48,6 @@ import com.gh.download.server.BrowserInstallHelper;
import com.gh.gamecenter.DownloadManagerActivity;
import com.gh.gamecenter.R;
import com.gh.gamecenter.WebActivity;
import com.gh.gamecenter.common.databinding.LayoutGameItemSellingPointBinding;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.utils.DarkModeUtils;
import com.gh.gamecenter.common.utils.ExtensionsKt;
@ -61,7 +55,6 @@ import com.gh.gamecenter.common.utils.FileUtils;
import com.gh.gamecenter.common.utils.NewFlatLogUtils;
import com.gh.gamecenter.common.utils.SensorsBridge;
import com.gh.gamecenter.core.utils.MtaHelper;
import com.gh.gamecenter.core.utils.TimeUtils;
import com.gh.gamecenter.core.utils.ToastUtils;
import com.gh.gamecenter.feature.entity.ApkEntity;
import com.gh.gamecenter.feature.entity.GameEntity;
@ -296,7 +289,7 @@ public class BindingAdapters {
});
break;
case RESERVED:
ReservationHelper.showCancelReservationDialog(progressBar.getContext(), gameEntity, () -> {
ReservationHelper.showCancelReservationDialog(progressBar.getContext(),gameEntity, () -> {
ReservationHelper.cancelReservation(gameEntity, () -> {
updateReservation(progressBar, gameEntity);
});
@ -479,37 +472,39 @@ public class BindingAdapters {
}
}
/**
* 包含测试开服标签
*
* @param layout
* @param gameEntity
* @param subjectTag 默认为 “”只有游戏专题可以配置subjectTag
*/
public static void setGameTags(LinearLayout layout, GameEntity gameEntity, String subjectTag) {
// 包含测试开服标签
public static void setGameTags(LinearLayout layout, GameEntity gameEntity) {
try {
if (layout.getVisibility() == View.GONE) return;
ArrayList<TagStyleEntity> tagStyle = new ArrayList<>();
TestEntity test = gameEntity.getTest();
if (test != null && subjectTag.equals(SUBJECT_TAG_TEST)) {
// 显示开测表标签
TagStyleEntity typeTag = new TagStyleEntity();
boolean isDarkModeOn = DarkModeUtils.INSTANCE.isDarkModeOn(layout.getContext());
typeTag.setName(test.getType() != null ? test.getType() : "");
typeTag.setBackground("1AFFA142");
typeTag.setColor(isDarkModeOn ? "EB9238" : "FFA142");
tagStyle.add(typeTag);
TagStyleEntity timeTag = new TagStyleEntity();
if (test.getStartPending()) {
timeTag.setName(test.getStartText());
if (test != null
// 这个判断用于开测表列表
&& !"type_tag".equals(test.getGameTag())) {
if ("custom".equals(test.getGameTag())) {
TagStyleEntity typeTag = new TagStyleEntity();
if (!TextUtils.isEmpty(test.getText())) {
typeTag.setName(test.getText() != null ? test.getText() : "");
} else {
typeTag.setName(test.getType() != null ? test.getType() : "");
}
typeTag.setBackground("E8F3FF");
typeTag.setColor("1383EB");
tagStyle.add(typeTag);
} else {
timeTag.setName(GameViewUtils.getGameTestDate(test.getStart()));
}
timeTag.setBackground("1A06CEA8");
timeTag.setColor(isDarkModeOn ? "07A385" : "06CEA8");
tagStyle.add(timeTag);
TagStyleEntity typeTag = new TagStyleEntity();
boolean isDarkModeOn = DarkModeUtils.INSTANCE.isDarkModeOn(layout.getContext());
typeTag.setName(test.getType() != null ? test.getType() : "");
typeTag.setBackground("1AFFA142");
typeTag.setColor(isDarkModeOn ? "EB9238" : "FFA142");
tagStyle.add(typeTag);
TagStyleEntity timeTag = new TagStyleEntity();
timeTag.setName(GameViewUtils.getGameTestDate(test.getStart()));
timeTag.setBackground("1A06CEA8");
timeTag.setColor(isDarkModeOn ? "07A385" : "06CEA8");
tagStyle.add(timeTag);
}
} else {
tagStyle = gameEntity.getTagStyle();
}
@ -519,59 +514,6 @@ public class BindingAdapters {
}
}
public static void setGameTagsWithSellingPoint(LinearLayout layout, LayoutGameItemSellingPointBinding binding, GameEntity gameEntity, String subjectTag) {
if (subjectTag.equals(SUBJECT_TAG_SELLING_POINT)) {
layout.setVisibility(View.GONE);
binding.getRoot().setVisibility(View.VISIBLE);
GameEntity.SellingPoints sellingPoints = gameEntity.getSellingPoints();
if (sellingPoints != null) {
binding.tvSellingPoints.setVisibility(View.VISIBLE);
binding.tvSellingPoints.setText(sellingPoints.getText());
} else {
binding.tvSellingPoints.setVisibility(View.GONE);
}
Context context = layout.getContext();
binding.gtcvTags.removeAllViews();
ArrayList<TagStyleEntity> tagStyle = gameEntity.getTagStyle();
for (int i = 0; i < tagStyle.size(); i++) {
if (i < 3) {
TextView textView = new TextView(layout.getContext());
textView.setTextColor(ExtensionsKt.toColor(com.gh.gamecenter.common.R.color.text_tertiary, context));
textView.setTextSize(10);
textView.setText((i == 0 ? "" : "·") + tagStyle.get(i).getName());
binding.gtcvTags.addView(textView);
}
}
} else {
layout.setVisibility(View.VISIBLE);
binding.getRoot().setVisibility(View.GONE);
switch (subjectTag) {
case SUBJECT_TAG_UPDATE:
List<TagStyleEntity> updateTags = new ArrayList<>();
TagStyleEntity updateTag = new TagStyleEntity(
"local_generated",
TimeUtils.getFormatTime(gameEntity.getUpdateTime(), "MM-dd") + " 更新",
"",
"1383EB",
"E8F3FF",
"1383EB",
false
);
updateTags.add(updateTag);
GameViewUtils.setLabelList(layout.getContext(), layout, updateTags);
break;
case SUBJECT_TAG_TYPE:
GameViewUtils.setLabelList(layout.getContext(), layout, gameEntity.getTagStyle());
break;
default:
setGameTags(layout, gameEntity, subjectTag);
break;
}
}
}
public static void setVideoDetailGameTags(LinearLayout layout, GameEntity gameEntity) {
try {
ArrayList<TagStyleEntity> tagStyle = new ArrayList<>();

View File

@ -16,7 +16,6 @@ import com.gh.common.pop.EditBindWechatPop
import com.gh.common.pop.RealNameTipsPop
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toObject
@ -84,90 +83,79 @@ class ReserveSuccessReminderDialog(
handlers.clear()
binding.flContentContainer.removeAllViews()
val configTypes = mutableListOf<Int>()
// 短信
if (reserveReminder.hasSmsConfig) {
if (reserveReminder.smsConfig.notice) {
configTypes.add(SMS_REMINDER_ENABLE_TYPE)
} else {
configTypes.add(SMS_REMINDER_UNABLE_TYPE)
}
}
// 微信
if (reserveReminder.wechatConfig.isReminderEnable) {
configTypes.add(WECHAT_REMINDER_ENABLE_TYPE)
} else {
configTypes.add(WECHAT_REMINDER_UNABLE_TYPE)
}
// 日历
if (reserveReminder.hasCalendarConfig) {
if (reserveReminder.calendarConfig.notice) {
configTypes.add(CALENDAR_REMINDER_ENABLE_TYPE)
} else {
configTypes.add(CALENDAR_REMINDER_UNABLE_TYPE)
}
}
if (configTypes.size == 1) {
// 只有微信提醒
if (configTypes.first() == WECHAT_REMINDER_ENABLE_TYPE) {
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
handlers.add(
WechatReminderEnableHandler(reserveReminder.wechatConfig, 8.dp, binding.flContentContainer, this)
)
} else {
val smsConfig = reserveReminder.smsConfig
val wechatConfig = reserveReminder.wechatConfig
when {
reserveReminder.onlyShowWechatReminder && !wechatConfig.isReminderEnable -> { // 只显示微信:未开启
binding.tvContent.setText(R.string.reverse_success_without_reminder_tips)
handlers.add(OnlyWechatReminderUnableHandler(16.dp, binding.flContentContainer, this))
arrayListOf(OnlyWechatReminderUnableHandler(16.dp, binding.flContentContainer, this))
}
} else {
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
var isLargerSpacing = true
fun getPaddingTop(): Int {
val paddingTop = if (isLargerSpacing) 16.dp else 8.dp
isLargerSpacing = false
return paddingTop
reserveReminder.onlyShowWechatReminder && wechatConfig.isReminderEnable -> { // 只显示微信:已开
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
WechatReminderEnableHandler(
reserveReminder.wechatConfig.nickName,
8.dp,
binding.flContentContainer,
this
)
)
}
configTypes.sorted().forEach {
when (it) {
SMS_REMINDER_ENABLE_TYPE -> {
isLargerSpacing = true
SmsReminderEnableHandler(reserveReminder.smsConfig, 8.dp, binding.flContentContainer, this)
}
SMS_REMINDER_UNABLE_TYPE -> {
SmsReminderUnableHandler(getPaddingTop(), binding.flContentContainer, this)
}
WECHAT_REMINDER_ENABLE_TYPE -> {
isLargerSpacing = true
WechatReminderEnableHandler(
reserveReminder.wechatConfig,
8.dp,
binding.flContentContainer,
this
)
}
WECHAT_REMINDER_UNABLE_TYPE ->
WechatReminderUnableHandler(getPaddingTop(), binding.flContentContainer, this)
CALENDAR_REMINDER_ENABLE_TYPE -> {
isLargerSpacing = true
CalendarReminderEnableHandler(8.dp, binding.flContentContainer, this)
}
CALENDAR_REMINDER_UNABLE_TYPE ->
CalendarReminderUnableHandler(getPaddingTop(), binding.flContentContainer, this)
else -> null
}?.let(handlers::add)
!smsConfig.notice && !wechatConfig.isReminderEnable -> { // 短信,微信未开启
binding.tvContent.setText(R.string.reverse_success_without_reminder_tips)
arrayListOf(
SmsReminderUnableHandler(16.dp, binding.flContentContainer, this),
WechatReminderUnableHandler(8.dp, binding.flContentContainer, this)
)
}
smsConfig.notice && wechatConfig.isReminderEnable -> {// 短信,微信已开启
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
SmsReminderEnableHandler(reserveReminder.smsConfig, 8.dp, binding.flContentContainer, this),
WechatReminderEnableHandler(
reserveReminder.wechatConfig.nickName,
8.dp,
binding.flContentContainer,
this
)
)
}
smsConfig.notice && !wechatConfig.isReminderEnable -> { // 短信开启,微信未开启
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
SmsReminderEnableHandler(smsConfig, 8.dp, binding.flContentContainer, this),
WechatReminderUnableHandler(16.dp, binding.flContentContainer, this)
)
}
!smsConfig.notice && wechatConfig.isReminderEnable -> { // 微信开启,短信未开启
binding.tvContent.setText(R.string.reverse_success_with_reminder_tips)
arrayListOf(
WechatReminderEnableHandler(
wechatConfig.nickName,
8.dp,
binding.flContentContainer,
this
),
SmsReminderUnableHandler(16.dp, binding.flContentContainer, this)
)
}
else -> {
binding.tvContent.setText(R.string.reverse_success_without_reminder_tips)
arrayListOf()
}
}.let {
handlers.clear()
handlers.addAll(it)
}
handlers.forEach {
binding.flContentContainer.addView(it.init())
}
@ -232,14 +220,9 @@ class ReserveSuccessReminderDialog(
listener.changeWechatBinding()
}
override fun updateCalendarReminder() {
listener.updateCalendarReminder()
}
override fun onStart() {
super.onStart()
window?.let {
it.setDimAmount(0.4F)
it.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
val params = it.attributes
params.width = DisplayUtils.dip2px(300F)
@ -261,13 +244,6 @@ class ReserveSuccessReminderDialog(
private val Int.dp: Int
get() = DisplayUtils.dip2px(this.toFloat())
private const val SMS_REMINDER_ENABLE_TYPE = 1
private const val WECHAT_REMINDER_ENABLE_TYPE = 2
private const val CALENDAR_REMINDER_ENABLE_TYPE = 3
private const val SMS_REMINDER_UNABLE_TYPE = 4
private const val WECHAT_REMINDER_UNABLE_TYPE = 5
private const val CALENDAR_REMINDER_UNABLE_TYPE = 6
fun create(context: Context, listener: OnReserveReminderListener) =
ReserveSuccessReminderDialog(
context,
@ -384,7 +360,7 @@ class ReserveSuccessReminderDialog(
}
class WechatReminderEnableHandler(
private val wechatConfig: WechatConfigEntity,
private val nickName: String,
topMargin: Int,
parent: ViewGroup,
listener: OnReserveSuccessListener
@ -404,7 +380,7 @@ class ReserveSuccessReminderDialog(
}.root
override fun initView() {
binding.tvWechat.text = wechatConfig.nickName
binding.tvWechat.text = nickName
binding.vModifyWechat.setOnClickListener {
editWechatPop.showAsDropDown(
binding.ivModifyWechat,
@ -435,51 +411,6 @@ class ReserveSuccessReminderDialog(
}
class CalendarReminderUnableHandler(
topMargin: Int,
parent: ViewGroup,
listener: OnReserveSuccessListener
) : ReminderContentHandler(topMargin, parent, listener) {
private lateinit var binding: LayoutReserveWechatReminderUnableBinding
// 复用微信提醒未开启状态布局
override fun createView(inflater: LayoutInflater) =
LayoutReserveWechatReminderUnableBinding.inflate(inflater, parent, false)
.also {
binding = it
}.root
override fun initView() {
binding.tvWechatReminderTitle.setText(R.string.calendar_reminders)
binding.tvWechatReminderDescription.setText(R.string.calendar_reminders_description)
binding.vWechatAdd.setOnClickListener {
listener.updateCalendarReminder()
}
}
}
class CalendarReminderEnableHandler(
topMargin: Int,
parent: ViewGroup,
listener: OnReserveSuccessListener
) : ReminderContentHandler(topMargin, parent, listener) {
private lateinit var binding: LayoutReserveCalendarReminderUnableBinding
override fun createView(inflater: LayoutInflater) =
LayoutReserveCalendarReminderUnableBinding.inflate(inflater, parent, false)
.also {
binding = it
}.root
override fun initView() {
}
}
}
@ -494,6 +425,4 @@ interface OnReserveSuccessListener {
fun verifyPhoneNumber()
fun changeWechatBinding()
fun updateCalendarReminder()
}

View File

@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.PackageFlavorHelper
import com.gh.gamecenter.common.utils.debounceActionWithInterval
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.common.utils.toObject
@ -124,16 +123,10 @@ object RegionSettingHelper {
mIsInit = false
}
val fakeIp = if (PackageFlavorHelper.IS_TEST_FLAVOR) {
SPUtils.getString(Constants.SP_TEST_FLAVOR_IP)
} else {
""
}
// 使用默认的 Schdulers.io() 可能会触发 OOM
RetrofitManager.getInstance()
.api
.getRegionSetting(HaloApp.getInstance().channel, fakeIp)
.getRegionSetting(HaloApp.getInstance().channel)
.subscribeOn(Schedulers.io())
.subscribe(object : BiResponse<RegionSetting>() {
override fun onSuccess(data: RegionSetting) {

View File

@ -1,29 +0,0 @@
package com.gh.common.interceptor
import com.gh.gamecenter.common.constant.RouteConsts
import com.halo.assistant.HaloApp
import com.therouter.router.RouteItem
import com.therouter.router.interceptor.RouterReplaceInterceptor
import com.therouter.router.matchRouteMap
/**
* 主拦截器
*/
class MainInterceptor: RouterReplaceInterceptor() {
override fun replace(routeItem: RouteItem?): RouteItem? {
if (routeItem == null) return null
// 用户是否已经同意隐私政策
val isUserAcceptPrivacyPolicy = HaloApp.isUserAcceptPrivacyPolicy(HaloApp.getInstance())
// 如果用户已经同意隐私政策并且应用已经启动,直接返回 routeItem ,运行跳转
if (isUserAcceptPrivacyPolicy && HaloApp.getInstance().isAlreadyUpAndRunning) {
return routeItem
}
// 指向调整为 SplashScreenActivity
return matchRouteMap(RouteConsts.activity.splashActivity)
}
}

View File

@ -4,10 +4,8 @@ import android.view.View
import android.widget.LinearLayout
import android.widget.TextView
import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.common.databinding.LayoutGameItemSellingPointBinding
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.provider.IBindingAdaptersProvider
import com.gh.gamecenter.home.custom.adapter.CustomViewExt
@com.therouter.inject.ServiceProvider
class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
@ -20,7 +18,7 @@ class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
}
override fun setGameTags(layout: LinearLayout, gameEntity: GameEntity) {
BindingAdapters.setGameTags(layout, gameEntity, "")
BindingAdapters.setGameTags(layout, gameEntity)
}
override fun setMessageUnread(view: TextView, unreadCount: Int) {
@ -30,17 +28,4 @@ class BindingAdaptersProviderImpl : IBindingAdaptersProvider {
override fun setGame(view: View, gameEntity: GameEntity) {
BindingAdapters.setGame(view, gameEntity)
}
override fun setGameTagsWithSellingPoints(
layout: LinearLayout,
sellingPointsBinding: LayoutGameItemSellingPointBinding,
gameEntity: GameEntity,
subjectTag: String
) {
BindingAdapters.setGameTagsWithSellingPoint(layout, sellingPointsBinding, gameEntity, subjectTag)
}
override fun setGameDescription(tvDesc: TextView, briefStyle: String, game: GameEntity) {
CustomViewExt.setDescription(tvDesc, briefStyle, game)
}
}

View File

@ -2,8 +2,6 @@ package com.gh.common.provider
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.entity.GameUpdateEntity
@ -13,7 +11,6 @@ import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.provider.IDownloadButtonClickedProvider
import com.gh.gamecenter.feature.view.DownloadButton
import com.gh.gamecenter.packagehelper.PackageRepository
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
import com.lightgame.utils.Utils
@ -30,9 +27,6 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
var packageName = ""
var exposureSourceList: List<ExposureSource>? = null
var customPageTrackData: CustomPageTrackData? = null
val pushMessageId = (HaloApp.get(Constants.PUSH_MESSAGE_ID, false) as? String) ?: ""
val pushLinkId = (HaloApp.get(Constants.PUSH_LINK_ENTITY, false) as? LinkEntity)?.link ?: ""
val isFromPush = pushMessageId.isNotEmpty()
val boundedObject = downloadButton.getObject()
@ -142,9 +136,6 @@ class DownloadButtonClickedProviderImpl : IDownloadButtonClickedProvider {
"last_page_name", GlobalActivityManager.getLastPageEntity().pageName,
"last_page_id", GlobalActivityManager.getLastPageEntity().pageId,
"last_page_business_id", GlobalActivityManager.getLastPageEntity().pageBusinessId,
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
*customPageKV
)
}

View File

@ -12,14 +12,6 @@ class IAcceleratorDataHolderProviderImpl : IAcceleratorDataHolderProvider {
}
}
override fun addInitFunResult(result: String) {
AcceleratorDataHolder.instance.addInitFunResult(result)
}
override fun getInitFunResults(): List<String> {
return AcceleratorDataHolder.instance.initResults
}
override fun clear() {
AcceleratorDataHolder.instance.clear()
}

View File

@ -2,7 +2,6 @@ package com.gh.common.util
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.core.utils.TimeUtils
import com.gh.gamecenter.retrofit.RetrofitManager
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
@ -13,18 +12,15 @@ import okhttp3.ResponseBody
object ActivationHelper {
private const val HAS_SENT_ACTIVATED_INFO = "has_sent_activated_info"
private const val SENT_ACTIVATED_INFO_TIME = "sent_activated_info_time"
private const val HAS_SENT_RETENTION_INFO = "has_sent_retention_info"
private var hasSentActivatedInfo = SPUtils.getBoolean(HAS_SENT_ACTIVATED_INFO, false)
private var hasSentRetentionInfo = SPUtils.getBoolean(HAS_SENT_RETENTION_INFO, false)
var mHasSentActivatedInfo = SPUtils.getBoolean(HAS_SENT_ACTIVATED_INFO, false)
/**
* 发送激活信息 (用于推广)
*/
@JvmStatic
fun sendActivationInfo() {
if (!hasSentActivatedInfo) {
if (!mHasSentActivatedInfo) {
RetrofitManager.getInstance()
.api.postActivationInfo()
.subscribeOn(Schedulers.io())
@ -32,36 +28,8 @@ object ActivationHelper {
override fun onResponse(response: ResponseBody?) {
super.onResponse(response)
hasSentActivatedInfo = true
mHasSentActivatedInfo = true
SPUtils.setBoolean(HAS_SENT_ACTIVATED_INFO, true)
SPUtils.setLong(SENT_ACTIVATED_INFO_TIME, System.currentTimeMillis())
}
})
}
}
/**
* 发送次日留存信息 (用于推广)
*/
@JvmStatic
fun sendRetentionInfo() {
if (hasSentActivatedInfo && !hasSentRetentionInfo) {
val activateTimeMillis = SPUtils.getLong(SENT_ACTIVATED_INFO_TIME, 0)
val currentTimeMillis = System.currentTimeMillis()
if (!TimeUtils.isNextDay(activateTimeMillis, currentTimeMillis)) {
return
}
RetrofitManager.getInstance()
.api.postRetentionInfo()
.subscribeOn(Schedulers.io())
.subscribe(object : Response<ResponseBody>() {
override fun onResponse(response: ResponseBody?) {
super.onResponse(response)
hasSentRetentionInfo = true
SPUtils.setBoolean(HAS_SENT_RETENTION_INFO, true)
}
})
}

View File

@ -111,6 +111,7 @@ public class DataUtils {
try {
HaloApp.getInstance().getContentResolver().insert(Uri.parse("content://com.gh.gamecenter.provider/device"), values);
} catch (Exception exception) {
SentryHelper.INSTANCE.onEvent("DEVICE_INSERT_ERROR", "exception_digest", exception.getLocalizedMessage());
exception.printStackTrace();
}
});
@ -195,6 +196,7 @@ public class DataUtils {
// TODO 将 com.gh.gamecenter 改成 BuildConfig.ApplicationID
HaloApp.getInstance().getContentResolver().insert(Uri.parse("content://com.gh.gamecenter.provider/certification"), values);
} catch (Exception exception) {
SentryHelper.INSTANCE.onEvent("CERTIFICATION_INSERT_ERROR", "exception_digest", exception.getLocalizedMessage());
exception.printStackTrace();
}
}

View File

@ -854,8 +854,7 @@ object DirectUtils {
entrance: String? = null,
autoDownload: Boolean? = null,
tab: String? = "",
traceEvent: ExposureEvent? = null,
from: String? = null
traceEvent: ExposureEvent? = null
) {
if (id.isEmpty()) return
@ -863,7 +862,6 @@ object DirectUtils {
.path(RouteConsts.activity.gameDetailActivity)
.appendQueryParameter(KEY_ENTRANCE, entrance)
.appendQueryParameter(KEY_GAME_ID, id)
.appendQueryParameter(KEY_FROM, from)
.build()
TheRouter

View File

@ -655,11 +655,7 @@ object DownloadItemUtils {
}
// 缺省情况下回落到游戏简介
if (TextUtils.isEmpty(briefStyle)
|| briefStyle!!.contains("brief")
|| briefStyle.contains("recommend")
|| briefStyle.contains("test&appointment")
) {
if (TextUtils.isEmpty(briefStyle) || briefStyle!!.contains("brief") || briefStyle.contains("recommend")) {
holder.gameDes?.visibility = View.VISIBLE
} else {
holder.gameDes?.visibility = View.GONE

View File

@ -14,7 +14,6 @@ import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.entity.SimpleGameEntity
import com.gh.gamecenter.common.entity.SuggestType
import com.gh.gamecenter.common.eventbus.EBShowDialog
@ -557,10 +556,6 @@ object DownloadObserver {
} else {
arrayOf()
}
val pushMessageId = (HaloApp.get(Constants.PUSH_MESSAGE_ID, false) as? String) ?: ""
val pushLinkId = (HaloApp.get(Constants.PUSH_LINK_ENTITY, false) as? LinkEntity)?.link ?: ""
val isFromPush = pushMessageId.isNotEmpty()
SensorsBridge.trackEventWithExposureSource(
"DownloadProcessFinish",
exposureEvent?.source,
@ -577,9 +572,6 @@ object DownloadObserver {
"last_page_business_id", getLastPageEntity().pageBusinessId,
"download_status", downloadEntity.meta[Constants.DOWNLOAD_STATUS_IN_CHINESE] ?: "",
"download_type", if (downloadEntity.asVGame()) "畅玩下载" else "本地下载",
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
*kvs
)
}

View File

@ -95,8 +95,7 @@ object ReservationHelper {
it.categoryChinese,
data.wechatConfig.isReminderEnable,
if (data.hasSmsConfig) data.smsConfig.notice else null,
if (data.isEnableAutoDownload) data.wifiAutoDownload else null,
if (data.hasCalendarConfig) false else null
if (data.isEnableAutoDownload) data.wifiAutoDownload else null
)
}

View File

@ -29,7 +29,6 @@ import com.gh.common.util.PackageUtils;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.base.GlobalActivityManager;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.exposure.meta.MetaUtil;
import com.gh.gamecenter.common.utils.DeviceUtils;
import com.gh.gamecenter.common.utils.ExtensionsKt;
@ -452,15 +451,8 @@ public class DownloadManager implements DownloadStatusListener {
trackDownloadType = "本地下载";
}
String pushMessageId = HaloApp.get(Constants.PUSH_MESSAGE_ID, false) instanceof String
? (String) HaloApp.get(Constants.PUSH_MESSAGE_ID, false)
: "";
String pushLinkId = HaloApp.get(Constants.PUSH_LINK_ENTITY, false) instanceof LinkEntity
? ((LinkEntity) HaloApp.get(Constants.PUSH_LINK_ENTITY, false)).getLink()
: "";
boolean isFromPush = !pushMessageId.isEmpty();
Object[] arrayKv = {
String[] arrayKv = {
"game_id", gameEntity.getId(),
"game_name", gameEntity.getName(),
"game_type", gameEntity.getCategoryChinese(),
@ -473,19 +465,16 @@ public class DownloadManager implements DownloadStatusListener {
"last_page_id", GlobalActivityManager.getLastPageEntity().getPageId(),
"last_page_business_id", GlobalActivityManager.getLastPageEntity().getPageBusinessId(),
"download_status", gameEntity.getDownloadStatusChinese(),
"download_type", trackDownloadType,
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
"download_type", trackDownloadType
};
List<Object> kvs = new ArrayList<>(Arrays.asList(arrayKv));
List<String> kvs = new ArrayList<>(Arrays.asList(arrayKv));
if (customPageTrackData != null) {
kvs.addAll(Arrays.asList(customPageTrackData.toKV()));
}
SensorsBridge.trackEventWithExposureSource("DownloadProcessBegin",
downloadExposureEvent.getSource(), kvs.toArray(new Object[0])
downloadExposureEvent.getSource(), kvs.toArray(new String[0])
);
//TODO remove

View File

@ -164,8 +164,7 @@ class DownloadDialog : BaseDraggableDialogFragment() {
true,
mTraceEvent,
mEntrance,
mLocation,
onDownloadClickAction
mLocation
)
mBinding.collectionList.layoutManager = createLayoutManager(itemList)
mBinding.collectionList.adapter = mCollectionAdapter

View File

@ -119,7 +119,6 @@ import com.sina.weibo.sdk.auth.AuthInfo;
import com.sina.weibo.sdk.openapi.IWBAPI;
import com.sina.weibo.sdk.openapi.WBAPIFactory;
import com.therouter.TheRouter;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
@ -223,7 +222,7 @@ public class MainActivity extends BaseActivity {
DialogHelper.showCenterWarningDialog(this, "发生闪退", "光环助手发生了闪退,建议安装到最新版本修复异常"
, "马上反馈", "马上安装修复",
() -> {
DirectUtils.directToGameDetail(this, Constants.GHZS_GAME_ID, "", "crash", true, "desc", null, "");
DirectUtils.directToGameDetail(this, Constants.GHZS_GAME_ID, "", "crash", true, "desc", null);
return null;
},
() -> {
@ -256,12 +255,9 @@ public class MainActivity extends BaseActivity {
// 跳转至其它页面
if (getIntent() != null
&& getIntent().getExtras() != null) {
if (getIntent().getBooleanExtra(EntranceConsts.KEY_REQUIRE_REDIRECT, false)) {
doSkip();
} else if (!TextUtils.isEmpty(getIntent().getStringExtra(EntranceConsts.KEY_THE_ROUTER_PATH))) {
doRedirect(getIntent().getStringExtra(EntranceConsts.KEY_THE_ROUTER_PATH));
}
&& getIntent().getExtras() != null
&& getIntent().getBooleanExtra(EntranceConsts.KEY_REQUIRE_REDIRECT, false)) {
doSkip();
}
// debug 模式下的快速跳转页面
@ -460,10 +456,6 @@ public class MainActivity extends BaseActivity {
handler.removeCallbacksAndMessages(null);
releaseExoSourceCache();
// 移除推送触发启动记录
HaloApp.remove(Constants.PUSH_MESSAGE_ID);
HaloApp.remove(Constants.PUSH_LINK_ENTITY);
}
/**
@ -828,19 +820,6 @@ public class MainActivity extends BaseActivity {
}, 500);
}
/**
* 重定向至 TheRouter 配置的页面
*/
private void doRedirect(String path) {
if (getIntent().getExtras() != null) {
// 更新 intent 数据,避免页面重建重新跳转
getIntent().getExtras().putString(EntranceConsts.KEY_THE_ROUTER_PATH, "");
AppExecutor.getUiExecutor().executeWithDelay(() -> {
TheRouter.build(path).navigation(this);
}, 500L);
}
}
@NonNull
private Function0<Unit> launchGame(String gamePackageName) {
return () -> {

View File

@ -1,7 +1,6 @@
package com.gh.gamecenter;
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_BROWSER;
import static com.gh.gamecenter.common.constant.EntranceConsts.ENTRANCE_OTHER;
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;
@ -36,7 +35,6 @@ import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_VIDEO_STREAM
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_VIDEO_STREAMING_HOME;
import static com.gh.gamecenter.common.constant.EntranceConsts.HOST_WEB;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_DATA;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_FROM;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_GAME_NAME;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_NAME;
import static com.gh.gamecenter.common.constant.EntranceConsts.KEY_PACKAGENAME;
@ -102,6 +100,7 @@ public class SkipActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Uri uri = getIntent().getData();
Bundle bundle;
if (uri != null) {
@ -161,8 +160,7 @@ public class SkipActivity extends BaseActivity {
DirectUtils.directToArticle(this, path, entrance);
break;
case HOST_GAME:
String from = uri.getQueryParameter(KEY_FROM);
DirectUtils.directToGameDetail(this, path, "", entrance, "true".equals(uri.getQueryParameter("auto_download")), to, null, from);
DirectUtils.directToGameDetail(this, path, "", entrance, "true".equals(uri.getQueryParameter("auto_download")), to, null);
break;
case HOST_COLUMN:
DirectUtils.directToSubject(this, path, uri.getQueryParameter(KEY_NAME), entrance, null, SubjectData.SubjectType.NORMAL);
@ -182,7 +180,7 @@ public class SkipActivity extends BaseActivity {
DirectUtils.directToAnswerDetail(this, path, entrance, pathName);
break;
case HOST_QUESTION:
DirectUtils.directToQuestionDetail(this, path, entrance, pathName, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
DirectUtils.directToQuestionDetail(this, path, entrance, pathName, "");
break;
case HOST_TOOLBOX:
DirectUtils.directToToolbox(this, uri.getQueryParameter("gameId"), uri.getQueryParameter("toolboxUrl"), entrance);
@ -192,7 +190,7 @@ public class SkipActivity extends BaseActivity {
break;
// 社区文章格式一
case "community.article":
DirectUtils.directToCommunityArticle(this, uri.getQueryParameter("articleId"), uri.getQueryParameter("communityId"), entrance, pathName, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
DirectUtils.directToCommunityArticle(this, uri.getQueryParameter("articleId"), uri.getQueryParameter("communityId"), entrance, pathName, "");
break;
// 社区文章格式二
case "communities":
@ -213,13 +211,13 @@ public class SkipActivity extends BaseActivity {
}
}
if ("articles".equals(type)) {
DirectUtils.directToCommunityArticle(this, typeId, communityId, entrance, pathName, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
DirectUtils.directToCommunityArticle(this, typeId, communityId, entrance, pathName, "");
break;
}
break;
case HOST_VIDEO:
DirectUtils.directToVideoDetail(this, path, VideoDetailContainerViewModel.Location.HOTTEST_GAME_VIDEO.getValue(),
false, id, entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
false, id, entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, "");
break;
case HOST_UPLOAD_VIDEO://跳转上传视频
String titleParameter = uri.getQueryParameter("title");
@ -239,7 +237,7 @@ public class SkipActivity extends BaseActivity {
break;
case HOST_VIDEO_SINGLE:
DirectUtils.directToVideoDetail(this, path, VideoDetailContainerViewModel.Location.SINGLE_VIDEO.getValue(),
false, "", entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
false, "", entrance, pathName, TextUtils.isEmpty(referer) ? "" : referer, "");
break;
case HOST_VIDEO_MORE:
gameId = uri.getQueryParameter("gameId");
@ -296,7 +294,7 @@ public class SkipActivity extends BaseActivity {
EntranceUtils.jumpActivityCompat(this, bundle);
break;
case EntranceConsts.HOST_VIDEO_DETAIL:
DirectUtils.directToVideoDetail(this, path, entrance, "", isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
DirectUtils.directToVideoDetail(this, path, entrance, "", "");
break;
case HOST_LIBAO:
DirectUtils.directToGiftDetail(this, path, entrance);
@ -317,7 +315,7 @@ public class SkipActivity extends BaseActivity {
break;
case HOST_COLUMN_COLLECTION:
DirectUtils.directToColumnCollection(this, path, -1, entrance, "", "", "", "", null, false);
DirectUtils.directToColumnCollection(this, path, -1, entrance, "", "", "", "", null,false);
break;
case EntranceConsts.HOST_BLOCK:
name = uri.getQueryParameter("name");
@ -359,7 +357,7 @@ public class SkipActivity extends BaseActivity {
byte[] linkData = Base64.decode(dataString, Base64.DEFAULT);
String linkDataString = new String(linkData, "UTF-8");
LaunchRedirect launchRedirect = GsonUtils.fromJson(linkDataString, LaunchRedirect.class);
DirectUtils.directToLinkPage(this, launchRedirect, entrance, "", isFromPush ? ENTRANCE_PUSH : ENTRANCE_OTHER);
DirectUtils.directToLinkPage(this, launchRedirect, entrance, "", "");
}
} catch (Exception e) {
e.printStackTrace();
@ -416,13 +414,13 @@ public class SkipActivity extends BaseActivity {
break;
case HOST_ARCHIVE_LOGIN:
String gamePkg = uri.getQueryParameter(EntranceConsts.KEY_GAME_PKG);
if (CheckLoginUtils.isLogin()) {
if(CheckLoginUtils.isLogin()) {
VHelper.INSTANCE.updateAuthorizeInfo(true);
} else {
Bundle newBundle = new Bundle();
newBundle.putString(EntranceConsts.KEY_TO, LoginActivity.class.getName());
EntranceUtils.jumpActivityCompat(this, newBundle, null, (resultCode, data) -> {
if (CheckLoginUtils.isLogin()) {
if(CheckLoginUtils.isLogin()) {
VHelper.INSTANCE.updateAuthorizeInfo(true);
}
VHelper.launch(this, gamePkg, false, false);

View File

@ -5,7 +5,6 @@ import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.content.SharedPreferences
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.preference.PreferenceManager
@ -27,9 +26,6 @@ import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats
import com.gh.download.DownloadManager
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.KEY_FROM
import com.gh.gamecenter.common.constant.EntranceConsts.KEY_GAMEID
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.tracker.TrackerLogger
import com.gh.gamecenter.common.utils.*
@ -94,9 +90,8 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
showPrivacyDialog()
} else {
val spanBuilder = buildSpannedString {
append(
"这个弹窗只会在右上角有环境标签的测试包出现" +
"\n进入应用以后还可以到关于我们页面长按应用图标重新选择"
append("这个弹窗只会在右上角有环境标签的测试包出现" +
"\n进入应用以后还可以到关于我们页面长按应用图标重新选择"
)
bold {
color(com.gh.gamecenter.common.R.color.text_theme.toColor(this@SplashScreenActivity)) {
@ -109,7 +104,7 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
executeDex2OatInAdvance()
DialogHelper.showDialog(
context = this,
title = "选择环境",
title ="选择环境",
content = spanBuilder,
confirmText = "正式环境",
cancelText = "测试环境",
@ -150,10 +145,6 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
val trackEvent = JSONObject()
// 是否首次使用神策
val isFirstTime = SPUtils.getBoolean(Constants.SP_SENSORS_IS_FIRST_TIME, true)
val therouterPath = intent.extras?.getString(EntranceConsts.KEY_THE_ROUTER_PATH) ?: ""
val uri = Uri.parse(therouterPath)
val isFromWechat = WECHAT_APPOINTMENT == if (!uri.isOpaque) uri.getQueryParameter(KEY_FROM) else false
val gameId = if (!uri.isOpaque) uri.getQueryParameter(KEY_GAMEID) else ""
tryCatchInRelease {
trackEvent.run {
put("\$is_first_time", isFirstTime)
@ -163,10 +154,6 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
put("signature", signatureHash)
put("app_name", appProvider?.getAppName())
put("install_first_time", if (HaloApp.getInstance().isBrandNewInstall) "" else "")
if (isFromWechat) {
put("source_entrance", WECHAT_NOTIFICATION)
put("page_business_id", gameId)
}
}
}
SensorsBridge.trackEvent("AppLaunch", trackEvent)
@ -337,9 +324,6 @@ class SplashScreenActivity : BaseActivity(), ISplashScreen {
const val HONOR_CULPRIT_ID = 12324
const val HONOR_CULPRIT_CHANNEL = "荣耀通道"
private const val WECHAT_APPOINTMENT = "wechat_appointment"
private const val WECHAT_NOTIFICATION = "微信通知"
@JvmStatic
fun getSplashScreenIntent(context: Context?, bundle: Bundle?): Intent {
val intent = Intent(context, SplashScreenActivity::class.java)

View File

@ -107,12 +107,12 @@ class DetailViewHolder(
// 注意 View 的命名
init {
downloadBottom = view.findViewById(R.id.detail_ll_bottom)
downloadPb = downloadBottom.findViewById(R.id.detail_progressbar)
downloadTips = downloadBottom.findViewById(R.id.downloadTipsLottie)
downloadPb = view.findViewById(R.id.detail_progressbar)
downloadTips = view.findViewById(R.id.downloadTipsLottie)
overlayTv = view.findViewById(R.id.overlayTv)
overlayContainer = view.findViewById(R.id.overlayContainer)
extraOverlayTv = view.findViewById(R.id.extraOverlayTv)
multiVersionDownloadTv = downloadBottom.findViewById(R.id.multiVersionDownloadTv)
multiVersionDownloadTv = view.findViewById(R.id.multiVersionDownloadTv)
localDownloadContainer = view.findViewById(R.id.localDownloadContainer)
localDownloadSizeTv = view.findViewById(R.id.localDownloadSizeTv)
localDownloadTitleTv = view.findViewById(R.id.localDownloadTitleTv)

View File

@ -242,7 +242,7 @@ class CategoryV2ListAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.text = if (gameEntity.commentCount > 3) {
if (gameEntity.star == 10.0F) "10" else gameEntity.star.toString()

View File

@ -15,7 +15,6 @@ import com.gh.gamecenter.common.base.BaseSimpleDao
import com.gh.gamecenter.common.base.GlobalActivityManager.getCurrentPageEntity
import com.gh.gamecenter.common.base.GlobalActivityManager.getLastPageEntity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.retrofit.Response
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.GsonUtils.toJson
@ -630,7 +629,6 @@ class UpdatableGameViewModel(
downloadEntity.addMetaExtra(Constants.APK_MD5, update.md5)
downloadEntity.addMetaExtra(Constants.GAME_NAME, update.name)
downloadEntity.addMetaExtra(Constants.GAME_CATEGORY_IN_CHINESE, update.categoryChinese)
downloadEntity.addMetaExtra(Constants.DOWNLOAD_STATUS_IN_CHINESE, update.downloadStatusChinese)
downloadEntity.putGameCategory(update.category ?: "")
if (update.isModdedGame) {
downloadEntity.addMetaExtra(Constants.EXTRA_IS_MODDED_GAME, "true")
@ -687,9 +685,6 @@ class UpdatableGameViewModel(
// 收集下载数据
DataCollectionUtils.uploadDownload(getApplication(), downloadEntity, "开始")
val pushMessageId = (HaloApp.get(Constants.PUSH_MESSAGE_ID, false) as? String) ?: ""
val pushLinkId = (HaloApp.get(Constants.PUSH_LINK_ENTITY, false) as? LinkEntity)?.link ?: ""
val isFromPush = pushMessageId.isNotEmpty()
SensorsBridge.trackEventWithExposureSource(
"DownloadProcessBegin",
event.source,
@ -705,9 +700,6 @@ class UpdatableGameViewModel(
"last_page_business_id", getLastPageEntity().pageBusinessId,
"download_status", update.downloadStatusChinese,
"download_type", "本地下载",
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
)
}

View File

@ -11,8 +11,6 @@ class ReserveReminderEntity(
private var _smsConfig: SmsConfig? = null,
@SerializedName("wechat_config")
private var _wechatConfig: WechatConfigEntity? = null,
@SerializedName("calendar_config")
private var _calendarConfig: CalendarConfig? = null,
@SerializedName("mirror_type")
private val _mirrorType: String? = null,
@SerializedName("wifi_auto_download")
@ -36,14 +34,8 @@ class ReserveReminderEntity(
_wechatConfig = value
}
val hasCalendarConfig: Boolean
get() = _calendarConfig != null
var calendarConfig: CalendarConfig
get() = _calendarConfig ?: CalendarConfig()
set(value) {
_calendarConfig = value
}
val onlyShowWechatReminder: Boolean
get() = _smsConfig == null
val mirrorType: String
get() = _mirrorType ?: ""
@ -89,39 +81,4 @@ class ReserveReminderEntity(
}
}
@Parcelize
class CalendarConfig(
@SerializedName("notice")
private val _notice: Boolean? = null,
@SerializedName("title")
private val _title: String? = null,
@SerializedName("time_start")
private val _timeStart: Long? = null,
@SerializedName("time_end")
private val _timeEnd: Long? = null,
@SerializedName("advance_seconds")
private val _advanceSeconds: Long? = null,
@SerializedName("remark")
private val _remark: String? = null
) : Parcelable {
val notice: Boolean
get() = _notice ?: false
val title: String
get() = _title ?: ""
val timeStart: Long
get() = _timeStart ?: 0L
val timeEnd: Long
get() = _timeEnd ?: 0L
val advanceSeconds: Long
get() = _advanceSeconds ?: 0L
val remark: String
get() = _remark ?: ""
}
}

View File

@ -130,13 +130,12 @@ data class SubjectEntity(
@IgnoredOnParcel
private var filteredData: MutableList<GameEntity>? = null
val subjectType: SubjectData.SubjectType
get() = when {
isQQColumn -> SubjectData.SubjectType.QQ_GAME
isWechatColumnCPM -> SubjectData.SubjectType.WECHAT_GAME_CPM
isWechatColumn -> SubjectData.SubjectType.WECHAT_GAME
else -> SubjectData.SubjectType.NORMAL
}
val subjectType: SubjectData.SubjectType get() = when {
isQQColumn -> SubjectData.SubjectType.QQ_GAME
isWechatColumnCPM -> SubjectData.SubjectType.WECHAT_GAME_CPM
isWechatColumn -> SubjectData.SubjectType.WECHAT_GAME
else -> SubjectData.SubjectType.NORMAL
}
val isMiniGame: Boolean get() = isQQColumn || isWechatColumn
@ -149,11 +148,4 @@ data class SubjectEntity(
val list: Int
get() = max(min(_list ?: 0, data?.size ?: 0), 1)
companion object {
const val SUBJECT_TAG_UPDATE = "update" // 更新时间
const val SUBJECT_TAG_TYPE = "type" // 游戏标签
const val SUBJECT_TAG_TEST = "test" // 开测时间
const val SUBJECT_TAG_SELLING_POINT = "selling_points&type" // 卖点文案+游戏标签
}
}

View File

@ -37,9 +37,9 @@ class UserSearchListFragment : LazyListFragment<FollowersOrFansEntity, UserSearc
SensorsBridge.trackUserSearchResultClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
mListViewModel.sourceEntrance,
mSearchKey,
SearchActivity.toTrackSearchType(mSearchType),
mListViewModel.sourceEntrance,
userId,
position
)

View File

@ -3,10 +3,10 @@ package com.gh.gamecenter.game.vertical
import android.content.Context
import android.graphics.Color
import android.graphics.Typeface
import android.os.Build
import android.text.TextUtils
import android.util.AttributeSet
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
import android.widget.LinearLayout
import android.widget.Space
@ -17,12 +17,11 @@ import androidx.core.content.ContextCompat
import com.airbnb.lottie.LottieAnimationView
import com.airbnb.lottie.LottieDrawable
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.databinding.LayoutGameItemSellingPointBinding
import com.gh.gamecenter.common.utils.setDrawableEnd
import com.gh.gamecenter.common.view.GameTagContainerView
import com.gh.gamecenter.feature.view.DownloadButton
import com.gh.gamecenter.feature.view.GameIconView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.setDrawableEnd
import com.gh.gamecenter.common.view.GameTagContainerView
import splitties.dimensions.dip
import splitties.views.backgroundColor
import splitties.views.dsl.constraintlayout.*
@ -64,7 +63,6 @@ class GameItemUi(override val ctx: Context) : Ui {
var gamePlayCountTv: TextView
var mGameDesSpace: Space
var sellingPointsBinding: LayoutGameItemSellingPointBinding
override val root: ConstraintLayout = constraintLayout {
padding = dip(16)
@ -86,7 +84,6 @@ class GameItemUi(override val ctx: Context) : Ui {
gameTagContainer = GameTagContainerView(ctx).apply { id = R.id.label_list }
mGameDesSpace = space { }.apply { id = R.id.gameDesSpace }
recommendConstraintLayout = initRecommendConstraintLayout()
sellingPointsBinding = LayoutGameItemSellingPointBinding.inflate(LayoutInflater.from(context))
add(iconIv, lParams(dip(64), dip(64)) {
topOfParent()
@ -145,12 +142,6 @@ class GameItemUi(override val ctx: Context) : Ui {
endToEndOf(mGameDesSpace)
orientation = LinearLayout.HORIZONTAL
})
add(sellingPointsBinding.root, lParams(0, wrapContent) {
topToBottomOf(mGameDesSpace)
bottomToBottomOf(iconIv)
startToEndOf(gamePlayCountTv)
endToEndOf(mGameDesSpace)
})
add(gamePlayCountTv, lParams(wrapContent, wrapContent) {
topToBottomOf(mGameDesSpace)
bottomToBottomOf(iconIv)
@ -206,8 +197,7 @@ class GameItemUi(override val ctx: Context) : Ui {
startPadding = dip(2)
endPadding = dip(2)
ellipsize = TextUtils.TruncateAt.END
background =
ContextCompat.getDrawable(context, com.gh.gamecenter.feature.R.drawable.bg_advance_download_game_subtitle)
background = ContextCompat.getDrawable(context, com.gh.gamecenter.feature.R.drawable.bg_advance_download_game_subtitle)
setTextColor(ContextCompat.getColor(context, com.gh.gamecenter.common.R.color.text_secondary))
visibility = View.GONE
}
@ -315,12 +305,7 @@ class GameItemUi(override val ctx: Context) : Ui {
gravity = Gravity.CENTER
text = "展开"
setTextColor(ContextCompat.getColor(context, com.gh.gamecenter.common.R.color.white))
setDrawableEnd(
AppCompatResources.getDrawable(
context,
com.gh.gamecenter.feature.R.drawable.ic_jump_universal
)
)
setDrawableEnd(AppCompatResources.getDrawable(context, com.gh.gamecenter.feature.R.drawable.ic_jump_universal))
compoundDrawablePadding = dip(2)
visibility = View.GONE
}

View File

@ -166,7 +166,7 @@ class GameVerticalAdapter(
false
)
BindingAdapters.setGame(iconIv, gameEntity)
BindingAdapters.setGameTags(gameTagContainer, gameEntity, subjectData?.tag ?: "")
BindingAdapters.setGameTags(gameTagContainer, gameEntity)
GameItemViewHolder.initServerType(gameNameTv, serverTypeTv, gameEntity)
gameDesTv.text = gameEntity.decoratedDes
GameItemViewHolder.initGameSubtitleAndAdLabel(
@ -225,10 +225,10 @@ class GameVerticalAdapter(
subjectData?.briefStyle
)
DownloadItemUtils.setOnClickListener(
context, downloadTv, gameEntity, position,
adapter, entrance, location = location, traceEvent = gameEntity.exposureEvent
)
DownloadItemUtils.setOnClickListener(
context, downloadTv, gameEntity, position,
adapter, entrance, location = location, traceEvent = gameEntity.exposureEvent
)
root.setPadding(paddingStart, 8F.dip2px(), paddingEnd, 8F.dip2px())
}

View File

@ -610,7 +610,7 @@ open class GameCollectionDetailAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(
if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable(mContext) else null
)

View File

@ -45,6 +45,7 @@ import com.google.gson.JsonArray
import com.google.gson.reflect.TypeToken
import com.halo.assistant.HaloApp
import com.halo.assistant.accelerator.repository.AccelerationRepository
import com.halo.assistant.accelerator.repository.AcceleratorDataHolder
import com.lightgame.utils.Utils
import io.reactivex.Single
import io.reactivex.android.schedulers.AndroidSchedulers
@ -132,9 +133,7 @@ class GameDetailViewModel(
private var isGameUpdatable = false
private val compositeDisposable = CompositeDisposable()
private var userRelatedInfoReceivedCallback: (() -> Unit)? = null
init {
loadData()
}
@ -770,14 +769,8 @@ class GameDetailViewModel(
.subscribe({
unifiedUserTrendEntity = it
emitter.onSuccess(Result.success(it))
userRelatedInfoReceivedCallback?.invoke()
userRelatedInfoReceivedCallback = null
}, {
emitter.onSuccess(Result.failure(it))
userRelatedInfoReceivedCallback?.invoke()
userRelatedInfoReceivedCallback = null
})
}
@ -807,21 +800,9 @@ class GameDetailViewModel(
tabSelectedLiveData.postValue(Event(LinkEntity(type = type)))
}
/**
* 发送内容卡片点击事件
* @param contentCardType 内容卡片类型
* @param waitForUserRelatedResult 是否等待用户相关信息请求结果
* @return 是否成功触发点击事件
*/
fun performContentCardClicked(contentCardType: String, waitForUserRelatedResult: Boolean = false): Boolean {
fun performContentCardClicked(contentCardType: String): Boolean {
return if (contentCardList?.any { it.link.type == contentCardType } == true) {
if (waitForUserRelatedResult && CheckLoginUtils.isLogin()) {
userRelatedInfoReceivedCallback = {
contentCardClickedLiveData.postValue(Event(contentCardType))
}
} else {
contentCardClickedLiveData.postValue(Event(contentCardType))
}
contentCardClickedLiveData.postValue(Event(contentCardType))
true
} else {
false
@ -831,7 +812,7 @@ class GameDetailViewModel(
fun performScrollToServer(): Boolean {
// 如果该游戏的【内容卡片】在详情中显示类型为【游戏开服】的卡片时,触发点击类型为【游戏开服】的内容卡片进入开服日历表页面
// 如果该游戏的【内容卡片】在详情中没有【游戏开服】的卡片时,定位到游戏详情页-详情tab-【游戏开服】组件
return if (performContentCardClicked(ContentCardEntity.TYPE_SERVER, true)) {
return if (performContentCardClicked(ContentCardEntity.TYPE_SERVER)) {
true
} else if (detailDataListLiveData.value?.any { it.linkServer != null } == true) {
scrollToListPositionLiveData.postValue(Event(LinkEntity(type = GameDetailData.TYPE_SERVER)))
@ -981,7 +962,7 @@ class GameDetailViewModel(
unifiedUserTrendEntity.game?.let {
if (it.isEmpty()) return@let
for (game in it) {
meLiveData.value = game.me
meLiveData.postValue(game.me)
break
}
}

View File

@ -471,8 +471,8 @@ class GameDetailWrapperFragment : BaseLazyFragment(), IScrollable {
}, 120)
val viewHolder = detailViewHolder
binding.divider.isVisible = true
DetailDownloadUtils.updateViewHolder(viewHolder)
binding.divider.isVisible = binding.detailLlBottom.root.isVisible
if (autoDownload || isOpenPlatformWindow && gameEntity!!.getApk().size > 1) {
viewHolder.downloadPb.performClick()
@ -727,8 +727,6 @@ class GameDetailWrapperFragment : BaseLazyFragment(), IScrollable {
fragment = fragment ?: WebFragment()
bundle.putString(EntranceConsts.KEY_ENTRANCE, "游戏专区")
bundle.putString(EntranceConsts.KEY_URL, zone.link)
bundle.putBoolean(WebFragment.KEY_ENABLE_HORIZONTAL_SCROLL_DISPATCH, true)
bundle.putBoolean(WebFragment.KEY_FORCE_ENABLE_NESTED_SCROLL, true)
} else {
fragment = fragment ?: FuLiFragment()
}
@ -737,12 +735,6 @@ class GameDetailWrapperFragment : BaseLazyFragment(), IScrollable {
GameDetailTabEntity.TYPE_WEB -> {
fragment = fragment ?: WebFragment()
bundle.putString(EntranceConsts.KEY_URL, tabEntity.link?.link)
bundle.putBoolean(WebFragment.KEY_ENABLE_HORIZONTAL_SCROLL_DISPATCH, true)
bundle.putBoolean(WebFragment.KEY_FORCE_ENABLE_NESTED_SCROLL, true)
bundle.putBoolean(
WebFragment.KEY_LEAVE_WEB_PAGE_TO_HANDLE_BACK_PRESSED,
tabEntity.link?.link?.contains("leave_web_page_handle_back_pressed=true") == true
)
}
GameDetailTabEntity.TYPE_GIFT -> {
@ -757,7 +749,6 @@ class GameDetailWrapperFragment : BaseLazyFragment(), IScrollable {
bundle.putString(EntranceConsts.KEY_CUSTOM_PAGE_ID, tabEntity.link?.link)
bundle.putString(EntranceConsts.KEY_CUSTOM_PAGE_NAME, tabEntity.link?.text)
bundle.putBoolean(EntranceConsts.KEY_SHOW_FLOATING_WINDOW, false)
bundle.putBoolean(EntranceConsts.KEY_SHOW_PULL_DOWN_PUSH, false)
}
}
fragment?.let {
@ -766,7 +757,7 @@ class GameDetailWrapperFragment : BaseLazyFragment(), IScrollable {
}
}
viewPager.setRestoredCurItem(destinationTab)
onPageSelected(destinationTab)
currentVpPosition = destinationTab
viewPager.offscreenPageLimit = fragmentsList.size
viewPager.adapter =
FragmentAdapter(childFragmentManager, fragmentsList, tabEntityList.map { it.name })
@ -1550,12 +1541,9 @@ class GameDetailWrapperFragment : BaseLazyFragment(), IScrollable {
downloadMenuIcon?.setImageResource(R.drawable.toolbar_download)
if (::viewModel.isInitialized) {
updateConcernMenuIcon(viewModel.meLiveData.value?.isGameConcerned ?: false)
if (gameEntity != null) {
val viewHolder = detailViewHolder
viewHolder.downloadPb.buttonStyle = detailViewHolder.downloadPb.buttonStyle
if (viewHolder.downloadTips.isVisible) {
viewHolder.downloadTips.setDownloadTipsAnimation(detailViewHolder.downloadTips.isAnimating)
}
detailViewHolder.downloadPb.buttonStyle = detailViewHolder.downloadPb.buttonStyle
if (detailViewHolder.downloadTips.visibility == View.VISIBLE) {
detailViewHolder.downloadTips.setDownloadTipsAnimation(detailViewHolder.downloadTips.isAnimating)
}
}
controlReserveBtn()

View File

@ -27,6 +27,7 @@ import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.gamedetail.StartingAcceleratorViewModel
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper.Companion.DISTRICT_SERVER_HAVA
import com.gh.gamecenter.gamedetail.accelerator.GameDetailAcceleratorUiHelper.Companion.SOURCE_ENTRANCE_GAME_DETAIL
import com.gh.gamecenter.gamedetail.accelerator.dialog.AcceleratorDialogFragment.Companion.SPEED_ENABLE_VIP
import com.gh.gamecenter.gamedetail.accelerator.dialog.AcceleratorDialogFragment.Companion.SPEED_START_FAILURE
import com.gh.gamecenter.livedata.EventObserver
import com.gh.gamecenter.login.user.UserManager
@ -75,7 +76,7 @@ class StartingAcceleratorDialogFragment : BaseDialogFragment() {
is AccelerateState.Failure -> {
// 有些错误需要额外处理,这里直接跳过错误提示(如token失效登录时token设置失败)
if ((state.isTokenInvalid) && refreshTokenCount < REFRESH_TOKEN_MAX_COUNT) {
if ((state.isTokenExpired || state.isTokenEmpty) && refreshTokenCount < REFRESH_TOKEN_MAX_COUNT) {
// do nothing
} else {
if (!state.isSkipError) {
@ -108,7 +109,7 @@ class StartingAcceleratorDialogFragment : BaseDialogFragment() {
is AccelerateState.Normal -> {
if (state.isTokenInvalid) {
if (state.isTokenExpired || state.isTokenEmpty) {
// token过期/登录时token设置失败,在此获取token并重新启动加速(最多重试三次)
if (refreshTokenCount < REFRESH_TOKEN_MAX_COUNT) {
viewModel.loadAcceleratorToken()

View File

@ -271,7 +271,8 @@ class GameDetailFragment : LazyFragment(), IScrollable {
}
val infoTagData = viewModel.infoTagLiveData.value
val showFunctionTagGuide = !infoTagData?.infoTags.isNullOrEmpty() && SPUtils.getBoolean(Constants.SP_SHOW_GAME_DETAIL_FUNCTION_TAG_GUIDE, true)
val isFunctionTagShow = infoTagData?.requestSpeedStatus == "on" || !infoTagData?.infoTags.isNullOrEmpty()
val showFunctionTagGuide = isFunctionTagShow && SPUtils.getBoolean(Constants.SP_SHOW_GAME_DETAIL_FUNCTION_TAG_GUIDE, true)
if (!isPerformedSuccess && showFunctionTagGuide) {
binding.coverRv.post {
showFunctionTagGuide()
@ -923,7 +924,6 @@ class GameDetailFragment : LazyFragment(), IScrollable {
// 登录事件/礼包状态变更事件
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(reuse: EBReuse) {
if (!::viewModel.isInitialized) return
if (reuse.type == Constants.LOGIN_TAG || (reuse.type == Constants.LIBAO_CHANGED_TAG && !isSupportVisible)) {
viewModel.getUserRelatedInfoAndGiftStatus()
}
@ -932,7 +932,6 @@ class GameDetailFragment : LazyFragment(), IScrollable {
// 更新评分
@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(data: EBStar) {
if (!::binding.isInitialized) return
if (binding.scoreContainer.isVisible) {
val showScore = data.commentCount > 3
binding.scoreIv.setImageResource(if (showScore) R.drawable.text_game_detail_score else R.drawable.text_game_detail_no_score)
@ -945,8 +944,6 @@ class GameDetailFragment : LazyFragment(), IScrollable {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (!::viewModel.isInitialized) return
val commentPosition = detailListAdapter.currentList.indexOfFirst { it.linkComment != null }
if (resultCode == Activity.RESULT_OK) {
if (GameDetailCommentItemViewHolder.RATING_REPLY_REQUEST == requestCode || GameDetailCommentItemViewHolder.RATING_PATCH_REQUEST == requestCode) {
@ -998,8 +995,6 @@ class GameDetailFragment : LazyFragment(), IScrollable {
override fun onDarkModeChanged() {
super.onDarkModeChanged()
if (!::binding.isInitialized || !::viewModel.isInitialized) return
binding.coverSfv.run {
setIndicatorBackground(com.gh.gamecenter.common.R.drawable.background_shape_white_radius_999.toDrawable(requireContext()))
setTextColor(

View File

@ -150,7 +150,7 @@ class GameDetailCoverAdapter(
val ratio = imageWidth / imageHeight.toFloat()
ConstraintSet().also {
it.clone(holder.binding.root)
it.setDimensionRatio(holder.binding.galleryIv.id, if (isLandscape) "h,16:9" else "")
it.setDimensionRatio(holder.binding.galleryIv.id, if (isLandscape) "h,344:193" else "")
}.applyTo(holder.binding.root)
holder.binding.root.updateLayoutParams<MarginLayoutParams> {
width = if (isLandscape || isSingleGallery) ViewGroup.LayoutParams.MATCH_PARENT else ViewGroup.LayoutParams.WRAP_CONTENT

View File

@ -51,7 +51,7 @@ class GameDetailRelatedGameAdapter(
holder.binding.root.setPadding(paddingStart, 8F.dip2px(), paddingEnd, 8F.dip2px())
holder.binding.gameNameTv.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(context))
holder.binding.gameNameTv.text = gameEntity.name
BindingAdapters.setGameTags(holder.binding.gameLabelLl, gameEntity, "")
BindingAdapters.setGameTags(holder.binding.gameLabelLl, gameEntity)
holder.binding.gameIconView.displayGameIcon(gameEntity)
holder.binding.gameIconView.setBorderColor(com.gh.gamecenter.common.R.color.resource_border)
holder.itemView.setOnClickListener {

View File

@ -179,15 +179,11 @@ class GameDetailComprehensivePanelItemViewHolder(
override fun onBindViewHolder(holder: ComprehensivePanelFunctionItemViewHolder, position: Int) {
val data = dataList.getOrNull(position) ?: return
holder.binding.numberIv.goneIf(dataList.size < 2) {
holder.binding.numberIv.setImageResource(R.drawable.bg_game_detail_comprehensive_panel_function_number)
}
holder.binding.numberIv.setImageResource(R.drawable.bg_game_detail_comprehensive_panel_function_number)
holder.binding.numberTv.run {
goneIf(dataList.size < 2) {
setTextColor(com.gh.gamecenter.common.R.color.text_aw_primary.toColor(context))
setTypeface(Typeface.createFromAsset(context.assets, Constants.DIN_FONT_PATH))
text = (position + 1).toString()
}
setTextColor(com.gh.gamecenter.common.R.color.text_aw_primary.toColor(context))
setTypeface(Typeface.createFromAsset(context.assets, Constants.DIN_FONT_PATH))
text = (position + 1).toString()
}
holder.binding.contentTv.run {
setTextColor(com.gh.gamecenter.common.R.color.text_secondary.toColor(context))

View File

@ -211,7 +211,7 @@ class GameDetailContentCardSingleItemViewHolder(
ServersCalendarActivity.getIntent(
context,
viewModel.game!!, contentCardEntity.server!!,
viewModel.meLiveData.value ?: MeEntity()
MeEntity()
)
)
}

View File

@ -120,14 +120,14 @@ class GameDetailInfoItemViewHolder(
nameTv.setTextColor(com.gh.gamecenter.common.R.color.text_tertiary.toColor(context))
infoTv.setTextColor(if (data.name == TYPE_ICP) com.gh.gamecenter.common.R.color.text_theme.toColor(context) else com.gh.gamecenter.common.R.color.text_secondary.toColor(context))
actionTv.setTextColor(com.gh.gamecenter.common.R.color.text_theme.toColor(context))
nameTv.text = if (data.name == TYPE_CONTACT) data.text else normalTypeNameMap[data.name]
nameTv.text = if (data.name == TYPE_CONTACT) data.contact?.hint else normalTypeNameMap[data.name]
infoTv.text = when (data.name) {
TYPE_INTERNET -> if (data.value == "yes") "" else ""
TYPE_UPDATE_TIME -> data.value.toLongOrNull()?.let { TimeUtils.getFormatTime(it) }
else -> data.value
}
actionTv.goneIf(data.name != TYPE_CONTACT) {
val actionString = if (data.type == "qq") ACTION_CONTACT else if (data.key.isNotEmpty()) ACTION_JOIN else ACTION_COPY
actionTv.goneIf(data.name != TYPE_CONTACT || data.contact == null) {
val actionString = if (data.contact?.type == "qq") ACTION_CONTACT else if (data.contact?.key.isNullOrEmpty()) ACTION_COPY else ACTION_JOIN
actionTv.text = actionString
actionTv.setOnClickListener {
when (actionString) {
@ -141,7 +141,7 @@ class GameDetailInfoItemViewHolder(
ACTION_JOIN -> {
if (ShareUtils.isQQClientAvailable(context)) {
DirectUtils.directToQqGroup(context, data.key)
DirectUtils.directToQqGroup(context, data.contact?.key)
} else {
data.value.copyTextAndToast("已复制")
}
@ -191,11 +191,11 @@ class GameDetailInfoItemViewHolder(
const val TYPE_CREDIT_CODE = "credit_code"
const val TYPE_SIZE = "size"
const val TYPE_SUPPLIER = "supplier"
const val TYPE_CONTACT = "qq/qq_qun"
const val TYPE_CONTACT = "contact"
const val ACTION_COPY = "复制"
const val ACTION_JOIN = "加入"
const val ACTION_CONTACT = "添加"
const val ACTION_CONTACT = "咨询"
// 固定信息类型
val staticTypeNameMap = mapOf(

View File

@ -53,7 +53,7 @@ class GameDetailServerItemViewHolder(
context,
viewModel.game!!,
entity,
viewModel.meLiveData.value
null
)
context.startActivity(intent)
viewModel.game?.let {

View File

@ -408,14 +408,12 @@ data class GameDetailInfo(
@Parcelize
data class InfoItem(
val name: String = "",
val type: String = "",
val text: String = "",
val key: String = "", // QQ群KEY
val value: String = "",
@SerializedName("is_first")
val isFirst: Boolean = true, // 是否显示在一级页面
val order: Int = -1, // 排序
val permissions: List<Permission>? = null,
val contact: Contact? = null
): Parcelable
}

View File

@ -513,13 +513,12 @@ class RatingEditActivity : ToolBarActivity(), KeyboardHeightObserver {
ToastUtils.showToast("请先给游戏打分", if (mIsKeyBoardShow) Gravity.CENTER else -1)
return@OnReturnValue
}
val contentLength = content.count { !it.isWhitespace() }
if (contentLength == 0) {
if (content.isEmpty()) {
ToastUtils.showToast("评论内容不能为空喔~", if (mIsKeyBoardShow) Gravity.CENTER else -1)
return@OnReturnValue
}
if (contentLength > 10000) {
if (content.length > 10000) {
ToastUtils.showToast("评论最多10000个字", if (mIsKeyBoardShow) Gravity.CENTER else -1)
return@OnReturnValue
}

View File

@ -112,7 +112,6 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable, IB
private var bottomTabName = ""
private var tabIndex = -1
private var showFloatingWindow = true
private var showPullDownPush = true
private lateinit var pageLocation: PageLocation
@ -144,7 +143,6 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable, IB
bottomTabName = arguments?.getString(EntranceConsts.KEY_BOTTOM_TAB_NAME, "") ?: ""
tabIndex = arguments?.getInt(EntranceConsts.KEY_TAB_INDEX, -1) ?: -1
showFloatingWindow = arguments?.getBoolean(EntranceConsts.KEY_SHOW_FLOATING_WINDOW, true) ?: true
showPullDownPush = arguments?.getBoolean(EntranceConsts.KEY_SHOW_PULL_DOWN_PUSH, true) ?: true
val tabName = arguments?.getString(EntranceConsts.KEY_TAB_NAME, "") ?: ""
val multiTabNavId = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_ID, "") ?: ""
val multiTabNavName = arguments?.getString(EntranceConsts.KEY_MULTI_TAB_NAV_NAME, "") ?: ""
@ -589,9 +587,7 @@ class CustomPageFragment : LazyFragment(), ISmartRefreshContent, IScrollable, IB
private fun buildPriorityChain() {
val videoHandler = VideoHandler(24, scrollCalculatorHelper)
if (showPullDownPush) {
priorityChain.addHandler(pullDownPushHandler)
}
priorityChain.addHandler(pullDownPushHandler)
if (showFloatingWindow) {
val floatingWindowHandler = CustomFloatingWindowHandler(23)

View File

@ -187,7 +187,7 @@ class CustomFoldSlideLargeImageItemAdapter(
binding.gStar.goneIf(!(data.data.showStar && game.commentCount > 3)) {
binding.tvStar.text = if (game.star == 10.0F) "10" else game.star.toString()
}
BindingAdapters.setGameTags(binding.llLabel, game, "")
BindingAdapters.setGameTags(binding.llLabel, game)
binding.cvContainer.setCardBackgroundColor(com.gh.gamecenter.common.R.color.ui_surface.toColor(itemView.context))
try {

View File

@ -91,7 +91,7 @@ class CustomGamePluginAdapter(
binding.gameRating.textSize =
(if (gameEntity.commentCount > 3) 12 else 10).toFloat()
BindingAdapters.setGameName(binding.gameName, gameEntity, true)
BindingAdapters.setGameTags(binding.labelList, gameEntity, "")
BindingAdapters.setGameTags(binding.labelList, gameEntity)
binding.gameRating.setDrawableStart(
if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null,
null,

View File

@ -142,7 +142,7 @@ class CustomGameRefreshVerticalAdapter(
false
)
BindingAdapters.setGame(iconIv, gameEntity)
BindingAdapters.setGameTags(gameTagContainer, gameEntity, "")
BindingAdapters.setGameTags(gameTagContainer, gameEntity)
GameItemViewHolder.initServerType(gameNameTv, serverTypeTv, gameEntity)
gameDesTv.text = gameEntity.decoratedDes
GameItemViewHolder.initGameSubtitleAndAdLabel(

View File

@ -59,8 +59,7 @@ class CustomGameVerticalAdapter(
briefStyle = _data.briefStyle,
adIconActive = _data.adIconActive,
showSubscript = _data.showIndexIconSubscript,
showSubTitle = _data.showIndexSubtitle,
subjectTag = _data.tag ?: ""
showSubTitle = _data.showIndexSubtitle
)
holder.itemView.setOnClickListener {
@ -117,8 +116,7 @@ class CustomGameVerticalAdapter(
briefStyle: String,
adIconActive: Boolean,
showSubscript: Boolean,
showSubTitle: Boolean,
subjectTag: String = ""
showSubTitle: Boolean
) {
val context = itemView.context
@ -143,23 +141,16 @@ class CustomGameVerticalAdapter(
with(ui) {
gameNameTv.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(context))
serverTypeTv.setTextColor(com.gh.gamecenter.common.R.color.primary_theme.toColor(context))
downloadTv.background =
com.gh.gamecenter.common.R.drawable.download_button_normal_style.toDrawable(context)
downloadTv.background = com.gh.gamecenter.common.R.drawable.download_button_normal_style.toDrawable(context)
gameDesTv.setTextColor(com.gh.gamecenter.common.R.color.text_tertiary.toColor(context))
BindingAdapters.setGameName(
gameNameTv,
gameEntity,
false
)
iconIv.displayGameIconWithIfShowSubscript(gameEntity, showSubscript)
BindingAdapters.setGameTagsWithSellingPoint(
gameTagContainer,
sellingPointsBinding,
gameEntity,
subjectTag
)
BindingAdapters.setGameTags(gameTagContainer, gameEntity)
GameItemViewHolder.initServerType(gameNameTv, serverTypeTv, gameEntity)
val styleResId = R.style.CustomPageGameRating

View File

@ -46,7 +46,6 @@ import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_ITEM_TYPE_GAME_HORIZONTAL_TIME_LINE
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_ITEM_TYPE_GAME_ICON_MATRIX
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_ITEM_TYPE_GAME_LONG_LIST
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_ITEM_TYPE_GAME_VERTICAL_IMAGE_TEXT
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_ITEM_TYPE_GAME_VERTICAL_SLIDE
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_ITEM_TYPE_HORIZONTAL_SLIDE_VIDEO_LIST
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_PAGE_ITEM_TYPE_MINI_GAME_RECENT_PLAY
@ -77,7 +76,7 @@ class CustomPageAdapter(
/**
* 记录第一个显示的 itemView 的位置
* note由于组件中可能在第一个位置配置了 va最近在玩 qq小游戏最近在玩 微信小游戏最近在玩 加速-最近在玩
* note由于组件中可能在第一个位置配置了 va最近在玩 qq小游戏最近在玩 微信小游戏最近在玩
* 当后台配置了这几个组件时用户还没有玩过游戏这几个组件会加入到显示列表中由于还没有数据ItemView处于隐藏状态
* 所以:使用 viewHolder.bindingAdapterPosition == 0 来判断是否是第一个组件时会出现不准的情况
*/
@ -95,44 +94,35 @@ class CustomPageAdapter(
super.submitList(dataWithFooter)
}
/**
* 查找第一个出现的组件 在 data 中的位置
* 请注意:这里的 return 不能删除
*/
fun updateFirstItemId() {
currentList.forEachIndexed { index, item ->
when (item) {
is CustomRecentGamesItem -> {
if (item.data.isNotEmpty()) {
_firstShowPosition.value = index
return
}
}
is CustomRecentWeChatMiniGamesItem -> {
if (item.data.isNotEmpty()) {
_firstShowPosition.value = index
return
}
}
is CustomRecentQqMiniGamesItem -> {
if (item.data.isNotEmpty()) {
_firstShowPosition.value = index
return
}
}
is CustomRecentAcceleratorItem -> {
if (item.data.isNotEmpty()) {
_firstShowPosition.value = index
return
}
}
else -> {
_firstShowPosition.value = index
return
}
}
}
@ -286,9 +276,6 @@ class CustomPageAdapter(
CUSTOM_PAGE_ITEM_TYPE_DOUBLE_GAME_WELFARE_CARD ->
CustomDoubleWelfareCardViewHolder(viewModel, parent.toBinding())
CUSTOM_PAGE_ITEM_TYPE_GAME_VERTICAL_IMAGE_TEXT ->
CustomGameVerticalImageTextViewHolder(viewModel, parent.toBinding())
CUSTOM_PAGE_ITEM_TYPE_ACCELERATOR_RECENT_PLAYED -> {
CustomRecentAcceleratorViewHolder(viewModel, parent.toBinding())
}
@ -489,15 +476,15 @@ class CustomPageAdapter(
val positionList = ArrayList<GameAndPosition>()
viewModel.getNewGameTestUserCase(item.link.link ?: "none")
.getDataListLiveData().value?.forEach { gameDataWrapper ->
val gameEntity = gameDataWrapper.gameData
if (gameEntity != null) {
for (apkEntity in gameEntity.getApk()) {
if (apkEntity.packageName == packageName) {
positionList.add(GameAndPosition(gameEntity, position))
}
val gameEntity = gameDataWrapper.gameData
if (gameEntity != null) {
for (apkEntity in gameEntity.getApk()) {
if (apkEntity.packageName == packageName) {
positionList.add(GameAndPosition(gameEntity, position))
}
}
}
}
positionList
}

View File

@ -1,14 +1,9 @@
package com.gh.gamecenter.home.custom.adapter
package com.gh.gamecenter.home.custom.adapter
import android.content.Context
import android.widget.TextView
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toResString
import com.gh.gamecenter.common.utils.visibleIf
import com.gh.gamecenter.core.utils.TimeUtils
import com.gh.gamecenter.feature.entity.GameEntity
import kotlin.math.roundToInt
object CustomViewExt {
@ -50,48 +45,9 @@ object CustomViewExt {
"size&brief" -> getBriefWithSize()
"star&brief" -> game.brief
"recommend" -> game.columnRecommend?.text ?: getBriefWithSize()
"test&appointment" -> getBriefWithTestAndAppointment(game, tvDesc.context)
else -> getBriefWithSize()
}
tvDesc.text = brief
}
private fun getBriefWithTestAndAppointment(game: GameEntity, context: Context) =
if (game.test?.startPending == true) {
val startText = game.test?.startText ?: ""
if (startText.isBlank()) {
getBookVolumeText(game.appointmentCount, context, false)
} else {
"$startText${getBookVolumeText(game.appointmentCount, context, true)}"
}
} else {
"${getTestDescription(game)}${getBookVolumeText(game.appointmentCount, context, true)}"
}
private fun getTestDescription(game: GameEntity): String {
val timeText = TimeUtils.formatTestTime(game.test?.start ?: 0L)
val eventName = if (game.test?.type == "删档内测") {
R.string.first_release.toResString()
} else {
R.string.go_live.toResString()
}
return "$timeText$eventName"
}
private fun getBookVolumeText(number: Int, context: Context, showDivider: Boolean): String =
when {
number == 0 -> ""
number <= 99999 -> context.getString(
R.string.number_of_reservations,
if (showDivider) " | $number" else "$number"
)
else -> context.getString(
R.string.number_of_reservations,
if (showDivider) " | ${(number / 10000F).roundToInt()}W" else "${(number / 10000F).roundToInt()}W"
)
}
}

View File

@ -112,7 +112,6 @@ abstract class CustomPageItem(
const val COMPONENTS_SUBJECT_TYPE_GAME_EXPAND = "game_expand"
const val COMPONENTS_SUBJECT_TYPE_SINGLE_GAME_CARD = "game_single_card"
const val COMPONENTS_SUBJECT_TYPE_DOUBLE_GAME_WELFARE_CARD = "game_double_welfare_card"
const val COMPONENTS_SUBJECT_TYPE_GAME_VERTICAL_IMAGE_TEXT = "game_vertical_image_text"
// 合集
const val COMPONENTS_COLLECTION_STYLE_RANKING_LIST = "ranking-list"
@ -181,7 +180,6 @@ abstract class CustomPageItem(
const val CUSTOM_PAGE_ITEM_TYPE_DOUBLE_GAME_WELFARE_CARD = 37
const val CUSTOM_PAGE_ITEM_TYPE_PK = 38
const val CUSTOM_PAGE_ITEM_TYPE_ACCELERATOR_RECENT_PLAYED = 39
const val CUSTOM_PAGE_ITEM_TYPE_GAME_VERTICAL_IMAGE_TEXT = 40
// 专题样式 to itemType
val subjectTypeMap: HashMap<String, Int> = hashMapOf(
@ -198,7 +196,6 @@ abstract class CustomPageItem(
COMPONENTS_SUBJECT_TYPE_GAME to CUSTOM_PAGE_ITEM_TYPE_GAME_HOME_GAME_ITEM,
COMPONENTS_SUBJECT_TYPE_SINGLE_GAME_CARD to CUSTOM_PAGE_ITEM_TYPE_SINGLE_GAME_CARD,
COMPONENTS_SUBJECT_TYPE_DOUBLE_GAME_WELFARE_CARD to CUSTOM_PAGE_ITEM_TYPE_DOUBLE_GAME_WELFARE_CARD,
COMPONENTS_SUBJECT_TYPE_GAME_VERTICAL_IMAGE_TEXT to CUSTOM_PAGE_ITEM_TYPE_GAME_VERTICAL_IMAGE_TEXT
)
// 专题样式 to 组件样式名称
@ -217,8 +214,7 @@ abstract class CustomPageItem(
COMPONENTS_SUBJECT_TYPE_GAME to "展开大图",
COMPONENTS_SUBJECT_TYPE_GAME_EXPAND to "展开大图",
COMPONENTS_SUBJECT_TYPE_SINGLE_GAME_CARD to "单游戏卡片",
COMPONENTS_SUBJECT_TYPE_DOUBLE_GAME_WELFARE_CARD to "双列福利卡片",
COMPONENTS_SUBJECT_TYPE_GAME_VERTICAL_IMAGE_TEXT to "竖式图文列表"
COMPONENTS_SUBJECT_TYPE_DOUBLE_GAME_WELFARE_CARD to "双列福利卡片"
)
}

View File

@ -23,12 +23,6 @@ import com.gh.gamecenter.entity.GameUpdateEntity
import com.gh.gamecenter.entity.PullDownPush
import com.gh.gamecenter.entity.SubjectEntity
import com.gh.gamecenter.feature.entity.*
import com.gh.gamecenter.entity.SubjectEntity.Companion.SUBJECT_TAG_SELLING_POINT
import com.gh.gamecenter.entity.SubjectEntity.Companion.SUBJECT_TAG_UPDATE
import com.gh.gamecenter.feature.entity.FloatingWindowEntity
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.entity.PluginLocation
import com.gh.gamecenter.feature.entity.TagStyleEntity
import com.gh.gamecenter.feature.utils.ApkActiveUtils
import com.gh.gamecenter.gamedetail.rating.edit.RatingEditActivity
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMMON_CONTENT_COLLECTION_LAYOUT_BANNER
@ -53,7 +47,6 @@ import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMPONENTS_S
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMPONENTS_SUBJECT_TYPE_GAME_HORIZONTAL
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMPONENTS_SUBJECT_TYPE_GAME_HORIZONTAL_SLIDE
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMPONENTS_SUBJECT_TYPE_GAME_TIMELINE_HORIZONTAL_SLIDE
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMPONENTS_SUBJECT_TYPE_GAME_VERTICAL_IMAGE_TEXT
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMPONENTS_SUBJECT_TYPE_GAME_VERTICAL_SLIDE
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_LINK_TYPE_COLUMN
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.CUSTOM_LINK_TYPE_GAME
@ -717,21 +710,29 @@ class CustomPageRepository private constructor(
// 替换游戏
substituteGameIfNeeded(gameSubject)
if (gameSubject.tag == "update") {
// 优先显示更新标签
gameSubject.data?.forEach {
it.tagStyle.clear()
it.tagStyle.add(
TagStyleEntity(
id = "local_generated",
name = TimeUtils.getFormatTime(it.updateTime, "MM-dd") + " 更新",
color = "1383EB",
background = "E8F3FF",
column = "1383EB"
)
)
}
}
when (gameSubject.type) {
COMPONENTS_GAME_SUBJECT_TYPE_DOUBLE_CARD, COMPONENTS_SUBJECT_TYPE_DOUBLE_GAME_WELFARE_CARD, COMPONENTS_SUBJECT_TYPE_GAME_VERTICAL_IMAGE_TEXT -> {
// 双列卡片 双列福利卡片 竖式图文列表
COMPONENTS_GAME_SUBJECT_TYPE_DOUBLE_CARD, COMPONENTS_SUBJECT_TYPE_DOUBLE_GAME_WELFARE_CARD -> {
// 双列卡片 双列福利卡片
val gameCount = gameSubject.data?.size ?: 0
if (gameCount >= COMPONENT_TYPE_COLUMN_LIMIT_TWO_COUNT) {
val isMustFullyCover = gameSubject.type == COMPONENTS_SUBJECT_TYPE_GAME_VERTICAL_IMAGE_TEXT
val subjectItems =
convertSplitSubjectItems(
link,
subjectEntity,
currentPosition,
componentPosition,
2,
isMustFullyCover
)
convertSplitSubjectItems(link, subjectEntity, currentPosition, componentPosition, 2, false)
list.addAll(subjectItems)
currentPosition += subjectItems.size
}

View File

@ -10,7 +10,6 @@ import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.databinding.CommonCollection12ItemCustomBinding
import com.gh.gamecenter.databinding.CommonCollectionItemBinding
import com.gh.gamecenter.databinding.CommonCollectionItemCustomBinding
import com.gh.gamecenter.entity.CommonCollectionContentEntity
import com.gh.gamecenter.home.custom.model.CustomPageData
import com.gh.gamecenter.home.custom.model.CustomPageItem.Companion.COMMON_CONTENT_COLLECTION_LAYOUT_DOUBLE_ROW_VERTICAL_CARD
@ -51,9 +50,14 @@ class CommonContentCollection12Ui(
} else {
width / 2
}
val leftBinding = CommonCollectionItemBinding.bind(binding.leftView.root)
val rightBinding = CommonCollectionItemBinding.bind(binding.rightView.root)
bindSubView(
data[leftPosition],
binding.leftView,
leftBinding,
collection.layout,
width,
height,
@ -65,7 +69,7 @@ class CommonContentCollection12Ui(
binding.rightView.root.visibility = View.VISIBLE
bindSubView(
data[rightPosition],
binding.rightView,
rightBinding,
collection.layout,
width,
height,
@ -95,7 +99,7 @@ class CommonContentCollection12Ui(
private fun bindSubView(
contentEntity: CommonCollectionContentEntity,
subBinding: CommonCollectionItemCustomBinding,
subBinding: CommonCollectionItemBinding,
layout: Int,
width: Int,
height: Int,

View File

@ -17,7 +17,6 @@ import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.StringUtils
import com.gh.gamecenter.databinding.GameItemCustomBinding
import com.gh.gamecenter.entity.SubjectEntity.Companion.SUBJECT_TAG_SELLING_POINT
import com.gh.gamecenter.feature.R
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.minigame.MiniGameItemHelper
@ -66,8 +65,7 @@ class CustomGameItemViewHolder(
root.setPadding(root.paddingLeft, root.paddingTop, root.paddingRight, paddingBottom)
clContainer.background =
com.gh.gamecenter.common.R.drawable.reuse_listview_item_style.toDrawable(root.context)
clContainer.background = com.gh.gamecenter.common.R.drawable.reuse_listview_item_style.toDrawable(root.context)
selectIv.setImageDrawable(DrawableView.getCheckSelectorDrawable(root.context))
gameKaifuType.setBackgroundColor(com.gh.gamecenter.common.R.color.primary_theme.toColor(root.context))
gameName.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(root.context))
@ -77,7 +75,7 @@ class CustomGameItemViewHolder(
gameIconView.displayGameIconWithIfShowSubscript(entity, item.data.showIndexIconSubscript)
val provider = TheRouter.get(IBindingAdaptersProvider::class.java)
provider?.setGameName(gameName, entity, false)
provider?.setGameTagsWithSellingPoints(labelList, layoutSellingPoints, entity, subject.tag ?: "")
provider?.setGameTags(labelList, entity)
CustomViewExt.setGameRatting(gameRating, subject.briefStyle, entity)
CustomViewExt.setDescription(gameDes, subject.briefStyle, entity)

View File

@ -1,121 +0,0 @@
package com.gh.gamecenter.home.custom.viewholder
import android.view.ViewGroup.MarginLayoutParams
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.databinding.GameVerticalImageTextBinding
import com.gh.gamecenter.databinding.RecyclerGameVerticalImageTextBinding
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.feature.exposure.ExposureEvent
import com.gh.gamecenter.feature.game.GameItemViewHolder
import com.gh.gamecenter.home.custom.CustomPageViewModel
import com.gh.gamecenter.home.custom.createExposureEvent
import com.gh.gamecenter.home.custom.eventlistener.SubjectEventHelper
import com.gh.gamecenter.home.custom.model.CustomPageItem
import com.gh.gamecenter.home.custom.model.CustomSplitSubjectItem
class CustomGameVerticalImageTextViewHolder(
viewModel: CustomPageViewModel,
private val binding: RecyclerGameVerticalImageTextBinding
) : BaseCustomViewHolder(viewModel, binding.root) {
private val posterWidth by lazy {
(itemView.context.resources.displayMetrics.widthPixels - 40F.dip2px()) / 2
}
override val childEventHelper: SubjectEventHelper by lazy {
SubjectEventHelper(viewModel)
}
override fun bindView(item: CustomPageItem) {
super.bindView(item)
if (item is CustomSplitSubjectItem) {
val gameList = item.data.data ?: return
fillExposureList(item)
setSplitSubjectTitle(binding.layoutTitle, item, childEventHelper)
(itemView.layoutParams as? MarginLayoutParams)?.let {
it.bottomMargin = 16F.dip2px()
itemView.layoutParams = it
}
val leftPosition = item.startChildPosition
val rightPosition = leftPosition + 1
val hasLeft = gameList.size > leftPosition
if (hasLeft) {
bindSubView(
item,
gameList[leftPosition],
binding.leftCardView,
leftPosition
)
}
val hasRight = gameList.size > rightPosition
binding.rightCardView.root.visibleIf(hasRight) {
bindSubView(
item,
gameList[rightPosition],
binding.rightCardView,
rightPosition
)
}
}
}
private fun bindSubView(
item: CustomSplitSubjectItem,
gameEntity: GameEntity,
subBinding: GameVerticalImageTextBinding,
position: Int
) {
subBinding.run {
commonCollectionImage.setTag(ImageUtils.TAG_TARGET_WIDTH, posterWidth)
commonCollectionImage.post {
if (gameEntity.columnImage.isBlank()) {
commonCollectionImage.display(gameEntity.image)
} else {
commonCollectionImage.display(gameEntity.columnImage)
}
}
gameName.text = gameEntity.name
GameItemViewHolder.initGameSubtitleAndAdLabelOnGameSubject(
gameEntity,
gameSubtitle,
canShowTitle = item.data.showIndexSubtitle
)
tvExplain.goneIf(gameEntity.explainText.isBlank()) {
tvExplain.text = gameEntity.explainText
}
tvRecommend.text = gameEntity.recommendText
root.setOnClickListener {
childEventHelper.navigateToGameDetailPage(position, gameEntity)
}
}
}
private fun fillExposureList(item: CustomSplitSubjectItem) {
val eventList = arrayListOf<ExposureEvent>()
runOnIoThread(true) {
for (i in item.startChildPosition..item.endChildPosition) {
val game = item.data.data?.getOrNull(i) ?: break
val event = createExposureEvent(
game,
item.exposureSource,
pageConfigure.exposureSourceList,
i,
item.componentPosition,
createTrackData(item)
)
game.exposureEvent = event
eventList.add(event)
}
}
item.exposureEventList = eventList
}
}

View File

@ -187,7 +187,7 @@ class CustomHomeGameItemViewHolder(
binding.gameRating.text = game.star.toString()
binding.gameRating2.text = game.star.toString()
binding.gameRating.setDrawableStart(R.drawable.home_game_rating, 12F.dip2px(), 12F.dip2px())
BindingAdapters.setGameTags(binding.gameTags, game, "")
BindingAdapters.setGameTags(binding.gameTags, game)
GameItemViewHolder.initGameSubtitleAndAdLabelOnGameSubject(
game,

View File

@ -93,7 +93,7 @@ class CustomHomeHorizontalSlideVideoItemViewHolder(
binding.gameIcon.displayGameIconWithIfShowSubscript(gameEntity, showSubscript)
binding.gameName.text = gameEntity.name
binding.gameName.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(binding.root.context))
BindingAdapters.setGameTags(binding.gameTags, gameEntity, "")
BindingAdapters.setGameTags(binding.gameTags, gameEntity)
GameItemViewHolder.initGameSubtitleAndAdLabelOnGameSubject(
gameEntity,
binding.gameSubtitleTv,

View File

@ -75,7 +75,7 @@ class HomeHorizontalSlideVideoItemViewHolder(val binding: ItemHomeHorizontalSlid
binding.gameIcon.displayGameIcon(gameEntity)
binding.gameName.text = gameEntity.name
binding.gameName.setTextColor(com.gh.gamecenter.common.R.color.text_primary.toColor(binding.root.context))
BindingAdapters.setGameTags(binding.gameTags, gameEntity, "")
BindingAdapters.setGameTags(binding.gameTags, gameEntity)
GameItemViewHolder.initGameSubtitleAndAdLabel(gameEntity, binding.gameSubtitleTv)
MiniGameItemHelper.setMiniGameUsage(binding.gamePlayCount, gameEntity)

View File

@ -43,7 +43,7 @@ class HomeGameTestV2GameListViewHolder(
mBinding.run {
gameIconView.displayGameIcon(gameEntity)
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
GameItemViewHolder.initGameSubtitleAndAdLabel(gameEntity, gameSubtitleTv)
@ -62,8 +62,8 @@ class HomeGameTestV2GameListViewHolder(
)
//开服日期
val gameTimeText = if (gameEntity.test?.startPending == true) {
gameEntity.test?.startText ?: ""
val gameTimeText = if (gameEntity.openTest?.startPending == true) {
gameEntity.openTest?.startText ?: ""
} else {
getGameTimeText(gameEntity)
}

View File

@ -81,7 +81,7 @@ class MyFollowedGameAdapter(context: Context, var mViewModel: MyFollowedGameView
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.setPadding(0, 0, if (gameEntity.commentCount > 3) 8F.dip2px() else 0, 0)
gameRating.text = if (gameEntity.commentCount > 3) {

View File

@ -133,7 +133,7 @@ class MyReservationAdapter(context: Context, var mViewModel: MyReservationViewMo
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(
if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable(mContext) else null
)

View File

@ -118,7 +118,7 @@ open class PlayedGameAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.setPadding(0, 0, if (gameEntity.commentCount > 3) 8F.dip2px() else 0, 0)
gameRating.text = if (gameEntity.commentCount > 3) {

View File

@ -86,7 +86,6 @@ class ArticleDetailFragment : BaseCommentFragment<CommentItemData, ArticleDetail
gameForumType = it?.community?.game?.categoryChinese ?: "",
activityTag = it?.tagActivityName ?: "",
articleType = "帖子",
articleId = it?.id ?: "",
sourceEntrance = sourceEntrance
)
}

View File

@ -74,7 +74,6 @@ class NewQuestionDetailFragment :
gameForumType = it?.community?.game?.categoryChinese ?: "",
activityTag = it?.tagActivityName ?: "",
articleType = "提问帖",
articleId = it?.id ?: "",
sourceEntrance = sourceEntrance
)
}

View File

@ -108,7 +108,6 @@ class ForumVideoDetailFragment : BaseLazyTabFragment() {
gameForumType = it?.data?.bbs?.game?.categoryChinese ?: "",
activityTag = it?.data?.tagActivityName ?: "",
articleType = "视频贴",
articleId = it?.data?.id ?: "",
sourceEntrance = sourceEntrance
)
}

View File

@ -594,10 +594,10 @@ class VideoPublishFragment : ToolbarFragment(), KeyboardHeightObserver {
handleFileNotFound()
toast("上传失败,视频文件不存在")
} else {
mBinding.uploadStatus.text = "网络错误,中断上传 $errorMsg"
mBinding.uploadStatus.text = "网络错误,中断上传"
mBinding.pauseButton.setImageResource(R.drawable.upload_resume)
mBinding.pauseButton.visibility = View.VISIBLE
toast("网络错误,请检查网络正常后再重试 $errorMsg")
toast("网络错误,请检查网络正常后再重试")
}
mBinding.uploadSpeed.visibility = View.GONE
}

View File

@ -222,7 +222,7 @@ public interface ApiService {
* 获取地区配置
*/
@GET("region_setting")
Single<RegionSetting> getRegionSetting(@Query("channel") String channel, @Query("ip") String ip);
Single<RegionSetting> getRegionSetting(@Query("channel") String channel);
/**
* 根据包名获取游戏摘要
@ -1308,13 +1308,6 @@ public interface ApiService {
@POST("./app:activate")
Observable<ResponseBody> postActivationInfo();
/**
* 次日留存
*/
@POST("./app:retention")
Observable<ResponseBody> postRetentionInfo();
/**
* 获取首页游戏补充库
*/

View File

@ -40,7 +40,6 @@ class SearchDefaultRankAdapter(
}
val labelName = if (rank.link.type == "game") gameEntity?.name else rank.name.ifBlank { rank.link.text }
name.text = labelName
name.requestLayout()
index.run {
typeface = Typeface.createFromAsset(mContext.assets, Constants.DIN_FONT_PATH)
text = (position + 1).toString()

View File

@ -135,7 +135,7 @@ class SearchGameFirstItemViewHolder(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.setPadding(0, 0, if (gameEntity.commentCount > 3) 8F.dip2px() else 0, 0)
gameRating.text = if (gameEntity.commentCount > 3) {
@ -159,7 +159,7 @@ class SearchGameFirstItemViewHolder(
adLabelTv
)
}
binding.gameItemIncluded.root.setPadding(16F.dip2px(), 0, 16F.dip2px(), 0)
binding.gameItemIncluded.root.setPadding(16F.dip2px(), 16F.dip2px(), 16F.dip2px(), 16F.dip2px())
SearchGameIndexItemViewHolder.initServerType(gameEntity, binding.gameItemIncluded)
val exposureSources = ArrayList<ExposureSource>()

View File

@ -141,7 +141,7 @@ class SearchGameIndexAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.setPadding(0, 0, if (gameEntity.commentCount > 3) 8F.dip2px() else 0, 0)
gameRating.text = if (gameEntity.commentCount > 3) {

View File

@ -7,8 +7,6 @@ import androidx.recyclerview.widget.RecyclerView
import com.gh.common.util.DirectUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.SearchActivity
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.exposure.ExposureSource
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
@ -126,32 +124,6 @@ class SearchSubjectItemViewHolder(var binding: SearchSubjectItemBinding) : Recyc
text = "游戏"
)
}
if (it.isMiniGame()) {
SensorsBridge.trackMiniGameSearchResultClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
sourceEntrance,
key,
SearchActivity.toTrackSearchType(type),
it.id,
it.name ?: "",
it.categoryChinese,
bindingAdapterPosition
)
} else {
SensorsBridge.trackGameSearchResultClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
sourceEntrance,
key,
SearchActivity.toTrackSearchType(type),
it.id,
it.name ?: "",
it.categoryChinese,
bindingAdapterPosition
)
}
}
headContainer.adLabelTv.goneIf(!entity.adIconActive)
headContainer.headTitle.text = entity.name
@ -172,17 +144,6 @@ class SearchSubjectItemViewHolder(var binding: SearchSubjectItemBinding) : Recyc
SubjectData.SubjectType.NORMAL
}
)
SensorsBridge.trackGameSearchResultClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
sourceEntrance,
key,
SearchActivity.toTrackSearchType(type),
"",
"",
"",
bindingAdapterPosition
)
} else if (entity.adId.isNotEmpty() && entity.codeId.isNotEmpty()) {
SubjectActivity.startAdSubjectActivity(
context,

View File

@ -260,8 +260,7 @@ class SearchGameResultAdapter(
holder.binding.gameItemIncluded,
item,
mContext,
this,
sourceEntrance
this
)
}
}
@ -383,7 +382,7 @@ class SearchGameResultAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.setPadding(0, 0, if (gameEntity.commentCount > 3) 8F.dip2px() else 0, 0)
gameRating.text = if (gameEntity.commentCount > 3) {
@ -479,8 +478,7 @@ class SearchGameResultAdapter(
binding.gameItemIncluded,
item,
mContext,
this,
sourceEntrance
this
)
}
@ -901,8 +899,7 @@ class SearchGameResultAdapter(
binding: SearchGameItemBinding,
item: SearchItemData,
context: Context,
adapter: SearchGameResultAdapter,
sourceEntrance: String
adapter: SearchGameResultAdapter
) {
val gameEntity = item.game ?: return
if (SPUtils.getBoolean(Constants.SP_TEENAGER_MODE)) {
@ -947,33 +944,7 @@ class SearchGameResultAdapter(
location = "小游戏搜索结果列表",
searchContent = key,
)
SensorsBridge.trackMiniGameSearchResultClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
sourceEntrance,
key,
SearchActivity.toTrackSearchType(type),
gameEntity.id,
gameEntity.name ?: "",
gameEntity.categoryChinese,
position
)
} else {
SensorsBridge.trackGameSearchResultClick(
GlobalActivityManager.getCurrentPageEntity().pageId,
GlobalActivityManager.getCurrentPageEntity().pageName,
sourceEntrance,
key,
SearchActivity.toTrackSearchType(type),
gameEntity.id,
gameEntity.name ?: "",
gameEntity.categoryChinese,
position
)
}
},
refreshCallback = null
) {

View File

@ -104,8 +104,8 @@ class GameBigImageViewHolder(val binding: ItemGameServerTestBigImageBinding) :
binding.infoContainer.background = com.gh.gamecenter.common.R.drawable.reuse_listview_item_style.toDrawable(binding.root.context)
binding.gameIcon.displayGameIcon(gameEntity)
binding.gameName.text = gameEntity.name
val time = if (gameEntity.test?.startPending == true) {
gameEntity.test?.startText ?: ""
val time = if (gameEntity.openTest?.startPending == true) {
gameEntity.openTest?.startText ?: ""
} else {
TimeUtils.getGameServerTestTransformedTime(gameEntity.time?.time ?: 0L)
}

View File

@ -69,8 +69,8 @@ class GameServerTestV2ItemViewHolder(val binding: ItemGameServerTestV2Binding) :
binding.infoContainer.background = com.gh.gamecenter.common.R.drawable.reuse_listview_item_style.toDrawable(binding.root.context)
binding.gameIcon.displayGameIcon(gameEntity)
binding.gameName.text = gameEntity.name
val time = if (gameEntity.test?.startPending == true) {
gameEntity.test?.startText ?: ""
val time = if (gameEntity.openTest?.startPending == true) {
gameEntity.openTest?.startText ?: ""
} else {
TimeUtils.getGameServerTestTransformedTime(gameEntity.time?.time ?: 0L)
}

View File

@ -83,7 +83,7 @@ class GameServerTestV2ViewModel(application: Application) : AndroidViewModel(app
companion object {
const val RECENT_GAME = "近期"
const val TODAY_GAME = "今天"
const val FUTURE_GAME = "预约"
const val FUTURE_GAME = "未来"
}
class Factory(private val mApplication: Application) :

View File

@ -185,7 +185,7 @@ class SimulatorGameListAdapter(
gameIconView.displayGameIcon(gameEntity)
gameRating.textSize = if (gameEntity.commentCount > 3) 12F else 10F
BindingAdapters.setGameName(gameName, gameEntity, false)
BindingAdapters.setGameTags(labelList, gameEntity, "")
BindingAdapters.setGameTags(labelList, gameEntity)
gameRating.setDrawableStart(if (gameEntity.commentCount > 3) com.gh.gamecenter.feature.R.drawable.game_horizontal_rating.toDrawable() else null)
gameRating.setPadding(0, 0, if (gameEntity.commentCount > 3) 8F.dip2px() else 0, 0)
gameRating.text = if (gameEntity.commentCount > 3) {

View File

@ -3,8 +3,6 @@ package com.gh.vspace
import android.os.Build
import android.os.Bundle
import android.os.Parcelable
import android.text.InputFilter
import android.text.Spanned
import android.view.Gravity
import android.view.LayoutInflater
import android.view.View
@ -72,27 +70,11 @@ class VFeedbackDialogFragment : BaseDialogFragment() {
mBinding.closeIv.setOnClickListener {
dismissAllowingStateLoss()
}
mBinding.feedbackEt.filters = arrayOf(object : InputFilter {
override fun filter(
source: CharSequence?,
start: Int,
end: Int,
dest: Spanned?,
dstart: Int,
dend: Int
): CharSequence {
val count = dest?.count { !it.isWhitespace() } ?: 0
if(count >= 500){
ToastHelper.showToast(requireContext(), "最多输入500个字")
return ""
}else{
return source?:""
}
mBinding.feedbackEt.doOnTextChanged { _, _, _, count ->
if (count == 500) {
ToastHelper.showToast(requireContext(), "最多输入500个字")
}
})
mBinding.feedbackEt.doOnTextChanged { _, _, _, _ ->
updateSubmitButton()
}
mBinding.dontShowAgainTv.enlargeTouchArea()
@ -160,7 +142,8 @@ class VFeedbackDialogFragment : BaseDialogFragment() {
private fun updateSubmitButton() {
val isTagSelected = mTagList?.any { it.checked } ?: false
if (mBinding.feedbackEt.text.trim().isNotBlank() || isTagSelected) {
if (mBinding.feedbackEt.text.isNotEmpty() || isTagSelected) {
mBinding.submitTv.isEnabled = true
mBinding.submitTv.alpha = 1F
} else {

View File

@ -6,6 +6,7 @@ import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.database.sqlite.SQLiteDiskIOException
import android.database.sqlite.SQLiteException
import android.database.sqlite.SQLiteFullException
import android.net.Uri
import android.os.Build
@ -34,7 +35,6 @@ import com.gh.gamecenter.*
import com.gh.gamecenter.category2.CategoryV2Activity
import com.gh.gamecenter.common.base.GlobalActivityManager
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.common.eventbus.EBReuse
import com.gh.gamecenter.common.exposure.meta.MetaUtil
import com.gh.gamecenter.common.json.json
@ -87,6 +87,8 @@ import com.lightgame.download.DownloadEntity
import com.lightgame.utils.AppManager
import com.lightgame.utils.Utils
import com.lightgame.view.CheckableLinearLayout
import io.reactivex.Completable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import io.reactivex.subjects.PublishSubject
@ -1938,10 +1940,6 @@ object VHelper {
"game_schema_type", if (originDownloadEntity.getMetaExtra(Constants.KEY_BIT) == "32") "32位" else "64位"
)
val pushMessageId = (HaloApp.get(Constants.PUSH_MESSAGE_ID, false) as? String) ?: ""
val pushLinkId = (HaloApp.get(Constants.PUSH_LINK_ENTITY, false) as? LinkEntity)?.link ?: ""
val isFromPush = pushMessageId.isNotEmpty()
SensorsBridge.trackEventWithExposureSource(
"DownloadProcessBegin",
event.source,
@ -1956,9 +1954,6 @@ object VHelper {
"last_page_id", GlobalActivityManager.getLastPageEntity().pageId,
"last_page_business_id", GlobalActivityManager.getLastPageEntity().pageBusinessId,
"download_type", "畅玩下载",
"is_from_push_notifications", isFromPush,
"message_id", pushMessageId,
"link_id", pushLinkId,
)
}

View File

@ -27,7 +27,6 @@ import com.gh.ad.AdDelegateHelper;
import com.gh.base.GlobalActivityLifecycleObserver;
import com.gh.common.FixedRateJobHelper;
import com.gh.common.filter.RegionSettingHelper;
import com.gh.common.interceptor.MainInterceptor;
import com.gh.common.prioritychain.GlobalPriorityChainHelper;
import com.gh.common.util.ActivationHelper;
import com.gh.common.util.DataUtils;
@ -47,7 +46,6 @@ import com.gh.download.simple.SimpleDownloadDatabase;
import com.gh.gamecenter.BuildConfig;
import com.gh.gamecenter.common.constant.Config;
import com.gh.gamecenter.common.constant.Constants;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.exposure.meta.MetaUtil;
import com.gh.gamecenter.common.image.EmptyDecoder;
import com.gh.gamecenter.common.tracker.Tracker;
@ -292,7 +290,6 @@ public class HaloApp extends MultiDexApplication {
private void initRouter() {
TheRouter.init(this);
NavigatorKt.addRouterReplaceInterceptor(new MainInterceptor());
NavigatorKt.addRouterReplaceInterceptor(new LoginInterceptor());
}
@ -335,12 +332,6 @@ public class HaloApp extends MultiDexApplication {
SignatureRepository.INSTANCE.init();
// 初始化奇游sdk需要放在 UserRepository.getInstance().init() 前面必须先初始化sdk才能 setQyToken
IAcceleratorProvider acceleratorProvider = TheRouter.get(IAcceleratorProvider.class);
if (acceleratorProvider != null) {
acceleratorProvider.init(EnvHelper.isDevEnv(), this, PackageUtils.getGhVersionName());
}
// 刷新内存中的用户信息,避免应用进程重建时因没有用户信息数据而显示为掉登录状态
// 同时避免请求实名信息时没有用户信息导致实名信息变更为设备实名的问题
UserRepository.getInstance().init();
@ -369,9 +360,6 @@ public class HaloApp extends MultiDexApplication {
LogUtils.uploadDevice(launchType);
ActivationHelper.sendActivationInfo();
} else {
// 发送次日留存信息
ActivationHelper.sendRetentionInfo();
}
return null;
});
@ -435,6 +423,10 @@ public class HaloApp extends MultiDexApplication {
}
}, delay);
IAcceleratorProvider acceleratorProvider = TheRouter.get(IAcceleratorProvider.class);
if (acceleratorProvider != null) {
acceleratorProvider.init(EnvHelper.isDevEnv(), this, PackageUtils.getGhVersionName());
}
AcceleratorDataHolder.Companion.getInstance().init();
}
@ -493,11 +485,6 @@ public class HaloApp extends MultiDexApplication {
pushProvider.initialize(this);
pushProvider.setOnPushOpenedCallback((id, title, content, linkType, linkId) -> {
SensorsBridge.trackJiGuangPushClick(id, title, content, linkType, linkId);
put(Constants.PUSH_MESSAGE_ID, id);
LinkEntity link = new LinkEntity();
link.setLink(linkId);
link.setType(linkType);
put(Constants.PUSH_LINK_ENTITY, link);
return null;
});
}

View File

@ -20,14 +20,6 @@ class AcceleratorDataHolder {
private val listeners = mutableSetOf<OnDataHolderListener>()
private val _initResults = arrayListOf<String>()
val initResults: List<String>
get() = _initResults
fun addInitFunResult(result: String) {
_initResults.add(result)
}
private var _hasAcctGameInfoInLocal = false
val hasAcctGameInfoInLocal: Boolean
get() = _hasAcctGameInfoInLocal
@ -70,26 +62,27 @@ class AcceleratorDataHolder {
""
}
var vipEntity: VipEntity? = null
private set
private var _vipEntity: VipEntity? = null
val vipEntity: VipEntity?
get() = _vipEntity
val isVip: Boolean
get() = vipEntity?.vipStatus ?: false
get() = _vipEntity?.vipStatus ?: false
val isNewUser: Boolean
get() = vipEntity?.isNewUser ?: false
get() = _vipEntity?.isNewUser ?: false
val memberType: String
get() = when {
!CheckLoginUtils.isLogin() -> MEMBER_TYPE_NOT_LOGIN
vipEntity?.vipStatus == true && vipEntity?.isTryVip == true -> MEMBER_TYPE_FREE_MEMBER
vipEntity?.vipStatus == true -> MEMBER_TYPE_PAID_MEMBER
_vipEntity?.vipStatus == true && _vipEntity?.isTryVip == true -> MEMBER_TYPE_FREE_MEMBER
_vipEntity?.vipStatus == true -> MEMBER_TYPE_PAID_MEMBER
else -> MEMBER_TYPE_NONE_MEMBER
}
fun setVipEntity(vip: VipEntity) {
if (vipEntity != vip) {
vipEntity = vip
if (_vipEntity != vip) {
_vipEntity = vip
listeners.forEach {
it.onVipStateChanged(vip)
}
@ -105,7 +98,7 @@ class AcceleratorDataHolder {
}
fun clear() {
vipEntity = null
_vipEntity = null
listeners.clear()
}

View File

@ -117,7 +117,6 @@ class WebFragment : LazyFragment(), IScrollable {
private var mLeaveWebpageToHandleTitle = false //是否由网页处理标题
private var mClearHistoryOnLoaded = false // 是否加载完成以后清理掉旧的加载历史
private var mIsWebViewInstalled = true // 当前设备是否存在可用的 WebView
private var mForceEnableNestedScroll = false // 强制启用嵌套滚动
private var mTimeElapsedHelper: TimeElapsedHelper? = null
private lateinit var mJsApi: DefaultJsApi
@ -348,7 +347,6 @@ class WebFragment : LazyFragment(), IScrollable {
mIsSecurityCertification = args.getBoolean(KEY_IS_SECURITY_CERTIFICATION, false)
mLeaveWebpageToHandleTitle = args.getBoolean(KEY_LEAVE_WEB_PAGE_TO_HANDLE_TITLE, false)
mWebUrl = dealWithUrl(args.getString(EntranceConsts.KEY_URL, ""))
mForceEnableNestedScroll = args.getBoolean(KEY_ENABLE_HORIZONTAL_SCROLL_DISPATCH)
}
mJsApi = DefaultJsApi(
requireContext(),
@ -700,9 +698,6 @@ class WebFragment : LazyFragment(), IScrollable {
if (mIsHorizontalDispatcherEnabled) {
webview.enableHorizontalScrollDispatch()
}
if (mForceEnableNestedScroll) {
webview.enableForceNestedScroll()
}
webview.addJavascriptObject(mJsApi, null)
webview.addJavascriptObject(ShareNativeCallback(), "share")
webview.addJavascriptObject(InternalJsApi(), "internal")
@ -1052,7 +1047,6 @@ class WebFragment : LazyFragment(), IScrollable {
const val KEY_GAME_NAME = "game_name"
const val KEY_CLOSE_BUTTON = "close_button"
const val KEY_ENABLE_HORIZONTAL_SCROLL_DISPATCH = "enable_horizontal_scroll_dispatch"
const val KEY_FORCE_ENABLE_NESTED_SCROLL = "force_enable_nested_scroll"
private const val REQUEST_PICK_IMAGE = 101
}
}

View File

@ -109,7 +109,7 @@ public class GamePluginAdapter extends BaseRecyclerAdapter {
binding.gameItemIncluded.gameIconView.displayGameIcon(gameEntity);
binding.gameItemIncluded.gameRating.setTextSize(gameEntity.getCommentCount() > 3 ? 12 : 10);
BindingAdapters.setGameName(binding.gameItemIncluded.gameName, gameEntity, true);
BindingAdapters.setGameTags(binding.gameItemIncluded.labelList, gameEntity, "");
BindingAdapters.setGameTags(binding.gameItemIncluded.labelList, gameEntity);
ExtensionsKt.setDrawableStart(binding.gameItemIncluded.gameRating, gameEntity.getCommentCount() > 3 ? ExtensionsKt.toDrawable(com.gh.gamecenter.feature.R.drawable.game_horizontal_rating) : null, null, null);
binding.gameItemIncluded.gameRating.setPadding(0, 0, gameEntity.getCommentCount() > 3 ? DisplayUtils.dip2px(8) : 0, 0);
binding.gameItemIncluded.gameRating.setText(gameEntity.getCommentCount() > 3 ? (gameEntity.getStar() == 10.0 ? "10" : String.valueOf(gameEntity.getStar())) : "");

View File

@ -15,7 +15,6 @@ import com.gh.gamecenter.ShellActivity.Companion.getIntent
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.common.utils.PermissionHelper
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.toObject
import com.gh.gamecenter.core.utils.CurrentActivityHolder
@ -132,13 +131,6 @@ class ReserveReminderContainerFragment : Fragment(), OnReserveReminderListener {
requireContext().startActivity(intent)
}
override fun updateCalendarReminder() {
trackAppointmentSuccessDialogClick("开启日历提醒")
PermissionHelper.checkCalendarPermissions(this, game?.id ?: "", game?.name ?: "", game?.categoryChinese ?: "") {
viewModel.addCalendarEvent(game?.id ?: "", reserveReminderEntity.calendarConfig)
}
}
private fun showPhoneNumberDialog(dialogType: Int, phone: String, serviceId: String = "") {
isCanDismissed = false
@ -183,11 +175,7 @@ class ReserveReminderContainerFragment : Fragment(), OnReserveReminderListener {
game?.id ?: "",
game?.name ?: "",
game?.categoryChinese ?: "",
"关闭弹窗",
wechatRemind = reserveReminderEntity.wechatConfig.isReminderEnable,
messageRemind = if (reserveReminderEntity.hasSmsConfig) reserveReminderEntity.smsConfig.notice else null,
automaticDownload = reserveReminderEntity.isEnableAutoDownload,
calendarRemind = if (reserveReminderEntity.hasCalendarConfig) reserveReminderEntity.calendarConfig.notice else null
"关闭弹窗"
)
val ft = parentFragmentManager.beginTransaction()
ft.remove(this)
@ -211,7 +199,6 @@ class ReserveReminderContainerFragment : Fragment(), OnReserveReminderListener {
)
}
companion object {
private const val KEY_RESERVE_REMINDER = "key_reserve_reminder"
@ -267,6 +254,4 @@ interface OnReserveReminderListener {
fun enableAutoDownload(isEnable: Boolean)
fun realName()
fun updateCalendarReminder()
}

View File

@ -1,11 +1,9 @@
package com.halo.assistant.fragment.reserve
import android.annotation.SuppressLint
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.os.Message
import com.gh.gamecenter.common.utils.CalendarEventUtils
import com.gh.gamecenter.common.utils.SensorsBridge
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.entity.ReserveModifyEntity
@ -15,7 +13,6 @@ import com.gh.gamecenter.entity.ValidateCodeResponse
import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.retrofit.service.ApiService
import com.halo.assistant.HaloApp
import io.reactivex.Single
import io.reactivex.schedulers.Schedulers
import okhttp3.RequestBody
@ -95,31 +92,6 @@ class ReserveReminderRepository(
return apiService.reserveSetting(requestBody)
}
@SuppressLint("CheckResult")
fun addCalendarEvent(gameId: String, calendarConfig: ReserveReminderEntity.CalendarConfig) =
Single.create {
val calendarEvent = CalendarEventUtils.CalendarEvent(
title = calendarConfig.title,
startTime = calendarConfig.timeStart * 1000,
endTIme = calendarConfig.timeEnd * 1000,
reminderTime = calendarConfig.advanceSeconds * 1000,
remark = calendarConfig.remark
)
val eventId = CalendarEventUtils.addCalendarEvent(calendarEvent, HaloApp.getInstance())
if (eventId != null) {
it.onSuccess(eventId)
} else {
it.onError(Throwable(message = "Failed to add calendar event"))
}
}.doOnSuccess {
val body = hashMapOf(
"calendar_config" to hashMapOf("notice" to true)
).toRequestBody()
apiService.reserveModify(gameId, body)
.subscribe({}, {})
}
companion object {
private const val MESSAGE_WHAT_ENABLE_AUTO_DOWNLOAD = 1

View File

@ -1,14 +1,10 @@
package com.halo.assistant.fragment.reserve
import android.annotation.SuppressLint
import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.singleToMain
import com.gh.gamecenter.common.utils.toResString
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.entity.ReserveModifyEntity
import com.gh.gamecenter.entity.ReserveReminderEntity
import com.gh.gamecenter.entity.ValidateCodeResponse
@ -16,7 +12,7 @@ import com.gh.gamecenter.feature.entity.GameEntity
import com.gh.gamecenter.livedata.Event
import io.reactivex.disposables.CompositeDisposable
class ReserveReminderViewModel(app: Application) : AndroidViewModel(app) {
class ReserveReminderViewModel : ViewModel() {
private val repository = ReserveReminderRepository.newInstance()
@ -63,27 +59,6 @@ class ReserveReminderViewModel(app: Application) : AndroidViewModel(app) {
repository.enableAutoDownload(game, enable)
}
/**
* 日历添加事件
* 如果在日历添加期间,用户退出当前页面,操作仍然继续
* 所以这里不和ui层生命周期绑定
*/
@SuppressLint("CheckResult")
fun addCalendarEvent(gameId: String, calendarConfig: ReserveReminderEntity.CalendarConfig) {
repository.addCalendarEvent(gameId, calendarConfig)
.compose(singleToMain())
.subscribe(object : BiResponse<Long>() {
override fun onSuccess(data: Long) {
ToastUtils.showToast(com.gh.gamecenter.common.R.string.add_calendar_event_successfully.toResString())
val reminderEntity = _reserveReminder.value ?: return
reminderEntity.calendarConfig = ReserveReminderEntity.CalendarConfig(_notice = true)
updateReserveReminder(reminderEntity)
}
})
}
override fun onCleared() {
composeDisposable.clear()

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/ui_container_1" />
<corners android:radius="8dp" />
<corners android:radius="4dp" />
</shape>

View File

@ -4,5 +4,5 @@
android:endColor="#0A2496FF"/>
<stroke android:color="#142496FF"
android:width="1dp"/>
<corners android:radius="8dp"/>
<corners android:radius="4dp"/>
</shape>

View File

@ -156,12 +156,12 @@
style="@style/CustomPageGameRating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@id/gameDesSpace"
tools:text="10"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintLeft_toLeftOf="@+id/gameDesSpace"
app:layout_constraintRight_toLeftOf="@+id/game_des"
app:layout_constraintTop_toTopOf="@+id/gameDesSpace"
tools:text="10" />
app:layout_constraintBottom_toBottomOf="@id/gameDesSpace" />
<TextView
android:id="@+id/game_des"
@ -172,10 +172,10 @@
android:singleLine="true"
android:textColor="@color/text_tertiary"
android:textSize="10sp"
android:layout_marginTop="6dp"
app:layout_constraintLeft_toRightOf="@+id/game_rating"
app:layout_constraintRight_toRightOf="@+id/gameDesSpace"
app:layout_constraintTop_toTopOf="@+id/gameDesSpace"
app:layout_constraintBottom_toBottomOf="@id/gameDesSpace"
tools:text="巫妖王再怒霜之哀殤又飢渴" />
<LinearLayout
@ -263,31 +263,21 @@
app:layout_constraintRight_toRightOf="@+id/gameDesSpace"
app:layout_constraintTop_toBottomOf="@+id/gameDesSpace" />
<include
android:id="@+id/layout_selling_points"
layout="@layout/layout_game_item_selling_point"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="@+id/gameIconView"
app:layout_constraintLeft_toRightOf="@+id/game_play_count"
app:layout_constraintRight_toRightOf="@+id/gameDesSpace"
app:layout_constraintTop_toBottomOf="@+id/gameDesSpace" />
<TextView
android:id="@+id/game_play_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:gravity="center"
android:includeFontPadding="false"
android:textColor="@color/text_tertiary"
android:textSize="11sp"
android:visibility="visible"
android:includeFontPadding="false"
app:layout_constraintBottom_toBottomOf="@+id/gameIconView"
app:layout_constraintLeft_toLeftOf="@+id/gameDesSpace"
app:layout_constraintRight_toLeftOf="@+id/label_list"
app:layout_constraintTop_toBottomOf="@+id/gameDesSpace"
android:textSize="11sp"
android:gravity="center"
android:layout_marginRight="8dp"
android:textColor="@color/text_tertiary"
tools:text="999.9万人玩过" />
<TextView

View File

@ -1,91 +0,0 @@
<?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"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="8dp"
app:cardElevation="0dp">
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/common_collection_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:actualImageScaleType="centerCrop"
app:backgroundImage="@color/placeholder_bg"
app:fadeDuration="500"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:placeholderImage="@drawable/preload"
app:pressedStateOverlayImage="@color/pressed_bg"
app:viewAspectRatio="2" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:id="@+id/gameNameContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/gameName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:includeFontPadding="false"
android:singleLine="true"
android:textColor="@color/text_primary"
android:textSize="14sp"
tools:text="火炬之光:无限" />
<TextView
android:id="@+id/gameSubtitle"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:background="@drawable/bg_advance_download_game_subtitle"
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:singleLine="true"
android:textColor="@color/text_secondary"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
tools:text="副标题"
tools:visibility="visible" />
</LinearLayout>
<TextView
android:id="@+id/tv_explain"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/text_secondary"
android:textSize="12sp"
android:visibility="gone"
tools:text="linkDes1"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_recommend"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/text_tertiary"
android:textSize="12sp"
tools:text="linkDes2"
tools:visibility="visible" />
</LinearLayout>

View File

@ -12,7 +12,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="h,16:9"
app:layout_constraintDimensionRatio="h,344:193"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -18,7 +18,7 @@
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintDimensionRatio="h,16:9"
app:layout_constraintDimensionRatio="h,344:193"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@ -39,7 +39,6 @@
android:paddingBottom="4dp"
android:textColor="@color/text_secondary"
android:textSize="@dimen/secondary_size"
app:layout_goneMarginStart="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/numberIv"

View File

@ -76,7 +76,6 @@
android:id="@+id/privacyPolicyTv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:drawablePadding="4dp"
android:gravity="center"
android:includeFontPadding="false"
@ -90,7 +89,7 @@
android:id="@+id/permissionsTv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:layout_marginStart="16dp"
android:drawablePadding="4dp"
android:gravity="center"
android:includeFontPadding="false"
@ -104,6 +103,7 @@
android:id="@+id/requestUpdateTv"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:drawablePadding="4dp"
android:gravity="center"
android:includeFontPadding="false"
@ -119,6 +119,7 @@
android:id="@+id/divider2"
android:layout_width="match_parent"
android:layout_height="@dimen/divider_1px"
android:layout_marginTop="8dp"
android:background="@color/ui_divider" />
<TextView

View File

@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="252dp"
android:layout_height="40dp"
android:background="@drawable/bg_sms_reminders_enable">
<TextView
android:id="@+id/tv_wechat_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:textStyle="bold"
android:text="@string/calendar_reminders"
android:textColor="@color/text_tertiary"
android:textSize="13dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:textSize="13sp"
android:textColor="@color/text_tertiary"
android:text="@string/calendar_reminders_enabled"
app:layout_constraintBottom_toBottomOf="@id/tv_wechat_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_wechat_title" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -13,7 +13,6 @@
android:layout_marginStart="12dp"
android:gravity="center"
android:text="@string/sms_reminder"
android:textStyle="bold"
android:textColor="@color/text_tertiary"
android:textSize="13dp"
app:layout_constraintBottom_toBottomOf="parent"

View File

@ -62,8 +62,8 @@
android:id="@+id/v_sms_add"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@id/tv_sms_reminder_open"
app:layout_constraintEnd_toEndOf="@id/tv_sms_reminder_open"
app:layout_constraintStart_toStartOf="@id/iv_sms_add"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="@id/tv_sms_reminder_open" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -12,7 +12,6 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:gravity="center"
android:textStyle="bold"
android:text="@string/wechat_reminder"
android:textColor="@color/text_tertiary"
android:textSize="13dp"

Some files were not shown because too many files have changed in this diff Show More