Compare commits

...

10 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
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
225 changed files with 6926 additions and 458 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

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

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

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

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

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

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

@ -50,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
@ -689,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

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

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

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

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

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

@ -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,6 +1,6 @@
ext {
//Android
buildToolsVersion = "30.0.2"
buildToolsVersion = "30.0.3"
compileSdkVersion = 33
minSdkVersion = 16
@ -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

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

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

@ -0,0 +1,36 @@
package com.gh.gamecenter.common.utils
import com.gh.gamecenter.common.json.JsonObjectBuilder
import com.gh.gamecenter.common.json.json
import com.gh.gamecenter.common.loghub.LoghubUtils
import com.lightgame.utils.Utils
import org.json.JSONObject
object NewFlatLogUtils {
private fun log(jsonObject: JSONObject, logStore: String, uploadImmediately: Boolean) {
Utils.log("NewLogUtils", jsonObject.toString(4))
LoghubUtils.log(jsonObject, logStore, uploadImmediately)
}
private fun parseAndPutMeta(): JsonObjectBuilder.() -> Unit = {
val meta = LogUtils.getNewMetaObject()
val metaKeys = meta.keys()
while (metaKeys.hasNext()) {
val key: String = metaKeys.next().toString()
val value = meta.getString(key)
key to value
}
}
//设置点击深色模式跟随系统切换开关
@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)
}
}

View File

@ -70,4 +70,18 @@ object NewLogUtils {
}
log(json, "event", false)
}
//点击微信提醒
@JvmStatic
fun logWechatRemindConfigClick(isBind: Boolean, isFollow: Boolean, isRemind: Boolean) {
val json = json {
"event" to "appointment_wechat_remind_config_click"
"wechat_is_bind" to isBind
"wechat_is_follow" to isFollow
"wechat_is_remind" to isRemind
"timestamp" to System.currentTimeMillis() / 1000
parseAndPutMeta().invoke(this)
}
log(json, "appointment", false)
}
}

View File

@ -14,6 +14,8 @@ interface IAppProvider : IProvider {
fun getChannel(): String
fun setChannel(channel: String)
fun getUserAgent(): String
fun getServerUserMark(): String

View File

@ -0,0 +1,9 @@
package com.gh.gamecenter.core.provider
import com.alibaba.android.arouter.facade.template.IProvider
interface IBrowserInstallHelperProvider : IProvider {
fun isUseBrowserToInstallEnabled(): Boolean
fun shouldUseBrowserToInstall(): Boolean
fun logSwitchInstallSettingEvent()
}

View File

@ -19,4 +19,5 @@ interface IConfigProvider : IProvider {
fun getQuickLoginAppId(): String
fun getQuickLoginAppKey(): String
fun getWeiboAppKey(): String
fun getNightModeSetting(): Boolean
}

View File

@ -1,9 +1,20 @@
package com.gh.gamecenter.core.provider
import android.app.Dialog
import android.content.Context
import com.alibaba.android.arouter.facade.template.IProvider
interface IDialogUtilsProvider : IProvider {
fun showRegulationTestDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit)
fun showWaitDialog(context: Context, string: String): Dialog
fun showForceDialog(context: Context, title: String, message: CharSequence, positive: String, negative: String, confirm: () -> Unit, cancel: () -> Unit)
fun showUsageStatsDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit)
fun showNoticeDialog(context: Context, title: String, content: String, confirm: () -> Unit)
fun showBindPhoneDialog(context: Context, confirm: () -> Unit): Dialog
}

View File

@ -23,4 +23,8 @@ interface IDirectProvider : IProvider {
fun directToExchangeCommodityPage(context: Context)
fun directToLotteryParadisePage(context: Context)
fun directDouyin(context: Context, userId: String)
fun directToSuggestionFromDiagnosis(context: Context, diagnosis: String)
}

View File

@ -0,0 +1,7 @@
package com.gh.gamecenter.core.provider
import com.alibaba.android.arouter.facade.template.IProvider
interface IHistoryHelperProvider : IProvider {
fun emptyDatabase()
}

View File

@ -0,0 +1,9 @@
package com.gh.gamecenter.core.provider
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.facade.template.IProvider
interface IMainProvider : IProvider {
fun skipToMainActivity(context: Context, position: Int)
}

View File

@ -0,0 +1,10 @@
package com.gh.gamecenter.core.provider
import android.content.Context
import android.content.Intent
import android.os.Parcelable
import com.alibaba.android.arouter.facade.template.IProvider
interface IShellProvider : IProvider {
fun getSwitchInstallMethodIntent(context: Context, extraParcelable: Parcelable?): Intent?
}

View File

@ -0,0 +1,9 @@
package com.gh.gamecenter.core.provider
import android.content.Context
import android.os.Handler
import com.alibaba.android.arouter.facade.template.IProvider
interface IUpdateManagerProvider: IProvider {
fun checkUpdate(context: Context, isAutoCheck: Boolean, handler: Handler)
}

View File

@ -0,0 +1,9 @@
package com.gh.gamecenter.core.provider
import android.content.Context
import com.alibaba.android.arouter.facade.template.IProvider
interface IUsageStatsHelperProvider : IProvider {
fun checkForPermission(): Boolean
fun skipToUsageStats(context: Context, requestCode: Int)
}

View File

@ -8,4 +8,8 @@ interface IWebProvider : IProvider {
fun getIntent(context: Context, url: String, autoCompletionTitle: Boolean): Intent?
fun getWebIntent(context: Context, title: String, url: String): Intent?
fun getBindWechatIntent(context: Context): Intent?
fun getSecurityCertificationIntent(context: Context): Intent?
}

View File

@ -3,5 +3,5 @@ package com.gh.gamecenter.core.provider
import com.alibaba.android.arouter.facade.template.IProvider
interface IWechatBindHelperProvider : IProvider {
fun getWechatConfig()
fun getWechatConfig(callback: (() -> Unit)? = null)
}

View File

@ -21,6 +21,10 @@ class AppProviderImpl : IAppProvider {
return ""
}
override fun refreshGid() {
// Do nothing
}
override fun getOaid(): String {
return ""
}
@ -29,6 +33,10 @@ class AppProviderImpl : IAppProvider {
return ""
}
override fun setChannel(channel: String) {
// Do nothing
}
override fun getUserAgent(): String {
return ""
}

View File

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

View File

@ -1,5 +1,6 @@
package com.gh.gamecenter.energy.provider
import android.app.Dialog
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.gh.gamecenter.common.constant.RouteConsts
@ -12,6 +13,41 @@ class DialogUtilsProviderImpl : IDialogUtilsProvider {
ToastUtils.toast("调用->DialogUtilsProviderImpl.showRegulationTestDialog")
}
override fun showWaitDialog(context: Context, string: String): Dialog {
ToastUtils.toast("调用->DialogUtilsProviderImpl.showWaitDialog")
return Dialog(context)
}
override fun showForceDialog(
context: Context,
title: String,
message: CharSequence,
positive: String,
negative: String,
confirm: () -> Unit,
cancel: () -> Unit
) {
ToastUtils.toast("调用->DialogUtilsProviderImpl.showForceDialog")
}
override fun showUsageStatsDialog(context: Context, confirm: () -> Unit, cancel: () -> Unit) {
ToastUtils.toast("调用->DialogUtilsProviderImpl.showUsageStatsDialog")
}
override fun showNoticeDialog(
context: Context,
title: String,
content: String,
confirm: () -> Unit
) {
ToastUtils.toast("调用->DialogUtilsProviderImpl.showNoticeDialog")
}
override fun showBindPhoneDialog(context: Context, confirm: () -> Unit): Dialog {
ToastUtils.toast("调用->DialogUtilsProviderImpl.showBindPhoneDialog")
return Dialog(context)
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -49,6 +49,14 @@ class DirectProviderImpl : IDirectProvider {
ToastUtils.toast("调用->DirectProviderImpl.directToLotteryParadisePage")
}
override fun directDouyin(context: Context, userId: String) {
ToastUtils.toast("调用->DirectProviderImpl.directDouyin")
}
override fun directToSuggestionFromDiagnosis(context: Context, diagnosis: String) {
ToastUtils.toast("调用->DirectProviderImpl.directToSuggestionFromDiagnosis")
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -16,6 +16,14 @@ class WebProviderImpl : IWebProvider {
return null
}
override fun getBindWechatIntent(context: Context): Intent? {
return null
}
override fun getSecurityCertificationIntent(context: Context): Intent? {
return null
}
override fun init(context: Context?) {
// Do nothing
}

View File

@ -7,7 +7,7 @@ import com.gh.gamecenter.core.provider.IWechatBindHelperProvider
@Route(path = RouteConsts.provider.wechatHelper, name = "WechatHelper暴露服务")
class WechatHelperProviderImpl : IWechatBindHelperProvider {
override fun getWechatConfig() {
override fun getWechatConfig(callback: (() -> Unit)?) {
// Do nothing
}

View File

@ -143,10 +143,14 @@ public class UserRepository {
SPUtils.setString(Constants.SP_REGULATION_TEST_PASS_STATUS, "");
IReservationRepositoryProvider reservationRepository = (IReservationRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.reservationRepository).navigation();
reservationRepository.clearReservations();
if (reservationRepository != null) {
reservationRepository.clearReservations();
}
IGameSubstituteRepositoryProvider gameSubstituteRepository = (IGameSubstituteRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.gameSubstituteRepository).navigation();
gameSubstituteRepository.updateSubstitutableGames();
if (gameSubstituteRepository != null) {
gameSubstituteRepository.updateSubstitutableGames();
}
// 通知页面更新
EventBus.getDefault().post(new EBReuse(LOGOUT_TAG));
@ -240,7 +244,7 @@ public class UserRepository {
IGameSubstituteRepositoryProvider gameSubstituteRepository = (IGameSubstituteRepositoryProvider) ARouter.getInstance().build(RouteConsts.provider.gameSubstituteRepository).navigation();
gameSubstituteRepository.updateSubstitutableGames();
IWechatBindHelperProvider wechatBindHelper = (IWechatBindHelperProvider) ARouter.getInstance().build(RouteConsts.provider.wechatHelper).navigation();
wechatBindHelper.getWechatConfig();
wechatBindHelper.getWechatConfig(null);
if (callback != null) {
callback.onFirst(response);

1
module_setting/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

View File

@ -0,0 +1,94 @@
if (isRelease.toBoolean()) {
apply plugin: 'com.android.library'
} else {
apply plugin: 'com.android.application'
}
apply plugin: 'org.jetbrains.kotlin.android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
if (!isRelease.toBoolean()) {
applicationId "com.gh.setting"
multiDexEnabled true
buildConfigField "String", "API_HOST", "\"${API_HOST}\""
}
minSdk rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
sourceSets {
main {
if (isRelease.toBoolean()) {
manifest.srcFile 'src/main/AndroidManifest.xml'
java {
exclude 'manifest/**'
}
} else {
java {
srcDirs = ['src/main/java', "src/setting/java"]
}
manifest.srcFile 'src/main/manifest/AndroidManifest.xml'
}
}
}
buildFeatures {
viewBinding true
}
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.name)
}
}
buildTypes {
debug {
if (!isRelease.toBoolean()) {
buildConfigField "String", "DEV_API_HOST", "\"${DEV_API_HOST}\""
}
}
release {
consumerProguardFiles 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
kapt "com.alibaba:arouter-compiler:$arouterVersion"
if (!isRelease.toBoolean()) {
implementation "androidx.multidex:multidex:${multiDex}"
}
implementation(project(path: ":module_common")) {
exclude group: 'androidx.swiperefreshlayout'
}
implementation(project(path: ":module_login")) {
exclude group: 'androidx.swiperefreshlayout'
}
implementation "com.lg:gid:${gid}"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

29
module_setting/proguard-rules.pro vendored Normal file
View File

@ -0,0 +1,29 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-renamesourcefileattribute SourceFile
# Keep Attribute
-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod,SourceFile,LineNumberTable
### keep models
-keep class com.gh.gamecenter.setting.entity.* {*;}
-keep class com.gh.gamecenter.setting.retrofit.* {*;}

View File

@ -0,0 +1,24 @@
package com.gh.gamecenter.setting
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.gh.gamecenter.setting", appContext.packageName)
}
}

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gh.gamecenter.setting">
<application>
<activity
android:name=".view.SettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.security.SecurityActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.VideoSettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.GameDownloadSettingActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.AboutActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.NetworkDiagnosisActivity"
android:screenOrientation="portrait" />
<activity
android:name=".view.security.BindPhoneActivity"
android:screenOrientation="portrait" />
</application>
</manifest>

View File

@ -0,0 +1,44 @@
package com.gh.gamecenter.setting
import android.app.Application
import android.content.res.Configuration
import com.gh.gamecenter.core.iinterface.IApplication
import com.google.auto.service.AutoService
@AutoService(IApplication::class)
class HaloApp : IApplication {
override fun attachBaseContext() {
// Do nothing
}
override fun onCreate(application: Application) {
mApp = application
}
override fun onLowMemory() {
// Do nothing
}
override fun onTerminate() {
// Do nothing
}
override fun onTrimMemory(level: Int) {
// Do nothing
}
override fun onConfigurationChanged(newConfig: Configuration) {
// Do nothing
}
companion object {
private lateinit var mApp: Application
@JvmStatic
fun getInstance(): Application {
return mApp
}
}
}

View File

@ -1,7 +1,8 @@
package com.gh.gamecenter.entity
package com.gh.gamecenter.setting.entity
import android.os.Parcelable
import androidx.annotation.Keep
import com.gh.gamecenter.login.entity.Badge
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize
@ -11,4 +12,13 @@ data class ConflictUserEntity(
val user: User? = null,
@SerializedName("register_type")
var registerType: String = ""
) : Parcelable
@Parcelize
data class User(
@SerializedName("_id")
var id: String = "",
var name: String = "",
var icon: String = "",
var badge: Badge? = null
) : Parcelable

View File

@ -0,0 +1,26 @@
package com.gh.gamecenter.setting.retrofit
import io.reactivex.Single
import okhttp3.RequestBody
import okhttp3.ResponseBody
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Query
interface ApiService {
/**
* 绑定手机
*/
@Headers("Content-Type: application/json", "Accept: application/json")
@POST("./mobile:bind")
fun bindPhone(@Query("step") step: Int, @Body body: RequestBody): Single<ResponseBody>
/**
* 换绑手机
*/
@Headers("Content-Type: application/json", "Accept: application/json")
@POST("./mobile:rebind")
fun reBindPhone(@Query("step") step: Int, @Body body: RequestBody): Single<ResponseBody>
}

View File

@ -0,0 +1,19 @@
package com.gh.gamecenter.setting.retrofit
import com.gh.gamecenter.common.retrofit.BaseRetrofitManager
import com.gh.gamecenter.common.utils.EnvHelper.getHost
import com.gh.gamecenter.core.utils.SingletonHolder
import com.gh.gamecenter.setting.HaloApp
class RetrofitManager private constructor(): BaseRetrofitManager() {
val api: ApiService
init {
val context = HaloApp.getInstance().applicationContext
val okHttpNormalConfig = getOkHttpConfig(context, 0, 2)
api = provideService(okHttpNormalConfig, getHost(), ApiService::class.java)
}
companion object: SingletonHolder<RetrofitManager>(::RetrofitManager)
}

View File

@ -1,4 +1,4 @@
package com.gh.gamecenter;
package com.gh.gamecenter.setting.view;
import android.content.Context;
import android.content.Intent;
@ -11,7 +11,7 @@ import com.gh.gamecenter.common.base.activity.ToolBarActivity;
import com.gh.gamecenter.common.constant.EntranceConsts;
import com.gh.gamecenter.common.constant.RouteConsts;
import com.gh.gamecenter.common.utils.ExtensionsKt;
import com.halo.assistant.fragment.AboutFragment;
import com.gh.gamecenter.setting.R;
/**
* Created by khy on 2017/2/28.
@ -42,4 +42,4 @@ public class AboutActivity extends ToolBarActivity {
super.onDarkModeChanged();
ExtensionsKt.updateStatusBarColor(this, R.color.background_white, R.color.background_white);
}
}
}

View File

@ -1,4 +1,4 @@
package com.halo.assistant.fragment
package com.gh.gamecenter.setting.view
import android.annotation.SuppressLint
import android.app.Activity
@ -11,24 +11,21 @@ import android.preference.PreferenceManager
import android.text.TextUtils
import android.view.View
import androidx.core.content.ContextCompat
import com.gh.common.util.*
import com.gh.gamecenter.R
import com.gh.gamecenter.WebActivity
import com.alibaba.android.arouter.launcher.ARouter
import com.gh.gamecenter.common.base.fragment.ToolbarFragment
import com.gh.gamecenter.common.constant.Constants
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.*
import com.gh.gamecenter.core.utils.MtaHelper.onEvent
import com.gh.gamecenter.core.utils.SPUtils
import com.gh.gamecenter.core.utils.StringUtils
import com.gh.gamecenter.core.utils.TimeUtils.getFormatTime
import com.gh.gamecenter.core.utils.ToastUtils
import com.gh.gamecenter.databinding.FragmentAboutBinding
import com.gh.gamecenter.manager.UpdateManager
import com.halo.assistant.HaloApp
import com.gh.gamecenter.common.constant.RouteConsts
import com.gh.gamecenter.common.utils.DialogHelper
import com.gh.gamecenter.common.utils.PackageFlavorHelper
import com.gh.gamecenter.common.utils.copyTextAndToast
import com.gh.gamecenter.common.utils.toColor
import com.gh.gamecenter.core.provider.*
import com.gh.gamecenter.core.utils.*
import com.gh.gamecenter.setting.R
import com.gh.gamecenter.setting.databinding.FragmentAboutBinding
import java.util.*
class AboutFragment : ToolbarFragment() {
private lateinit var mBinding: FragmentAboutBinding
@ -64,15 +61,16 @@ class AboutFragment : ToolbarFragment() {
val serverTime = PreferenceManager.getDefaultSharedPreferences(requireContext())
.getLong("server_time", 1587693163L)
val year = getFormatTime(serverTime, "yyyy")
val year = TimeUtils.getFormatTime(serverTime, "yyyy")
mBinding.copyrightTv.text = getString(R.string.copyright_hint, year)
if (arguments != null && requireArguments().getBoolean(EntranceConsts.KEY_VERSION_UPDATE)) {
UpdateManager.getInstance(context).checkUpdate(false, mBaseHandler) // 检查更新
val updateManager = ARouter.getInstance().build(RouteConsts.provider.updateManager).navigation() as? IUpdateManagerProvider
updateManager?.checkUpdate(requireContext(), false, mBaseHandler) // 检查更新
}
mBinding.aboutGhIcon.setOnLongClickListener {
onEvent("我的光环_设置", "关于光环", "图标长按")
MtaHelper.onEvent("我的光环_设置", "关于光环", "图标长按")
if (PackageFlavorHelper.IS_TEST_FLAVOR) {
DialogHelper.showDialog(
requireContext(),
@ -88,7 +86,8 @@ class AboutFragment : ToolbarFragment() {
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
} else {
toast(HaloApp.getInstance().channel)
val appProvider = ARouter.getInstance().build(RouteConsts.provider.app).navigation() as? IAppProvider
toast(appProvider?.getChannel())
}
false
}
@ -97,14 +96,18 @@ class AboutFragment : ToolbarFragment() {
@SuppressLint("SetTextI18n")
private fun initView() {
mBinding.aboutTvVersion.text = "V" + PackageUtils.getGhVersionName()
val packageUtils = ARouter.getInstance().build(RouteConsts.provider.packageUtils).navigation() as? IPackageUtilsProvider
val webActivity = ARouter.getInstance().build(RouteConsts.provider.webActivity).navigation() as? IWebProvider
mBinding.aboutTvVersion.text = "V" + packageUtils?.getGhVersionName()
if (PackageFlavorHelper.IS_TEST_FLAVOR == true) {
var channel = SPUtils.getString(Constants.SP_TEST_FLAVOR_CHANNEL)
if (channel == null || TextUtils.isEmpty(channel)) {
channel = HaloApp.getInstance().channel
val appProvider = ARouter.getInstance().build(RouteConsts.provider.app).navigation() as? IAppProvider
channel = appProvider?.getChannel() ?: ""
}
mBinding.aboutTvVersion.text = "V" + PackageUtils.getGhVersionName() + "$channel"
mBinding.aboutTvVersion.text = "V" + packageUtils?.getGhVersionName() + "$channel"
}
mBinding.updateItem.run {
@ -112,17 +115,18 @@ class AboutFragment : ToolbarFragment() {
contentTv.text = ""
contentTv.visibility = View.VISIBLE
root.setOnClickListener {
onEvent("我的光环_设置", "关于光环", "版本更新")
UpdateManager.getInstance(context).checkUpdate(false, mBaseHandler) // 检查更新
MtaHelper.onEvent("我的光环_设置", "关于光环", "版本更新")
val updateManager = ARouter.getInstance().build(RouteConsts.provider.updateManager).navigation() as? IUpdateManagerProvider
updateManager?.checkUpdate(requireContext(), false, mBaseHandler) // 检查更新
}
}
mBinding.userProtocolItem.run {
titleTv.text = "用户协议"
textMoreTv.visibility = View.VISIBLE
root.setOnClickListener {
onEvent("我的光环_设置", "关于光环", "用户协议")
MtaHelper.onEvent("我的光环_设置", "关于光环", "用户协议")
startActivity(
WebActivity.getWebIntent(
webActivity?.getWebIntent(
requireContext(),
requireContext().getString(R.string.disclaimer_title),
requireContext().getString(R.string.disclaimer_url)
@ -134,9 +138,9 @@ class AboutFragment : ToolbarFragment() {
titleTv.text = "隐私政策"
textMoreTv.visibility = View.VISIBLE
root.setOnClickListener {
onEvent("我的光环_设置", "关于光环", "隐私政策")
MtaHelper.onEvent("我的光环_设置", "关于光环", "隐私政策")
startActivity(
WebActivity.getWebIntent(
webActivity?.getWebIntent(
requireContext(),
requireContext().getString(R.string.privacy_policy_title),
requireContext().getString(R.string.privacy_policy_url)
@ -149,17 +153,18 @@ class AboutFragment : ToolbarFragment() {
textMoreTv.text = "光环助手APP"
textMoreTv.visibility = View.VISIBLE
root.setOnClickListener {
onEvent("我的光环_设置", "关于光环", "抖音")
MtaHelper.onEvent("我的光环_设置", "关于光环", "抖音")
val url = getString(R.string.gh_douyin_url)
url.copyTextAndToast(String.format(Locale.CHINA, "已成功复制%s ,打开抖音可直达", url))
DirectUtils.directDouyin(requireContext(), "1402577827140941")
val directUtils = ARouter.getInstance().build(RouteConsts.provider.directUtils).navigation() as? IDirectProvider
directUtils?.directDouyin(requireContext(), "1402577827140941")
}
}
mBinding.aboutBottom.setOnLongClickListener {
onEvent("我的光环_设置", "关于光环", "底部长按")
MtaHelper.onEvent("我的光环_设置", "关于光环", "底部长按")
if (context == null) return@setOnLongClickListener true
if (context is Activity && (context as Activity).isFinishing) return@setOnLongClickListener true
startActivity(WebActivity.getSecurityCertificationIntent(requireContext()))
startActivity(webActivity?.getSecurityCertificationIntent(requireContext()))
true
}
mBinding.aboutTvVersion.setOnLongClickListener {

View File

@ -1,12 +1,12 @@
package com.gh.gamecenter.setting
package com.gh.gamecenter.setting.view
import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.gh.gamecenter.common.base.activity.ToolBarActivity
import com.gh.gamecenter.R
import com.gh.gamecenter.common.constant.EntranceConsts
import com.gh.gamecenter.common.utils.updateStatusBarColor
import com.gh.gamecenter.setting.R
class GameDownloadSettingActivity : ToolBarActivity() {

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