diff --git a/app/src/main/java/com/gh/common/view/DownloadDialog.java b/app/src/main/java/com/gh/common/view/DownloadDialog.java index ec7564bcb9..38997564fc 100644 --- a/app/src/main/java/com/gh/common/view/DownloadDialog.java +++ b/app/src/main/java/com/gh/common/view/DownloadDialog.java @@ -16,6 +16,7 @@ import android.widget.PopupWindow; import android.widget.TextView; import com.gh.common.exposure.ExposureEvent; +import com.gh.common.util.DirectUtils; import com.gh.common.util.DisplayUtils; import com.gh.common.util.PackageUtils; import com.gh.common.util.PlatformUtils; @@ -27,6 +28,7 @@ import com.gh.gamecenter.entity.ApkEntity; import com.gh.gamecenter.entity.ApkLink; import com.gh.gamecenter.entity.GameCollectionEntity; import com.gh.gamecenter.entity.GameEntity; +import com.gh.gamecenter.entity.LinkEntity; import com.gh.gamecenter.eventbus.EBDownloadStatus; import com.gh.gamecenter.eventbus.EBPackage; import com.gh.gamecenter.eventbus.EBReuse; @@ -68,6 +70,7 @@ public class DownloadDialog implements OnCollectionCallBackListener { private PlatformPagerAdapter adapter; private LinearLayout dialog_ll_hint; private LinearLayout dialog_ll_collection; + private TextView dialogAd; private ViewPager collectionViewPager; private PlatformPagerAdapter collectionAdapter; private DataWatcher dataWatcher = new DataWatcher() { @@ -153,6 +156,23 @@ public class DownloadDialog implements OnCollectionCallBackListener { dialog_ll_collection = contentView.findViewById(R.id.dialog_ll_collection); dialog_ll_collection_hint = contentView.findViewById(R.id.dialog_ll_collection_hint); collectionViewPager = contentView.findViewById(R.id.dialog_collection_viewPager); + dialogAd = contentView.findViewById(R.id.dialog_ad); + + LinkEntity downloadAd = gameEntity.getDownloadAd(); + if (downloadAd != null) { + dialogAd.setVisibility(View.VISIBLE); + dialogAd.setText(downloadAd.getTitle()); + dialogAd.setOnClickListener(v -> { + if ("imprint".equals(downloadAd.getType())) { + // todo show imprint dialog + } else { + DirectUtils.directToLinkPage( + mContext, + downloadAd, + entrance, "下载多平台弹窗"); + } + }); + } isLoadPlatform = false; diff --git a/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt index 5ed41697f3..88adff2d08 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/ApkEntity.kt @@ -21,7 +21,8 @@ data class ApkEntity(@SerializedName("package") var isActive: Boolean = true, var force: Boolean = false, var apkLink: ApkLink? = null, - var plugin: String? = ""/*控制是否显示插件化 默认:open,取值有:open/only_index/only_game/close*/) : Parcelable { + var plugin: String? = "",/*控制是否显示插件化 默认:open,取值有:open/only_index/only_game/close*/ + var time: Long? = null) : Parcelable { fun getPlatform(): String? { if (TextUtils.isEmpty(platform)) { return "官方版" diff --git a/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt index 49571c4ac2..d7f75f12b3 100644 --- a/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt +++ b/app/src/main/java/com/gh/gamecenter/entity/GameEntity.kt @@ -69,7 +69,9 @@ data class GameEntity( // 用于开服表标记是否为置顶项目 @SerializedName("is_fixed_top") var fixedTop: Boolean? = false, - var fixedTopHint: Boolean? = false) : Parcelable { + var fixedTopHint: Boolean? = false, + @SerializedName("download_notice") + val downloadAd: LinkEntity? = null) : Parcelable { @IgnoredOnParcel private var entryMap: ArrayMap? = ArrayMap() diff --git a/app/src/main/res/layout/game_download_dialog.xml b/app/src/main/res/layout/game_download_dialog.xml index 4a074e79aa..165b300f2c 100644 --- a/app/src/main/res/layout/game_download_dialog.xml +++ b/app/src/main/res/layout/game_download_dialog.xml @@ -13,14 +13,23 @@ android:clickable = "true" android:orientation = "vertical" > - + + + + +