Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
This commit is contained in:
@ -30,7 +30,6 @@ import com.halo.assistant.fragment.SettingsFragment.AUTO_INSTALL_SP_KEY
|
||||
import com.lightgame.download.DataWatcher
|
||||
import com.lightgame.download.DownloadEntity
|
||||
import com.lightgame.download.DownloadStatus
|
||||
import com.lightgame.utils.Utils
|
||||
import io.reactivex.disposables.Disposable
|
||||
import kotlinx.android.synthetic.main.dialog_device_remind.view.*
|
||||
import java.lang.ref.WeakReference
|
||||
@ -179,7 +178,7 @@ class DeviceRemindDialog(context: Context, val entity: DeviceDialogEntity, val g
|
||||
|
||||
inner class BannerAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
return object : RecyclerView.ViewHolder(LayoutInflater.from(context).inflate(R.layout.item_ad_banner, parent, false)) {}
|
||||
return object : RecyclerView.ViewHolder(LayoutInflater.from(context).inflate(R.layout.item_device_remind_banner, parent, false)) {}
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = if (mDatas.size == 1) mDatas.size else Int.MAX_VALUE
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.gh.common.exposure
|
||||
|
||||
import com.gh.common.constant.Constants
|
||||
import com.gh.common.util.PackageUtils
|
||||
import com.gh.common.util.toObject
|
||||
import com.gh.gamecenter.entity.ApkEntity
|
||||
@ -15,6 +16,11 @@ object ExposureUtils {
|
||||
traceEvent: ExposureEvent?,
|
||||
downloadType: DownloadType): ExposureEvent {
|
||||
val gameEntity = entity.clone()
|
||||
gameEntity.id = if (entity.id.contains(Constants.GAME_ID_DIVIDER)) {
|
||||
entity.id.split(Constants.GAME_ID_DIVIDER).toTypedArray()[0]
|
||||
} else {
|
||||
entity.id
|
||||
}
|
||||
gameEntity.platform = platform
|
||||
gameEntity.downloadType = downloadType.toString()
|
||||
val exposureEvent = ExposureEvent.createEvent(gameEntity = gameEntity,
|
||||
|
||||
@ -3,6 +3,7 @@ package com.gh.common.util;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
|
||||
import com.gh.common.constant.Constants;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.entity.NewsDetailEntity;
|
||||
import com.gh.gamecenter.manager.DataCollectionManager;
|
||||
@ -32,7 +33,7 @@ public class DataCollectionUtils {
|
||||
public static void uploadDownload(Context context, DownloadEntity downloadEntity, String status) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("game", downloadEntity.getName());
|
||||
map.put("game_id", downloadEntity.getGameId());
|
||||
map.put("game_id", downloadEntity.getRealGameId(Constants.GAME_ID_DIVIDER));
|
||||
if (downloadEntity.isPluggable()) {
|
||||
map.put("method", "插件化");
|
||||
map.put("btn_status", "插件化");
|
||||
|
||||
@ -221,7 +221,7 @@ object DownloadObserver {
|
||||
}
|
||||
|
||||
ExposureUtils.logADownloadCompleteExposureEvent(
|
||||
GameEntity(downloadEntity.getRealGameId(Constants.GAME_ID_DIVIDER), downloadEntity.name),
|
||||
GameEntity(id = downloadEntity.getRealGameId(Constants.GAME_ID_DIVIDER), mName = downloadEntity.name),
|
||||
downloadEntity.platform,
|
||||
downloadEntity.exposureTrace,
|
||||
type)
|
||||
|
||||
@ -443,7 +443,7 @@ class DescAdapter(context: Context,
|
||||
MtaHelper.onEvent("历史版本", "进入", gameName)
|
||||
MtaHelper.onEvent("游戏详情_新", "更新内容_历史版本", gameName)
|
||||
val intent = HistoryApkListActivity.getIntent(mContext, mViewModel.game
|
||||
?: GameEntity(), mEntrance, "更新内容")
|
||||
?: GameEntity(), mEntrance, "游戏详情[${gameName}]:更新内容")
|
||||
mContext.startActivity(intent)
|
||||
}
|
||||
holder.binding.historyVersionTv.visibility = if (updateContent?.historyApkStatus == "on" && updateContent.historyApkCount != 0) View.VISIBLE else View.GONE
|
||||
|
||||
@ -25,7 +25,9 @@ import com.lightgame.download.DownloadEntity
|
||||
import com.lightgame.download.DownloadStatus
|
||||
import com.lightgame.utils.Utils
|
||||
|
||||
class HistoryApkListAdapter(context: Context, private var mViewModel: HistoryApkListViewModel) : ListAdapter<GameEntity>(context) {
|
||||
class HistoryApkListAdapter(context: Context,
|
||||
private var mViewModel: HistoryApkListViewModel,
|
||||
private var mEntrance: String) : ListAdapter<GameEntity>(context) {
|
||||
|
||||
private var mExpandSparseBooleanArray = SparseBooleanArray()
|
||||
private var mDescExpandedMarginRight = -1
|
||||
@ -74,7 +76,7 @@ class HistoryApkListAdapter(context: Context, private var mViewModel: HistoryApk
|
||||
gameEntity,
|
||||
0,
|
||||
this@HistoryApkListAdapter,
|
||||
"历史版本",
|
||||
"$mEntrance+(历史版本)",
|
||||
"",
|
||||
null,
|
||||
object : EmptyCallback {
|
||||
|
||||
@ -84,7 +84,7 @@ class HistoryApkListFragment : ListFragment<GameEntity, HistoryApkListViewModel>
|
||||
|
||||
override fun provideListAdapter(): ListAdapter<*> {
|
||||
if (mAdapter == null) {
|
||||
mAdapter = HistoryApkListAdapter(requireContext(), mViewModel!!)
|
||||
mAdapter = HistoryApkListAdapter(requireContext(), mViewModel!!, mEntrance)
|
||||
}
|
||||
return mAdapter!!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user