Compare commits

...

15 Commits

Author SHA1 Message Date
04468c0627 build: suppress warning 2022-12-23 16:16:12 +08:00
e585d905ac fix: 处理一些细节问题 2022-11-08 17:56:55 +08:00
1f066e676f Merge branch 'feature-module_setting' into feature-module_setting_compose 2022-11-08 17:51:03 +08:00
a08f3aa9ac Merge branch 'dev-5.16.0' into feature-module_setting
# Conflicts:
#	app/src/main/res/values/strings.xml
2022-11-08 17:30:04 +08:00
b0ad6ff8c5 chore: 版本更新至 5.16.0 2022-11-08 10:37:46 +08:00
ccbe6650d1 Merge branch 'feature-GHZS-28' into 'dev-5.16.0'
feat:【V5.16.0】游戏广告管理功能(前端部分)—客户端 https://jira.shanqu.cc/browse/GHZS-28

See merge request halo/android/assistant-android!416
2022-11-08 10:14:18 +08:00
f99b3af9c6 feat:【V5.16.0】游戏广告管理功能(前端部分)—客户端 https://jira.shanqu.cc/browse/GHZS-28 2022-11-08 10:14:18 +08:00
a5ce8f389c Merge branch 'feature-GHZS-55' into 'dev-5.16.0'
feat:【V5.16.0】游戏搜索-热门榜单功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-55

See merge request halo/android/assistant-android!414
2022-11-08 09:19:55 +08:00
8f5daed7a7 feat:【V5.16.0】游戏搜索-热门榜单功能优化—客户端 https://jira.shanqu.cc/browse/GHZS-55 2022-11-08 09:19:55 +08:00
f799096655 fix: 处理一些细节问题 2022-11-07 18:01:28 +08:00
431aa52e49 refactor:使用 Jetpack Compose 实现设置功能模块的 UI https://git.shanqu.cc/halo/android/assistant-android/-/issues/88 2022-11-04 11:36:25 +08:00
26d6e4086a fix: 处理合并分支后出现的冲突 2022-11-02 17:16:55 +08:00
7e999784b7 Merge branch 'feature-module_setting' into dev
# Conflicts:
#	app/build.gradle
#	app/src/main/java/com/gh/common/util/DownloadObserver.kt
#	app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt
#	app/src/main/java/com/gh/gamecenter/personal/HaloPersonalFragment.kt
#	app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt
#	module_core/src/main/java/com/gh/gamecenter/core/provider/IAppProvider.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/GameDownloadSettingActivity.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/GameDownloadSettingFragment.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/NetworkDiagnosisActivity.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/SettingsFragment.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/VideoSettingActivity.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/security/BindPhoneFragment.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/security/SecurityActivity.kt
#	module_setting/src/main/java/com/gh/gamecenter/setting/view/security/SecurityFragment.kt
2022-11-02 16:56:56 +08:00
f07bcc89e8 fix:修复无法跳转安装包清理的问题 2022-10-28 17:47:14 +08:00
22cff4ed72 refactor: 组件化设置功能 https://git.shanqu.cc/halo/android/assistant-android/-/issues/87 2022-10-18 11:57:27 +08:00
260 changed files with 7335 additions and 544 deletions

View File

@ -268,6 +268,9 @@ dependencies {
implementation(project(':module_login')) {
exclude group: 'androidx.swiperefreshlayout'
}
implementation(project(':module_setting_compose')) {
exclude group: 'androidx.swiperefreshlayout'
}
// 默认不接入光能模块,提高编译速度
// debugImplementation(project(':module_energy')) {
// exclude group: 'androidx.swiperefreshlayout'

View File

@ -51,7 +51,27 @@
com.google.android.exoplayer2,
tv.danmaku.ijk.media.exo2,
pl.droidsonroids.gif,
com.lzf.easyfloat" />
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,
androidx.compose.ui.tooling.preview"/>
<!-- 去掉 SDK 一些流氓权限 -->
<uses-permission
@ -148,10 +168,6 @@
android:name="com.gh.gamecenter.NewsDetailActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.SettingActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.ConcernActivity"
android:screenOrientation="portrait" />
@ -219,18 +235,6 @@
android:name="com.gh.gamecenter.SelectUserIconActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.AboutActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.security.SecurityActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.security.BindPhoneActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.CommentDetailActivity"
android:screenOrientation="portrait"
@ -344,10 +348,6 @@
android:name="com.gh.gamecenter.amway.AmwayActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.NetworkDiagnosisActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.gh.gamecenter.personalhome.fans.FansActivity"
android:screenOrientation="portrait" />
@ -586,14 +586,6 @@
android:name=".qa.video.publish.VideoPublishActivity"
android:screenOrientation="portrait" />
<activity
android:name=".setting.GameDownloadSettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".setting.VideoSettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".qa.video.detail.ForumVideoDetailActivity"
android:screenOrientation="portrait" />

View File

@ -1 +0,0 @@
{"v":"5.6.9","fr":60,"ip":0,"op":36,"w":120,"h":66,"nm":"开关动画-关闭","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"按钮手柄","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.667,"y":0},"t":0,"s":[87,33,0],"to":[7.682,0,0],"ti":[-13.443,0,0]},{"i":{"x":0.333,"y":1},"o":{"x":0.333,"y":0},"t":18,"s":[31,33,0],"to":[2.306,0,0],"ti":[-1.318,0,0]},{"t":24,"s":[33,33,0]}],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[16,16],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":37,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"指示器-on","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":0,"s":[100]},{"t":18,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[33,33,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":0,"s":[6.5,6.5]},{"t":18,"s":[4.5,4.5]}],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"椭圆路径 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"st","c":{"a":0,"k":[0.966666666667,0.966666666667,0.966666666667,0.420000005762],"ix":3},"o":{"a":0,"k":40,"ix":4},"w":{"a":0,"k":1.5,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"描边 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"椭圆形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":37,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"指示器-off","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[87,33,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":1,"k":[{"i":{"x":[0.667,0.667],"y":[1,1]},"o":{"x":[0.667,0.667],"y":[0,0]},"t":0,"s":[1.5,4]},{"t":18,"s":[1.5,6]}],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0.75,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0,0,1],"ix":4},"o":{"a":0,"k":5,"ix":5},"r":1,"bm":0,"nm":"填充 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":90,"ix":6},"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":0,"s":[0]},{"t":18,"s":[100]}],"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":37,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"按钮背景","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[60,33,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"sy":[{"c":{"a":0,"k":[0,0,0,1],"ix":2},"o":{"a":0,"k":5,"ix":3},"a":{"a":0,"k":120,"ix":5},"s":{"a":0,"k":1,"ix":8},"d":{"a":0,"k":0,"ix":6},"ch":{"a":0,"k":100,"ix":7},"bm":{"a":0,"k":5,"ix":1},"no":{"a":0,"k":0,"ix":9},"ty":2,"nm":"内阴影"}],"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[40,22],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":12,"ix":4},"nm":"矩形路径 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.667],"y":[0]},"t":0,"s":[0.141176477075,0.588235318661,1,1]},{"t":18,"s":[0.933333337307,0.933333337307,0.933333337307,1]}],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"filling","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0.118,0.006],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[300,300],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"变换"}],"nm":"矩形","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":37,"st":0,"bm":0}],"markers":[]}

View File

@ -10,7 +10,9 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.FragmentActivity
import com.gh.common.util.*
import com.gh.common.util.LogUtils
import com.gh.gamecenter.*
import com.gh.gamecenter.BuildConfig
import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.NotificationUgc
@ -30,13 +32,14 @@ import com.gh.gamecenter.entity.MtaEvent
import com.gh.gamecenter.help.QaFeedbackDialogFragment
import com.gh.gamecenter.login.entity.Badge
import com.gh.gamecenter.login.user.LoginTag
import com.gh.gamecenter.login.view.LoginActivity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.security.BindPhoneActivity
import com.gh.gamecenter.login.user.UserRepository
import com.gh.gamecenter.login.utils.LoginHelper
import com.gh.gamecenter.login.utils.QuickLoginHelper
import com.gh.gamecenter.login.view.LoginActivity
import com.gh.gamecenter.personalhome.border.AvatarBorderActivity
import com.gh.gamecenter.setting.compose.activity.ComposeAboutActivity
import com.gh.gamecenter.setting.compose.activity.ComposeBindPhoneActivity
import com.halo.assistant.HaloApp
import com.lightgame.utils.Utils
import org.json.JSONObject
@ -267,7 +270,7 @@ class DefaultJsApi(var context: Context, val entrance: String = "") {
@JavascriptInterface
fun bindPhone(msg: Any) {
val intent = BindPhoneActivity.getNormalIntent(context, false)
val intent = ComposeBindPhoneActivity.getNormalIntent(context, false)
context.startActivity(intent)
}
@ -413,7 +416,7 @@ class DefaultJsApi(var context: Context, val entrance: String = "") {
@JavascriptInterface
fun checkUpdateGhzs(msg: Any) {
context.startActivity(AboutActivity.getIntent(context, true))
context.startActivity(ComposeAboutActivity.getIntent(context, true))
}
@JavascriptInterface

View File

@ -309,26 +309,6 @@ public class Config {
return mDefaultSharedPreferences;
}
public static boolean isExistHideFunction() {
SharedPreferences preferences = getPreferences();
if (!preferences.getBoolean(FIX_DOWNLOAD_KEY, false)) return true;
if (!preferences.getBoolean(FIX_PLUGIN_KEY, false)) return true;
if (!preferences.getBoolean(FIX_COMMUNITY_KEY, false)) return true;
if (!preferences.getBoolean(FIX_ARTICLE_KEY, false)) return true;
return false;
}
public static void fixHideFunction() {
SharedPreferences preferences = PreferenceManager.
getDefaultSharedPreferences(HaloApp.getInstance().getApplication());
SharedPreferences.Editor editor = preferences.edit();
editor.putBoolean(Config.FIX_DOWNLOAD_KEY, true);
editor.putBoolean(Config.FIX_ARTICLE_KEY, true);
editor.putBoolean(Config.FIX_COMMUNITY_KEY, true);
editor.putBoolean(Config.FIX_PLUGIN_KEY, true);
editor.apply();
}
@SuppressLint("CheckResult")
public static void getGhzsSettings() {
String channel = HaloApp.getInstance().getChannel();

View File

@ -18,19 +18,19 @@ import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.gamecenter.common.constant.Constants
import com.gh.download.DownloadManager
import com.gh.gamecenter.R
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.common.utils.countDownTimer
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.common.utils.ImageUtils
import com.gh.gamecenter.core.utils.GsonUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.databinding.DialogDeviceRemindBinding
import com.gh.gamecenter.entity.DeviceDialogEntity
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.setting.compose.activity.ComposeGameDownloadSettingActivity
import com.google.gson.reflect.TypeToken
import com.gh.gamecenter.setting.GameDownloadSettingFragment.Companion.AUTO_INSTALL_SP_KEY
import com.lightgame.download.DataWatcher
import com.lightgame.download.DownloadEntity
import com.lightgame.download.DownloadStatus
@ -53,7 +53,7 @@ class DeviceRemindDialog(context: Context, val entity: DeviceDialogEntity, val g
private val dataWatcher = object : DataWatcher() {
override fun onDataChanged(downloadEntity: DownloadEntity) {
if (downloadEntity.status == DownloadStatus.done && downloadEntity.name == gameEntity.name) {
val autoInstall = SPUtils.getBoolean(AUTO_INSTALL_SP_KEY, true)
val autoInstall = SPUtils.getBoolean(ComposeGameDownloadSettingActivity.AUTO_INSTALL_SP_KEY, true)
if (autoInstall) {
dismiss()
}

View File

@ -70,7 +70,8 @@ data class ExposureEvent(
welcomeDialogId = gameEntity?.welcomeDialogId
?: eTrace?.firstOrNull()?.payload?.welcomeDialogId,
welcomeDialogLinkTitle = gameEntity?.welcomeDialogTitle
?: eTrace?.firstOrNull()?.payload?.welcomeDialogLinkTitle
?: eTrace?.firstOrNull()?.payload?.welcomeDialogLinkTitle,
isAdData = gameEntity?.adIconActive ?: eTrace?.firstOrNull()?.payload?.isAdData ?: false
)
this.id = UUID.randomUUID().toString()
this.timeInMillisecond = System.currentTimeMillis()

View File

@ -33,6 +33,10 @@ class AppProviderImpl : IAppProvider {
return HaloApp.getInstance().channel ?: ""
}
override fun setChannel(channel: String) {
HaloApp.getInstance().channel = channel
}
override fun getUserAgent(): String {
return HaloApp.getInstance().userAgent ?: ""
}

View File

@ -0,0 +1,23 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.download.server.BrowserInstallHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IBrowserInstallHelperProvider
@Route(path = RouteConsts.provider.browserInstallHelper, name = "BrowserInstallHelper暴露服务")
class BrowserInstallHelperProviderImpl : IBrowserInstallHelperProvider {
override fun isUseBrowserToInstallEnabled(): Boolean = BrowserInstallHelper.isUseBrowserToInstallEnabled()
override fun shouldUseBrowserToInstall(): Boolean = BrowserInstallHelper.shouldUseBrowserToInstall()
override fun logSwitchInstallSettingEvent() {
BrowserInstallHelper.logOrdinaryBrowserEvent(BrowserInstallHelper.Type.SWITCH_INSTALL_SETTING)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -72,6 +72,10 @@ class ConfigProviderImpl : IConfigProvider {
return Config.WEIBO_APPKEY
}
override fun getNightModeSetting(): Boolean {
return Config.getNightModeSetting()?.setting ?: false
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -1,5 +1,6 @@
package com.gh.common.provider
import android.app.Dialog
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.DialogUtils
@ -22,6 +23,46 @@ class DialogUtilsProviderImpl : IDialogUtilsProvider {
})
}
override fun showWaitDialog(context: Context, string: String): Dialog = DialogUtils.showWaitDialog(context, string)
override fun showForceDialog(
context: Context,
title: String,
message: CharSequence,
positive: String,
negative: String,
confirm: () -> Unit,
cancel: () -> Unit
) {
DialogUtils.showForceDialog(context, title, message, positive, negative,
{ confirm.invoke() }, object :CancelListener{
override fun onCancel() {
cancel.invoke()
}
})
}
override fun showUsageStatsDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) {
DialogUtils.showUsageStatsDialog(context,
{ confirm.invoke() }, object :CancelListener{
override fun onCancel() {
cancel.invoke()
}
})
}
override fun showNoticeDialog(
context: Context,
title: String,
content: String,
confirm: () -> Unit
) {
DialogUtils.showNoticeDialog(context, title, content
) { confirm.invoke() }
}
override fun showBindPhoneDialog(context: Context, confirm: () -> Unit): Dialog = DialogUtils.showBindPhoneDialog(context) { confirm.invoke() }
override fun init(context: Context?) {
// Do nothing
}

View File

@ -49,6 +49,14 @@ class DirectProviderImpl : IDirectProvider {
DirectUtils.directToLotteryParadisePage(context)
}
override fun directDouyin(context: Context, userId: String) {
DirectUtils.directDouyin(context, userId)
}
override fun directToSuggestionFromDiagnosis(context: Context, diagnosis: String) {
DirectUtils.directToSuggestion(context, diagnosis = diagnosis)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -0,0 +1,18 @@
package com.gh.common.provider
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.history.HistoryHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IHistoryHelperProvider
@Route(path = RouteConsts.provider.historyHelper, name = "HistoryHelper暴露服务")
class HistoryHelperProviderImpl : IHistoryHelperProvider {
override fun emptyDatabase() {
HistoryHelper.emptyDatabase()
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,20 @@
package com.gh.common.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.MainActivity
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IMainProvider
@Route(path = RouteConsts.provider.mainActivity, name = "MainActivity暴露服务")
class MainProviderImpl : IMainProvider {
override fun skipToMainActivity(context: Context, position: Int) {
MainActivity.skipToMainActivity(context, position)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,19 @@
package com.gh.common.provider
import android.content.Context
import android.content.Intent
import android.os.Parcelable
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.ShellActivity
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IShellProvider
@Route(path = RouteConsts.provider.shellActivity, name = "ShellActivity暴露服务")
class ShellProviderImpl : IShellProvider {
override fun getSwitchInstallMethodIntent(context: Context, extraParcelable: Parcelable?): Intent =
ShellActivity.getIntent(context, ShellActivity.Type.SWITCH_INSTALL_METHOD, extraParcelable)
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,19 @@
package com.gh.common.provider
import android.content.Context
import android.os.Handler
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUpdateManagerProvider
import com.gh.gamecenter.manager.UpdateManager
@Route(path = RouteConsts.provider.updateManager, name = "UpdateManager暴露服务")
class UpdateManagerProviderImpl: IUpdateManagerProvider {
override fun checkUpdate(context: Context, isAutoCheck: Boolean, handler: Handler) {
UpdateManager.getInstance(context).checkUpdate(isAutoCheck, handler)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -0,0 +1,23 @@
package com.gh.common.provider
import android.content.Context
import android.os.Build
import androidx.annotation.RequiresApi
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.common.util.UsageStatsHelper
import com.gh.common.util.WechatBindHelper
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.core.provider.IUsageStatsHelperProvider
@Route(path = RouteConsts.provider.usageStatsHelper, name = "UsageStatsHelper暴露服务")
class UsageStatsHelperProviderImpl : IUsageStatsHelperProvider {
@RequiresApi(Build.VERSION_CODES.LOLLIPOP_MR1)
override fun checkForPermission(): Boolean = UsageStatsHelper.checkForPermission()
override fun skipToUsageStats(context: Context, requestCode: Int) {
UsageStatsHelper.skipToUsageStats(context, requestCode)
}
override fun init(context: Context?) {
// Do nothing
}
}

View File

@ -17,6 +17,14 @@ class WebProviderImpl : IWebProvider {
return WebActivity.getWebIntent(context, title, url)
}
override fun getBindWechatIntent(context: Context): Intent {
return WebActivity.getBindWechatIntent(context)
}
override fun getSecurityCertificationIntent(context: Context): Intent {
return WebActivity.getSecurityCertificationIntent(context)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -8,8 +8,10 @@ import com.gh.gamecenter.core.provider.IWechatBindHelperProvider
@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务")
class WechatHelperProviderImpl : IWechatBindHelperProvider {
override fun getWechatConfig() {
WechatBindHelper.getWechatConfig()
override fun getWechatConfig(callback: (() -> Unit)?) {
WechatBindHelper.getWechatConfig {
callback?.invoke()
}
}
override fun init(context: Context?) {

View File

@ -93,8 +93,8 @@ import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.entity.SimpleGameEntity;
import com.gh.gamecenter.entity.TrackableEntity;
import com.gh.gamecenter.login.entity.Badge;
import com.gh.gamecenter.security.BindPhoneActivity;
import com.gh.gamecenter.setting.GameDownloadSettingFragment;
import com.gh.gamecenter.setting.compose.activity.ComposeBindPhoneActivity;
import com.gh.gamecenter.setting.compose.activity.ComposeGameDownloadSettingActivity;
import com.gh.gamecenter.suggest.SuggestType;
import com.lightgame.adapter.BaseRecyclerAdapter;
import com.lightgame.download.DownloadEntity;
@ -216,7 +216,7 @@ public class DialogUtils {
} else if (NetworkUtils.isWifiConnected(context)
|| filter4GorSize(context, size)) {
callBack.onResponse(false);
} else if (!SPUtils.getBoolean(GameDownloadSettingFragment.getTrafficDownloadHintKey(), true)) {
} else if (!SPUtils.getBoolean(ComposeGameDownloadSettingActivity.getTrafficDownloadHintKey(), true)) {
AppExecutor.getUiExecutor().executeWithDelay(() -> Utils.toast(context, "当前使用移动网络下载,请注意流量消耗"), 500);
callBack.onResponse(false);
} else {
@ -288,7 +288,7 @@ public class DialogUtils {
// MtaHelper.onEvent("移动网络下载", NetworkUtils.getMobileNetworkType(finalContext), "连上WiFi后自动下载");
});
allowAlways.setOnClickListener(v -> {
SPUtils.setBoolean(GameDownloadSettingFragment.getTrafficDownloadHintKey(), false);
SPUtils.setBoolean(ComposeGameDownloadSettingActivity.getTrafficDownloadHintKey(), false);
AppExecutor.getUiExecutor().executeWithDelay(() -> {
// 显示了弹窗以后,即便下面这个 toast 放在 listener.onConfirm 后调用也是显示 listener.onConfirm 里的 toast
// 喷了,延时包治疑难杂症
@ -2080,7 +2080,7 @@ public class DialogUtils {
binding.bindPhoneBtn.setOnClickListener(v -> {
dialog.dismiss();
Intent intent = BindPhoneActivity.getNormalIntent(finalContext, false);
Intent intent = ComposeBindPhoneActivity.getNormalIntent(finalContext, false);
finalContext.startActivity(intent);
});

View File

@ -9,31 +9,31 @@ import android.os.Build
import android.os.Bundle
import android.text.TextUtils
import androidx.appcompat.app.AppCompatActivity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.core.AppExecutor
import com.gh.common.constant.Config
import com.gh.gamecenter.common.constant.Constants
import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureEvent.Companion.createEvent
import com.gh.common.exposure.ExposureManager.log
import com.gh.common.exposure.ExposureTraceUtils.appendTrace
import com.gh.common.exposure.ExposureType
import com.gh.gamecenter.common.constant.EntranceConsts.*
import com.gh.common.util.EntranceUtils.*
import com.gh.common.util.EntranceUtils.jumpActivity
import com.gh.gamecenter.*
import com.gh.gamecenter.amway.AmwayActivity
import com.gh.gamecenter.catalog.CatalogActivity
import com.gh.gamecenter.category.CategoryDirectoryActivity
import com.gh.gamecenter.category2.CategoryV2Activity
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.BaseActivity_TabLayout
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.base.fragment.BaseFragment_TabLayout
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.EntranceConsts.*
import com.gh.gamecenter.common.entity.CommunityEntity
import com.gh.gamecenter.common.entity.Display
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.AppExecutor
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.discovery.DiscoveryActivity
import com.gh.gamecenter.download.DownloadFragment.Companion.INDEX_UPDATE
@ -63,9 +63,10 @@ import com.gh.gamecenter.qa.questions.newdetail.NewQuestionDetailActivity
import com.gh.gamecenter.qa.subject.CommunitySubjectActivity
import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.security.BindPhoneActivity
import com.gh.gamecenter.servers.GameServerTestActivity
import com.gh.gamecenter.servers.GameServersActivity
import com.gh.gamecenter.setting.compose.activity.ComposeBindPhoneActivity
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity
import com.gh.gamecenter.subject.SubjectActivity
import com.gh.gamecenter.suggest.SuggestType
import com.gh.gamecenter.tag.TagsActivity
@ -357,7 +358,7 @@ object DirectUtils {
"mobile_bind" -> {
CheckLoginUtils.checkLogin(context, entrance) {
context.startActivity(BindPhoneActivity.getNormalIntent(context, false))
context.startActivity(ComposeBindPhoneActivity.getNormalIntent(context, false))
}
}
@ -387,7 +388,7 @@ object DirectUtils {
"etiquette_exam" -> directToRegulationTestPage(context)
"setting" -> context.startActivity(SettingActivity.getIntent(context, false, entrance))
"setting" -> context.startActivity(ComposeSettingActivity.getIntent(context, false, entrance))
"index_page" -> directToHomeTab(context)

View File

@ -1,6 +1,5 @@
package com.gh.common.util
import android.preference.PreferenceManager
import com.gh.common.constant.Config
import com.gh.common.exposure.ExposureUtils
import com.gh.common.simulator.SimulatorDownloadManager
@ -23,7 +22,7 @@ import com.gh.gamecenter.entity.SimpleGameEntity
import com.gh.gamecenter.entity.SimulatorEntity
import com.gh.gamecenter.eventbus.EBDownloadStatus
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.setting.GameDownloadSettingFragment
import com.gh.gamecenter.setting.compose.activity.ComposeGameDownloadSettingActivity
import com.gh.gamecenter.suggest.SuggestType
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
@ -262,7 +261,7 @@ object DownloadObserver {
} else {
val downloadType = downloadEntity.getMetaExtra(Constants.EXTRA_DOWNLOAD_TYPE)
// 是否是自动安装
val isAutoInstall = SPUtils.getBoolean(GameDownloadSettingFragment.AUTO_INSTALL_SP_KEY, true)
val isAutoInstall = SPUtils.getBoolean(ComposeGameDownloadSettingActivity.AUTO_INSTALL_SP_KEY, true)
if (downloadType == Constants.SIMULATOR_DOWNLOAD || isAutoInstall) {
if (FileUtils.isEmptyFile(downloadEntity.path)) {
Utils.toast(mApplication, R.string.install_failure_hint)

View File

@ -553,7 +553,7 @@ public class LogUtils {
}
public static void uploadSearchGame(String event, String location, String key, String searchType) {
uploadSearchClick(event, location, key, searchType, "", "", false);
uploadSearchClick(event, location, key, searchType, "", "", false, false);
}
public static void uploadSearchClick(String event,
@ -562,7 +562,8 @@ public class LogUtils {
String searchType,
String gameId,
String gameName,
Boolean isMirrorData) {
Boolean isMirrorData,
Boolean isAdData) {
JSONObject object = new JSONObject();
JSONObject payload = new JSONObject();
try {
@ -576,6 +577,7 @@ public class LogUtils {
payload.put("game_id", gameId); //event为search_click才取值
payload.put("game_name", gameName); //event为search_click才取值
payload.put("is_mirror_data", isMirrorData);
payload.put("is_ad_data", isAdData);
object.put("payload", payload);
} catch (JSONException e) {
e.printStackTrace();

View File

@ -461,17 +461,6 @@ object NewFlatLogUtils {
log(json, "event", false)
}
//设置点击深色模式跟随系统切换开关
@JvmStatic
fun logHaloSelfNightModeOsSwitch(isOn: Boolean) {
val json = json {
"event" to "halo_self_night_mode_os_switch"
"is_on" to isOn
parseAndPutMeta().invoke(this)
}
log(json, "event", false)
}
//触发关闭深色模式跟随系统切换弹窗
@JvmStatic
fun logHaloSelfNightModeOsDialog(buttonText: String) {

View File

@ -1,6 +1,7 @@
package com.gh.common.util
import android.annotation.SuppressLint
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.common.json.JsonObjectBuilder
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.loghub.LoghubUtils
@ -8,12 +9,10 @@ import com.gh.gamecenter.common.retrofit.EmptyResponse
import com.gh.gamecenter.common.tracker.Tracker
import com.gh.gamecenter.common.utils.toRequestBody
import com.gh.gamecenter.entity.QuoteCountEntity
import com.gh.gamecenter.entity.WechatConfigEntity
import com.gh.gamecenter.retrofit.RetrofitManager
import com.lightgame.utils.Utils
import io.reactivex.schedulers.Schedulers
import okhttp3.ResponseBody
import org.json.JSONArray
import org.json.JSONObject
object NewLogUtils {
@ -1896,20 +1895,6 @@ object NewLogUtils {
log(json, "appointment", false)
}
//点击微信提醒
@JvmStatic
fun logWechatRemindConfigClick(wechatConfigEntity: WechatConfigEntity) {
val json = json {
"event" to "appointment_wechat_remind_config_click"
"wechat_is_bind" to wechatConfigEntity.bind
"wechat_is_follow" to wechatConfigEntity.follow
"wechat_is_remind" to wechatConfigEntity.notice
"timestamp" to System.currentTimeMillis() / 1000
parseAndPutMeta().invoke(this)
}
log(json, "appointment", false)
}
//选择图片上传方式
@JvmStatic
fun logShowGameCollectionCoverTypeDialog() {

View File

@ -8,9 +8,9 @@ import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.gh.gamecenter.common.callback.CancelListener
import com.gh.gamecenter.common.callback.ConfirmListener
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.entity.GameEntity
import com.gh.gamecenter.entity.WechatConfigEntity
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.retrofit.RetrofitManager

View File

@ -3,11 +3,11 @@ package com.gh.common.util
import android.annotation.SuppressLint
import com.gh.gamecenter.common.callback.BiCallback
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.entity.WechatConfigEntity
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.utils.createRequestBody
import com.gh.gamecenter.common.utils.singleToMain
import com.gh.gamecenter.common.utils.toJson
import com.gh.gamecenter.entity.WechatConfigEntity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.common.retrofit.BiResponse
import com.gh.gamecenter.retrofit.RetrofitManager

View File

@ -22,7 +22,7 @@ import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.packagehelper.PackageRepository
import com.gh.gamecenter.packagehelper.PackageViewModel
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.setting.GameDownloadSettingFragment.Companion.CONCERN_GAME_SP_KEY
import com.gh.gamecenter.setting.compose.activity.ComposeGameDownloadSettingActivity
import com.halo.assistant.HaloApp
import com.lightgame.download.DownloadEntity
import com.lightgame.download.FileUtils
@ -109,7 +109,11 @@ object PackageObserver {
DownloadManager.getInstance().cancel(mDownloadEntity.url, false, true, false)
if (SPUtils.getBoolean(CONCERN_GAME_SP_KEY, true)) { //设置页面控制是否安装后自动关注
if (SPUtils.getBoolean(
ComposeGameDownloadSettingActivity.CONCERN_GAME_SP_KEY,
true
)
) { //设置页面控制是否安装后自动关注
// 安装后关注游戏
val finalDownloadEntity = mDownloadEntity
RetrofitManager.getInstance().api

View File

@ -6,13 +6,16 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.constant.RouteConsts;
import com.halo.assistant.fragment.ApkCleanerFragment;
/**
* Created by khy on 2017/1/24.
*/
@Route(path = RouteConsts.activity.cleanApkActivity)
public class CleanApkActivity extends ToolBarActivity {
@NonNull
@ -34,4 +37,9 @@ public class CleanApkActivity extends ToolBarActivity {
bundle.putString(EntranceConsts.KEY_PLATFORM_REQUESTS_ID, platformRequestsId);
return getTargetIntent(context, CleanApkActivity.class, ApkCleanerFragment.class, bundle);
}
@Override
protected Intent provideNormalIntent() {
return getIntent(this);
}
}

View File

@ -40,6 +40,7 @@ import com.gh.download.DownloadManager;
import com.gh.gamecenter.adapter.viewholder.DetailViewHolder;
import com.gh.gamecenter.common.callback.OnRequestCallBackListener;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.common.retrofit.Response;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.gh.gamecenter.common.utils.ShareUtils;
@ -56,10 +57,9 @@ import com.gh.gamecenter.eventbus.EBConcernChanged;
import com.gh.gamecenter.eventbus.EBDownloadStatus;
import com.gh.gamecenter.eventbus.EBNetworkState;
import com.gh.gamecenter.eventbus.EBPackage;
import com.gh.gamecenter.common.eventbus.EBReuse;
import com.gh.gamecenter.newsdetail.NewsDetailAdapter;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.halo.assistant.fragment.SettingsFragment;
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity;
import com.lightgame.download.DataWatcher;
import com.lightgame.download.DownloadEntity;
import com.lightgame.utils.Utils;
@ -319,7 +319,7 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
}
sp = PreferenceManager.getDefaultSharedPreferences(this);
fontsize = sp.getInt(SettingsFragment.FONT_SIZE_SP_KEY, 1);
fontsize = sp.getInt(ComposeSettingActivity.FONT_SIZE_SP_KEY, 1);
if (fontsize == 0) {
fontsize = 1;
}
@ -556,14 +556,14 @@ public class NewsDetailActivity extends DownloadToolbarActivity implements OnCli
if ((R11 - R12) > scrollSize && fontsize > 1) {
fontsize--;
adapter.setFontSize(fontsize);
sp.edit().putInt(SettingsFragment.FONT_SIZE_SP_KEY, fontsize).apply();
sp.edit().putInt(ComposeSettingActivity.FONT_SIZE_SP_KEY, fontsize).apply();
String fontSizeText = getFontSize(fontsize);
Utils.toast(this, fontSizeText);
}
if ((R11 - R12) < -scrollSize && fontsize < 4) {
fontsize++;
adapter.setFontSize(fontsize);
sp.edit().putInt(SettingsFragment.FONT_SIZE_SP_KEY, fontsize).apply();
sp.edit().putInt(ComposeSettingActivity.FONT_SIZE_SP_KEY, fontsize).apply();
String fontSizeText = getFontSize(fontsize);
Utils.toast(this, fontSizeText);
}

View File

@ -6,6 +6,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.databinding.GameHeadItemBinding
import com.gh.gamecenter.entity.SubjectEntity
@ -64,5 +65,6 @@ class GameHeadViewHolder(var binding: GameHeadItemBinding) :
binding.arrowIv.visibility = View.VISIBLE
}
binding.headTitle.setTextColor(R.color.text_title.toColor(binding.root.context))
binding.adLabelTv.goneIf(!subject.adIconActive)
}
}

View File

@ -16,6 +16,7 @@ import com.gh.common.exposure.ExposureType
import com.gh.common.exposure.IExposable
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.BlockActivity
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.MainActivity

View File

@ -26,7 +26,9 @@ class GamesCollectionDetailEntity(
var count: Count? = null,
var user: UserEntity? = null,
var me: MeEntity? = null,
val source: SourceEntity? = null
val source: SourceEntity? = null,
@SerializedName("ad_icon_active")
var adIconActive: Boolean = false,
) : Parcelable {
@Parcelize

View File

@ -41,7 +41,9 @@ class GamesCollectionEntity(
var time: TimeEntity? = null,
@Ignore
var status: String = "",// draft/pending/pass/failed
@Ignore
@SerializedName("ad_icon_active")
var adIconActive: Boolean = false,
//本地字段
@Ignore
var isLocalDraft: Boolean = false

View File

@ -10,5 +10,7 @@ data class SearchSubjectEntity(
val games: List<GameEntity> = listOf(),
val location: Int = 0,
@SerializedName("column_id")
val columnId: String = ""
val columnId: String = "",
@SerializedName("ad_icon_active")
val adIconActive: Boolean = false
) : Parcelable

View File

@ -119,12 +119,14 @@ data class SettingsEntity(
) {
data class RankList(
var title: String = "",
var content: List<RankContent> = listOf()
var content: List<RankContent> = listOf(),
var isShowIcon: Boolean = true // 榜单Item是否显示图标所有内容都配置了图标前端才可显示否则均不显示图标
) {
data class RankContent(
@SerializedName("_id")
var id: String = "",
var name: String = "",
var icon: String = "",
var title: String = "",
var order: Int = 0,
@SerializedName("recommend_type")

View File

@ -75,6 +75,8 @@ data class SubjectEntity(
// 专题内游戏item是否显示下载按钮(目前只针对横向专题)
@SerializedName("show_download")
var showDownload: Boolean = false,
@SerializedName("ad_icon_active")
var adIconActive: Boolean = false,
@SerializedName("link_text")
var linkText: String = "",

View File

@ -25,7 +25,9 @@ data class SubjectSettingEntity(
var filterSizes: ArrayList<Size>? = null,
@SerializedName("filter_options")
var filterOptions: List<String> = ArrayList() // 过滤选项,推荐、最新、评分、更新
var filterOptions: List<String> = ArrayList(), // 过滤选项,推荐、最新、评分、更新
@SerializedName("ad_icon_active")
var adIconActive: Boolean = false,
) : Parcelable {
@Parcelize
data class TypeEntity(

View File

@ -7,12 +7,12 @@ import android.text.TextUtils
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.common.utils.NetworkUtils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.common.utils.safelyGetInRelease
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.entity.ForumVideoEntity
import com.gh.gamecenter.setting.VideoSettingFragment
import com.gh.gamecenter.setting.compose.activity.ComposeVideoSettingActivity
import com.gh.gamecenter.video.detail.CustomManager
import com.halo.assistant.HaloApp
import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer
@ -150,15 +150,15 @@ class ForumScrollCalculatorHelper(
if (gsyBaseVideoPlayer != null && !gsyBaseVideoPlayer!!.isInPlayingState) {
val videoOption =
SPUtils.getString(Constants.SP_CONTENT_VIDEO_OPTION, VideoSettingFragment.VIDEO_OPTION_WIFI)
?: VideoSettingFragment.VIDEO_OPTION_WIFI
SPUtils.getString(Constants.SP_CONTENT_VIDEO_OPTION, ComposeVideoSettingActivity.VIDEO_OPTION_WIFI)
?: ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
when (videoOption) {
VideoSettingFragment.VIDEO_OPTION_ALL -> {
ComposeVideoSettingActivity.VIDEO_OPTION_ALL -> {
startPlayLogic(gsyBaseVideoPlayer)
}
VideoSettingFragment.VIDEO_OPTION_WIFI -> {
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI -> {
if (NetworkUtils.isWifiConnected(HaloApp.getInstance().application)) {
startPlayLogic(gsyBaseVideoPlayer)
}

View File

@ -18,6 +18,7 @@ import com.gh.common.exposure.ExposureType
import com.gh.common.exposure.IExposable
import com.gh.common.util.*
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.BlockActivity
import com.gh.gamecenter.GameDetailActivity

View File

@ -11,6 +11,7 @@ import com.gh.common.databind.BindingAdapters
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.common.view.DrawableView
@ -61,6 +62,7 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
gameDes.text = entity.decoratedDes
recommendStar.rating = entity.recommendStar.toFloat()
initGameSubtitle(entity, gameSubtitleTv, gameDesSpace, root, forceShowSubtitle)
adLabelTv.goneIf(!entity.adIconActive)
}
}
@ -113,7 +115,8 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
}
}
gameDesSpace.post {
gameSubtitleTv.maxWidth = gameDesSpace.width
gameSubtitleTv.maxWidth =
if (entity.adIconActive) gameDesSpace.width - 25F.dip2px() else gameDesSpace.width
}
}
if (entity.advanceDownload) {

View File

@ -31,7 +31,7 @@ import com.gh.gamecenter.game.rank.RankCollectionAdapter
import com.gh.gamecenter.gamecollection.square.GameCollectionListItemData
import com.gh.gamecenter.home.BlankDividerViewHolder
import com.gh.gamecenter.retrofit.RetrofitManager
import com.halo.assistant.fragment.SettingsFragment
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
@ -94,7 +94,7 @@ class GameViewModel(application: Application, var blockData: SubjectRecommendEnt
// 游戏库才需要展示"猜你喜欢"专题
if (blockData?.text == "游戏库"
&& blockData?.name == "游戏库"
&& SPUtils.getBoolean(SettingsFragment.PERSONAL_RECOMMEND_SP_KEY, true)
&& SPUtils.getBoolean(ComposeSettingActivity.PERSONAL_RECOMMEND_SP_KEY, true)
) {
getSmartColumn()
}

View File

@ -3,15 +3,18 @@ package com.gh.gamecenter.game.upload
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.R
import com.gh.gamecenter.common.base.activity.BaseActivity
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
/**
* 游戏投稿
*/
@Route(path = RouteConsts.activity.gameSubmissionActivity)
class GameSubmissionActivity : ToolBarActivity() {
companion object {
@JvmStatic

View File

@ -41,6 +41,7 @@ class GameItemUi(override val ctx: Context) : Ui {
var iconIv: GameIconView
var gameNameTv: TextView
var gameSubtitleTv: TextView
var adLabelTv: TextView
var downloadTv: DownloadButton
var gameDesTv: TextView
var serverTypeTv: TextView
@ -63,6 +64,7 @@ class GameItemUi(override val ctx: Context) : Ui {
serverTypeTv = initServerTypeTv()
gameNameTv = initGameNameTv()
gameSubtitleTv = initGameSubtitleTv()
adLabelTv = initAdLabelTv()
downloadTv = initDownloadTv()
gameDesTv = initGameDesTv()
gameRatingTv = initGameRatingTv()
@ -175,6 +177,15 @@ class GameItemUi(override val ctx: Context) : Ui {
startMargin = dip(4)
})
add(adLabelTv, lParams(dip(21), dip(14)) {
startToEndOf(gameSubtitleTv)
topToTopOf(gameSubtitleTv)
bottomToBottomOf(gameSubtitleTv)
endToEndOf(mGameDesSpace)
horizontalBias = 0F
startMargin = dip(4)
})
gameInfoGroup.visibility = View.GONE
}
@ -207,6 +218,16 @@ class GameItemUi(override val ctx: Context) : Ui {
visibility = View.GONE
}
private fun initAdLabelTv() = textView {
id = R.id.adLabelTv
textSize = 10F
text = "AD"
gravity = Gravity.CENTER
background = ContextCompat.getDrawable(context, R.drawable.bg_ad_label)
setTextColor(Color.WHITE)
visibility = View.GONE
}
private fun initServerTypeTv() = textView {
id = R.id.game_server_type
textSize = 9F

View File

@ -13,6 +13,7 @@ import com.gh.common.util.DownloadItemUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
import com.gh.gamecenter.common.utils.dip2px
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.common.view.AsyncUi
@ -89,6 +90,7 @@ class GameVerticalAdapter(
GameItemViewHolder.initServerType(gameNameTv, serverTypeTv, gameEntity)
gameDesTv.text = gameEntity.decoratedDes
gameSubtitleTv.visibility = View.GONE
adLabelTv.goneIf(!gameEntity.adIconActive)
if (gameEntity.serverLabel == null && gameEntity.subtitle.isNotEmpty() && !gameEntity.advanceDownload) {
gameSubtitleTv.run {
visibility = View.VISIBLE

View File

@ -13,7 +13,7 @@ class ChooseGamesViewModel(application: Application, repository: ChooseGamesRepo
val deleteOrAddGameLiveData = repository.deleteOrAddGameLiveData
class Factory : ViewModelProvider.NewInstanceFactory() {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return ChooseGamesViewModel(
HaloApp.getInstance().application,
ChooseGamesRepository.getInstance()

View File

@ -4,8 +4,13 @@ import android.app.Activity
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.SpannableStringBuilder
import android.text.Spanned
import android.view.Gravity
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.ViewCompat
@ -32,6 +37,7 @@ import com.gh.gamecenter.common.syncpage.SyncPageRepository
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.SegmentedFilterView
import com.gh.gamecenter.core.iinterface.IScrollable
import com.gh.gamecenter.core.utils.CenterImageSpan
import com.gh.gamecenter.core.utils.DisplayUtils
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.core.utils.SPUtils
@ -44,12 +50,12 @@ import com.gh.gamecenter.eventbus.EBUserFollow
import com.gh.gamecenter.gamedetail.GameDetailFragment
import com.gh.gamecenter.home.video.ScrollCalculatorHelper
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.login.user.UserViewModel
import com.gh.gamecenter.qa.article.detail.CommentItemData
import com.gh.gamecenter.qa.comment.CommentActivity
import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter
import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel
import com.gh.gamecenter.setting.VideoSettingFragment
import com.gh.gamecenter.login.user.UserViewModel
import com.gh.gamecenter.setting.compose.activity.ComposeVideoSettingActivity
import com.gh.gamecenter.video.detail.CustomManager
import com.google.android.material.appbar.AppBarLayout
import com.halo.assistant.HaloApp
@ -444,7 +450,7 @@ class GameCollectionDetailFragment :
private fun initImageTypeView() {
mBinding?.imageItem?.run {
mEntity?.run {
nameTv.text = title
initGameCollectionTitle(this, nameTv)
userNameTv.text = user?.name
ImageUtils.display(poster, cover)
tagIv.goneIf(stamp.isEmpty())
@ -483,8 +489,8 @@ class GameCollectionDetailFragment :
mBinding?.videoItem?.run {
mEntity?.run {
tagIv.goneIf(stamp.isEmpty())
initGameCollectionTitle(this, nameTv)
userNameTv.text = user?.name
nameTv.text = title
videoItemDesTv.text = intro
videoActivityLabelTv.goneIf(activityTags.isNullOrEmpty())
ipRegionTv.goneIf(!(source != null && source.region.isNotEmpty()))
@ -518,6 +524,34 @@ class GameCollectionDetailFragment :
}
}
private fun initGameCollectionTitle(entity: GamesCollectionDetailEntity, nameTv: TextView) {
entity.run {
if (adIconActive) {
val adLabelView = TextView(context).apply {
layoutParams =
FrameLayout.LayoutParams(21F.dip2px(), 14F.dip2px()).apply { leftMargin = 4F.dip2px() }
background = R.drawable.bg_ad_label.toDrawable(context)
text = "AD"
textSize = 10F
setTextColor(Color.WHITE)
gravity = Gravity.CENTER
}
adLabelView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED)
val adLabelBitmap = FrameLayout(requireContext()).apply { addView(adLabelView) }.convertViewToBitmap()
nameTv.text = SpannableStringBuilder("$title ").apply {
setSpan(
CenterImageSpan(context, adLabelBitmap),
title.length,
title.length + 1,
Spanned.SPAN_EXCLUSIVE_INCLUSIVE
)
}
} else {
nameTv.text = title
}
}
}
private fun getTagView(
content: String,
isLast: Boolean,
@ -655,15 +689,15 @@ class GameCollectionDetailFragment :
//val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
val videoOption = SPUtils.getString(
Constants.SP_HOME_OR_DETAIL_VIDEO_OPTION,
VideoSettingFragment.VIDEO_OPTION_WIFI
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
)
?: VideoSettingFragment.VIDEO_OPTION_WIFI
?: ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
when (videoOption) {
VideoSettingFragment.VIDEO_OPTION_ALL -> {
ComposeVideoSettingActivity.VIDEO_OPTION_ALL -> {
startPlayLogic(isAutoPlay = true)
}
VideoSettingFragment.VIDEO_OPTION_WIFI -> {
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI -> {
if (NetworkUtils.isWifiConnected(requireContext()) /*|| !trafficVideo*/) {
if (mListViewModel.isTopVideoPartlyCached(video.url)) {
startPlayLogic(isAutoPlay = true)

View File

@ -348,6 +348,7 @@ class GameCollectionSquareAdapter(
}
tagContainer.visibleIf(!CheckLoginUtils.isLogin() || gamesCollectionEntity.count?.game == 0)
playedGamesContainer.visibleIf(CheckLoginUtils.isLogin() && gamesCollectionEntity.count?.game != 0)
adLabelTv.goneIf(!gamesCollectionEntity.adIconActive)
iconIvOne.setOnClickListener {
val game = gamesCollectionEntity.games?.get(0)
NewLogUtils.logClickGameCollectionGameIcon(

View File

@ -40,6 +40,7 @@ import com.gh.common.simulator.SimulatorGameManager
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.common.view.FlexLinearLayout
import com.gh.common.xapk.XapkInstaller
@ -75,7 +76,7 @@ import com.gh.gamecenter.gamedetail.video.TopVideoView
import com.gh.gamecenter.home.video.ScrollCalculatorHelper
import com.gh.gamecenter.login.user.UserViewModel
import com.gh.gamecenter.packagehelper.PackageViewModel
import com.gh.gamecenter.setting.VideoSettingFragment
import com.gh.gamecenter.setting.compose.activity.ComposeVideoSettingActivity
import com.gh.gamecenter.simulatorgame.SimulatorGameActivity
import com.gh.gamecenter.tag.TagsActivity
import com.gh.gamecenter.video.detail.CustomManager
@ -627,25 +628,6 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
return (width / textWidth).toInt()
}
/**
* 把View转化成Bitmap
*/
private fun View.convertViewToBitmap(): Bitmap? {
measure(
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
)
layout(0, 0, measuredWidth, measuredHeight)
return if (measuredWidth > 0 && measuredHeight > 0) {
val bitmap =
Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
draw(canvas)
canvas.save()
bitmap
} else null
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
@ -1330,15 +1312,15 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
//val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
val videoOption = SPUtils.getString(
Constants.SP_HOME_OR_DETAIL_VIDEO_OPTION,
VideoSettingFragment.VIDEO_OPTION_WIFI
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
)
?: VideoSettingFragment.VIDEO_OPTION_WIFI
?: ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
when (videoOption) {
VideoSettingFragment.VIDEO_OPTION_ALL -> {
ComposeVideoSettingActivity.VIDEO_OPTION_ALL -> {
mVideoBinding.player.startPlayLogic(isAutoPlay = true)
}
VideoSettingFragment.VIDEO_OPTION_WIFI -> {
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI -> {
if (NetworkUtils.isWifiConnected(requireContext()) /*|| !trafficVideo*/) {
if (mViewModel.isTopVideoPartlyCached(topVideo.url)) {
mVideoBinding.player.startPlayLogic(isAutoPlay = true)

View File

@ -29,6 +29,7 @@ import com.gh.common.exposure.ExposureSource
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.GameNewsActivity
import com.gh.gamecenter.R

View File

@ -9,6 +9,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.facebook.drawee.view.SimpleDraweeView
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.common.util.*
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.view.WrapContentDraweeView
import com.gh.gamecenter.ImageViewerActivity
import com.gh.gamecenter.R

View File

@ -11,7 +11,6 @@ import com.gh.common.exposure.ExposureSource
import com.gh.common.exposure.IExposable
import com.gh.common.util.DirectUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.AboutActivity
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder
@ -36,6 +35,7 @@ import com.gh.gamecenter.home.amway.HomeAmwayListViewHolder
import com.gh.gamecenter.home.gamecollection.HomeGameCollectionViewHolder
import com.gh.gamecenter.home.slide.HomeSlideListAdapter
import com.gh.gamecenter.home.slide.HomeSlideListViewHolder
import com.gh.gamecenter.setting.compose.activity.ComposeAboutActivity
import com.gh.vspace.HomeRecentVGameAdapter
import com.gh.vspace.HomeRecentVGameViewHolder
import com.gh.vspace.VHelper
@ -218,7 +218,7 @@ class HomeFragmentAdapter(
private fun bindUnknown(holder: ReuseViewHolder) {
holder.itemView.setOnClickListener {
mContext.startActivity(AboutActivity.getIntent(mContext, true))
mContext.startActivity(ComposeAboutActivity.getIntent(mContext, true))
}
}

View File

@ -138,6 +138,7 @@ class HomeGameItemViewHolder(val binding: HomeGameItemBinding) : BaseRecyclerVie
} else View.GONE
}, 5)
binding.gameSubtitleTv.visibility = View.GONE
binding.adLabelTv.goneIf(!game.adIconActive)
if (game.serverLabel == null && game.subtitle.isNotEmpty() && !game.advanceDownload) {
binding.gameSubtitleTv.run {
visibility = View.VISIBLE
@ -157,7 +158,8 @@ class HomeGameItemViewHolder(val binding: HomeGameItemBinding) : BaseRecyclerVie
}
}
binding.ratingAndTagContainer.post {
binding.gameSubtitleTv.maxWidth = binding.ratingAndTagContainer.width + 32F.dip2px()
binding.gameSubtitleTv.maxWidth =
if (game.adIconActive) binding.ratingAndTagContainer.width + 32F.dip2px() else binding.ratingAndTagContainer.width + 7F.dip2px()
}
}
if (game.advanceDownload) {

View File

@ -26,10 +26,10 @@ import com.gh.gamecenter.game.rank.RankCollectionAdapter
import com.gh.gamecenter.gamecollection.square.GameCollectionListItemData
import com.gh.gamecenter.packagehelper.PackageRepository
import com.gh.gamecenter.retrofit.RetrofitManager
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity
import com.gh.vspace.VGameItemData
import com.gh.vspace.VHelper
import com.halo.assistant.HaloApp
import com.halo.assistant.fragment.SettingsFragment
import com.lightgame.download.DownloadEntity
import com.lightgame.utils.Utils
import io.reactivex.android.schedulers.AndroidSchedulers
@ -98,7 +98,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
// 触发列表刷新行为时亦刷新内存中的备用游戏库列表
GameSubstituteRepositoryHelper.refreshRepositoryFromLocal()
if (SPUtils.getBoolean(SettingsFragment.PERSONAL_RECOMMEND_SP_KEY, true)) {
if (SPUtils.getBoolean(ComposeSettingActivity.PERSONAL_RECOMMEND_SP_KEY, true)) {
getSmartColumn()
}
@ -431,6 +431,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
val homeContent = homeContents[i]
val linkType = homeContent.linkType
val linkStyle = homeContent.linkColumn?.style ?: ""
val adIconActive = homeContent.linkColumn?.adIconActive ?: false
if (i + 1 < homeContents.size) {
val nextItem = homeContents[i + 1]
@ -449,7 +450,11 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
}
} else if (linkType == "top_game_comment") {
val head = HomeItemData()
head.columnHead = SubjectEntity(type = linkType, name = "安利墙")
head.columnHead = SubjectEntity(
type = linkType,
name = "安利墙",
adIconActive = homeContent.linkColumn?.adIconActive ?: false
)
mSnapshotItemList.add(LegacyHomeSubjectTransformer.getBlankSpacingItem(HomeItemData()) as HomeItemData)
mSnapshotItemList.add(head)
@ -517,6 +522,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
homePageStyle = homeContent.commonCollection?.homePageStyle ?: ""
verticalLine = homeContent.commonCollection?.verticalLine ?: ""
commonCollectionList = homeContent.commonCollection?.collectionList
this.adIconActive = adIconActive
}
val head = HomeItemData()
head.columnHead = subjectEntity
@ -553,7 +559,8 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
}
} else if (linkType == "game_list_collection") {
val head = HomeItemData()
head.columnHead = SubjectEntity(type = linkType, name = homeContent.linkText)
head.columnHead =
SubjectEntity(type = linkType, name = homeContent.linkText, adIconActive = adIconActive)
mSnapshotItemList.add(LegacyHomeSubjectTransformer.getBlankSpacingItem(HomeItemData()) as HomeItemData)
mSnapshotItemList.add(head)

View File

@ -10,18 +10,18 @@ import androidx.recyclerview.widget.RecyclerView
import com.gh.common.databind.BindingAdapters
import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureSource
import com.gh.gamecenter.core.runOnIoThread
import com.gh.common.util.*
import com.gh.gamecenter.AboutActivity
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.DataLogUtils
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.core.runOnIoThread
import com.gh.gamecenter.core.utils.MtaHelper
import com.gh.gamecenter.core.utils.PageSwitchDataHelper
import com.gh.gamecenter.databinding.HomeSlideListItemBinding
import com.gh.gamecenter.entity.HomeSlide
import com.gh.gamecenter.home.HomeItemData
import com.gh.gamecenter.setting.compose.activity.ComposeAboutActivity
import com.lightgame.adapter.BaseRecyclerAdapter
import com.lightgame.download.DownloadEntity
import java.lang.ref.WeakReference
@ -116,7 +116,7 @@ class HomeSlideListAdapter(
"新首页-轮播图[${homeSlide.linkText}<-||->${homeSlide.title}=${homeSlide.linkType}=$actualPositionString]",
exposureEvent,
unknownCallback = {
mContext.startActivity(AboutActivity.getIntent(mContext, true))
mContext.startActivity(ComposeAboutActivity.getIntent(mContext, true))
})
}

View File

@ -6,10 +6,10 @@ import android.os.Looper
import android.view.View
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.common.utils.NetworkUtils
import com.gh.gamecenter.core.utils.MD5Utils
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.setting.VideoSettingFragment
import com.gh.gamecenter.setting.compose.activity.ComposeVideoSettingActivity
import com.gh.gamecenter.video.detail.CustomManager
import com.halo.assistant.HaloApp
import com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer
@ -98,15 +98,18 @@ class ScrollCalculatorHelper(private val mListRv: RecyclerView, private val mPla
if (gsyBaseVideoPlayer != null && !gsyBaseVideoPlayer!!.isInPlayingState) {
val videoOption =
SPUtils.getString(Constants.SP_HOME_OR_DETAIL_VIDEO_OPTION, VideoSettingFragment.VIDEO_OPTION_WIFI)
?: VideoSettingFragment.VIDEO_OPTION_WIFI
SPUtils.getString(
Constants.SP_HOME_OR_DETAIL_VIDEO_OPTION,
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
)
?: ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
when (videoOption) {
VideoSettingFragment.VIDEO_OPTION_ALL -> {
ComposeVideoSettingActivity.VIDEO_OPTION_ALL -> {
startPlayLogic(gsyBaseVideoPlayer)
}
VideoSettingFragment.VIDEO_OPTION_WIFI -> {
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI -> {
if (NetworkUtils.isWifiConnected(HaloApp.getInstance().application)) {
startPlayLogic(gsyBaseVideoPlayer)
}

View File

@ -14,6 +14,7 @@ import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureSource
import com.gh.common.exposure.IExposable
import com.gh.common.util.*
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.viewholder.FooterViewHolder

View File

@ -22,6 +22,7 @@ import com.gh.common.exposure.ExposureSource
import com.gh.common.exposure.IExposable
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.view.BugFixedPopupWindow
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.GameDetailActivity

View File

@ -74,7 +74,7 @@ import com.gh.gamecenter.entity.NewsDetailEntity;
import com.gh.gamecenter.entity.NewsEntity;
import com.gh.gamecenter.qa.editor.OnLinkClickListener;
import com.gh.gamecenter.retrofit.RetrofitManager;
import com.halo.assistant.fragment.SettingsFragment;
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity;
import com.lightgame.adapter.BaseRecyclerAdapter;
import com.lightgame.utils.Utils;
@ -259,7 +259,7 @@ public class NewsDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
mWebSettings = viewHolder.binding.newsdetailItemWvContent.getSettings();
mWebSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(mContext);
mWebSettings.setTextZoom(defaultTextZoom + sp.getInt(SettingsFragment.FONT_SIZE_SP_KEY, 1) * 15);
mWebSettings.setTextZoom(defaultTextZoom + sp.getInt(ComposeSettingActivity.FONT_SIZE_SP_KEY, 1) * 15);
ExtensionsKt.enableForceDark(viewHolder.binding.newsdetailItemWvContent, DarkModeUtils.INSTANCE.isDarkModeOn(mContext));
ExtensionsKt.setTransparentBackground(viewHolder.binding.newsdetailItemWvContent);
viewHolder.binding.newsdetailItemWvContent.setHtml(mNewsDetailEntity.getContent(), true);

View File

@ -4,7 +4,10 @@ import android.content.Context
import android.os.Build
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.gh.common.util.*
import com.gh.common.util.CheckLoginUtils
import com.gh.common.util.DataCollectionUtils
import com.gh.common.util.DirectUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.*
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.utils.*
@ -15,7 +18,7 @@ import com.gh.gamecenter.entity.AddonLinkEntity
import com.gh.gamecenter.game.upload.GameSubmissionActivity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.message.MessageUnreadRepository
import com.gh.gamecenter.security.SecurityActivity
import com.gh.gamecenter.setting.compose.activity.ComposeSecurityActivity
import com.gh.gamecenter.simulatorgame.SimulatorGameActivity
import com.gh.gamecenter.teenagermode.TeenagerModeActivity
import com.gh.gamecenter.toolbox.ToolBoxBlockActivity
@ -92,7 +95,7 @@ class HaloPersonalBannerAdapter(context: Context) : BaseRecyclerAdapter<Recycler
}
"账号安全" -> {
if (UserManager.getInstance().isLoggedIn) {
mContext.startActivity(SecurityActivity.getIntent(mContext, "我的光环-账号安全"))
mContext.startActivity(ComposeSecurityActivity.getIntent(mContext, "我的光环-账号安全"))
} else {
CheckLoginUtils.checkLogin(mContext, "我的光环-账号安全") {}
}

View File

@ -21,6 +21,7 @@ import com.gh.common.databind.BindingAdapters
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.LogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.common.util.NewLogUtils
import com.gh.gamecenter.*
import com.gh.gamecenter.common.base.fragment.BaseLazyFragment
@ -50,6 +51,7 @@ import com.gh.gamecenter.mygame.MyGameActivity
import com.gh.gamecenter.mypost.MyPostActivity
import com.gh.gamecenter.personalhome.UserHomeViewModel
import com.gh.gamecenter.room.AppDatabase
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity
import com.google.android.material.appbar.AppBarLayout
import com.halo.assistant.HaloApp
import com.jakewharton.rxbinding2.view.RxView
@ -589,7 +591,7 @@ class HaloPersonalFragment : BaseLazyFragment() {
iconIv.setImageResource(R.drawable.ic_personal_setting)
root.setOnClickListener {
NewFlatLogUtils.logHaloSelfClick("其他功能", "设置")
startActivity(SettingActivity.getIntent(requireContext(), false, "我的光环"))
startActivity(ComposeSettingActivity.getIntent(requireContext(), false, "我的光环"))
}
}
mStubBinding.feedbackItem.run {

View File

@ -19,7 +19,7 @@ import com.gh.gamecenter.entity.AddonLinkEntity
import com.gh.gamecenter.game.upload.GameSubmissionActivity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.message.MessageUnreadRepository
import com.gh.gamecenter.security.SecurityActivity
import com.gh.gamecenter.setting.compose.activity.ComposeSecurityActivity
import com.gh.gamecenter.simulatorgame.SimulatorGameActivity
import com.gh.gamecenter.teenagermode.TeenagerModeActivity
import com.gh.gamecenter.toolbox.ToolBoxBlockActivity
@ -100,7 +100,7 @@ class HaloPersonalFunctionAdapter(context: Context) : BaseRecyclerAdapter<Recycl
}
"账号安全" -> {
if (UserManager.getInstance().isLoggedIn) {
mContext.startActivity(SecurityActivity.getIntent(mContext, "我的光环-账号安全"))
mContext.startActivity(ComposeSecurityActivity.getIntent(mContext, "我的光环-账号安全"))
} else {
CheckLoginUtils.checkLogin(mContext, "我的光环-账号安全") {}
}

View File

@ -20,7 +20,7 @@ import com.gh.gamecenter.entity.AddonLinkEntity
import com.gh.gamecenter.game.upload.GameSubmissionActivity
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.message.MessageUnreadRepository
import com.gh.gamecenter.security.SecurityActivity
import com.gh.gamecenter.setting.compose.activity.ComposeSecurityActivity
import com.gh.gamecenter.simulatorgame.SimulatorGameActivity
import com.gh.gamecenter.teenagermode.TeenagerModeActivity
import com.gh.gamecenter.toolbox.ToolBoxBlockActivity
@ -118,7 +118,7 @@ class HaloPersonalRecommendAdapter(val context: Context) : BaseRecyclerAdapter<R
}
"账号安全" -> {
if (UserManager.getInstance().isLoggedIn) {
mContext.startActivity(SecurityActivity.getIntent(mContext, "我的光环-账号安全"))
mContext.startActivity(ComposeSecurityActivity.getIntent(mContext, "我的光环-账号安全"))
} else {
CheckLoginUtils.checkLogin(mContext, "我的光环-账号安全") {}
}

View File

@ -9,6 +9,7 @@ import androidx.core.os.bundleOf
import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.core.AppExecutor
import com.gh.common.util.*
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.baselist.ListAdapter
import com.gh.gamecenter.common.baselist.ListFragment

View File

@ -10,6 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.constant.ItemViewType
import com.gh.common.util.*
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.viewholder.FooterViewHolder
import com.gh.gamecenter.common.baselist.ListAdapter

View File

@ -4,6 +4,7 @@ import com.gh.common.filter.RegionSetting;
import com.gh.gamecenter.common.entity.LinkEntity;
import com.gh.gamecenter.common.entity.ToolBoxEntity;
import com.gh.gamecenter.common.entity.OssEntity;
import com.gh.gamecenter.common.entity.WechatConfigEntity;
import com.gh.gamecenter.entity.SettingsEntity;
import com.gh.gamecenter.entity.*;
import com.gh.gamecenter.gamedetail.entity.BigEvent;
@ -811,21 +812,6 @@ public interface ApiService {
@GET("users/{user_id}:sign-in")
Observable<SignEntity> postSign(@Path("user_id") String userId);
/**
* 绑定手机
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("./mobile:bind")
Single<ResponseBody> bindPhone(@Query("step") int step, @Body RequestBody body);
/**
* 换绑手机
*/
@Headers({"Content-Type: application/json", "Accept: application/json"})
@POST("./mobile:rebind")
Single<ResponseBody> reBindPhone(@Query("step") int step, @Body RequestBody body);
/**
* 修改开服信息
*/

View File

@ -20,6 +20,7 @@ import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureManager
import com.gh.common.exposure.ExposureSource
import com.gh.common.util.*
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.view.DrawableView
@ -76,6 +77,7 @@ open class SearchDefaultFragment : BaseFragment<Any>() {
mBinding = FragmentSearchDefaultBinding.bind(mCachedView)
mRankList = Config.getSettings()?.search?.rankList?.apply {
forEachIndexed { outIndex, rankList ->
rankList.isShowIcon = !rankList.content.any { it.icon.isBlank() }
rankList.content.forEachIndexed { index, rank ->
val source = listOf(ExposureSource("首页搜索", "搜索榜单: ${rankList.title}-${rank.name}"))
if (rank.link.type == "game") {

View File

@ -2,12 +2,16 @@ package com.gh.gamecenter.search
import android.content.Context
import android.graphics.Typeface
import android.view.View
import android.view.ViewGroup
import com.gh.common.util.DirectUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
import com.gh.gamecenter.common.utils.display
import com.gh.gamecenter.common.utils.toBinding
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.utils.toDrawable
import com.gh.gamecenter.databinding.SearchDefaultRankItemBinding
import com.gh.gamecenter.entity.SettingsEntity
import com.lightgame.adapter.BaseRecyclerAdapter
@ -15,18 +19,23 @@ import com.lightgame.utils.Util_System_Keyboard
class SearchDefaultRankAdapter(
context: Context,
private val mTitle: String,
private val mRankContent: List<SettingsEntity.Search.RankList.RankContent>,
private val mRankList: SettingsEntity.Search.RankList,
) : BaseRecyclerAdapter<SearchDefaultRankAdapter.SearchDefaultRankItemViewHolder>(context) {
override fun getItemCount() = mRankContent.size
override fun getItemCount() = minOf(mRankList.content.size, 10)
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) =
SearchDefaultRankItemViewHolder(parent.toBinding())
override fun onBindViewHolder(holder: SearchDefaultRankItemViewHolder, position: Int) {
val rank = mRankContent[position]
val rank = mRankList.content[position]
holder.binding.run {
if (mRankList.isShowIcon) {
icon.visibility = View.VISIBLE
icon.display(rank.icon)
} else {
icon.visibility = View.GONE
}
name.text = rank.name.ifBlank { rank.link.text }
index.run {
typeface = Typeface.createFromAsset(mContext.assets, "fonts/d_din_bold.ttf")
@ -55,7 +64,7 @@ class SearchDefaultRankAdapter(
mContext,
rank.link,
"游戏搜索-搜索榜单",
"${mTitle}-${rank.name}",
"${mRankList.title}-${rank.name}",
rank.exposureEvent
)
Util_System_Keyboard.hideSoftKeyboardByIBinder(mContext, it.windowToken)

View File

@ -29,8 +29,7 @@ class SearchDefaultRankListAdapter(
view!!.findViewById<RecyclerView>(R.id.rankContainer).run {
layoutManager = LinearLayoutManager(mContext)
adapter =
SearchDefaultRankAdapter(mContext, mRankList[position].title, mRankList[position].content.take(10))
adapter = SearchDefaultRankAdapter(mContext, mRankList[position])
}
return view
}

View File

@ -140,10 +140,19 @@ class SearchGameIndexAdapter(
gameRating.text = if (gameEntity.commentCount > 3) {
if (gameEntity.star == 10.0F) "10" else gameEntity.star.toString()
} else ""
gameRating.setTextColor(if (gameEntity.commentCount > 3) R.color.theme_font.toColor() else R.color.theme.toColor())
gameRating.setTextColor(
if (gameEntity.commentCount > 3) {
R.color.theme_font.toColor(mContext)
} else {
R.color.theme.toColor(
mContext
)
}
)
gameDes.text = gameEntity.decoratedDes
recommendStar.rating = gameEntity.recommendStar.toFloat()
gameSubtitleTv.visibility = View.GONE
adLabelTv.goneIf(!gameEntity.adIconActive)
if (gameEntity.serverLabel == null && gameEntity.subtitle.isNotEmpty() && !gameEntity.advanceDownload) {
gameSubtitleTv.run {
visibility = View.VISIBLE
@ -407,7 +416,8 @@ class SearchGameIndexAdapter(
SearchType.fromString(type).toChinese(),
gameEntity.id,
gameEntity.name,
gameEntity.shouldUseMirrorInfo()
gameEntity.shouldUseMirrorInfo(),
gameEntity.adIconActive
)
}
@ -461,7 +471,8 @@ class SearchGameIndexAdapter(
SearchType.fromString(type).toChinese(),
gameEntity.id,
gameEntity.name,
gameEntity.shouldUseMirrorInfo()
gameEntity.shouldUseMirrorInfo(),
gameEntity.adIconActive
)
}
}
@ -475,6 +486,7 @@ class SearchGameIndexAdapter(
)
}
} else if (holder is SearchHistoryViewHolder) {
holder.binding.adLabelTv.goneIf(!gameEntity.adIconActive)
holder.binding.searchHistoryName.text = gameEntity.name
holder.binding.root.setOnClickListener {
if (searchMap[gameEntity.id] == null) {
@ -500,7 +512,8 @@ class SearchGameIndexAdapter(
SearchType.fromString(type).toChinese(),
gameEntity.id,
gameEntity.name,
gameEntity.shouldUseMirrorInfo()
gameEntity.shouldUseMirrorInfo(),
gameEntity.adIconActive
)
}
}

View File

@ -9,6 +9,7 @@ import com.gh.common.exposure.ExposureEvent
import com.gh.common.exposure.ExposureSource
import com.gh.common.util.DirectUtils
import com.gh.gamecenter.R
import com.gh.gamecenter.common.utils.goneIf
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.common.view.DrawableView
import com.gh.gamecenter.databinding.SearchGameIndexItemBinding
@ -69,6 +70,7 @@ class SearchSubjectItemViewHolder(var binding: SearchSubjectItemBinding) : Recyc
subjectRv.adapter = SearchSubjectAdapter(context, entity.games, "($type-专题)") {
dao?.add(key)
}
headContainer.adLabelTv.goneIf(!entity.adIconActive)
headContainer.headTitle.text = entity.name
headContainer.headActionTv.text = "全部"
headContainer.headActionTv.setTextColor(R.color.theme_font.toColor(context))

View File

@ -205,10 +205,19 @@ class SearchGameResultAdapter(
gameRating.text = if (gameEntity.commentCount > 3) {
if (gameEntity.star == 10.0F) "10" else gameEntity.star.toString()
} else ""
gameRating.setTextColor(if (gameEntity.commentCount > 3) R.color.theme_font.toColor() else R.color.theme.toColor())
gameRating.setTextColor(
if (gameEntity.commentCount > 3) {
R.color.theme_font.toColor(mContext)
} else {
R.color.theme.toColor(
mContext
)
}
)
gameDes.text = gameEntity.decoratedDes
recommendStar.rating = gameEntity.recommendStar.toFloat()
gameSubtitleTv.visibility = View.GONE
adLabelTv.goneIf(!gameEntity.adIconActive)
if (gameEntity.serverLabel == null && gameEntity.subtitle.isNotEmpty() && !gameEntity.advanceDownload) {
gameSubtitleTv.run {
visibility = View.VISIBLE
@ -468,7 +477,8 @@ class SearchGameResultAdapter(
SearchType.fromString(type).toChinese(),
gameEntity.id,
gameEntity.name,
gameEntity.shouldUseMirrorInfo()
gameEntity.shouldUseMirrorInfo(),
gameEntity.adIconActive
)
if (SearchType.fromString(type) == SearchType.AUTO) {
@ -520,7 +530,8 @@ class SearchGameResultAdapter(
SearchType.fromString(type).toChinese(),
gameEntity.id,
gameEntity.name,
gameEntity.shouldUseMirrorInfo()
gameEntity.shouldUseMirrorInfo(),
gameEntity.adIconActive
)
if (SearchType.fromString(type) == SearchType.AUTO) {

View File

@ -275,7 +275,7 @@ class GameServersTestViewModel(application: Application, private val mColumnId:
class Factory(private val mApplication: Application, private val mColumnId: String) :
ViewModelProvider.NewInstanceFactory() {
override fun <T : ViewModel?> create(modelClass: Class<T>): T {
override fun <T : ViewModel> create(modelClass: Class<T>): T {
return GameServersTestViewModel(mApplication, mColumnId) as T
}
}

View File

@ -19,6 +19,7 @@ import com.gh.gamecenter.core.AppExecutor
import com.gh.gamecenter.common.constant.Constants
import com.gh.common.util.*
import com.gh.common.util.DirectUtils.directToLinkPage
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.view.BugFixedPopupWindow
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.EntranceConsts

View File

@ -26,6 +26,7 @@ import com.gh.common.simulator.SimulatorDownloadManager
import com.gh.common.simulator.SimulatorGameManager
import com.gh.common.util.*
import com.gh.common.util.DialogUtils
import com.gh.common.util.NewFlatLogUtils
import com.gh.gamecenter.common.view.BugFixedPopupWindow
import com.gh.gamecenter.GameDetailActivity
import com.gh.gamecenter.MainActivity

View File

@ -47,6 +47,7 @@ class SubjectFragment : LazyFragment() {
if (it == null) {
mBinding?.noConnectionContainer?.reuseNoConnection?.visibility = View.VISIBLE
} else {
showAdLabel(it.adIconActive)
initContentView(it)
}
})

View File

@ -39,9 +39,9 @@ import com.gh.gamecenter.entity.VideoEntity
import com.gh.gamecenter.eventbus.EBRecommed
import com.gh.gamecenter.login.user.UserManager
import com.gh.gamecenter.qa.comment.CommentActivity
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity
import com.gh.gamecenter.video.game.GameVideoActivity
import com.halo.assistant.HaloApp
import com.halo.assistant.fragment.SettingsFragment
import com.jakewharton.rxbinding2.view.RxView
import com.lightgame.utils.Utils
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
@ -542,7 +542,7 @@ class DetailPlayerView @JvmOverloads constructor(context: Context, attrs: Attrib
override fun showWifiDialog() {
val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context)
.getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
.getBoolean(ComposeSettingActivity.TRAFFIC_VIDEO_SP_KEY, false)
val nonWifiTips = SPUtils.getBoolean(Constants.SP_NON_WIFI_TIPS, true)
if (!trafficVideo) {
if (nonWifiTips) {

View File

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

View File

@ -1,5 +1,7 @@
<?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:background="@drawable/reuse_listview_item_style"
@ -13,15 +15,45 @@
android:layout_marginRight="16dp"
android:background="@color/divider" />
<TextView
android:id="@+id/search_history_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:gravity="center_vertical"
android:padding="16dp"
android:singleLine="true"
android:textColor="@color/text_title"
android:textSize="14sp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="16dp">
<TextView
android:id="@+id/search_history_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/text_title"
android:textSize="14sp"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/adLabelTv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/adLabelTv"
android:layout_width="21dp"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_ad_label"
android:gravity="center"
android:text="AD"
android:textColor="@color/white"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/search_history_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@+id/search_history_name"
app:layout_constraintTop_toTopOf="@+id/search_history_name" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -41,23 +41,46 @@
<TextView
android:id="@+id/titleTv"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="18dp"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/white"
android:textSize="@dimen/secondary_title_text_size"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@+id/rightContainer"
app:layout_constrainedWidth="true"
app:layout_constraintEnd_toStartOf="@+id/adLabelTv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed"
app:layout_goneMarginEnd="16dp"
tools:text="刺激游戏大合集刺激游戏大合集刺激游戏大合集" />
<TextView
android:id="@+id/adLabelTv"
android:layout_width="21dp"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp"
android:background="@drawable/bg_ad_label"
android:gravity="center"
android:text="AD"
android:textColor="@color/white"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/titleTv"
app:layout_constraintEnd_toStartOf="@+id/rightContainer"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@+id/titleTv"
app:layout_constraintTop_toTopOf="@+id/titleTv" />
<com.gh.common.view.GameIconView
android:id="@+id/iconIvOne"
android:layout_width="30dp"

View File

@ -1,5 +1,6 @@
<?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"
@ -14,19 +15,52 @@
android:paddingLeft="@dimen/home_item_padding"
android:paddingRight="@dimen/home_item_padding">
<TextView
android:id="@+id/head_title"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/text_title"
android:textSize="18sp"
android:textStyle="bold"
tools:text="人气手游风向标" />
android:layout_weight="1">
<TextView
android:id="@+id/head_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
android:textColor="@color/text_title"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/adLabelTv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="人气手游风向标" />
<TextView
android:id="@+id/adLabelTv"
android:layout_width="21dp"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:background="@drawable/bg_ad_label"
android:gravity="center"
android:text="AD"
android:textColor="@color/white"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/head_title"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@+id/head_title"
app:layout_constraintTop_toTopOf="@+id/head_title" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ProgressBar
android:id="@+id/head_pb"

View File

@ -88,6 +88,24 @@
app:layout_constraintTop_toTopOf="@+id/game_name"
tools:text="副标题" />
<TextView
android:id="@+id/adLabelTv"
android:layout_width="21dp"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_ad_label"
android:gravity="center"
android:text="AD"
android:textColor="@color/white"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/gameSubtitleTv"
app:layout_constraintEnd_toEndOf="@+id/gameDesSpace"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@+id/gameSubtitleTv"
app:layout_constraintTop_toTopOf="@+id/gameSubtitleTv" />
<TextView
android:id="@+id/recent_played_tag"
android:layout_width="48dp"

View File

@ -75,6 +75,24 @@
app:layout_goneMarginStart="0dp"
tools:text="副标题" />
<TextView
android:id="@+id/adLabelTv"
android:layout_width="21dp"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:background="@drawable/bg_ad_label"
android:gravity="center"
android:text="AD"
android:textColor="@color/white"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/gameSubtitleTv"
app:layout_constraintEnd_toStartOf="@+id/download_btn"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@+id/gameSubtitleTv"
app:layout_constraintTop_toTopOf="@+id/gameSubtitleTv" />
<LinearLayout
android:id="@+id/ratingAndTagContainer"
android:layout_width="0dp"

View File

@ -25,11 +25,32 @@
android:textStyle="bold"
app:layout_constrainedWidth="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/adLabelTv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="人气手游风向标" />
<TextView
android:id="@+id/adLabelTv"
android:layout_width="21dp"
android:layout_height="14dp"
android:layout_marginStart="4dp"
android:layout_marginLeft="4dp"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:background="@drawable/bg_ad_label"
android:gravity="center"
android:text="AD"
android:textColor="@color/white"
android:textSize="@dimen/tag_text_size"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="@+id/headTitle"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@+id/headTitle"
app:layout_constraintTop_toTopOf="@+id/headTitle" />
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView

View File

@ -11,14 +11,25 @@
android:gravity="center"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.facebook.drawee.view.SimpleDraweeView
android:id="@+id/icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="8dp"
style="@style/frescoStyle"
app:roundedCornerRadius="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@+id/index" />
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:ellipsize="end"
android:maxLines="1"
android:textSize="14sp"
@ -28,15 +39,15 @@
app:layout_constraintEnd_toStartOf="@+id/labelIv"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@+id/index"
app:layout_constraintStart_toEndOf="@+id/icon"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:id="@+id/labelIv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginRight="12dp"
android:layout_marginStart="4dp"
android:layout_marginEnd="12dp"
app:layout_constraintBottom_toBottomOf="@+id/name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/name"

View File

@ -20,7 +20,6 @@
<string name="download_update">更新</string>
<string name="title_message_center">消息中心</string>
<string name="news_concenrn_game_mine">我关注的游戏</string>
<string name="personal_update_hint">新版本</string>
<string name="news_search_input">请输入搜索关键字</string>
<string name="news_search">搜索</string>
<string name="game_percentage">44.5%</string>
@ -63,29 +62,6 @@
<string name="message_detail_comment_hint">说点什么吧</string>
<string name="news_detail_send_comment">发表评论...</string>
<string name="select_from_media_library">从手机相册中选择</string>
<string name="setting_security">账号与安全</string>
<string name="setting_system_dark_mode">深色模式跟随系统切换</string>
<string name="setting_video">视频播放</string>
<string name="setting_game_download">游戏下载</string>
<string name="setting_fix">一键修复</string>
<string name="setting_install_auto">下载完成自动安装游戏</string>
<string name="setting_favorite_auto">安装完成自动关注游戏</string>
<string name="setting_install_method">切换安装方式</string>
<string name="setting_wechat_remind">微信提醒</string>
<string name="setting_traffic_download">非Wi-Fi环境下载游戏提醒</string>
<string name="setting_usage_stats">统计游戏时长</string>
<string name="setting_notification_authority">通知权限</string>
<string name="setting_notification_authority_hint">开启后你可以及时收到重要通知</string>
<string name="setting_personal_recommend">个性化推荐</string>
<string name="setting_personal_recommend_hint">开启功能后,您在本应用的使用信息(如下载信息),将用于个性化内容推荐,以提升您在本应用的体验</string>
<string name="setting_download_path_des">…/gh-files</string>
<string name="setting_pic_path_des">…/pictures/ghzhushou</string>
<string name="setting_download_path">游戏下载目录</string>
<string name="setting_pic_path">图片保存目录</string>
<string name="setting_clear_cache">清除缓存</string>
<string name="setting_cache_size_def">0.0M</string>
<string name="setting_about">关于我们</string>
<string name="setting_about_channel">关于我们(长按可更改渠道号)</string>
<string name="setting_user_protocol">用户协议</string>
<string name="setting_privacy_policy">隐私政策</string>
<string name="setting_clean_package">安装包清理</string>
@ -94,11 +70,6 @@
<string name="setting_sdk_list">接入第三方SDK目录</string>
<string name="setting_permission_and_usage">权限申请与使用情况说明</string>
<string name="setting_children_policy">儿童隐私保护声明</string>
<string name="all_network_auto_play">任何网络下都自动播放</string>
<string name="only_wifi_auto_play">仅WIFI条件下自动播放</string>
<string name="close_auto_play">关闭自动播放</string>
<string name="setting_mute">默认静音播放视频</string>
<string name="setting_mute_hint">开启后以上位置的视频均默认静音播放</string>
<string name="sharecard_qrcode_hint">长按二维码查看详情</string>
<string name="sharecard_from">分享自『光环助手』App</string>
<string name="suggest_content_hint">请详细描述你遇到的问题\\n↓↓你还可以上传截图</string>
@ -134,7 +105,6 @@
<string name="loading_error_network">网络错误,点击重试!</string>
<string name="comment_empty">目前还没有评论</string>
<string name="comment_nomore">没有更多评论啦</string>
<string name="title_about">关于</string>
<string name="title_clean_apk">安装包清理</string>
<string name="title_choose_apk">选择安装包</string>
<string name="title_comment_detail">查看对话</string>
@ -150,14 +120,12 @@
<string name="title_game_upload">游戏上传</string>
<string name="title_history_apk">历史版本</string>
<string name="title_my_game_rating">我的游戏评论</string>
<string name="copyright_hint">Copyright %1$s GHZhuShou Team All Rights Reserved.</string>
<string name="news_zixun">资讯</string>
<string name="news_gonglve">攻略</string>
<string name="dialog_feedback_doing">正在反馈...</string>
<string name="title_downloadmanager">下载管理</string>
<string name="about_version_update">版本更新</string>
<string name="title_userinfo">个人中心</string>
<string name="clean_apk_deleteall">一键删除(%1$d个释放%2$s</string>
<string name="menu_text_save">保存</string>
@ -278,7 +246,6 @@
<string name="article_top">置顶</string>
<string name="article_hot">热门</string>
<string name="toast_upload_latest">已是最新版本</string>
<string name="vote_count">%1$d票</string>
<string name="kefu_default_name">光环客服</string>
<string name="menu_search">搜索</string>
@ -447,22 +414,6 @@
<string name="security_tips">还有其他问题?</string>
<string name="security_contact">联系客服</string>
<string name="account_security_center">账户安全中心</string>
<string name="bind_phone_skip">跳过</string>
<string name="bind_phone_key">绑定手机</string>
<string name="bind_phone_title1">绑定手机号</string>
<string name="bind_phone_title2">更换手机号</string>
<string name="bind_phone_desc">绑定手机后手机号将用于光环助手活动奖励领取、安全验证等用途</string>
<string name="bind_phone_next">下一步</string>
<string name="bind_phone_conflict_text">手机号绑定冲突</string>
<string name="bind_phone_conflict_guide">遇到冲突如何换绑</string>
<string name="bind_phone_conflict_guide_content1">1、请先退出当前号【我的光环--设置--退出账号】</string>
<string name="bind_phone_conflict_guide_content2">2、再重新登录冲突号在【我的光环--账户安全】\n或【我的光环--设置--账户安全】更换手机号</string>
<string name="bind_phone_conflict_guide_content3">3、冲突号成功更换新手机号后再退出冲突号\n并重新登录当前号进行绑定</string>
<string name="bind_phone_conflict_item_current_text">当前号</string>
<string name="bind_phone_conflict_item_conflict_text">冲突号</string>
<string name="bind_phone_conflict_change">换个手机号试试</string>
<string name="bind_phone_conflict_cancel">取消绑定</string>
<string name="change_phone_same">新手机号与当前手机号相同,暂不支持本\n次绑定</string>
<string name="badge_center">徽章中心</string>
<string name="receive_badge">领取徽章</string>
@ -480,8 +431,6 @@
<string name="change_bg_tips">点击更换背景</string>
<string name="post_suggest">提交反馈</string>
<string name="seek_game">求游戏</string>
<string name="seek_function">求功能</string>
@ -528,7 +477,6 @@
<item>完美,太棒了</item>
</string-array>
<string name="title_installed_game">将已安装游戏标记为玩过的游戏</string>
<string name="gh_douyin_url">https://v.douyin.com/C9UHr6/</string>
<string name="dialog_reserve_title">你有<Data><![CDATA[<font color="#1383EB">%1$d</font>]]></Data>款预约的游戏上线啦</string>
<string name="dialog_privacy_policy_content">欢迎您使用光环助手!\n在您使用光环助手之前请您认真阅读《用户协议》和《隐私政策》的全部内容以了解用户权利义务和个人信息处理规则。主要内容向您说明如下\n1.为了正常地提供优质的产品服务,基于您的授权我们会获取必要的个人信息,您有权拒绝或取消授权\n2.我们会采取合理的安全措施保护您的个人信息,防止数据被不当使用或未经授权的情况下被访问、公开披露、使用、修改、损坏、丢失或泄漏。\n3.未经您同意,我们不会从第三方处获取、共享或向其提供您的信息\n4.您可以查询、更正、删除您的个人信息,我们也提供账户注销的渠道</string>
<string name="oversea_hint">此游戏下载资源由第三方提供。若该资源侵犯了您的合法权益或违反了当地法规,请点击页面右上角-版权申诉,按指引发起申诉,我们会尽快联系您并解决。</string>

View File

@ -1,6 +1,6 @@
buildscript {
ext {
kotlinVersion = "1.6.21"
kotlinVersion = "1.7.20"
}
repositories {
maven {url 'https://maven.aliyun.com/repository/public'}
@ -18,7 +18,8 @@ apply plugin: 'kotlin'
dependencies {
implementation gradleApi()
implementation localGroovy()
implementation "com.android.tools.build:gradle:7.0.4"
implementation "com.android.tools.build:gradle:7.2.2"
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
implementation "commons-io:commons-io:2.4"
implementation "org.javassist:javassist:3.25.0-GA"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"

View File

@ -1,14 +1,14 @@
ext {
//Android
buildToolsVersion = "30.0.2"
buildToolsVersion = "30.0.3"
compileSdkVersion = 33
minSdkVersion = 16
targetSdkVersion = 28
// application info (每个大版本之间的 versionCode 增加 20)
versionCode = 650
versionName = "5.15.0"
versionCode = 670
versionName = "5.16.0"
applicationId = "com.gh.gamecenter"
// AndroidX
@ -96,6 +96,7 @@ ext {
matisse = "0.5.1"
picasso = "2.5.2"
lottie = "3.7.0"
lottieCompose = "5.2.0"
flexbox = "1.1.0"
pickerView = "4.1.8"
verifier = "1.0.6"
@ -123,4 +124,9 @@ ext {
lancet_version = "v1.0.6"
autoServiceVersion = "1.0-rc7"
arouterVersion = "1.5.1"
composeVersion = "1.2.1"
activityComposeVersion = "1.6.0"
composeCompilerVersion = "1.3.2"
constraintlayoutCompose = "1.0.1"
}

View File

@ -54,6 +54,8 @@ public abstract class ToolBarActivity extends BaseActivity implements ToolbarCon
protected TextView mTitleTv;
protected TextView mAdLabelTv;
protected LinearLayout mTitleContainer;
protected LinearLayout mIconTitleContainer;
@ -133,6 +135,7 @@ public abstract class ToolBarActivity extends BaseActivity implements ToolbarCon
mToolbarContainer = findViewById(R.id.normal_toolbar_container);
mToolbar = findViewById(R.id.normal_toolbar);
mTitleTv = findViewById(R.id.normal_title);
mAdLabelTv = findViewById(R.id.adLabelTv);
mActionMenuView = findViewById(R.id.actionMenuView);
mTitleContainer = findViewById(R.id.titleContainer);
mIconTitleContainer = findViewById(R.id.iconTitleContainer);
@ -299,6 +302,11 @@ public abstract class ToolBarActivity extends BaseActivity implements ToolbarCon
}
}
@Override
public void showAdLabel(boolean isAd) {
mAdLabelTv.setVisibility(isAd ? View.VISIBLE : View.GONE);
}
// 针对部分跳转不符合ToolbarActivity规则的额外处理主要绑定ToolbarFragment
protected Intent provideNormalIntent() {
return null;

View File

@ -22,4 +22,6 @@ public interface ToolbarController {
MenuItem getMenuItem(@IdRes int res);
void hideToolbar(boolean isHide);
void showAdLabel(boolean isAd);
}

View File

@ -50,6 +50,12 @@ public abstract class ToolbarFragment extends BaseFragment {
return null;
}
protected void showAdLabel(Boolean isAd) {
if (getActivity() instanceof ToolbarController) {
((ToolbarController) getActivity()).showAdLabel(isAd);
}
}
public void onTouchEvent(MotionEvent event) {
}

View File

@ -7,6 +7,11 @@ import com.gh.gamecenter.core.utils.SPUtils.setString
object Config {
const val FIX_DOWNLOAD_KEY = "isFixDownload"
const val FIX_PLUGIN_KEY = "isFixPlugin"
const val FIX_ARTICLE_KEY = "isFixArticle"
const val FIX_COMMUNITY_KEY = "isFixCommunity"
const val DEFAULT_CHANNEL = "GH_TEST3"
const val DEFAULT_CHANNEL_FOR_RELEASE = "GH_LOST" // 正式包的缺省渠道,避免因渠道丢失而回落到测试渠道
private var mDefaultSharedPreferences: SharedPreferences? = null
@ -37,4 +42,22 @@ object Config {
}
return mDefaultSharedPreferences!!
}
fun isExistHideFunction(): Boolean {
if (!getPreferences().getBoolean(FIX_DOWNLOAD_KEY, false)) return true
if (!getPreferences().getBoolean(FIX_PLUGIN_KEY, false)) return true
if (!getPreferences().getBoolean(FIX_COMMUNITY_KEY, false)) return true
if (!getPreferences().getBoolean(FIX_ARTICLE_KEY, false)) return true
return false
}
fun fixHideFunction() {
getPreferences().edit().run {
putBoolean(FIX_DOWNLOAD_KEY, true)
putBoolean(FIX_ARTICLE_KEY, true)
putBoolean(FIX_COMMUNITY_KEY, true)
putBoolean(FIX_PLUGIN_KEY, true)
apply()
}
}
}

View File

@ -5,13 +5,17 @@ object RouteConsts {
object activity {
const val splashActivity = "/app/SplashScreenActivity"
const val aboutActivity = "/setting/AboutActivity"
const val aboutActivity = "/settings/AboutActivity"
const val webActivity = "/setting/WebActivity"
const val weiBoShareActivity = "/setting/weiBoShareActivity"
const val loginActivity = "/login/LoginActivity"
const val bindPhoneActivity = "/security/BindPhoneActivity"
const val cleanApkActivity = "/app/cleanApkActivity"
const val gameSubmissionActivity = "/app/gameSubmissionActivity"
const val suggestionActivity = "/app/suggestionActivity"
}
object fragment {
@ -44,6 +48,12 @@ object RouteConsts {
const val floatingBackViewManager = "/services/floatingBackViewManager"
const val linkDirectUtils = "/services/linkDirectUtils"
const val handleGameResponse = "/services/handleGameResponse"
const val usageStatsHelper = "/services/usageStatsHelper"
const val mainActivity = "/services/mainActivity"
const val shellActivity = "/services/shellActivity"
const val browserInstallHelper = "/services/browserInstallHelper"
const val historyHelper = "/services/historyHelper"
const val updateManager = "/services/updateManager"
const val userManager = "/login/userManager"
const val quickLogin = "/login/quickLogin"

View File

@ -77,6 +77,8 @@ data class ExposureEntity(
//跳转链接标题 如:热门好游
@SerializedName("control_link_name")
var controlLinkName: String? = null,
@SerializedName("is_ad_data")
var isAdData: Boolean = false,
) : Parcelable {
fun setContainerInfo(id: String?, type: String?) {

View File

@ -1,4 +1,4 @@
package com.gh.gamecenter.entity
package com.gh.gamecenter.common.entity
import com.google.gson.annotations.SerializedName
@ -8,4 +8,4 @@ data class WechatConfigEntity(
var notice: Boolean = false,//是否打开微信通知开关
@SerializedName("nickname")
var nickName: String = "",
)
)

View File

@ -1352,4 +1352,23 @@ fun WebView.fixUiModeIfNeeded() {
context.resources.displayMetrics
)
}
}
/**
* 把View转化成Bitmap
*/
fun View.convertViewToBitmap(): Bitmap? {
measure(
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
)
layout(0, 0, measuredWidth, measuredHeight)
return if (measuredWidth > 0 && measuredHeight > 0) {
val bitmap =
Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_8888)
val canvas = Canvas(bitmap)
draw(canvas)
canvas.save()
bitmap
} else null
}

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