Commit 62ffa5ee authored by jyx's avatar jyx

代码优化

parent 9c52849b
......@@ -8,6 +8,7 @@ import com.bytedance.sdk.openadsdk.mediation.ad.IMediationNativeAdInfo
import com.bytedance.sdk.openadsdk.mediation.ad.MediationAdSlot
import com.bytedance.sdk.openadsdk.mediation.ad.MediationNativeToBannerListener
import com.mints.helivideo.BuildConfig
import com.mints.helivideo.MintsApplication
import com.mints.helivideo.manager.UserManager
import com.mints.helivideo.utils.LogUtil
import com.mints.helivideo.utils.UIUtils
......@@ -36,7 +37,10 @@ object BannerManager {
var adSlot: AdSlot = AdSlot.Builder()
.setCodeId(BuildConfig.GROMORE_BANNER_CODE)
// .setImageAcceptedSize(UIUtils.dp2px(weakActivity?.get(), 300f), UIUtils.dp2px(weakActivity?.get(), 45f)) // 单位px
.setImageAcceptedSize(UIUtils.dp2px(weakActivity?.get(), 300f), 0) // 单位px
.setImageAcceptedSize(
UIUtils.getAdWidth2(MintsApplication.getContext()).toInt(),
0
) // 单位px
.setUserID("1234")
.setMediationAdSlot(
MediationAdSlot.Builder()
......@@ -45,7 +49,7 @@ object BannerManager {
* 如果未使用banner混出信息流功能,则无需设置MediationNativeToBannerListener。
* 如要使用混出功能,可参考AdUtils.kt类中getCSJMBannerViewFromNativeAd函数部分。
*/
.setMediationNativeToBannerListener(object: MediationNativeToBannerListener() {
.setMediationNativeToBannerListener(object : MediationNativeToBannerListener() {
override fun getMediationBannerViewFromNativeAd(adInfo: IMediationNativeAdInfo): View? {
return null
}
......
......@@ -4,12 +4,10 @@ import android.os.Bundle
import android.view.KeyEvent
import android.view.View
import com.mints.helivideo.R
import com.mints.helivideo.mvp.model.OrderRecordBean
import com.mints.helivideo.ui.activitys.base.BaseActivity
import com.mints.helivideo.utils.SpanUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_nine_know.*
import kotlinx.android.synthetic.main.fragment_main_my.*
/**
* 描述:9宫格手机
......
......@@ -38,7 +38,7 @@ class NineContinueDialog(
val tv_nine_next = findViewById<TextView>(R.id.tv_nine_next)
val tv_nine_close = findViewById<ImageView>(R.id.tv_nine_close)
tv_nine_text.text = String.format("再看%d即可抽奖", watchCount)
tv_nine_text.text = String.format("再看%d即可抽奖", watchCount)
listener.setDialog(this)
tv_nine_next.setOnClickListener(listener)
......
......@@ -290,4 +290,8 @@ public class UIUtils {
public static float getAdWidth(Context context) {
return getScreenWidth(context) - dp2px(60);
}
public static float getAdWidth2(Context context) {
return getScreenWidth(context) - dp2px(30);
}
}
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#90000000"
android:orientation="vertical">
<LinearLayout
android:layout_width="250dp"
android:layout_height="170dp"
android:layout_centerInParent="true"
android:background="@mipmap/bg_vip_count"
android:orientation="vertical">
<TextView
android:id="@+id/tv_nine_know_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="34dp"
android:gravity="center"
android:textColor="@color/black"
android:textSize="16sp"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="每次解锁剧集,广告次数+1"
android:textColor="@color/gray"
android:textSize="11sp"></TextView>
<TextView
android:id="@+id/tv_nine_know_next"
android:layout_width="200dp"
android:layout_height="44dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="24dp"
android:layout_marginBottom="18dp"
android:background="@mipmap/bg_vip_count_btn"
android:gravity="center"
android:text="知道了"
android:textColor="#6C4D22"
android:textSize="14sp" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true">
<ImageView
android:layout_width="250dp"
android:layout_height="170dp"
android:scaleType="fitXY"
android:src="@mipmap/bg_vip_count" />
<LinearLayout
android:layout_width="250dp"
android:layout_height="170dp"
android:orientation="vertical">
<TextView
android:id="@+id/tv_nine_know_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="34dp"
android:gravity="center"
android:textColor="@color/black"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="每次解锁剧集,广告次数+1"
android:textColor="@color/gray" />
<TextView
android:id="@+id/tv_nine_know_next"
android:layout_width="200dp"
android:layout_height="44dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="24dp"
android:layout_marginBottom="18dp"
android:background="@mipmap/bg_vip_count_btn"
android:gravity="center"
android:text="知道了"
android:textColor="#6C4D22"
android:textSize="14sp" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
......@@ -98,29 +98,24 @@
android:overScrollMode="never" />
</LinearLayout>
<LinearLayout
<FrameLayout
android:id="@+id/fl_main_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="45dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:text="分类"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
<FrameLayout
android:id="@+id/fl_main_banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginLeft="4dp" />
</LinearLayout>
android:layout_gravity="center_vertical"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="45dp"
android:layout_marginLeft="16dp"
android:gravity="center"
android:text="分类"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold" />
</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