Compare commits
31 Commits
v5.30.0-95
...
v5.30.6-95
| Author | SHA1 | Date | |
|---|---|---|---|
| 94ffe5a86f | |||
| c3ddd28bad | |||
| eab8bc846c | |||
| 3d322b29c1 | |||
| dcfc2f44cb | |||
| 3afae78477 | |||
| b03df595bc | |||
| 1c35982db0 | |||
| 52f71dc79e | |||
| a88500576f | |||
| 058eaf0a4a | |||
| 71318fa9ef | |||
| 05b4896d6e | |||
| 7f40e45ef2 | |||
| 412ea87668 | |||
| dc40f81ff2 | |||
| d593c54262 | |||
| b1e5d48098 | |||
| 77ee092b5b | |||
| c65147e309 | |||
| 1ff2bb0bcc | |||
| 89ecf09b55 | |||
| 2cfb227c22 | |||
| f34adc8e6d | |||
| 8606c8f87a | |||
| caf2dbacf9 | |||
| 9587336b31 | |||
| e1c2b2027a | |||
| c5ff26c879 | |||
| 9690a695d4 | |||
| 78e9c43f24 |
@ -60,9 +60,6 @@ object AdDelegateHelper {
|
||||
private val mGameSearchAdList: ArrayList<AdConfig> by lazy { arrayListOf() }
|
||||
private var mVGameLaunchAd: AdConfig? = null
|
||||
|
||||
private var mIsCsjRequired: Boolean = false // 是否需要初始化穿山甲 SDK
|
||||
private var mIsBeiziRequired: Boolean = false // 师傅需要初始化 Beizi SDK
|
||||
|
||||
private const val AD_SDK_CSJ = "穿山甲"
|
||||
private const val AD_SDK_BEIZI = "倍孜"
|
||||
private const val AD_TYPE_SDK = "third_party_ads" // 第三方 SDK 广告
|
||||
@ -73,11 +70,32 @@ object AdDelegateHelper {
|
||||
HaloApp.getInstance().getSharedPreferences("AdConfig", Context.MODE_PRIVATE)
|
||||
}
|
||||
|
||||
fun initAdSdk(context: Context) {
|
||||
// 初始化 Beizi
|
||||
if (mBeiziAdImpl == null) {
|
||||
mBeiziAdImpl =
|
||||
ARouter.getInstance().build(RouteConsts.provider.beiziAd).navigation() as? IBeiziAdProvider
|
||||
mBeiziAdImpl?.initSDK(context)
|
||||
}
|
||||
|
||||
// 初始化穿山甲
|
||||
if (mCsjAdImpl == null) {
|
||||
mCsjAdImpl =
|
||||
ARouter.getInstance().build(RouteConsts.provider.csjAd).navigation() as? ICsjAdProvider
|
||||
mCsjAdImpl?.initSDK(context, BuildConfig.CSJ_APPID, HaloApp.getInstance().oaid)
|
||||
// 监听亮色/暗色模式切换
|
||||
DarkModeUtils.registerModeChangeListener {
|
||||
val topActivity = CurrentActivityHolder.getCurrentActivity() ?: return@registerModeChangeListener
|
||||
updateThemeStatus(context, DarkModeUtils.isDarkModeOn(topActivity))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求接口获取广告相关配置
|
||||
*/
|
||||
@SuppressLint("CheckResult")
|
||||
fun requestAdConfig(context: Context, isFromRetry: Boolean) {
|
||||
fun requestAdConfig(isFromRetry: Boolean) {
|
||||
// mAdConfigList 不为空不需要重试
|
||||
if (isFromRetry && mAdConfigList != null) {
|
||||
return
|
||||
@ -89,7 +107,7 @@ object AdDelegateHelper {
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe(object : BiResponse<List<AdConfig>>() {
|
||||
override fun onSuccess(data: List<AdConfig>) {
|
||||
handleAdConfig(context, data)
|
||||
handleAdConfig(data)
|
||||
|
||||
// 缓存数据到 SP 供接口请求失败用
|
||||
SPUtils.setString(mAdConfigSp, KEY_CACHE_CONFIG, data.toJson())
|
||||
@ -101,7 +119,7 @@ object AdDelegateHelper {
|
||||
// 若接口请求失败时,从 SP 里获取上次缓存的数据
|
||||
val cachedConfig: List<AdConfig>? = SPUtils.getString(mAdConfigSp, KEY_CACHE_CONFIG).toObject()
|
||||
if (cachedConfig != null) {
|
||||
handleAdConfig(context, cachedConfig)
|
||||
handleAdConfig(cachedConfig)
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -124,7 +142,7 @@ object AdDelegateHelper {
|
||||
/**
|
||||
* 处理广告配置
|
||||
*/
|
||||
fun handleAdConfig(context: Context, configList: List<AdConfig>) {
|
||||
fun handleAdConfig(configList: List<AdConfig>) {
|
||||
for (config in configList) {
|
||||
// 处理返回的数据
|
||||
when (config.location) {
|
||||
@ -133,39 +151,6 @@ object AdDelegateHelper {
|
||||
"game_search" -> config.let { mGameSearchAdList.add(it) }
|
||||
"helper_launch" -> mVGameLaunchAd = config
|
||||
}
|
||||
|
||||
// 根据返回的值里判断是否含有 Beizi 的广告
|
||||
if (!mIsBeiziRequired) {
|
||||
if (config.thirdPartyAd?.sourceName == AD_SDK_BEIZI) {
|
||||
mIsBeiziRequired = true
|
||||
}
|
||||
}
|
||||
|
||||
// 根据返回的值里判断是否含有 穿山甲 的广告
|
||||
if (!mIsCsjRequired) {
|
||||
if (config.thirdPartyAd?.sourceName == AD_SDK_CSJ) {
|
||||
mIsCsjRequired = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化 Beizi
|
||||
if (mIsBeiziRequired && mBeiziAdImpl == null) {
|
||||
mBeiziAdImpl =
|
||||
ARouter.getInstance().build(RouteConsts.provider.beiziAd).navigation() as? IBeiziAdProvider
|
||||
mBeiziAdImpl?.initSDK(context)
|
||||
}
|
||||
|
||||
// 初始化穿山甲
|
||||
if (mIsCsjRequired && mCsjAdImpl == null) {
|
||||
mCsjAdImpl =
|
||||
ARouter.getInstance().build(RouteConsts.provider.csjAd).navigation() as? ICsjAdProvider
|
||||
mCsjAdImpl?.initSDK(context, BuildConfig.CSJ_APPID, HaloApp.getInstance().oaid)
|
||||
// 监听亮色/暗色模式切换
|
||||
DarkModeUtils.registerModeChangeListener {
|
||||
val topActivity = CurrentActivityHolder.getCurrentActivity() ?: return@registerModeChangeListener
|
||||
updateThemeStatus(context, DarkModeUtils.isDarkModeOn(topActivity))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2051,6 +2051,11 @@ object DirectUtils {
|
||||
qqGameId: String
|
||||
) {
|
||||
|
||||
if (activity !is AppCompatActivity || activity.supportFragmentManager.isDestroyed) {
|
||||
ToastUtils.toast("启动QQ小游戏失败,请稍后再试")
|
||||
return
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
ToastUtils.toast("该游戏仅支持安卓5.0及以上设备")
|
||||
return
|
||||
|
||||
@ -135,7 +135,7 @@ object XapkInstaller : XApkUnZipCallback, XApkUnZipOutputFactory {
|
||||
|
||||
override fun onProgress(apk: XApkFile, progress: Float) {
|
||||
val downloadEntity = mDownloadEntityMap[apk.file.path] ?: return
|
||||
downloadEntity.meta[XAPK_UNZIP_PERCENT] = String.format("%.2f", progress * 100)
|
||||
downloadEntity.meta[XAPK_UNZIP_PERCENT] = String.format(Locale.CHINA, "%.2f", progress * 100)
|
||||
downloadEntity.meta[XAPK_UNZIP_STATUS] = XapkUnzipStatus.UNZIPPING.name
|
||||
|
||||
AppExecutor.ioExecutor.execute {
|
||||
|
||||
@ -66,8 +66,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
|
||||
)
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ data class CommonCollectionEntity(
|
||||
val name: String = "",
|
||||
val type: String = "",
|
||||
val style: String = "",
|
||||
val more: Int = 0,
|
||||
@SerializedName("home_page_style")
|
||||
val homePageStyle: String = "horizontal_sliding", //首页样式 (横排滑动:horizontal_sliding 竖排一行两个:1-2)
|
||||
@SerializedName("vertical_line")
|
||||
|
||||
@ -19,26 +19,15 @@ class PrivacyPolicyEntity(
|
||||
data.title = "欢迎来到光环助手"
|
||||
data.topContent = "为提供完整的功能与稳定的服务,光环助手将向你申请开启以下权限:"
|
||||
data.bottomContent =
|
||||
"点击<a href=\"https://resource.ghzs.com/page/permissions/android.html\">查看权限应用场景</a>,你可以在系统设置中关闭授权,但可能会影响部分功能的正常使用"
|
||||
"点击<a href=\"https://resource.ghzs.com/page/privacy_policies/permissions.html\">查看权限应用场景</a>,你可以在系统设置中关闭授权,但可能会影响部分功能的正常使用"
|
||||
val permissions = arrayListOf<PermissionsEntity>()
|
||||
permissions.add(
|
||||
PermissionsEntity(
|
||||
icon = "res:///" + R.drawable.permission_storage,
|
||||
name = "存储权限",
|
||||
intro = "用于下载游戏,以及实现内容缓存提升浏览体验"
|
||||
icon = "res:///" + R.drawable.permission_installed_list,
|
||||
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使用信息提醒",
|
||||
// intro = "向北京有竹居网络技术有限公司(北京字节跳动科技有限公司)提供您的以下信息:设备品牌、型号、软件系统相关信息、安卓(oaid、无线网SSID名称、WiFi路由器MAC地址、设备MAC地址、IMEI、地理位置),用于广告流量统计相关服务。"))
|
||||
data.permissions = permissions
|
||||
return data
|
||||
}
|
||||
|
||||
@ -1013,8 +1013,13 @@ class GameViewModel(application: Application, override var blockData: SubjectRec
|
||||
}
|
||||
if (itemDataList.isEmpty()) {
|
||||
if (subjectEntity.style?.contains("refresh") == true) {
|
||||
subjectEntity.id?.let { changeGameCollectionRefresh(it, false) }
|
||||
return
|
||||
if (subjectEntity.id != null && changeGameCollectionRefresh(subjectEntity.id!!, false)) {
|
||||
// 未加载完毕,则加载下一个游戏单
|
||||
return
|
||||
} else {
|
||||
// 加载完毕,则不显示此游戏单合集
|
||||
continue
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
@ -838,6 +838,7 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
id = homeContent.linkId
|
||||
name = homeContent.linkText
|
||||
style = homeContent.commonCollection?.style
|
||||
more = homeContent.commonCollection?.more
|
||||
homePageStyle = homeContent.commonCollection?.homePageStyle ?: ""
|
||||
verticalLine = homeContent.commonCollection?.verticalLine ?: ""
|
||||
commonCollectionList = homeContent.commonCollection?.collectionList
|
||||
@ -900,8 +901,13 @@ class HomeViewModel(application: Application) : AndroidViewModel(application) {
|
||||
}
|
||||
if (itemDataList.isEmpty()) {
|
||||
if (homeContent.style.contains("refresh")) {
|
||||
changeGameCollectionRefresh(homeContent.linkId, false)
|
||||
return
|
||||
if (changeGameCollectionRefresh(homeContent.linkId, false)) {
|
||||
// 未加载完毕,则加载下一个游戏单
|
||||
return
|
||||
} else {
|
||||
// 加载完毕,则不显示此游戏单合集
|
||||
continue
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ public class NetworkStateReceiver extends BroadcastReceiver {
|
||||
// 奇怪,初次注册监听就会有回调,会导致部分接口短时间内触发两次调用
|
||||
ExtensionsKt.doOnMainProcessOnly(context, () -> {
|
||||
if (NetworkUtils.isNetworkConnected(context)) {
|
||||
AdDelegateHelper.INSTANCE.requestAdConfig(context, true);
|
||||
AdDelegateHelper.INSTANCE.requestAdConfig(true);
|
||||
RegionSettingHelper.getRegionSetting();
|
||||
ReservationRepository.refreshReservationsIfNeeded();
|
||||
EventBus.getDefault().post(new EBNetworkState(NetworkUtils.isNetworkConnected(context)));
|
||||
|
||||
@ -31,15 +31,17 @@ class GameServerTestActivity : DownloadToolbarActivity() {
|
||||
companion object {
|
||||
fun getIntent(context: Context, id: String, title: String, entrance: String, traceEvent: ExposureEvent?): Intent {
|
||||
val bundle = Bundle()
|
||||
val exposureSourceList = traceEvent?.source
|
||||
bundle.putString(GameServersTestFragment.TEST_COLUMN_ID, id)
|
||||
bundle.putString(GameServersTestFragment.TEST_TITLE, title)
|
||||
bundle.putString(EntranceConsts.KEY_ENTRANCE, entrance)
|
||||
if (exposureSourceList is ArrayList) {
|
||||
bundle.putParcelableArrayList(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST, exposureSourceList)
|
||||
} else {
|
||||
bundle.putParcelableArrayList(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST, ArrayList(exposureSourceList))
|
||||
traceEvent?.source?.let {
|
||||
if (it is ArrayList) {
|
||||
bundle.putParcelableArrayList(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST, it)
|
||||
} else {
|
||||
bundle.putParcelableArrayList(EntranceConsts.KEY_EXPOSURE_SOURCE_LIST, ArrayList(it))
|
||||
}
|
||||
}
|
||||
|
||||
return getTargetIntent(
|
||||
context,
|
||||
GameServerTestActivity::class.java,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.gh.vspace
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@ -43,6 +44,7 @@ class HomeRecentVGameViewHolder(var binding: ItemHomeRecentVgameBinding) :
|
||||
}
|
||||
})
|
||||
|
||||
binding.moreTv.visibility = View.VISIBLE
|
||||
binding.moreTv.setOnClickListener {
|
||||
NewFlatLogUtils.logHaloFunManageShow("最近在玩")
|
||||
binding.root.context.startActivity(
|
||||
|
||||
@ -1178,13 +1178,17 @@ object VHelper {
|
||||
|
||||
if (packageName.isNullOrBlank()) return
|
||||
|
||||
vGameDao.delete(packageName)
|
||||
refreshVGameSnapshot()
|
||||
try {
|
||||
vGameDao.delete(packageName)
|
||||
refreshVGameSnapshot()
|
||||
|
||||
if (vGameDao.getAll().isEmpty()) {
|
||||
VBackupHelper.removeAllDatabase()
|
||||
} else {
|
||||
VBackupHelper.backupDBToExternalStorage(HaloApp.getInstance())
|
||||
if (vGameDao.getAll().isEmpty()) {
|
||||
VBackupHelper.removeAllDatabase()
|
||||
} else {
|
||||
VBackupHelper.backupDBToExternalStorage(HaloApp.getInstance())
|
||||
}
|
||||
} catch (e: SQLiteFullException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
val uninstallClosure: () -> Unit = {
|
||||
|
||||
@ -306,9 +306,10 @@ public class HaloApp extends MultiDexApplication {
|
||||
// 获取 settings 配置
|
||||
ExtensionsKt.doOnMainProcessOnly(this, com.gh.common.constant.Config::getGhzsSettings);
|
||||
|
||||
// 获取广告配置
|
||||
// 初始化广告 SDK 并获取广告配置
|
||||
ExtensionsKt.doOnMainProcessOnly(this, () -> {
|
||||
AdDelegateHelper.INSTANCE.requestAdConfig(this, false);
|
||||
AdDelegateHelper.INSTANCE.initAdSdk(this);
|
||||
AdDelegateHelper.INSTANCE.requestAdConfig(false);
|
||||
});
|
||||
|
||||
String localTemporaryDeviceId = SPUtils.getString(Constants.SP_TEMPORARY_DEVICE_ID);
|
||||
|
||||
BIN
app/src/main/res/drawable-xxxhdpi/permission_installed_list.png
Normal file
BIN
app/src/main/res/drawable-xxxhdpi/permission_installed_list.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 949 B |
@ -7,8 +7,8 @@ ext {
|
||||
targetSdkVersion = 28
|
||||
|
||||
// application info (每个大版本之间的 versionCode 增加 20)
|
||||
versionCode = 950
|
||||
versionName = "5.30.0"
|
||||
versionCode = 956
|
||||
versionName = "5.30.6"
|
||||
applicationId = "com.gh.gamecenter"
|
||||
|
||||
// AndroidX
|
||||
|
||||
@ -22,6 +22,8 @@ object CsjAdHelper {
|
||||
|
||||
const val TAG = "CsjAdHelper"
|
||||
|
||||
var mIsInitialed = false
|
||||
|
||||
fun init(context: Context, csjId: String, oaid: String) {
|
||||
|
||||
try {
|
||||
@ -80,10 +82,12 @@ object CsjAdHelper {
|
||||
object : InitCallback {
|
||||
override fun success() {
|
||||
Utils.log(TAG, "穿山甲初始化成功")
|
||||
mIsInitialed = true
|
||||
}
|
||||
|
||||
override fun fail(p0: Int, p1: String?) {
|
||||
Utils.log(TAG, "穿山甲初始化失败, $p0 $p1")
|
||||
mIsInitialed = false
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -116,6 +120,14 @@ object CsjAdHelper {
|
||||
.setAdLoadType(TTAdLoadType.LOAD)// 推荐使用,用于标注此次的广告请求用途为预加载(当做缓存)还是实时加载,方便后续为开发者优化相关策略
|
||||
.build()
|
||||
|
||||
Utils.log(TAG, "请求开屏广告")
|
||||
|
||||
if (!mIsInitialed) {
|
||||
Utils.log(TAG, "初始化未完成,不加载开屏动画")
|
||||
callback.invoke(false)
|
||||
return
|
||||
}
|
||||
|
||||
mTTAdNative.loadSplashAd(adSlot, object : CSJSplashAdListener {
|
||||
override fun onSplashLoadSuccess() {
|
||||
Utils.log(TAG, "开屏广告加载成功")
|
||||
@ -201,7 +213,7 @@ object CsjAdHelper {
|
||||
mTTAdNative.loadNativeExpressAd(adSlot, object : NativeExpressAdListener {
|
||||
// 广告请求失败
|
||||
override fun onError(code: Int, message: String) {
|
||||
Utils.log(TAG, "requestFlowAd 广告请求失败 $message")
|
||||
Utils.log(TAG, "requestFlowAd $code 广告请求失败 $message")
|
||||
callback.invoke(false)
|
||||
}
|
||||
|
||||
|
||||
@ -11,20 +11,15 @@ import com.tencent.qqmini.sdk.launcher.model.MiniAppInfo
|
||||
|
||||
class MiniCustomizedProxyImpl : MiniCustomizedProxy() {
|
||||
|
||||
override fun onAppStateChange(info: MiniAppInfo, appState: Int) {
|
||||
val provider = ARouter
|
||||
.getInstance()
|
||||
.build(RouteConsts.provider.realName)
|
||||
.navigation() as IRealNameProvider
|
||||
|
||||
when(appState) {
|
||||
AppState.STATE_SHOW -> provider.setAppInfo(info.appId, info.name) {
|
||||
QGameHelper.stopMiniApp(AppLoaderFactory.g().context, info, true)
|
||||
}
|
||||
|
||||
AppState.STATE_HIDE -> {}
|
||||
|
||||
AppState.STATE_STOP -> {}
|
||||
}
|
||||
override fun onAppStateChange(info: MiniAppInfo?, appState: Int) {
|
||||
if(info != null && appState == AppState.STATE_SHOW) {
|
||||
val provider = ARouter
|
||||
.getInstance()
|
||||
.build(RouteConsts.provider.realName)
|
||||
.navigation() as IRealNameProvider
|
||||
provider.setAppInfo(info.appId, info.name) {
|
||||
QGameHelper.stopMiniApp(AppLoaderFactory.g().context, info, true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,7 +72,9 @@ class QGameProviderImpl : IQGameProvider<SendAuth.Resp> {
|
||||
}
|
||||
|
||||
override fun stopAllMiniApp(force: Boolean) {
|
||||
QGameHelper.stopAllMiniApp(AppLoaderFactory.g().context, force)
|
||||
AppLoaderFactory.g().context?.let {
|
||||
QGameHelper.stopAllMiniApp(it, force)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -303,7 +303,7 @@ public class Constants {
|
||||
public static final String FORUM_REGULATIONS_NEWS_ID = "5f4db9cc34d44d01b92fd670";
|
||||
|
||||
// 权限使用场景地址
|
||||
public static final String PERMISSION_SCENARIO_ADDRESS = "https://resource.ghzs.com/page/permissions/android.html";
|
||||
public static final String PERMISSION_SCENARIO_ADDRESS = "https://resource.ghzs.com/page/privacy_policies/permissions.html";
|
||||
|
||||
//帮助内容详情
|
||||
public static final String HELP_ADDRESS_DEV = "https://static-web.ghzs.com/ghzs_help_dev/help.html?content=";
|
||||
|
||||
@ -261,7 +261,7 @@ object PermissionHelper {
|
||||
DialogHelper.showDialog(
|
||||
context,
|
||||
title = "权限申请",
|
||||
content = "光环助手将向您申请开启设备的存储权限,以保证能正常使用相关功能。拒绝授权将无法正常使用部分功能。",
|
||||
content = "光环助手将向您申请开启设备的存储权限,以保证游戏下载/图片/视频上传等功能的正常使用。拒绝授权将无法使用该部分功能。",
|
||||
cancelText = "放弃",
|
||||
confirmText = "去授权",
|
||||
cancelClickCallback = {
|
||||
|
||||
@ -21,21 +21,23 @@ object GsonUtils {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@Deprecated("部分 7.1.1 设备会出现 AssertionError,尽量不要在关键功能上使用此方法")
|
||||
fun <T> fromJsonList(json: JSONArray): List<T> {
|
||||
return try {
|
||||
val type = object : TypeToken<List<T>>() {}.type
|
||||
return gson.fromJson(json.toString(), type)
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
listOf()
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@Deprecated("部分 7.1.1 设备会出现 AssertionError,尽量不要在关键功能上使用此方法")
|
||||
fun <T> fromJsonList(json: String): List<T> {
|
||||
return try {
|
||||
val type = object : TypeToken<List<T>>() {}.type
|
||||
gson.fromJson(json, type)
|
||||
} catch (e: Exception) {
|
||||
} catch (e: Throwable) {
|
||||
listOf()
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,10 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler, WeC
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (baseResp.getType() == ConstantsAPI.COMMAND_SENDAUTH && baseResp instanceof SendAuth.Resp) {
|
||||
} else if (baseResp.getType() == ConstantsAPI.COMMAND_SENDAUTH
|
||||
&& baseResp instanceof SendAuth.Resp
|
||||
&& ((SendAuth.Resp) baseResp).state.contains("qqminigame")
|
||||
) {
|
||||
IQGameProvider<SendAuth.Resp> iqGameProvider = (IQGameProvider<SendAuth.Resp>) ARouter.getInstance().build(RouteConsts.provider.qGame).navigation();
|
||||
|
||||
if (iqGameProvider != null) {
|
||||
|
||||
@ -73,7 +73,7 @@ class SortedMessageListAdapter(
|
||||
ovalHint.background = R.drawable.oval_message_hint_bg.toDrawable(mContext)
|
||||
|
||||
titleTv.text = entity.title
|
||||
if (mMessageTypeMap.getOrDefault(entity.type, null) != null && entity.icon.isEmpty()) {
|
||||
if (mMessageTypeMap[entity.type] != null && entity.icon.isEmpty()) {
|
||||
ImageUtils.display(iconIv, mMessageTypeMap[entity.type])
|
||||
} else {
|
||||
ImageUtils.display(iconIv, entity.icon)
|
||||
|
||||
Reference in New Issue
Block a user