Commit 4ec161d4 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 646724d8
......@@ -7,6 +7,7 @@ import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.utils.LogUtil
/**
* banner管理
......@@ -30,7 +31,7 @@ object BannerManager {
.setSupportDeepLink(true)
.setAdCount(1) //请求广告数量为1到3条
.setExpressViewAcceptedSize(viewWidth, viewHeight) //期望模板广告view的size,单位dp
.setImageAcceptedSize(640, 320) //这个参数设置即可,不影响模板广告的size
.setImageAcceptedSize(viewWidth.toInt(), viewHeight.toInt()) //这个参数设置即可,不影响模板广告的size
.build()
it.loadBannerExpressAd(adSlot, object : TTAdNative.NativeExpressAdListener {
override fun onNativeExpressAdLoad(ads: MutableList<TTNativeExpressAd>?) {
......@@ -42,7 +43,8 @@ object BannerManager {
}
override fun onError(code: Int, msg: String) {
frameLayout?.removeAllViews()
LogUtil.d("BannerManager","onError code:${code} msg:${msg}")
// frameLayout?.removeAllViews()
}
})
}
......@@ -61,6 +63,7 @@ object BannerManager {
override fun onRenderSuccess(view: View, p1: Float, p2: Float) {
frameLayout?.let {
it.visibility=View.VISIBLE
it.removeAllViews()
it.addView(view)
}
......
......@@ -17,7 +17,7 @@ public class TtCsjAdManager {
public static final String TT_AD_NAME = Constant.MINTS_APP_NAME;
/*banner*/
public static final String TT_AD_BANNER_MY = "945653342";// 个人中心
public static final String TT_AD_BANNER_MY = "945661050";// 个人中心
/*激励视频*/
public static final String TT_AD_VEDIO_MAIN_DEV = "945561938";// 开发使用
......
......@@ -49,7 +49,7 @@ class LoginPresenter : BasePresenter<LoginView>() {
val message: String = baseResponse.getMessage()
when (code) {
200 -> {
view.sendCodeSuc()
}
else -> {
view.showToast(message)
......
......@@ -2,9 +2,13 @@ package com.mints.goodmoney.ui.activitys
import android.os.Bundle
import android.view.View
import android.view.View.OnLongClickListener
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.utils.ToastUtil
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.ConstantUtil
import kotlinx.android.synthetic.main.activity_aboutus.*
import kotlinx.android.synthetic.main.header_layout.*
......@@ -26,6 +30,11 @@ class AboutusActivity : BaseActivity(), View.OnClickListener {
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
ivAboutasIcon.setOnLongClickListener(OnLongClickListener {
ToastUtil.showLong(context, CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME"))
true
})
initListener()
}
......
......@@ -160,18 +160,18 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
// 防止banner刷新太快
if (AntiShake.check(fl_my_banner?.id)) return
BannerManager.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_my_banner, 560f, 160f)
BannerManager.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_my_banner, 600f, 500f)
}
}
override fun onDestroyView() {
fl_my_banner?.removeAllViews()
item_clock_signview.onDestory()
super.onDestroyView()
}
override fun onDestroy() {
super.onDestroy()
fl_my_banner?.removeAllViews()
BxmManager.onDestory()
BannerManager.onDestroy()
myPresenter.detachView()
......
......@@ -30,6 +30,7 @@
android:textSize="13sp" />
<ImageView
android:id="@+id/ivAboutasIcon"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_horizontal"
......
......@@ -40,8 +40,11 @@
<FrameLayout
android:id="@+id/fl_my_banner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal" />
android:layout_height="280dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:visibility="gone" />
<include layout="@layout/item_fragment_main_my_promotions" />
......
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