Commit 7b6df7ec authored by Li's avatar Li

[李俊岐] 优化广告,优化弹窗

parent 511c1623
...@@ -128,7 +128,7 @@ object MainDialog { ...@@ -128,7 +128,7 @@ object MainDialog {
val ivGetDropBg = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg) val ivGetDropBg = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg)
val ivtitle = mDialogView?.findViewById<ImageView>(R.id.id_img_title) val ivtitle = mDialogView?.findViewById<ImageView>(R.id.id_img_title)
val tvGetDropCount = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count) val tvGetDropCount = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count)
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad) val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
val llcontent2 = mDialogView?.findViewById<LinearLayout>(R.id.id_ll_content_2) val llcontent2 = mDialogView?.findViewById<LinearLayout>(R.id.id_ll_content_2)
val ivGetDropBg2 = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg2) val ivGetDropBg2 = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg2)
val tvGetDropCount2 = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count2) val tvGetDropCount2 = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count2)
...@@ -258,7 +258,6 @@ object MainDialog { ...@@ -258,7 +258,6 @@ object MainDialog {
) )
val ivGetDropBg = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg) val ivGetDropBg = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg)
val ivtitle = mDialogView?.findViewById<ImageView>(R.id.id_img_title)
val tvGetDropCount = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count) val tvGetDropCount = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count)
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad) val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad)
val llcontent2 = mDialogView?.findViewById<LinearLayout>(R.id.id_ll_content_2) val llcontent2 = mDialogView?.findViewById<LinearLayout>(R.id.id_ll_content_2)
...@@ -268,12 +267,11 @@ object MainDialog { ...@@ -268,12 +267,11 @@ object MainDialog {
val ivGetDropBg3 = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg3) val ivGetDropBg3 = mDialogView?.findViewById<ImageView>(R.id.iv_get_drop_bg3)
val tvGetDropCount3 = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count3) val tvGetDropCount3 = mDialogView?.findViewById<TextView>(R.id.tv_get_drop_count3)
var tvget = mDialogView?.findViewById<TextView>(R.id.id_tv_gongxi_get) var tvget = mDialogView?.findViewById<TextView>(R.id.id_tv_gongxi_get)
val btn_get_drop_happy_accept = mDialogView.findViewById<ImageView>(R.id.btn_get_drop_happy_accept)
//3 种子 4 金币 5 加速剂 //3 种子 4 金币 5 加速剂
when (type) { when (type) {
1 -> { 1 -> {
tvget.text = "恭喜获得种子" tvget.text = "恭喜获得种子"
ivtitle.setImageResource(R.mipmap.icon_img_title_get_zhongzi)
llcontent2.visibility = View.GONE llcontent2.visibility = View.GONE
llcontent3.visibility = View.GONE llcontent3.visibility = View.GONE
if (result.seedList?.size == 1) { if (result.seedList?.size == 1) {
...@@ -299,22 +297,19 @@ object MainDialog { ...@@ -299,22 +297,19 @@ object MainDialog {
} }
2 -> { 2 -> {
ivtitle.setImageResource(R.mipmap.icon_img_title_get_coin_)
tvget.text = "恭喜获得金币" tvget.text = "恭喜获得金币"
ivGetDropBg.setImageResource(R.mipmap.icon_coin) ivGetDropBg.setImageResource(R.mipmap.icon_coin)
tvGetDropCount.text = "+${rewardCount}" tvGetDropCount.text = "+${rewardCount}"
} }
3 -> { 3 -> {
ivtitle.setImageResource(R.mipmap.icon_img_title_get_speed_water)
tvget.text = "恭喜获得加速剂" tvget.text = "恭喜获得加速剂"
ivGetDropBg.setImageResource(R.mipmap.icon_speed_water) ivGetDropBg.setImageResource(R.mipmap.icon_speed_water)
tvGetDropCount.text = "+${rewardCount}" tvGetDropCount.text = "+${rewardCount}"
} }
} }
//shwoAd(adType, context, layoutAd) FilterUtils.addClickAlpha(btn_get_drop_happy_accept)
btn_get_drop_happy_accept.setOnClickListener {
mDialogView.findViewById<TextView>(R.id.btn_get_drop_happy_accept).setOnClickListener {
mDialog.dismiss() mDialog.dismiss()
mListener.onCloseViewSuccess(true) mListener.onCloseViewSuccess(true)
} }
...@@ -325,15 +320,6 @@ object MainDialog { ...@@ -325,15 +320,6 @@ object MainDialog {
AdUtils.showFeedAd((context as Activity), adType, layoutAd) AdUtils.showFeedAd((context as Activity), adType, layoutAd)
// AdManager.loadFeedAd(
// ADConfig.AD_IMG_FADE,
// activity,
// ZXADSizeConfig(
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 56,
// ((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt()
// ),
// layouAd
// )
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener { mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) { override fun onDismiss(p0: DialogInterface?) {
onDestroy() onDestroy()
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
<RelativeLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="370dp"> android:layout_height="wrap_content">
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="328dp"
android:layout_height="wrap_content" android:layout_height="274dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="6dp"
android:layout_marginRight="5dp"
android:background="@drawable/icon_base_dialog_bg"> android:background="@drawable/icon_base_dialog_bg">
</RelativeLayout>
<ImageView
android:id="@+id/lv_get_drop_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="70dp"
android:layout_marginRight="@dimen/dp_30"
android:src="@mipmap/icon_new_close" />
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="350dp" android:layout_height="match_parent"
android:layout_alignParentBottom="true" android:layout_centerHorizontal="true">
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="20dp"
>
<ImageView
android:id="@+id/id_img_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:src="@mipmap/icon_top_bg"
android:visibility="gone"/>
<TextView <com.ym.library.widget.FontTextView
android:id="@+id/id_tv_gongxi_get" android:id="@+id/id_tv_gongxi_get"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_74" android:layout_marginTop="5dp"
android:includeFontPadding="false"
android:text="恭喜获得金币" android:text="恭喜获得金币"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="20sp" android:textSize="22sp"
android:visibility="visible" /> android:visibility="visible" />
<LinearLayout <LinearLayout
android:id="@+id/id_ll_content" android:id="@+id/id_ll_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="150dp" android:layout_height="wrap_content"
android:layout_below="@+id/id_tv_gongxi_get" android:layout_below="@+id/id_tv_gongxi_get"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_60" android:layout_marginTop="37dp"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="visible"> android:visibility="visible">
...@@ -88,14 +59,14 @@ ...@@ -88,14 +59,14 @@
android:layout_height="@dimen/dp_60" android:layout_height="@dimen/dp_60"
android:src="@mipmap/icon_coin" /> android:src="@mipmap/icon_coin" />
<TextView <com.ym.library.widget.FontTextView
android:id="@+id/tv_get_drop_count" android:id="@+id/tv_get_drop_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="4dp"
android:textStyle="bold" android:includeFontPadding="false"
android:textColor="@color/color_7C1714" android:textColor="#095100"
android:textSize="30sp" android:textSize="18sp"
tools:text="+40g" /> tools:text="+40g" />
</LinearLayout> </LinearLayout>
...@@ -116,14 +87,14 @@ ...@@ -116,14 +87,14 @@
android:layout_height="@dimen/dp_60" android:layout_height="@dimen/dp_60"
android:src="@mipmap/icon_coin" /> android:src="@mipmap/icon_coin" />
<TextView <com.ym.library.widget.FontTextView
android:id="@+id/tv_get_drop_count2" android:id="@+id/tv_get_drop_count2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="4dp"
android:textColor="@color/color_7C1714" android:includeFontPadding="false"
android:textSize="30sp" android:textColor="#095100"
android:textStyle="bold" android:textSize="18sp"
tools:text="+40g" /> tools:text="+40g" />
</LinearLayout> </LinearLayout>
...@@ -144,40 +115,53 @@ ...@@ -144,40 +115,53 @@
android:layout_height="@dimen/dp_60" android:layout_height="@dimen/dp_60"
android:src="@mipmap/icon_coin" /> android:src="@mipmap/icon_coin" />
<TextView <com.ym.library.widget.FontTextView
android:id="@+id/tv_get_drop_count3" android:id="@+id/tv_get_drop_count3"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" android:layout_marginTop="4dp"
android:textColor="@color/color_7C1714" android:includeFontPadding="false"
android:textSize="30sp" android:textColor="#095100"
android:textStyle="bold" android:textSize="18sp"
tools:text="+40g" /> tools:text="+40g" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<TextView <ImageView
android:id="@+id/btn_get_drop_happy_accept" android:id="@+id/btn_get_drop_happy_accept"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/id_ll_content" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:background="@drawable/btn_selector" /> android:layout_marginBottom="33dp"
android:background="@drawable/icon_dialog_get_showxia_btn" />
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>
<FrameLayout <ImageView
android:id="@+id/layout_get_drop_ad" android:id="@+id/lv_get_drop_close"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="18dp" android:layout_gravity="right"
android:layout_marginTop="5dp" android:src="@mipmap/icon_new_close" />
android:layout_marginRight="18dp"
android:background="@color/white" </FrameLayout>
android:padding="@dimen/dp_10"
android:visibility="gone" /> <include layout="@layout/layout_base_feed_ad" />
<!-- <FrameLayout-->
<!-- android:id="@+id/layout_get_drop_ad"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginLeft="18dp"-->
<!-- android:layout_marginTop="5dp"-->
<!-- android:layout_marginRight="18dp"-->
<!-- android:background="@color/white"-->
<!-- android:padding="@dimen/dp_10"-->
<!-- android:visibility="gone" />-->
</LinearLayout>
</FrameLayout> </LinearLayout>
\ No newline at end of file \ No newline at end of file
...@@ -79,22 +79,13 @@ object AdUtils { ...@@ -79,22 +79,13 @@ object AdUtils {
AdManager.showFeedAd( AdManager.showFeedAd(
AD_IMG_FADE, AD_IMG_FADE,
actionName, actionName,
ZXADSizeConfig( ZXADSizeConfig(Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 10, 260),
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
),
activity, activity,
view view
) )
view?.postDelayed({ view?.postDelayed({
AdManager.loadFeedAdToCache( AdManager.loadFeedAdToCache(AD_IMG_FADE, activity, ZXADSizeConfig(
AD_IMG_FADE, activity, ZXADSizeConfig( Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 10, 260))
// Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 40, 280
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 56,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 40) * 0.66).toInt()
)
)
},15000) },15000)
} catch (e: Exception) { } catch (e: Exception) {
} }
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
android:layout_marginTop="40dp" android:layout_marginTop="40dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:background="#c0c0c0"
android:visibility="gone"> android:visibility="gone">
</FrameLayout> </FrameLayout>
\ No newline at end of file
...@@ -83,11 +83,12 @@ ...@@ -83,11 +83,12 @@
<FrameLayout <FrameLayout
android:id="@+id/id_ad_frame_view" android:id="@+id/id_ad_frame_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="260dp"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
android:layout_marginLeft="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="10dp" android:layout_marginBottom="10dp"
android:padding="5dp"
android:visibility="gone" /> android:visibility="gone" />
<LinearLayout <LinearLayout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment