Compare commits
15 Commits
v5.15.1-65
...
feature-mo
| Author | SHA1 | Date | |
|---|---|---|---|
| 04468c0627 | |||
| e585d905ac | |||
| 1f066e676f | |||
| a08f3aa9ac | |||
| b0ad6ff8c5 | |||
| ccbe6650d1 | |||
| f99b3af9c6 | |||
| a5ce8f389c | |||
| 8f5daed7a7 | |||
| f799096655 | |||
| 431aa52e49 | |||
| 26d6e4086a | |||
| 7e999784b7 | |||
| f07bcc89e8 | |||
| 22cff4ed72 |
@ -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'
|
||||
|
||||
@ -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" />
|
||||
|
||||
@ -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":[]}
|
||||
@ -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
|
||||
|
||||
@ -8,26 +8,24 @@ import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.gh.gamecenter.common.utils.DarkModeUtils;
|
||||
import com.gh.gamecenter.common.utils.EnvHelper;
|
||||
import com.gh.gamecenter.common.constant.Constants;
|
||||
import com.gh.gamecenter.core.utils.GsonUtils;
|
||||
import com.gh.common.util.PackageHelper;
|
||||
import com.gh.common.util.PackageUtils;
|
||||
import com.gh.gamecenter.BuildConfig;
|
||||
import com.gh.gamecenter.SuggestionActivity;
|
||||
import com.gh.gamecenter.common.constant.Constants;
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse;
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.common.utils.DarkModeUtils;
|
||||
import com.gh.gamecenter.common.utils.EnvHelper;
|
||||
import com.gh.gamecenter.core.utils.GsonUtils;
|
||||
import com.gh.gamecenter.core.utils.SPUtils;
|
||||
import com.gh.gamecenter.entity.GameGuidePopupEntity;
|
||||
import com.gh.gamecenter.entity.NewApiSettingsEntity;
|
||||
import com.gh.gamecenter.entity.NewSettingsEntity;
|
||||
import com.gh.gamecenter.entity.NewsEntity;
|
||||
import com.gh.gamecenter.entity.SettingsEntity;
|
||||
import com.gh.gamecenter.common.eventbus.EBReuse;
|
||||
import com.gh.gamecenter.entity.SimulatorEntity;
|
||||
import com.gh.gamecenter.entity.VSetting;
|
||||
import com.gh.gamecenter.common.retrofit.BiResponse;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.gh.vspace.VHelper;
|
||||
import com.halo.assistant.HaloApp;
|
||||
@ -66,9 +64,8 @@ public class Config {
|
||||
|
||||
private static SettingsEntity mSettingsEntity;
|
||||
private static NewSettingsEntity mNewSettingsEntity;
|
||||
private static NewApiSettingsEntity mNewApiSettingsEntity;
|
||||
|
||||
private static NewApiSettingsEntity.NightMode mNightModeSetting;
|
||||
private static NewSettingsEntity.NightMode mNightModeSetting;
|
||||
private static SimulatorEntity mNewSimulatorEntity;
|
||||
private static VSetting mVSetting;
|
||||
private static GameGuidePopupEntity mGameGuidePopupEntity;
|
||||
@ -230,19 +227,19 @@ public class Config {
|
||||
public static SimulatorEntity getNewSimulatorEntitySetting() {
|
||||
if (mNewSimulatorEntity != null) {
|
||||
return mNewSimulatorEntity;
|
||||
} else if (mNewApiSettingsEntity != null && mNewApiSettingsEntity.getSimulator() != null) {
|
||||
return mNewApiSettingsEntity.getSimulator();
|
||||
} else if (mNewSettingsEntity != null && mNewSettingsEntity.getSimulator() != null) {
|
||||
return mNewSettingsEntity.getSimulator();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static NewApiSettingsEntity.NightMode getNightModeSetting() {
|
||||
public static NewSettingsEntity.NightMode getNightModeSetting() {
|
||||
if (mNightModeSetting != null) {
|
||||
return mNightModeSetting;
|
||||
} else if (mNewApiSettingsEntity != null && mNewApiSettingsEntity.getNightMode() != null) {
|
||||
return mNewApiSettingsEntity.getNightMode();
|
||||
} else if (mNewSettingsEntity != null && mNewSettingsEntity.getNightMode() != null) {
|
||||
return mNewSettingsEntity.getNightMode();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@ -312,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();
|
||||
@ -367,6 +344,9 @@ public class Config {
|
||||
@Override
|
||||
public void onSuccess(NewSettingsEntity data) {
|
||||
mNewSettingsEntity = data;
|
||||
if (mNightModeSetting != null) {
|
||||
mNewSettingsEntity.setNightMode(mNightModeSetting);
|
||||
}
|
||||
SPUtils.setString(Constants.SP_NEW_SETTINGS, GsonUtils.toJson(data));
|
||||
}
|
||||
});
|
||||
@ -384,22 +364,27 @@ public class Config {
|
||||
});
|
||||
}
|
||||
|
||||
if (mNewApiSettingsEntity == null) {
|
||||
if (mNightModeSetting == null && mNewSimulatorEntity == null) {
|
||||
RetrofitManager.getInstance()
|
||||
.getNewApi().getNewSettings(PackageUtils.getGhVersionName(), channel)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BiResponse<NewApiSettingsEntity>() {
|
||||
.subscribe(new BiResponse<NewSettingsEntity>() {
|
||||
@Override
|
||||
public void onSuccess(NewApiSettingsEntity data) {
|
||||
mNewApiSettingsEntity = data;
|
||||
public void onSuccess(NewSettingsEntity data) {
|
||||
mNightModeSetting = data.getNightMode();
|
||||
mNewSimulatorEntity = data.getSimulator();
|
||||
if (HaloApp.getInstance().isNewForThisVersion && mNightModeSetting != null && mNightModeSetting.getInstall()) {
|
||||
DarkModeUtils.INSTANCE.updateFollowSystemDarkModeToSp(true);
|
||||
DarkModeUtils.INSTANCE.updateAppDarkModeStatusToSp(true);
|
||||
DarkModeUtils.INSTANCE.initDarkMode();
|
||||
}
|
||||
SPUtils.setString(Constants.SP_NEW_API_SETTINGS, GsonUtils.toJson(data));
|
||||
|
||||
if (mNewSettingsEntity != null) {
|
||||
mNewSettingsEntity.setSimulator(mNewSimulatorEntity);
|
||||
mNewSettingsEntity.setNightMode(mNightModeSetting);
|
||||
SPUtils.setString(Constants.SP_NEW_SETTINGS, GsonUtils.toJson(data));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
@ -70,7 +70,8 @@ data class ExposureEvent(
|
||||
welcomeDialogId = gameEntity?.welcomeDialogId
|
||||
?: eTrace?.firstOrNull()?.payload?.welcomeDialogId,
|
||||
welcomeDialogLinkTitle = gameEntity?.welcomeDialogTitle
|
||||
?: eTrace?.firstOrNull()?.payload?.welcomeDialogLinkTitle
|
||||
?: eTrace?.firstOrNull()?.payload?.welcomeDialogLinkTitle,
|
||||
isAdData = gameEntity?.adIconActive ?: eTrace?.firstOrNull()?.payload?.isAdData ?: false
|
||||
)
|
||||
this.id = UUID.randomUUID().toString()
|
||||
this.timeInMillisecond = System.currentTimeMillis()
|
||||
|
||||
@ -18,7 +18,7 @@ import com.halo.assistant.HaloApp
|
||||
|
||||
@Database(
|
||||
entities = [AnswerEntity::class, ArticleEntity::class, NewsEntity::class, HistoryGameEntity::class, MyVideoEntity::class, GamesCollectionEntity::class],
|
||||
version = 12,
|
||||
version = 11,
|
||||
exportSchema = false
|
||||
)
|
||||
@TypeConverters(
|
||||
@ -28,7 +28,6 @@ import com.halo.assistant.HaloApp
|
||||
AnswerUserConverter::class,
|
||||
ThumbnailConverter::class,
|
||||
TagStyleListConverter::class,
|
||||
TagStyleConverter::class,
|
||||
StringArrayListConverter::class,
|
||||
ListStringConverter::class,
|
||||
CommunityVideoConverter::class,
|
||||
@ -128,13 +127,6 @@ abstract class HistoryDatabase : RoomDatabase() {
|
||||
}
|
||||
}
|
||||
|
||||
val MIGRATION_11_12: Migration = object : Migration(11, 12) {
|
||||
override fun migrate(database: SupportSQLiteDatabase) {
|
||||
database.execSQL("Alter TABLE HistoryGameEntity add subtitle TEXT NOT NULL DEFAULT ''")
|
||||
database.execSQL("Alter TABLE HistoryGameEntity add subtitleStyle TEXT")
|
||||
}
|
||||
}
|
||||
|
||||
val instance by lazy {
|
||||
Room.databaseBuilder(
|
||||
HaloApp.getInstance().application,
|
||||
@ -150,7 +142,6 @@ abstract class HistoryDatabase : RoomDatabase() {
|
||||
.addMigrations(MIGRATION_8_9)
|
||||
.addMigrations(MIGRATION_9_10)
|
||||
.addMigrations(MIGRATION_10_11)
|
||||
.addMigrations(MIGRATION_11_12)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,8 +71,6 @@ object HistoryHelper {
|
||||
historyGame.name = gameEntity.name
|
||||
historyGame.tagStyle = gameEntity.tagStyle
|
||||
historyGame.tag = gameEntity.getTag()
|
||||
historyGame.subtitle = gameEntity.subtitle
|
||||
historyGame.subtitleStyle = gameEntity.subtitleStyle
|
||||
return historyGame
|
||||
}
|
||||
|
||||
|
||||
@ -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 ?: ""
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
20
app/src/main/java/com/gh/common/provider/MainProviderImpl.kt
Normal file
20
app/src/main/java/com/gh/common/provider/MainProviderImpl.kt
Normal 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
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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?) {
|
||||
|
||||
@ -146,31 +146,21 @@ class SimulatorDownloadManager private constructor() {
|
||||
|
||||
PermissionHelper.checkGetInstalledAppsListBeforeAction(context, object : EmptyCallback {
|
||||
override fun onCallback() {
|
||||
val isInstalledNewSimulator =
|
||||
SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application)
|
||||
//当没有安装新版本模拟器时候 判断是否隐藏
|
||||
if (simulator?.active == false && !isInstalledNewSimulator) {
|
||||
//判断是否隐藏
|
||||
if (simulator?.active == false) {
|
||||
showNoneEmulatorDialog(context)
|
||||
return
|
||||
}
|
||||
var isInstalled = PackageUtils.isInstalledFromAllPackage(
|
||||
context,
|
||||
simulator?.apk?.packageName
|
||||
)
|
||||
//模拟器管理界面还是用之前的逻辑
|
||||
if (isInstalledNewSimulator && location != SimulatorLocation.SIMULATOR_MANAGE) {
|
||||
isInstalled = isInstalledNewSimulator
|
||||
}
|
||||
val isInstalled = PackageUtils.isInstalledFromAllPackage(context, simulator?.apk?.packageName)
|
||||
// val versionFromInstalledApp = PackageUtils.getVersionNameByPackageName(simulator?.apk?.packageName)
|
||||
val shouldShowUpdate =
|
||||
PackageUtils.isInstalledApkMatchedMd5(simulator?.apk?.packageName, simulator?.apk?.md5)
|
||||
val shouldShowUpdate = PackageUtils.isInstalledApkMatchedMd5(simulator?.apk?.packageName, simulator?.apk?.md5)
|
||||
val showAlertTag = SPUtils.getString(SimulatorGameManager.SIMULATOR_UPDATE_SHOW_ALERT_TAG, "") //当天是否弹过
|
||||
val todayIsShow = showAlertTag == TimeUtils.getToday()
|
||||
downloadType = if (shouldShowUpdate && isInstalled) "update" else "download"
|
||||
if (downloadType == "update" && todayIsShow && location != SimulatorLocation.SIMULATOR_MANAGE) {
|
||||
if (downloadType == "update" && todayIsShow && location != SimulatorLocation.SIMULATOR_MANAGE){
|
||||
return
|
||||
}
|
||||
if (downloadType == "download" && isInstalled) {
|
||||
if (downloadType == "download" && isInstalled){
|
||||
return
|
||||
}
|
||||
val title = if (shouldShowUpdate && isInstalled) "更新模拟器" else "安装模拟器"
|
||||
|
||||
@ -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);
|
||||
});
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -771,36 +772,6 @@ object DirectUtils {
|
||||
jumpActivity(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun directToFeedbackCompat(
|
||||
context: Context,
|
||||
content: String? = null,
|
||||
hintType: String? = null,
|
||||
isQaFeedback: Boolean = false,
|
||||
qaContentId: String? = "",
|
||||
entrance: String? = null
|
||||
) {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_ENTRANCE, entrance ?: ENTRANCE_BROWSER)
|
||||
bundle.putString(KEY_TO, SuggestionActivity::class.java.simpleName)
|
||||
if (isQaFeedback) {
|
||||
bundle.putBoolean(KEY_IS_QA_FEEDBACK, true)
|
||||
bundle.putString(KEY_QA_CONTENT_ID, qaContentId)
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
|
||||
} else {
|
||||
bundle.putString(KEY_CONTENT, content)
|
||||
if (TextUtils.isEmpty(hintType)) {
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.gameQuestion)
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, KEY_PLUGIN)
|
||||
} else {
|
||||
bundle.putSerializable(KEY_SUGGESTTYPE, SuggestType.normal)
|
||||
bundle.putString(KEY_SUGGEST_HINT_TYPE, hintType)
|
||||
}
|
||||
}
|
||||
|
||||
jumpActivityCompat(context, bundle)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun directToDownloadManager(context: Context, entrance: String? = null) {
|
||||
val bundle = Bundle()
|
||||
|
||||
@ -787,7 +787,6 @@ object DownloadItemUtils {
|
||||
DataLogUtils.uploadGameLog(context, gameEntity.id, gameEntity.name, entrance)
|
||||
} else if (str == context.getString(R.string.attempt)) {
|
||||
ChainBuilder().apply {
|
||||
addHandler(UpdateNewSimulatorHandler())
|
||||
addHandler(GamePermissionHandler())
|
||||
addHandler(BrowserInstallHandler())
|
||||
addHandler(PackageCheckHandler())
|
||||
@ -845,11 +844,8 @@ object DownloadItemUtils {
|
||||
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(context)
|
||||
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(context)
|
||||
var simulator = gameEntity.simulator
|
||||
val newSimulator = Config.getNewSimulatorEntitySetting()
|
||||
if (!isInstalledOldSimulator && newSimulator != null) {//在没有安装旧的模拟器且有配置新版模拟器 才使用新版模拟器 否则还是用以前旧的
|
||||
if (newSimulator.active) {
|
||||
simulator = newSimulator
|
||||
}
|
||||
if (!isInstalledOldSimulator) {
|
||||
simulator = Config.getNewSimulatorEntitySetting()
|
||||
}
|
||||
if (downloadEntity != null && SimulatorGameManager.isSimulatorGame(gameEntity) && !isInstalled && !isInstalledNewSimulator) {
|
||||
SimulatorDownloadManager.getInstance().showDownloadDialog(
|
||||
|
||||
@ -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
|
||||
@ -241,20 +240,16 @@ object DownloadObserver {
|
||||
val gameName = downloadEntity.getMetaExtra(Constants.GAME_NAME)
|
||||
if (simulatorJson.isEmpty()) return
|
||||
var simulator = GsonUtils.fromJson(simulatorJson, SimulatorEntity::class.java)
|
||||
val isInstalled = PackageUtils.isInstalledFromAllPackage(
|
||||
HaloApp.getInstance().application,
|
||||
simulator.apk?.packageName
|
||||
)
|
||||
val isInstalledNewSimulator =
|
||||
SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application)
|
||||
val isInstalledOldSimulator =
|
||||
SimulatorGameManager.isOldSimulatorInstalled(HaloApp.getInstance().application)
|
||||
val isInstalled = PackageUtils.isInstalledFromAllPackage(HaloApp.getInstance().application, simulator.apk?.packageName)
|
||||
val isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(HaloApp.getInstance().application)
|
||||
val isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(HaloApp.getInstance().application)
|
||||
// if (!isInstalled && !isInstalledNewSimulator) {
|
||||
val currentActivity = AppManager.getInstance().currentActivity()
|
||||
?: return
|
||||
val newSimulator = Config.getNewSimulatorEntitySetting()
|
||||
if ((!isInstalledOldSimulator && newSimulator != null && newSimulator.active) || isInstalledNewSimulator) { //如果没有安装任一旧的模拟器 或者下载了新模拟器 则使用新版本模拟器
|
||||
simulator = newSimulator!!
|
||||
if (!isInstalledOldSimulator || isInstalledNewSimulator) { //如果没有安装任一旧的模拟器 或者下载了新模拟器 则使用新版本模拟器
|
||||
Config.getNewSimulatorEntitySetting().let {
|
||||
simulator = it!!
|
||||
}
|
||||
}
|
||||
SimulatorDownloadManager.getInstance().showDownloadDialog(
|
||||
currentActivity, simulator,
|
||||
@ -266,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)
|
||||
|
||||
@ -37,32 +37,6 @@ import java.util.Set;
|
||||
|
||||
public class EntranceUtils {
|
||||
|
||||
public static void jumpActivityCompat(Context context, Bundle bundle) {
|
||||
bundle.putBoolean(KEY_REQUIRE_REDIRECT, true);
|
||||
|
||||
if (HaloApp.getInstance().isRunningForeground || HaloApp.getInstance().isAlreadyUpAndRunning) {
|
||||
// 应用正在运行,前台或后台
|
||||
String to = bundle.getString(KEY_TO);
|
||||
Class<?> clazz = ClassUtils.forName(to);
|
||||
if (clazz == null) clazz = MainActivity.class;
|
||||
if (ToolbarFragment.class.isAssignableFrom(clazz)) { // 兼容ToolbarFragment
|
||||
ToolBarActivity.startFragmentNewTask(context, (Class<? extends ToolbarFragment>) clazz, bundle);
|
||||
} else {
|
||||
Intent intent1 = new Intent(context, clazz);
|
||||
intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// 如果 activity 名称有 singleton 的就添加 reorder_to_front 标签 (有点粗暴有点蠢,但暂时就先这样吧 :C )
|
||||
if (clazz.getSimpleName().toLowerCase().contains("singleton")) {
|
||||
intent1.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
|
||||
}
|
||||
intent1.putExtras(bundle);
|
||||
context.startActivity(intent1);
|
||||
}
|
||||
} else {
|
||||
// 应用未在运行
|
||||
context.startActivity(SplashScreenActivity.getSplashScreenIntent(context, bundle));
|
||||
}
|
||||
}
|
||||
|
||||
public static void jumpActivity(Context context, Bundle bundle) {
|
||||
bundle.putBoolean(KEY_REQUIRE_REDIRECT, true);
|
||||
|
||||
|
||||
@ -553,7 +553,7 @@ public class LogUtils {
|
||||
}
|
||||
|
||||
public static void uploadSearchGame(String event, String location, String key, String searchType) {
|
||||
uploadSearchClick(event, location, key, searchType, "", "", false);
|
||||
uploadSearchClick(event, location, key, searchType, "", "", false, false);
|
||||
}
|
||||
|
||||
public static void uploadSearchClick(String event,
|
||||
@ -562,7 +562,8 @@ public class LogUtils {
|
||||
String searchType,
|
||||
String gameId,
|
||||
String gameName,
|
||||
Boolean isMirrorData) {
|
||||
Boolean isMirrorData,
|
||||
Boolean isAdData) {
|
||||
JSONObject object = new JSONObject();
|
||||
JSONObject payload = new JSONObject();
|
||||
try {
|
||||
@ -576,6 +577,7 @@ public class LogUtils {
|
||||
payload.put("game_id", gameId); //event为search_click才取值
|
||||
payload.put("game_name", gameName); //event为search_click才取值
|
||||
payload.put("is_mirror_data", isMirrorData);
|
||||
payload.put("is_ad_data", isAdData);
|
||||
object.put("payload", payload);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -36,7 +36,6 @@ import com.gh.common.util.PackageUtils;
|
||||
import com.gh.gamecenter.core.utils.PageSwitchDataHelper;
|
||||
import com.gh.gamecenter.core.utils.SPUtils;
|
||||
import com.gh.gamecenter.BuildConfig;
|
||||
import com.gh.gamecenter.core.utils.SentryHelper;
|
||||
import com.gh.gamecenter.download.DownloadedGameIdAndPackageNameDao;
|
||||
import com.gh.gamecenter.entity.ApkEntity;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
@ -390,16 +389,12 @@ public class DownloadManager implements DownloadStatusListener {
|
||||
* 清理不存在本地 APK 文件的任务
|
||||
*/
|
||||
public void clearTasksThatFileBeenDeleted() {
|
||||
try {
|
||||
for (DownloadEntity entity : getAllDownloadEntity()) {
|
||||
if (entity.getStatus() == DownloadStatus.done) {
|
||||
if (FileUtils.isEmptyFile(entity.getPath())) {
|
||||
cancel(entity.getUrl());
|
||||
}
|
||||
for (DownloadEntity entity : getAllDownloadEntity()) {
|
||||
if (entity.getStatus() == DownloadStatus.done) {
|
||||
if (FileUtils.isEmptyFile(entity.getPath())) {
|
||||
cancel(entity.getUrl());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
SentryHelper.INSTANCE.onEvent("CLEAR_DELETED_TASK_ERROR", "exception_digest", e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,7 +180,6 @@ public class MainActivity extends BaseActivity {
|
||||
showAd = getIntent().getBooleanExtra(SHOW_AD, false) && savedInstanceState == null;
|
||||
|
||||
HaloApp.getInstance().initFresco();
|
||||
HaloApp.getInstance().isAlreadyUpAndRunning = true;
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
setStatusBarColor(Color.TRANSPARENT);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ public class SkipActivity extends BaseActivity {
|
||||
if (!TextUtils.isEmpty(qaId)) {
|
||||
DirectUtils.directToQa(this, qaTitle, qaId);
|
||||
} else if ("vgame".equals(suggestionType)) {
|
||||
DirectUtils.directToFeedbackCompat(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
|
||||
DirectUtils.directToFeedback(this, content, "game", isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
|
||||
} else {
|
||||
DirectUtils.directToFeedback(this, content, null, isQaFeedback, qaContentId, EntranceConsts.ENTRANCE_BROWSER);
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.gh.gamecenter
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.SharedPreferences
|
||||
@ -26,7 +25,6 @@ import com.gh.common.util.GameSubstituteRepositoryHelper.updateGameSubstituteRep
|
||||
import com.gh.common.util.UsageStatsHelper.checkAndPostUsageStats
|
||||
import com.gh.download.DownloadManager
|
||||
import com.gh.gamecenter.common.base.activity.BaseActivity
|
||||
import com.gh.gamecenter.common.callback.SimpleCallback
|
||||
import com.gh.gamecenter.common.constant.Constants
|
||||
import com.gh.gamecenter.common.constant.RouteConsts
|
||||
import com.gh.gamecenter.common.tracker.TrackerLogger
|
||||
@ -62,8 +60,6 @@ class SplashScreenActivity : BaseActivity() {
|
||||
private var mShouldPrefetchData = true
|
||||
|
||||
private val mPermissions = arrayOf(
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
PermissionHelper.PERMISSION_GET_INSTALLED_LIST
|
||||
)
|
||||
|
||||
@ -154,41 +150,42 @@ class SplashScreenActivity : BaseActivity() {
|
||||
private fun showPrivacyDialog(guideLayout: ViewPager) {
|
||||
NewPrivacyPolicyDialogFragment.show(this, null) { isSuccess: Boolean ->
|
||||
if (isSuccess) {
|
||||
// guideLayout.visibility = View.VISIBLE
|
||||
// SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
|
||||
//
|
||||
// // 恢复畅玩数据
|
||||
// VHelper.recoverVDataIfPossible()
|
||||
//
|
||||
// requestPermission()
|
||||
//
|
||||
// // 检查是否有旧版本光环,有就删掉
|
||||
// AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
|
||||
// if (mStartMainActivityDirectly) {
|
||||
// launchMainActivity()
|
||||
// }
|
||||
guideLayout.visibility = View.VISIBLE
|
||||
SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
|
||||
|
||||
mShouldPrefetchData = false
|
||||
prefetchData()
|
||||
// 恢复畅玩数据
|
||||
VHelper.recoverVDataIfPossible()
|
||||
|
||||
val callback = object : SimpleCallback<Boolean> {
|
||||
override fun onCallback(arg: Boolean) {
|
||||
// Dialog dismiss 后的回调
|
||||
guideLayout.visibility = View.VISIBLE
|
||||
SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
|
||||
if (arg) {
|
||||
requestPermission()
|
||||
} else {
|
||||
mStartMainActivityDirectly = false
|
||||
}
|
||||
}
|
||||
requestPermission()
|
||||
|
||||
// 检查是否有旧版本光环,有就删掉
|
||||
AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
|
||||
if (mStartMainActivityDirectly) {
|
||||
launchMainActivity()
|
||||
} else {
|
||||
mShouldPrefetchData = false
|
||||
prefetchData()
|
||||
}
|
||||
|
||||
mViewModel?.showPrivacyPolicy({
|
||||
DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, it, callback)
|
||||
}, {
|
||||
DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, PrivacyPolicyEntity.createDefaultData(), callback)
|
||||
})
|
||||
// val callback = object : SimpleCallback<Boolean> {
|
||||
// override fun onCallback(arg: Boolean) {
|
||||
// // Dialog dismiss 后的回调
|
||||
// guideLayout.visibility = View.VISIBLE
|
||||
// SPUtils.setBoolean(Constants.SP_BRAND_NEW_USER, false)
|
||||
// if (arg) {
|
||||
// requestPermission()
|
||||
// } else {
|
||||
// mStartMainActivityDirectly = false
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// mViewModel?.showPrivacyPolicy({
|
||||
// DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, it, callback)
|
||||
// }, {
|
||||
// DialogUtils.showPrivacyPolicyDialog(this@SplashScreenActivity, PrivacyPolicyEntity.createDefaultData(), callback)
|
||||
// })
|
||||
|
||||
} else {
|
||||
DialogUtils.showPrivacyPolicyDisallowDialog(
|
||||
this,
|
||||
@ -388,10 +385,10 @@ class SplashScreenActivity : BaseActivity() {
|
||||
private fun checkAndRequestPermission() {
|
||||
if (EasyPermissions.hasPermissions(this, *mPermissions)) {
|
||||
// 恢复畅玩数据
|
||||
VHelper.recoverVDataIfPossible()
|
||||
// VHelper.recoverVDataIfPossible()
|
||||
|
||||
// 检查是否有旧版本光环,有就删掉
|
||||
AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
|
||||
// AppExecutor.ioExecutor.execute { deleteOutdatedUpdatePackage() }
|
||||
if (mStartMainActivityDirectly) {
|
||||
if (com.gh.gamecenter.common.BuildConfig.BUILD_TIME != 0L) {
|
||||
showGitLogDialogIfNeeded()
|
||||
|
||||
@ -42,7 +42,6 @@ import com.gh.gamecenter.entity.LibaoStatusEntity;
|
||||
import com.gh.gamecenter.entity.MeEntity;
|
||||
import com.gh.gamecenter.entity.UserDataLibaoEntity;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.game.GameItemViewHolder;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.gh.gamecenter.suggest.SuggestType;
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter;
|
||||
@ -197,8 +196,6 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
ExtensionsKt.setRootBackgroundColor(holder.binding.getRoot(), R.color.background_white);
|
||||
if (mLibaoEntity.getGame() != null) {
|
||||
holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getGame().getIcon(), mLibaoEntity.getGame().getIconSubscript());
|
||||
GameEntity gameEntity = mLibaoEntity.getGame().toGameEntity();
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, holder.binding.gameSubtitleTv, null, null, false);
|
||||
} else {
|
||||
holder.binding.libaodetailGameIcon.displayGameIcon(mLibaoEntity.getIcon(), null);
|
||||
}
|
||||
|
||||
@ -315,10 +315,9 @@ public class DetailViewHolder {
|
||||
boolean isInstalledNewSimulator = SimulatorGameManager.isNewSimulatorInstalled(mViewHolder.context);
|
||||
boolean isInstalledOldSimulator = SimulatorGameManager.isOldSimulatorInstalled(mViewHolder.context);
|
||||
SimulatorEntity simulator = mGameEntity.getSimulator();
|
||||
SimulatorEntity newSimulator = Config.getNewSimulatorEntitySetting();
|
||||
if (!isInstalledOldSimulator && newSimulator != null) {
|
||||
if (newSimulator.getActive()) {
|
||||
simulator = newSimulator;
|
||||
if (!isInstalledOldSimulator){
|
||||
if (Config.getNewSimulatorEntitySetting() != null){
|
||||
simulator = Config.getNewSimulatorEntitySetting();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
|
||||
import com.gh.gamecenter.common.utils.dip2px
|
||||
import com.gh.gamecenter.common.utils.toColor
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.utils.goneIf
|
||||
import com.gh.gamecenter.databinding.GameHeadItemBinding
|
||||
import com.gh.gamecenter.entity.SubjectEntity
|
||||
|
||||
@ -64,5 +65,6 @@ class GameHeadViewHolder(var binding: GameHeadItemBinding) :
|
||||
binding.arrowIv.visibility = View.VISIBLE
|
||||
}
|
||||
binding.headTitle.setTextColor(R.color.text_title.toColor(binding.root.context))
|
||||
binding.adLabelTv.goneIf(!subject.adIconActive)
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@ import com.gh.gamecenter.core.utils.NumberUtils
|
||||
import com.gh.gamecenter.databinding.AmwayCommentItemBinding
|
||||
import com.gh.gamecenter.eventbus.EBDownloadStatus
|
||||
import com.gh.gamecenter.game.GameAndPosition
|
||||
import com.gh.gamecenter.game.GameItemViewHolder
|
||||
import com.gh.gamecenter.game.vertical.GameVerticalAdapter
|
||||
import com.gh.gamecenter.gamedetail.rating.RatingFragment
|
||||
import com.gh.gamecenter.gamedetail.rating.RatingReplyActivity
|
||||
@ -207,7 +206,6 @@ class AmwayAdapter(
|
||||
) {
|
||||
val context = binding.root.context
|
||||
val amway = itemData.amwayCommentItem!!
|
||||
val gameEntity = amway.game.toGameEntity()
|
||||
|
||||
binding.gameContainer.background = R.drawable.selector_f8f8f8.toDrawable(context)
|
||||
binding.commentContainer.background = R.drawable.selector_f8f8f8.toDrawable(context)
|
||||
@ -239,8 +237,7 @@ class AmwayAdapter(
|
||||
)
|
||||
}
|
||||
|
||||
itemData.exposureEvent = ExposureEvent.createEvent(gameEntity, basicExposureSource)
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, binding.gameSubtitleTv)
|
||||
itemData.exposureEvent = ExposureEvent.createEvent(amway.game.toGameEntity(), basicExposureSource)
|
||||
|
||||
binding.gameContainer.setOnClickListener {
|
||||
GameDetailActivity.startGameDetailActivity(
|
||||
|
||||
@ -27,7 +27,6 @@ import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.databinding.CategoryGameItemBinding
|
||||
import com.gh.gamecenter.entity.GameEntity
|
||||
import com.gh.gamecenter.eventbus.EBDownloadStatus
|
||||
import com.gh.gamecenter.game.GameItemViewHolder
|
||||
import com.lightgame.download.DownloadEntity
|
||||
|
||||
class CategoryV2ListAdapter(
|
||||
@ -246,8 +245,6 @@ class CategoryV2ListAdapter(
|
||||
)
|
||||
)
|
||||
gameDes.text = gameEntity.decoratedDes
|
||||
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, gameSubtitleTv, gameDesSpace, root)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,6 @@ import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler;
|
||||
import com.gh.common.util.CollectionUtils;
|
||||
import com.gh.gamecenter.common.utils.DialogHelper;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.view.DrawableView;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.common.viewholder.FooterViewHolder;
|
||||
@ -233,11 +232,6 @@ public class AnswerAdapter extends ListAdapter<AnswerEntity> implements ISyncAda
|
||||
|
||||
}
|
||||
});
|
||||
mPopupBinding.checkAllCb.setCompoundDrawablesWithIntrinsicBounds(
|
||||
DrawableView.getCheckSelectorDrawable(
|
||||
mContext
|
||||
), null, null, null
|
||||
);
|
||||
mPopupBinding.checkAllCb.setOnClickListener(v -> {
|
||||
if (mPopupBinding.checkAllCb.isChecked()) {
|
||||
selectItems.clear();
|
||||
|
||||
@ -16,7 +16,6 @@ import com.gh.gamecenter.common.callback.OnListClickListener;
|
||||
import com.gh.gamecenter.common.constant.ItemViewType;
|
||||
import com.gh.gamecenter.common.utils.DialogHelper;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.common.view.DrawableView;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
import com.gh.gamecenter.common.utils.ImageUtils;
|
||||
import com.gh.common.util.NewsUtils;
|
||||
@ -362,11 +361,6 @@ public class ArticleAdapter extends ListAdapter<NewsEntity> {
|
||||
|
||||
}
|
||||
});
|
||||
mPopupBinding.checkAllCb.setCompoundDrawablesWithIntrinsicBounds(
|
||||
DrawableView.getCheckSelectorDrawable(
|
||||
mContext
|
||||
), null, null, null
|
||||
);
|
||||
mPopupBinding.checkAllCb.setOnClickListener(v -> {
|
||||
if (mPopupBinding.checkAllCb.isChecked()) {
|
||||
selectItems.clear();
|
||||
|
||||
@ -18,7 +18,6 @@ import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.databinding.CommunityAnswerItemBinding
|
||||
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
|
||||
import com.gh.gamecenter.common.entity.CommunityEntity
|
||||
import com.gh.gamecenter.common.view.DrawableView
|
||||
import com.gh.gamecenter.history.ManageOption
|
||||
import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder
|
||||
import com.gh.gamecenter.qa.article.detail.ArticleDetailActivity
|
||||
@ -173,11 +172,6 @@ class CommunityArticleAdapter(
|
||||
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
|
||||
|
||||
}
|
||||
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
|
||||
DrawableView.getCheckSelectorDrawable(
|
||||
mContext
|
||||
), null, null, null
|
||||
)
|
||||
mPopupBinding?.checkAllCb?.setOnClickListener {
|
||||
if (mPopupBinding?.checkAllCb?.isChecked == true) {
|
||||
selectItems.clear()
|
||||
|
||||
@ -24,7 +24,6 @@ import com.gh.gamecenter.adapter.viewholder.GameCollectionItemViewHolder
|
||||
import com.gh.gamecenter.common.baselist.ListAdapter
|
||||
import com.gh.gamecenter.collection.GamesCollectionFragment.Companion.TYPE_USER
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.view.DrawableView
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.databinding.ItemGameCollectionFlexTagBinding
|
||||
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
|
||||
@ -425,11 +424,6 @@ class GamesCollectionAdapter(
|
||||
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
|
||||
|
||||
}
|
||||
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
|
||||
DrawableView.getCheckSelectorDrawable(
|
||||
mContext
|
||||
), null, null, null
|
||||
)
|
||||
mPopupBinding?.checkAllCb?.setOnClickListener {
|
||||
if (mPopupBinding?.checkAllCb?.isChecked == true) {
|
||||
selectItems.clear()
|
||||
|
||||
@ -3,7 +3,6 @@ package com.gh.gamecenter.collection
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.StateListDrawable
|
||||
import android.view.Gravity
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@ -18,7 +17,6 @@ import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.viewholder.FooterViewHolder
|
||||
import com.gh.gamecenter.common.baselist.ListAdapter
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.view.DrawableView
|
||||
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
|
||||
import com.gh.gamecenter.databinding.VideoNewItemBinding
|
||||
import com.gh.gamecenter.entity.MyVideoEntity
|
||||
@ -168,11 +166,6 @@ class VideoAdapter(
|
||||
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
|
||||
|
||||
}
|
||||
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
|
||||
DrawableView.getCheckSelectorDrawable(
|
||||
mContext
|
||||
), null, null, null
|
||||
)
|
||||
mPopupBinding?.checkAllCb?.setOnClickListener {
|
||||
if (mPopupBinding?.checkAllCb?.isChecked == true) {
|
||||
selectItems.clear()
|
||||
|
||||
@ -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
|
||||
|
||||
@ -32,10 +32,6 @@ data class AmwayCommentEntity(
|
||||
@SerializedName("new_star")
|
||||
var star: Float,
|
||||
|
||||
var subtitle: String? = "",
|
||||
@SerializedName("subtitle_style")
|
||||
var subtitleStyle: TagStyleEntity? = null,
|
||||
|
||||
// 曝光用的位置
|
||||
var sequence: Int = 0,
|
||||
var outerSequence: Int = 0
|
||||
@ -54,9 +50,6 @@ data class AmwayCommentEntity(
|
||||
gameEntity.iconSubscript = iconSubscript
|
||||
gameEntity.platform = ""
|
||||
|
||||
gameEntity.subtitle = subtitle ?: ""
|
||||
gameEntity.subtitleStyle = subtitleStyle
|
||||
|
||||
gameEntity.sequence = sequence
|
||||
gameEntity.outerSequence = outerSequence
|
||||
return gameEntity
|
||||
|
||||
@ -876,11 +876,7 @@ data class SimpleGame(
|
||||
@SerializedName("recommend_text")
|
||||
var recommendText: String = "",
|
||||
@SerializedName("download_status")
|
||||
var downloadStatus: String = "",
|
||||
|
||||
var subtitle: String? = "",
|
||||
@SerializedName("subtitle_style")
|
||||
var subtitleStyle: TagStyleEntity? = null,
|
||||
var downloadStatus: String = ""
|
||||
) : Parcelable {
|
||||
|
||||
@IgnoredOnParcel
|
||||
@ -906,8 +902,6 @@ data class SimpleGame(
|
||||
gameEntity.recommendStar = recommendStar
|
||||
gameEntity.recommendText = recommendText
|
||||
gameEntity.downloadStatus = downloadStatus
|
||||
gameEntity.subtitle = subtitle ?: ""
|
||||
gameEntity.subtitleStyle = subtitleStyle
|
||||
return gameEntity
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,9 @@ class GamesCollectionDetailEntity(
|
||||
var count: Count? = null,
|
||||
var user: UserEntity? = null,
|
||||
var me: MeEntity? = null,
|
||||
val source: SourceEntity? = null
|
||||
val source: SourceEntity? = null,
|
||||
@SerializedName("ad_icon_active")
|
||||
var adIconActive: Boolean = false,
|
||||
) : Parcelable {
|
||||
|
||||
@Parcelize
|
||||
|
||||
@ -41,7 +41,9 @@ class GamesCollectionEntity(
|
||||
var time: TimeEntity? = null,
|
||||
@Ignore
|
||||
var status: String = "",// draft/pending/pass/failed
|
||||
|
||||
@Ignore
|
||||
@SerializedName("ad_icon_active")
|
||||
var adIconActive: Boolean = false,
|
||||
//本地字段
|
||||
@Ignore
|
||||
var isLocalDraft: Boolean = false
|
||||
|
||||
@ -16,9 +16,6 @@ data class HistoryGameEntity(
|
||||
var tag: ArrayList<String>? = null,
|
||||
var isLibaoExist: Boolean = false,
|
||||
|
||||
var subtitle: String = "",
|
||||
var subtitleStyle: TagStyleEntity? = null,
|
||||
|
||||
@SerializedName("tag_style")
|
||||
var tagStyle: ArrayList<TagStyleEntity> = ArrayList(),
|
||||
|
||||
@ -34,8 +31,6 @@ data class HistoryGameEntity(
|
||||
gameEntity.des = des
|
||||
gameEntity.rawIcon = icon
|
||||
gameEntity.iconSubscript = iconSubscript
|
||||
gameEntity.subtitle = subtitle
|
||||
gameEntity.subtitleStyle = subtitleStyle
|
||||
gameEntity.name = name
|
||||
gameEntity.tagStyle = tagStyle
|
||||
gameEntity.isLibaoExists = isLibaoExist
|
||||
|
||||
@ -1,21 +0,0 @@
|
||||
package com.gh.gamecenter.entity
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class NewApiSettingsEntity(
|
||||
@SerializedName("night_mode")
|
||||
var nightMode: NightMode? = null,
|
||||
var simulator: SimulatorEntity? = null,
|
||||
) {
|
||||
/**
|
||||
*
|
||||
* "icon": false, // 是否显示切换,true显示
|
||||
* "setting": false, // 设置页面是否显示,true显示
|
||||
* "install": false, // 安装时的默认值,true开启
|
||||
*/
|
||||
data class NightMode(
|
||||
val icon: Boolean,
|
||||
val setting: Boolean,
|
||||
val install: Boolean
|
||||
)
|
||||
}
|
||||
@ -5,6 +5,9 @@ import com.google.gson.annotations.SerializedName
|
||||
data class NewSettingsEntity(
|
||||
@SerializedName("install_model")
|
||||
var installModel: InstallModel? = null,
|
||||
@SerializedName("night_mode")
|
||||
var nightMode: NightMode? = null,
|
||||
var simulator: SimulatorEntity? = null
|
||||
) {
|
||||
data class InstallModel(
|
||||
var status: String = "",
|
||||
@ -12,4 +15,16 @@ data class NewSettingsEntity(
|
||||
@SerializedName("white_list")
|
||||
var whiteList: ArrayList<String>? = arrayListOf()
|
||||
)
|
||||
|
||||
/**
|
||||
*
|
||||
* "icon": false, // 是否显示切换,true显示
|
||||
* "setting": false, // 设置页面是否显示,true显示
|
||||
* "install": false, // 安装时的默认值,true开启
|
||||
*/
|
||||
data class NightMode(
|
||||
val icon: Boolean,
|
||||
val setting: Boolean,
|
||||
val install: Boolean
|
||||
)
|
||||
}
|
||||
@ -28,13 +28,13 @@ data class PrivacyPolicyEntity(
|
||||
intro = "用于下载游戏,以及实现内容缓存提升浏览体验"
|
||||
)
|
||||
)
|
||||
// permissions.add(
|
||||
// PermissionsEntity(
|
||||
// icon = "res:///" + R.drawable.permission_phone_state,
|
||||
// name = "设备信息",
|
||||
// intro = "为保障您的账号安全及使用软件与服务可安全运行"
|
||||
// )
|
||||
// )
|
||||
permissions.add(
|
||||
PermissionsEntity(
|
||||
icon = "res:///" + R.drawable.permission_phone_state,
|
||||
name = "设备信息",
|
||||
intro = "为保障您的账号安全及使用软件与服务可安全运行"
|
||||
)
|
||||
)
|
||||
// permissions.add(PermissionsEntity(
|
||||
// icon = "res:///" + R.drawable.permission_sdk,
|
||||
// name = "第三方SDK使用信息提醒",
|
||||
|
||||
@ -10,5 +10,7 @@ data class SearchSubjectEntity(
|
||||
val games: List<GameEntity> = listOf(),
|
||||
val location: Int = 0,
|
||||
@SerializedName("column_id")
|
||||
val columnId: String = ""
|
||||
val columnId: String = "",
|
||||
@SerializedName("ad_icon_active")
|
||||
val adIconActive: Boolean = false
|
||||
) : Parcelable
|
||||
@ -119,12 +119,14 @@ data class SettingsEntity(
|
||||
) {
|
||||
data class RankList(
|
||||
var title: String = "",
|
||||
var content: List<RankContent> = listOf()
|
||||
var content: List<RankContent> = listOf(),
|
||||
var isShowIcon: Boolean = true // 榜单Item是否显示图标(所有内容都配置了图标前端才可显示,否则均不显示图标)
|
||||
) {
|
||||
data class RankContent(
|
||||
@SerializedName("_id")
|
||||
var id: String = "",
|
||||
var name: String = "",
|
||||
var icon: String = "",
|
||||
var title: String = "",
|
||||
var order: Int = 0,
|
||||
@SerializedName("recommend_type")
|
||||
|
||||
@ -75,6 +75,8 @@ data class SubjectEntity(
|
||||
// 专题内游戏item是否显示下载按钮(目前只针对横向专题)
|
||||
@SerializedName("show_download")
|
||||
var showDownload: Boolean = false,
|
||||
@SerializedName("ad_icon_active")
|
||||
var adIconActive: Boolean = false,
|
||||
|
||||
@SerializedName("link_text")
|
||||
var linkText: String = "",
|
||||
|
||||
@ -25,7 +25,9 @@ data class SubjectSettingEntity(
|
||||
var filterSizes: ArrayList<Size>? = null,
|
||||
|
||||
@SerializedName("filter_options")
|
||||
var filterOptions: List<String> = ArrayList() // 过滤选项,推荐、最新、评分、更新
|
||||
var filterOptions: List<String> = ArrayList(), // 过滤选项,推荐、最新、评分、更新
|
||||
@SerializedName("ad_icon_active")
|
||||
var adIconActive: Boolean = false,
|
||||
) : Parcelable {
|
||||
@Parcelize
|
||||
data class TypeEntity(
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -2,7 +2,6 @@ package com.gh.gamecenter.game
|
||||
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.GradientDrawable
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.widget.Space
|
||||
import android.widget.TextView
|
||||
@ -12,7 +11,7 @@ import com.gh.common.databind.BindingAdapters
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.common.base.BaseRecyclerViewHolder
|
||||
import com.gh.gamecenter.common.utils.dip2px
|
||||
import com.gh.gamecenter.common.utils.maxWidthExcludeZero
|
||||
import com.gh.gamecenter.common.utils.goneIf
|
||||
import com.gh.gamecenter.common.utils.toColor
|
||||
import com.gh.gamecenter.common.utils.toDrawable
|
||||
import com.gh.gamecenter.common.view.DrawableView
|
||||
@ -34,7 +33,6 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
|
||||
) {
|
||||
binding.run {
|
||||
root.background = R.drawable.reuse_listview_item_style.toDrawable(root.context)
|
||||
selectIv.setImageDrawable(DrawableView.getCheckSelectorDrawable(root.context))
|
||||
gameKaifuType.setBackgroundColor(R.color.theme.toColor(root.context))
|
||||
gameName.setTextColor(R.color.text_title.toColor(root.context))
|
||||
gameDes.setTextColor(R.color.text_subtitleDesc.toColor(root.context))
|
||||
@ -64,6 +62,7 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
|
||||
gameDes.text = entity.decoratedDes
|
||||
recommendStar.rating = entity.recommendStar.toFloat()
|
||||
initGameSubtitle(entity, gameSubtitleTv, gameDesSpace, root, forceShowSubtitle)
|
||||
adLabelTv.goneIf(!entity.adIconActive)
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,17 +88,19 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun initGameSubtitle(entity: GameEntity,
|
||||
gameSubtitleTv: TextView,
|
||||
gameDesSpace: Space? = null,
|
||||
rootContainer: ConstraintLayout? = null,
|
||||
forceShowSubtitle: Boolean = false) {
|
||||
fun initGameSubtitle(
|
||||
entity: GameEntity,
|
||||
gameSubtitleTv: TextView,
|
||||
gameDesSpace: Space,
|
||||
rootContainer: ConstraintLayout,
|
||||
forceShowSubtitle: Boolean = false
|
||||
) {
|
||||
gameSubtitleTv.visibility = View.GONE
|
||||
if ((entity.serverLabel == null && entity.subtitle.isNotEmpty() && !entity.advanceDownload) || (forceShowSubtitle && entity.subtitle.isNotEmpty())) {
|
||||
gameSubtitleTv.run {
|
||||
visibility = View.VISIBLE
|
||||
text = entity.subtitle
|
||||
if (entity.subtitleStyle != null && !TextUtils.isEmpty(entity.subtitleStyle?.color)) {
|
||||
if (entity.subtitleStyle != null) {
|
||||
setTextColor(Color.parseColor("#${entity.subtitleStyle?.color}"))
|
||||
background = GradientDrawable().apply {
|
||||
cornerRadius = 2F.dip2px().toFloat()
|
||||
@ -113,9 +114,9 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
|
||||
}
|
||||
}
|
||||
}
|
||||
gameDesSpace?.post {
|
||||
// 模拟器上可能出现未提前 bindView 导致 gameDesSpace.width 为 0 的情况
|
||||
gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
|
||||
gameDesSpace.post {
|
||||
gameSubtitleTv.maxWidth =
|
||||
if (entity.adIconActive) gameDesSpace.width - 25F.dip2px() else gameDesSpace.width
|
||||
}
|
||||
}
|
||||
if (entity.advanceDownload) {
|
||||
@ -126,12 +127,15 @@ class GameItemViewHolder(var binding: GameItemBinding) : BaseRecyclerViewHolder<
|
||||
background = R.drawable.bg_advance_download_game_subtitle.toDrawable(context)
|
||||
}
|
||||
}
|
||||
rootContainer?.let {
|
||||
ConstraintSet().apply {
|
||||
clone(rootContainer)
|
||||
connect(R.id.game_name, ConstraintSet.END, if (entity.serverLabel != null && !entity.advanceDownload && !forceShowSubtitle) R.id.recent_played_tag else R.id.gameSubtitleTv, ConstraintSet.START)
|
||||
}.applyTo(rootContainer)
|
||||
}
|
||||
ConstraintSet().apply {
|
||||
clone(rootContainer)
|
||||
connect(
|
||||
R.id.game_name,
|
||||
ConstraintSet.END,
|
||||
if (entity.serverLabel != null && !entity.advanceDownload && !forceShowSubtitle) R.id.recent_played_tag else R.id.gameSubtitleTv,
|
||||
ConstraintSet.START
|
||||
)
|
||||
}.applyTo(rootContainer)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
@ -37,8 +37,6 @@ class CommonCollectionViewHolder(val binding: CommonCollectionListBinding) : Bas
|
||||
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
|
||||
var position = mLayoutManager.findLastCompletelyVisibleItemPosition()
|
||||
if (position == -1) position = mLayoutManager.findLastVisibleItemPosition() - 1
|
||||
if (position < 0) return
|
||||
|
||||
val linkEntity = mCollection?.commonCollectionList?.get(position)
|
||||
NewLogUtils.logSlideCommonCollection(
|
||||
mCollection?.id ?: "",
|
||||
|
||||
@ -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
|
||||
|
||||
@ -41,6 +41,7 @@ class GameItemUi(override val ctx: Context) : Ui {
|
||||
var iconIv: GameIconView
|
||||
var gameNameTv: TextView
|
||||
var gameSubtitleTv: TextView
|
||||
var adLabelTv: TextView
|
||||
var downloadTv: DownloadButton
|
||||
var gameDesTv: TextView
|
||||
var serverTypeTv: TextView
|
||||
@ -63,6 +64,7 @@ class GameItemUi(override val ctx: Context) : Ui {
|
||||
serverTypeTv = initServerTypeTv()
|
||||
gameNameTv = initGameNameTv()
|
||||
gameSubtitleTv = initGameSubtitleTv()
|
||||
adLabelTv = initAdLabelTv()
|
||||
downloadTv = initDownloadTv()
|
||||
gameDesTv = initGameDesTv()
|
||||
gameRatingTv = initGameRatingTv()
|
||||
@ -175,6 +177,15 @@ class GameItemUi(override val ctx: Context) : Ui {
|
||||
|
||||
startMargin = dip(4)
|
||||
})
|
||||
add(adLabelTv, lParams(dip(21), dip(14)) {
|
||||
startToEndOf(gameSubtitleTv)
|
||||
topToTopOf(gameSubtitleTv)
|
||||
bottomToBottomOf(gameSubtitleTv)
|
||||
endToEndOf(mGameDesSpace)
|
||||
horizontalBias = 0F
|
||||
|
||||
startMargin = dip(4)
|
||||
})
|
||||
|
||||
gameInfoGroup.visibility = View.GONE
|
||||
}
|
||||
@ -207,6 +218,16 @@ class GameItemUi(override val ctx: Context) : Ui {
|
||||
visibility = View.GONE
|
||||
}
|
||||
|
||||
private fun initAdLabelTv() = textView {
|
||||
id = R.id.adLabelTv
|
||||
textSize = 10F
|
||||
text = "AD"
|
||||
gravity = Gravity.CENTER
|
||||
background = ContextCompat.getDrawable(context, R.drawable.bg_ad_label)
|
||||
setTextColor(Color.WHITE)
|
||||
visibility = View.GONE
|
||||
}
|
||||
|
||||
private fun initServerTypeTv() = textView {
|
||||
id = R.id.game_server_type
|
||||
textSize = 9F
|
||||
|
||||
@ -13,7 +13,7 @@ import com.gh.common.util.DownloadItemUtils
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
|
||||
import com.gh.gamecenter.common.utils.dip2px
|
||||
import com.gh.gamecenter.common.utils.maxWidthExcludeZero
|
||||
import com.gh.gamecenter.common.utils.goneIf
|
||||
import com.gh.gamecenter.common.utils.toColor
|
||||
import com.gh.gamecenter.common.utils.toDrawable
|
||||
import com.gh.gamecenter.common.view.AsyncUi
|
||||
@ -90,6 +90,7 @@ class GameVerticalAdapter(
|
||||
GameItemViewHolder.initServerType(gameNameTv, serverTypeTv, gameEntity)
|
||||
gameDesTv.text = gameEntity.decoratedDes
|
||||
gameSubtitleTv.visibility = View.GONE
|
||||
adLabelTv.goneIf(!gameEntity.adIconActive)
|
||||
if (gameEntity.serverLabel == null && gameEntity.subtitle.isNotEmpty() && !gameEntity.advanceDownload) {
|
||||
gameSubtitleTv.run {
|
||||
visibility = View.VISIBLE
|
||||
@ -112,7 +113,7 @@ class GameVerticalAdapter(
|
||||
}
|
||||
}
|
||||
mGameDesSpace.post {
|
||||
gameSubtitleTv.maxWidthExcludeZero(mGameDesSpace.width)
|
||||
gameSubtitleTv.maxWidth = mGameDesSpace.width
|
||||
}
|
||||
}
|
||||
if (gameEntity.advanceDownload) {
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -639,7 +639,7 @@ open class GameCollectionDetailAdapter(
|
||||
}
|
||||
}
|
||||
gameDesSpace.post {
|
||||
gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
|
||||
gameSubtitleTv.maxWidth = gameDesSpace.width
|
||||
}
|
||||
}
|
||||
if (gameEntity.advanceDownload) {
|
||||
|
||||
@ -4,8 +4,13 @@ import android.app.Activity
|
||||
import android.content.Intent
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.text.SpannableStringBuilder
|
||||
import android.text.Spanned
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.TextView
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.core.view.ViewCompat
|
||||
@ -32,6 +37,7 @@ import com.gh.gamecenter.common.syncpage.SyncPageRepository
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.view.SegmentedFilterView
|
||||
import com.gh.gamecenter.core.iinterface.IScrollable
|
||||
import com.gh.gamecenter.core.utils.CenterImageSpan
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils
|
||||
import com.gh.gamecenter.core.utils.MD5Utils
|
||||
import com.gh.gamecenter.core.utils.SPUtils
|
||||
@ -44,12 +50,12 @@ import com.gh.gamecenter.eventbus.EBUserFollow
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment
|
||||
import com.gh.gamecenter.home.video.ScrollCalculatorHelper
|
||||
import com.gh.gamecenter.login.user.UserManager
|
||||
import com.gh.gamecenter.login.user.UserViewModel
|
||||
import com.gh.gamecenter.qa.article.detail.CommentItemData
|
||||
import com.gh.gamecenter.qa.comment.CommentActivity
|
||||
import com.gh.gamecenter.qa.comment.base.BaseCommentAdapter
|
||||
import com.gh.gamecenter.qa.comment.base.BaseCommentViewModel
|
||||
import com.gh.gamecenter.setting.VideoSettingFragment
|
||||
import com.gh.gamecenter.login.user.UserViewModel
|
||||
import com.gh.gamecenter.setting.compose.activity.ComposeVideoSettingActivity
|
||||
import com.gh.gamecenter.video.detail.CustomManager
|
||||
import com.google.android.material.appbar.AppBarLayout
|
||||
import com.halo.assistant.HaloApp
|
||||
@ -444,7 +450,7 @@ class GameCollectionDetailFragment :
|
||||
private fun initImageTypeView() {
|
||||
mBinding?.imageItem?.run {
|
||||
mEntity?.run {
|
||||
nameTv.text = title
|
||||
initGameCollectionTitle(this, nameTv)
|
||||
userNameTv.text = user?.name
|
||||
ImageUtils.display(poster, cover)
|
||||
tagIv.goneIf(stamp.isEmpty())
|
||||
@ -483,8 +489,8 @@ class GameCollectionDetailFragment :
|
||||
mBinding?.videoItem?.run {
|
||||
mEntity?.run {
|
||||
tagIv.goneIf(stamp.isEmpty())
|
||||
initGameCollectionTitle(this, nameTv)
|
||||
userNameTv.text = user?.name
|
||||
nameTv.text = title
|
||||
videoItemDesTv.text = intro
|
||||
videoActivityLabelTv.goneIf(activityTags.isNullOrEmpty())
|
||||
ipRegionTv.goneIf(!(source != null && source.region.isNotEmpty()))
|
||||
@ -518,6 +524,34 @@ class GameCollectionDetailFragment :
|
||||
}
|
||||
}
|
||||
|
||||
private fun initGameCollectionTitle(entity: GamesCollectionDetailEntity, nameTv: TextView) {
|
||||
entity.run {
|
||||
if (adIconActive) {
|
||||
val adLabelView = TextView(context).apply {
|
||||
layoutParams =
|
||||
FrameLayout.LayoutParams(21F.dip2px(), 14F.dip2px()).apply { leftMargin = 4F.dip2px() }
|
||||
background = R.drawable.bg_ad_label.toDrawable(context)
|
||||
text = "AD"
|
||||
textSize = 10F
|
||||
setTextColor(Color.WHITE)
|
||||
gravity = Gravity.CENTER
|
||||
}
|
||||
adLabelView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED)
|
||||
val adLabelBitmap = FrameLayout(requireContext()).apply { addView(adLabelView) }.convertViewToBitmap()
|
||||
nameTv.text = SpannableStringBuilder("$title ").apply {
|
||||
setSpan(
|
||||
CenterImageSpan(context, adLabelBitmap),
|
||||
title.length,
|
||||
title.length + 1,
|
||||
Spanned.SPAN_EXCLUSIVE_INCLUSIVE
|
||||
)
|
||||
}
|
||||
} else {
|
||||
nameTv.text = title
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTagView(
|
||||
content: String,
|
||||
isLast: Boolean,
|
||||
@ -655,15 +689,15 @@ class GameCollectionDetailFragment :
|
||||
//val trafficVideo = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(SettingsFragment.TRAFFIC_VIDEO_SP_KEY, false)
|
||||
val videoOption = SPUtils.getString(
|
||||
Constants.SP_HOME_OR_DETAIL_VIDEO_OPTION,
|
||||
VideoSettingFragment.VIDEO_OPTION_WIFI
|
||||
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
|
||||
)
|
||||
?: VideoSettingFragment.VIDEO_OPTION_WIFI
|
||||
?: ComposeVideoSettingActivity.VIDEO_OPTION_WIFI
|
||||
when (videoOption) {
|
||||
VideoSettingFragment.VIDEO_OPTION_ALL -> {
|
||||
ComposeVideoSettingActivity.VIDEO_OPTION_ALL -> {
|
||||
startPlayLogic(isAutoPlay = true)
|
||||
}
|
||||
|
||||
VideoSettingFragment.VIDEO_OPTION_WIFI -> {
|
||||
ComposeVideoSettingActivity.VIDEO_OPTION_WIFI -> {
|
||||
if (NetworkUtils.isWifiConnected(requireContext()) /*|| !trafficVideo*/) {
|
||||
if (mListViewModel.isTopVideoPartlyCached(video.url)) {
|
||||
startPlayLogic(isAutoPlay = true)
|
||||
|
||||
@ -348,6 +348,7 @@ class GameCollectionSquareAdapter(
|
||||
}
|
||||
tagContainer.visibleIf(!CheckLoginUtils.isLogin() || gamesCollectionEntity.count?.game == 0)
|
||||
playedGamesContainer.visibleIf(CheckLoginUtils.isLogin() && gamesCollectionEntity.count?.game != 0)
|
||||
adLabelTv.goneIf(!gamesCollectionEntity.adIconActive)
|
||||
iconIvOne.setOnClickListener {
|
||||
val game = gamesCollectionEntity.games?.get(0)
|
||||
NewLogUtils.logClickGameCollectionGameIcon(
|
||||
|
||||
@ -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
|
||||
@ -592,36 +593,32 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
|
||||
}
|
||||
|
||||
private fun subtractGameNameIfNeeded(textView: TextView, name: CharSequence, tagLayout: FrameLayout) {
|
||||
try {
|
||||
if (!isAdded) return
|
||||
textView.run {
|
||||
if (lineCount > 2 || (layout != null && layout.getEllipsisCount(1) > 0)) {
|
||||
val displayName = name.substring(0, name.length - 2) + "…"
|
||||
text = displayName
|
||||
if (tagLayout.getChildAt(0) != null) {
|
||||
val tagView = tagLayout.getChildAt(0)
|
||||
tagView.layoutParams = (tagView.layoutParams as FrameLayout.LayoutParams).apply {
|
||||
setMargins(if (lineCount == 1) 0 else 4F.dip2px(), 0, 0, 0)
|
||||
}
|
||||
}
|
||||
val tagBitmap = tagLayout.convertViewToBitmap()
|
||||
text = SpannableStringBuilder("$displayName ").apply {
|
||||
tagBitmap?.let {
|
||||
setSpan(
|
||||
CenterImageSpan(
|
||||
context,
|
||||
it
|
||||
), displayName.length, displayName.length + 1, Spanned.SPAN_EXCLUSIVE_INCLUSIVE
|
||||
)
|
||||
}
|
||||
}
|
||||
post {
|
||||
subtractGameNameIfNeeded(this, displayName, tagLayout)
|
||||
if (!isAdded) return
|
||||
textView.run {
|
||||
if (lineCount > 2 || (layout != null && layout.getEllipsisCount(1) > 0)) {
|
||||
val displayName = name.substring(0, name.length - 2) + "…"
|
||||
text = displayName
|
||||
if (tagLayout.getChildAt(0) != null) {
|
||||
val tagView = tagLayout.getChildAt(0)
|
||||
tagView.layoutParams = (tagView.layoutParams as FrameLayout.LayoutParams).apply {
|
||||
setMargins(if (lineCount == 1) 0 else 4F.dip2px(), 0, 0, 0)
|
||||
}
|
||||
}
|
||||
val tagBitmap = tagLayout.convertViewToBitmap()
|
||||
text = SpannableStringBuilder("$displayName ").apply {
|
||||
tagBitmap?.let {
|
||||
setSpan(
|
||||
CenterImageSpan(
|
||||
context,
|
||||
it
|
||||
), displayName.length, displayName.length + 1, Spanned.SPAN_EXCLUSIVE_INCLUSIVE
|
||||
)
|
||||
}
|
||||
}
|
||||
post {
|
||||
subtractGameNameIfNeeded(this, displayName, tagLayout)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
SentryHelper.onEvent("GAME_DETAIL_SUBTRACT_GAME_NAME_ERROR", "exception_digest", e.localizedMessage)
|
||||
}
|
||||
}
|
||||
|
||||
@ -631,25 +628,6 @@ class GameDetailFragment : ToolbarFragment(), IScrollable {
|
||||
return (width / textWidth).toInt()
|
||||
}
|
||||
|
||||
/**
|
||||
* 把View转化成Bitmap
|
||||
*/
|
||||
private fun View.convertViewToBitmap(): Bitmap? {
|
||||
measure(
|
||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
|
||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
|
||||
)
|
||||
layout(0, 0, measuredWidth, measuredHeight)
|
||||
return if (measuredWidth > 0 && measuredHeight > 0) {
|
||||
val bitmap =
|
||||
Bitmap.createBitmap(measuredWidth, measuredHeight, Bitmap.Config.ARGB_8888)
|
||||
val canvas = Canvas(bitmap)
|
||||
draw(canvas)
|
||||
canvas.save()
|
||||
bitmap
|
||||
} else null
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
@ -1334,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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -16,7 +16,6 @@ import com.gh.gamecenter.common.viewholder.FooterViewHolder
|
||||
import com.gh.gamecenter.adapter.viewholder.GameViewHolder
|
||||
import com.gh.gamecenter.common.baselist.ListAdapter
|
||||
import com.gh.gamecenter.common.utils.*
|
||||
import com.gh.gamecenter.common.view.DrawableView
|
||||
import com.gh.gamecenter.core.utils.*
|
||||
import com.gh.gamecenter.databinding.GameItemBinding
|
||||
import com.gh.gamecenter.databinding.PopupHistoryOptionBinding
|
||||
@ -150,11 +149,6 @@ class HistoryGameListAdapter(context: Context, private val mViewModel: HistoryGa
|
||||
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
|
||||
|
||||
}
|
||||
mPopupBinding?.checkAllCb?.setCompoundDrawablesWithIntrinsicBounds(
|
||||
DrawableView.getCheckSelectorDrawable(
|
||||
mContext
|
||||
), null, null, null
|
||||
)
|
||||
mPopupBinding?.checkAllCb?.setOnClickListener {
|
||||
if (mPopupBinding?.checkAllCb?.isChecked == true) {
|
||||
selectItems.clear()
|
||||
|
||||
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -138,6 +138,7 @@ class HomeGameItemViewHolder(val binding: HomeGameItemBinding) : BaseRecyclerVie
|
||||
} else View.GONE
|
||||
}, 5)
|
||||
binding.gameSubtitleTv.visibility = View.GONE
|
||||
binding.adLabelTv.goneIf(!game.adIconActive)
|
||||
if (game.serverLabel == null && game.subtitle.isNotEmpty() && !game.advanceDownload) {
|
||||
binding.gameSubtitleTv.run {
|
||||
visibility = View.VISIBLE
|
||||
@ -157,7 +158,8 @@ class HomeGameItemViewHolder(val binding: HomeGameItemBinding) : BaseRecyclerVie
|
||||
}
|
||||
}
|
||||
binding.ratingAndTagContainer.post {
|
||||
binding.gameSubtitleTv.maxWidth = binding.ratingAndTagContainer.width + 32F.dip2px()
|
||||
binding.gameSubtitleTv.maxWidth =
|
||||
if (game.adIconActive) binding.ratingAndTagContainer.width + 32F.dip2px() else binding.ratingAndTagContainer.width + 7F.dip2px()
|
||||
}
|
||||
}
|
||||
if (game.advanceDownload) {
|
||||
|
||||
@ -26,10 +26,10 @@ import com.gh.gamecenter.game.rank.RankCollectionAdapter
|
||||
import com.gh.gamecenter.gamecollection.square.GameCollectionListItemData
|
||||
import com.gh.gamecenter.packagehelper.PackageRepository
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.gh.gamecenter.setting.compose.activity.ComposeSettingActivity
|
||||
import com.gh.vspace.VGameItemData
|
||||
import com.gh.vspace.VHelper
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.halo.assistant.fragment.SettingsFragment
|
||||
import com.lightgame.download.DownloadEntity
|
||||
import com.lightgame.utils.Utils
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@ -98,7 +98,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
// 触发列表刷新行为时亦刷新内存中的备用游戏库列表
|
||||
GameSubstituteRepositoryHelper.refreshRepositoryFromLocal()
|
||||
|
||||
if (SPUtils.getBoolean(SettingsFragment.PERSONAL_RECOMMEND_SP_KEY, true)) {
|
||||
if (SPUtils.getBoolean(ComposeSettingActivity.PERSONAL_RECOMMEND_SP_KEY, true)) {
|
||||
getSmartColumn()
|
||||
}
|
||||
|
||||
@ -431,6 +431,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
val homeContent = homeContents[i]
|
||||
val linkType = homeContent.linkType
|
||||
val linkStyle = homeContent.linkColumn?.style ?: ""
|
||||
val adIconActive = homeContent.linkColumn?.adIconActive ?: false
|
||||
|
||||
if (i + 1 < homeContents.size) {
|
||||
val nextItem = homeContents[i + 1]
|
||||
@ -449,7 +450,11 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
}
|
||||
} else if (linkType == "top_game_comment") {
|
||||
val head = HomeItemData()
|
||||
head.columnHead = SubjectEntity(type = linkType, name = "安利墙")
|
||||
head.columnHead = SubjectEntity(
|
||||
type = linkType,
|
||||
name = "安利墙",
|
||||
adIconActive = homeContent.linkColumn?.adIconActive ?: false
|
||||
)
|
||||
mSnapshotItemList.add(LegacyHomeSubjectTransformer.getBlankSpacingItem(HomeItemData()) as HomeItemData)
|
||||
mSnapshotItemList.add(head)
|
||||
|
||||
@ -517,6 +522,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
homePageStyle = homeContent.commonCollection?.homePageStyle ?: ""
|
||||
verticalLine = homeContent.commonCollection?.verticalLine ?: ""
|
||||
commonCollectionList = homeContent.commonCollection?.collectionList
|
||||
this.adIconActive = adIconActive
|
||||
}
|
||||
val head = HomeItemData()
|
||||
head.columnHead = subjectEntity
|
||||
@ -553,7 +559,8 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
}
|
||||
} else if (linkType == "game_list_collection") {
|
||||
val head = HomeItemData()
|
||||
head.columnHead = SubjectEntity(type = linkType, name = homeContent.linkText)
|
||||
head.columnHead =
|
||||
SubjectEntity(type = linkType, name = homeContent.linkText, adIconActive = adIconActive)
|
||||
mSnapshotItemList.add(LegacyHomeSubjectTransformer.getBlankSpacingItem(HomeItemData()) as HomeItemData)
|
||||
mSnapshotItemList.add(head)
|
||||
|
||||
|
||||
@ -12,16 +12,13 @@ import com.gh.gamecenter.common.utils.toDrawable
|
||||
import com.gh.gamecenter.common.view.AsyncCell
|
||||
import com.gh.gamecenter.databinding.HomeAmwayItemBinding
|
||||
import com.gh.gamecenter.entity.AmwayCommentEntity
|
||||
import com.gh.gamecenter.game.GameItemViewHolder
|
||||
import com.gh.gamecenter.gamedetail.rating.edit.RatingEditActivity
|
||||
import java.util.regex.Pattern
|
||||
|
||||
class HomeAmwayItemViewHolder(val binding: HomeAmwayItemBinding) : BaseRecyclerViewHolder<Any>(binding.root) {
|
||||
|
||||
fun bindAmway(amway: AmwayCommentEntity) {
|
||||
val gameEntity = amway.game.toGameEntity()
|
||||
|
||||
binding.gameIcon.displayGameIcon(gameEntity)
|
||||
binding.gameIcon.displayGameIcon(amway.game.toGameEntity())
|
||||
binding.gameName.text = amway.game.name
|
||||
binding.amwayScoreNumber.text = amway.game.star.toString()
|
||||
BindingAdapters.setGameTags(binding.gameTags, amway.game.tag, 2)
|
||||
@ -54,7 +51,6 @@ class HomeAmwayItemViewHolder(val binding: HomeAmwayItemBinding) : BaseRecyclerV
|
||||
ratingName.setTextColor(R.color.text_subtitleDesc.toColor(root.context))
|
||||
all.setTextColor(R.color.text_title.toColor(root.context))
|
||||
}
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, binding.gameSubtitleTv)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -27,12 +27,10 @@ import com.gh.gamecenter.adapter.viewholder.NewsDigestViewHolder;
|
||||
import com.gh.gamecenter.databinding.NewsDigestItemBinding;
|
||||
import com.gh.gamecenter.entity.CommentnumEntity;
|
||||
import com.gh.gamecenter.entity.ConcernEntity;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.LibaoStatusEntity;
|
||||
import com.gh.gamecenter.entity.MeEntity;
|
||||
import com.gh.gamecenter.entity.UserDataLibaoEntity;
|
||||
import com.gh.gamecenter.entity.ViewsEntity;
|
||||
import com.gh.gamecenter.game.GameItemViewHolder;
|
||||
import com.gh.gamecenter.manager.CommentManager;
|
||||
import com.gh.gamecenter.login.user.UserManager;
|
||||
import com.gh.gamecenter.manager.VisitManager;
|
||||
@ -367,9 +365,6 @@ class ConcernAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
viewHolder.binding.newsDigestThumb.displayGameIcon(concernEntity.getGameIcon(), null);
|
||||
}
|
||||
viewHolder.binding.newsDigestTitle.setText(concernEntity.getGameName());
|
||||
|
||||
GameEntity gameEntity = concernEntity.getGame().toGameEntity();
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, viewHolder.binding.gameSubtitleTv, null, null, false);
|
||||
NewsUtils.setNewsPublishOn(viewHolder.binding.newsDigestTime, concernEntity.getTime());
|
||||
|
||||
if ("libao".equals(concernEntity.getType())) {
|
||||
|
||||
@ -22,10 +22,8 @@ import com.gh.gamecenter.common.callback.OnRequestCallBackListener;
|
||||
import com.gh.gamecenter.common.constant.ItemViewType;
|
||||
import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.databinding.LibaoItemBinding;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.LibaoEntity;
|
||||
import com.gh.gamecenter.entity.LibaoStatusEntity;
|
||||
import com.gh.gamecenter.game.GameItemViewHolder;
|
||||
import com.gh.gamecenter.login.user.UserManager;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
@ -240,9 +238,6 @@ class Libao2FragmentAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
}
|
||||
// LibaoUtils.setLiBaoBtnStatusRound(holder.libaoBtnStatus, libaoEntity, true, mContext);
|
||||
}
|
||||
|
||||
GameEntity gameEntity = libaoEntity.getGame().toGameEntity();
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, holder.binding.gameSubtitleTv, null, null, false);
|
||||
}
|
||||
|
||||
private void initFooterViewHolder(FooterViewHolder holder) {
|
||||
|
||||
@ -25,12 +25,10 @@ import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.common.viewholder.FooterViewHolder;
|
||||
import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder;
|
||||
import com.gh.gamecenter.databinding.LibaoItemBinding;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.LibaoEntity;
|
||||
import com.gh.gamecenter.entity.LibaoStatusEntity;
|
||||
import com.gh.gamecenter.entity.MeEntity;
|
||||
import com.gh.gamecenter.entity.UserDataLibaoEntity;
|
||||
import com.gh.gamecenter.game.GameItemViewHolder;
|
||||
import com.gh.gamecenter.login.user.UserManager;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
@ -263,9 +261,6 @@ class Libao3FragmentAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder>
|
||||
|
||||
holder.binding.libaoBtnStatus.setText("复制");
|
||||
holder.binding.libaoBtnStatus.setBackgroundResource(R.drawable.button_normal_round_style);
|
||||
|
||||
GameEntity gameEntity = libaoEntity.getGame().toGameEntity();
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, holder.binding.gameSubtitleTv, null, null, false);
|
||||
} else if (viewHolder instanceof FooterViewHolder) {
|
||||
initFooterViewHolder((FooterViewHolder) viewHolder);
|
||||
}
|
||||
|
||||
@ -20,12 +20,10 @@ import com.gh.gamecenter.common.utils.ExtensionsKt;
|
||||
import com.gh.gamecenter.core.utils.DisplayUtils;
|
||||
import com.gh.gamecenter.core.utils.UrlFilterUtils;
|
||||
import com.gh.gamecenter.databinding.LibaoItemBinding;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.LibaoEntity;
|
||||
import com.gh.gamecenter.entity.MeEntity;
|
||||
import com.gh.gamecenter.entity.UserDataLibaoEntity;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
import com.gh.gamecenter.game.GameItemViewHolder;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter;
|
||||
|
||||
@ -170,8 +168,6 @@ public class LibaoHistoryAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
LibaoUtils.setLiBaoBtnStatusRound(viewHolder.binding.libaoBtnStatus,
|
||||
libaoEntity, true, mContext);
|
||||
|
||||
GameEntity gameEntity = libaoEntity.getGame().toGameEntity();
|
||||
GameItemViewHolder.initGameSubtitle(gameEntity, viewHolder.binding.gameSubtitleTv, null, null, false);
|
||||
} else {
|
||||
FooterViewHolder viewHolder = (FooterViewHolder) holder;
|
||||
viewHolder.initFooterViewHolder(isLoading, isNetworkError, isOver, v -> {
|
||||
|
||||
@ -18,7 +18,6 @@ import com.gh.gamecenter.databinding.LibaoItemBinding
|
||||
import com.gh.gamecenter.entity.LibaoEntity
|
||||
import com.gh.gamecenter.entity.LibaoStatusEntity
|
||||
import com.gh.gamecenter.common.retrofit.Response
|
||||
import com.gh.gamecenter.game.GameItemViewHolder
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@ -225,10 +224,6 @@ class LibaoNewAdapter(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
libaoEntity.game?.toGameEntity()?.let {
|
||||
GameItemViewHolder.initGameSubtitle(it, holder.binding.gameSubtitleTv)
|
||||
}
|
||||
}
|
||||
|
||||
fun getLibaoListSize(): Int {
|
||||
|
||||
@ -126,7 +126,7 @@ class MyFollowedGameAdapter(context: Context, var mViewModel: MyFollowedGameView
|
||||
}
|
||||
}
|
||||
gameDesSpace.post {
|
||||
gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
|
||||
gameSubtitleTv.maxWidth = gameDesSpace.width
|
||||
}
|
||||
}
|
||||
if (gameEntity.advanceDownload) {
|
||||
|
||||
@ -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
|
||||
@ -127,7 +128,7 @@ class MyReservationAdapter(context: Context, var mViewModel: MyReservationViewMo
|
||||
}
|
||||
}
|
||||
gameDesSpace.post {
|
||||
gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
|
||||
gameSubtitleTv.maxWidth = gameDesSpace.width
|
||||
}
|
||||
}
|
||||
if (gameEntity.advanceDownload) {
|
||||
|
||||
@ -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
|
||||
@ -165,7 +166,7 @@ open class PlayedGameAdapter(
|
||||
}
|
||||
}
|
||||
gameDesSpace.post {
|
||||
gameSubtitleTv.maxWidthExcludeZero(gameDesSpace.width)
|
||||
gameSubtitleTv.maxWidth = gameDesSpace.width
|
||||
}
|
||||
}
|
||||
if (gameEntity.advanceDownload) {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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, "我的光环-账号安全") {}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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, "我的光环-账号安全") {}
|
||||
}
|
||||
|
||||
@ -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, "我的光环-账号安全") {}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
@ -756,7 +757,7 @@ public interface ApiService {
|
||||
* 新的设置接口
|
||||
*/
|
||||
@GET("settings")
|
||||
Single<NewApiSettingsEntity> getNewSettings(@Query("version") String version, @Query("channel") String channel);
|
||||
Single<NewSettingsEntity> getNewSettings(@Query("version") String version, @Query("channel") String channel);
|
||||
|
||||
/**
|
||||
* 获取新的配置信息,因为旧的已经太大了避免冲突
|
||||
@ -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);
|
||||
|
||||
|
||||
/**
|
||||
* 修改开服信息
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user