Commit 8f12c68e authored by 张释方's avatar 张释方

更新小满科技

parent 171b3485
......@@ -5,6 +5,7 @@ import com.mints.goodmoney.manager.UserManager
object Constant {
/**
* 首次弹出权限声明
*/
......@@ -89,6 +90,7 @@ object Constant {
const val MAIN_CUR_COIN = "main_cur_coin" //当前金币展示
const val MAIN_EXTRA_ID = "main_extra_id" //额外ID
const val MAIN_CARRIER_TYPE = "main_carrier_type" //载体
const val MAIN_CARRIER_TITLE = "main_carrier_title" //载体
const val MAIN_AID = "main_aid" // 体验安装过APP的aid
......@@ -183,7 +185,7 @@ object Constant {
// 热门活动类型
//小满
const val HOT_ACTIVITY_SHEEP="TO_XMKJ"
const val HOT_ACTIVITY_SHEEP = "TO_XMKJ"
const val HOT_ACTIVITY_WATER = "water"
const val HOT_ACTIVITY_WALK = "walk"
......
package com.mints.goodmoney.manager
import android.app.Application
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.widget.ImageView
......@@ -40,7 +41,7 @@ object XmManager {
}
fun loadMater(placeid: String) {
if (placeMateId.equals("")) {
if (TextUtils.isEmpty(placeMateId)) {
val tm: MaterialTm by lazy { MaterialTm() }
tm!!.loadMaterialData(UserManager.getInstance().userID, placeid, object : MaterialTm.Callback {
//对应PlaceID会有对应的素材
......@@ -57,6 +58,8 @@ object XmManager {
})
} else {
AdSdk.exposure(UserManager.getInstance().userID, placeid, placeMateId, materialId);
LogUtil.d("******exposure*********${UserManager.getInstance().userID}******$placeMateId********$materialId****************$placeid**")
}
}
......@@ -67,7 +70,7 @@ object XmManager {
*/
fun exprotClick(placeid: String) {
AdSdk.click(UserManager.getInstance().userID, placeid, materialId, materialId);
Log.d("loadMater", "******exprotClick*******${UserManager.getInstance().userID}*******$placeMateId********$materialId******$placeid")
LogUtil.d( "******exprotClick*******${UserManager.getInstance().userID}*******$placeMateId********$materialId******$placeid")
}
}
\ No newline at end of file
......@@ -31,17 +31,17 @@ import com.qq.e.ads.nativ.express2.NativeExpressADData2
import com.qq.e.ads.rewardvideo.RewardVideoAD
import com.qq.e.ads.rewardvideo.RewardVideoADListener
import com.qq.e.comm.util.AdError
import kotlinx.android.synthetic.main.activity_layout_xiaoman2.*
import kotlinx.android.synthetic.main.activity_layout_xiaoman.*
import kotlinx.android.synthetic.main.header_layout.*
class XiaomanActivity : BaseActivity(), View.OnClickListener {
private var carrierType = ""//传入载体
private var carrierType_title = ""//传入载体
private var isPlaySuccess = false
private var rewardVideoAD: RewardVideoAD? = null
private var unifiedBannerView: UnifiedBannerView? = null
private val TAG = "XiaomanActivity2"
private val TAG = "XiaomanActivity"
private val campaignFragment: CampaignFragment? = null
private var mttRewardVideoAd: TTRewardVideoAd? = null
......@@ -54,16 +54,20 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
override fun getContentViewLayoutID(): Int {
return R.layout.activity_layout_xiaoman2
return R.layout.activity_layout_xiaoman
}
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
carrierType = it.getString(Constant.MAIN_CARRIER_TYPE, "")
carrierType_title=it.getString(Constant.MAIN_CARRIER_TITLE, "")
}
}
override fun initViewsAndEvents() {
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
tv_title.text = carrierType_title
initListener()
/**
* CampaignFragment.newInstance("这里为userId")
......@@ -128,7 +132,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
}
private fun initListener() {
ivXiaomanBack.setOnClickListener(this)
iv_left_icon.setOnClickListener(this)
}
/**
......@@ -541,7 +545,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
override fun onClick(v: View) {
when (v.id) {
R.id.ivXiaomanBack -> {
R.id.iv_left_icon -> {
finish()
}
}
......
......@@ -245,7 +245,7 @@ class MyFragment : BaseFragment(),
// 生成热门活动数据
private fun generateGridData(data: List<BannerBean.ListBean>) {
val inflater = LayoutInflater.from(mContext)
for (i in 0 until data.size) {
for (i in 0..data.size-1) {
if (data.get(i).toUrl.equals(Constant.HOT_ACTIVITY_SHEEP)) {
XmManager.loadMater(data.get(i).xmPlaceId)
break
......@@ -949,6 +949,7 @@ class MyFragment : BaseFragment(),
Constant.HOT_ACTIVITY_SHEEP -> {
XmManager.exprotClick(hotBean.xmPlaceId)
val bundle = Bundle()
bundle.putString(Constant.MAIN_CARRIER_TITLE, hotBean.title)
bundle.putString(Constant.MAIN_CARRIER_TYPE, hotBean.xmPlaceId)
readyGo(XiaomanActivity::class.java, bundle)
}
......
......@@ -2,31 +2,24 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:paddingStart="10dp"
android:paddingEnd="0dp">
android:background="@color/white"
android:orientation="vertical">
<Button
android:id="@+id/btn_full2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:onClick="openPage"
android:text="打开活动" />
<Button
android:id="@+id/btn_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:onClick="loadMater"
android:text="加载素材" />
<include
android:id="@+id/layoutWrapper"
layout="@layout/header_layout" />
<FrameLayout
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/imageView"
tools:srcCompat="@tools:sample/avatars"
<FrameLayout
android:id="@+id/bannerContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="exprotClick" />
android:layout_centerInParent="true"></FrameLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-10dp"></FrameLayout>
<ImageView
android:id="@+id/ivXiaomanBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left" />
<FrameLayout
android:id="@+id/bannerContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"></FrameLayout>
</RelativeLayout>
\ No newline at end of file
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