Commit 62ffa5ee authored by jyx's avatar jyx

代码优化

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