Commit 07e9a8f8 authored by mengcuiguang's avatar mengcuiguang

代码合并

parents 585eba3d a24bab52
......@@ -345,8 +345,6 @@ dependencies {
implementation "com.alibaba:arouter-api:$arouter_api_version"
implementation 'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:4.4.3'
api 'org.aspectj:aspectjrt:1.9.5'
//小满
implementation ("com.bx:adsdk:1.4.2.2"){
exclude group:"com.miit.sdk"
......@@ -354,10 +352,12 @@ dependencies {
changing = true
}
//愉悦赚
//微信小程序sdk
implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:+'
implementation(name: 'mduisdk_v3.1.0.18_support_msa_1.0.23', ext: 'aar')
//腾讯x5内核
implementation 'com.tencent.tbs.tbssdk:sdk:43903'
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
......@@ -56,7 +56,7 @@ public class ReadToutiaoAD {
private void initFeedAD(OnAdViewReceiver receiver, int width, int height, OnClickListener clickListener) {
//设置广告参数
AdSlot adSlot = new AdSlot.Builder()
.setCodeId(TtCsjAdManager.TT_AD_NATIVEEXPRESS_AWARD) //广告位id
.setCodeId(TtCsjAdManager.TT_AD_NATIVEEXPRESS_READ) //广告位id
.setSupportDeepLink(true)
.setAdCount(1) //请求广告数量为1到3条
.setExpressViewAcceptedSize(width, height) //必填:期望个性化模板广告view的size,单位dp
......
......@@ -48,7 +48,7 @@ public class TtCsjAdManager {
/*全屏视频*/
public static String TT_AD_FULLVEDIO_ALL = "945752969";// 通用
/*信息流*/
public static String TT_AD_NATIVEEXPRESS_READ = "946010585";//听读
public static String TT_AD_NATIVEEXPRESS_READ = "945666097";//听读
public static String TT_AD_NATIVEEXPRESS_XMLY = "945700753";//喜马拉雅信息流
public static String TT_AD_NATIVEEXPRESS_AWARD = "945562047";//信息流弹窗
public static String TT_AD_NATIVEEXPRESS_WALK = "945562698";//走路
......
......@@ -7,34 +7,23 @@ import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.Toast
import androidx.fragment.app.FragmentTransaction
import com.bx.adsdk.CampaignCallback
import com.bx.adsdk.CampaignFragment
import com.bytedance.sdk.openadsdk.AdSlot
import com.bytedance.sdk.openadsdk.TTAdConstant
import com.bytedance.sdk.openadsdk.TTAdDislike
import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTAdSdk
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.bytedance.sdk.openadsdk.TTRewardVideoAd
import com.bytedance.sdk.openadsdk.*
import com.google.gson.Gson
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.TtCsjAdManager
import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.YlhAdManager
import com.mints.goodmoney.mvp.model.JsBridgeBean
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.qq.e.ads.banner2.UnifiedBannerADListener
import com.qq.e.ads.banner2.UnifiedBannerView
import com.qq.e.ads.nativ.express2.AdEventListener
import com.qq.e.ads.nativ.express2.NativeExpressAD2
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_xiaoman.*
import kotlinx.android.synthetic.main.header_layout.*
class XiaomanActivity : BaseActivity(), View.OnClickListener {
......@@ -45,7 +34,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
private var rewardVideoAD: RewardVideoAD? = null
private var unifiedBannerView: UnifiedBannerView? = null
private val TAG = "XiaomanActivity"
private val campaignFragment: CampaignFragment? = null
private val campaignFragment by lazy { CampaignFragment.newInstance(System.currentTimeMillis().toString()) }
private var mttRewardVideoAd: TTRewardVideoAd? = null
......@@ -64,9 +53,10 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
super.getBundleExtras(extras)
extras?.let {
placeId = it.getString(Constant.ACTIVITY_ID, "")
activityTitle=it.getString(Constant.ACTIVITY_TITLE, "")
activityTitle = it.getString(Constant.ACTIVITY_TITLE, "")
}
}
override fun initViewsAndEvents() {
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
......@@ -77,12 +67,8 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
* 为方便测试,demo中采用时间戳来标识用户唯一id
* 媒体对接时注意替换
*/
val fragment = CampaignFragment.newInstance(System.currentTimeMillis().toString() + "")
// fragment.setPlaceId(intent.getStringExtra("placeId"))
fragment.setPlaceId(placeId)
// fragment.setPlaceId("3497")
fragment.setCallback(object : CampaignCallback() {
campaignFragment.setPlaceId(placeId)
campaignFragment.setCallback(object : CampaignCallback() {
override fun showAd(s: String) {//2.2.9.1//调用激励视频
super.showAd(s)
/**
......@@ -93,9 +79,9 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
*/
val bean: JsBridgeBean = Gson().fromJson(s, JsBridgeBean::class.java)
if (bean.adType.equals("1")) {
loadBytedanceAd(fragment, bean)
loadBytedanceAd(campaignFragment, bean)
} else if (bean.adType.equals("2")) {
loadGDTRewardVideo(fragment, bean)
loadGDTRewardVideo(campaignFragment, bean)
}
}
......@@ -106,7 +92,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
override fun showBanner(params: String) {
//2.2.9.3 展示Banner类型广告
Log.d(TAG, "showBanner: $params")
Toast.makeText(this@XiaomanActivity, params, Toast.LENGTH_LONG).show()
// Toast.makeText(this@XiaomanActivity, params, Toast.LENGTH_LONG).show()
val bean: JsBridgeBean = Gson().fromJson(params, JsBridgeBean::class.java)
if (TextUtils.isEmpty(bean.pid)) {
return
......@@ -130,7 +116,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
})
val transaction: FragmentTransaction = supportFragmentManager.beginTransaction()
transaction.add(R.id.frame_layout, fragment)
transaction.add(R.id.frame_layout, campaignFragment)
transaction.commitAllowingStateLoss()
}
......@@ -506,23 +492,17 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
// }
override fun onBackPressed() {
finish()
// Toast.makeText(this@XiaomanActivity2, "按下返回键onBackPressed", Toast.LENGTH_LONG).show()
/* if (campaignFragment != null) {
campaignFragment.backButtonClick(new CampaignFragment.CallBack() {//返回当前界面必须回调
@Override
public void onSuccess(String jsonData) {
Main2Activity.super.onBackPressed();
if (campaignFragment != null) {
campaignFragment.backButtonClick(object : CampaignFragment.CallBack {
override fun onSuccess(jsonData: String) {
super@XiaomanActivity.onBackPressed()
}
@Override
public void onFailure(String code, String errmsg) {
}
});
override fun onFailure(code: String, errmsg: String) {}
})
} else {
super.onBackPressed();
}*/
super.onBackPressed()
}
}
/**
......@@ -542,8 +522,16 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
override fun onClick(v: View) {
when (v.id) {
R.id.iv_left_icon -> {
campaignFragment?.backButtonClick(object : CampaignFragment.CallBack {
override fun onSuccess(p0: String?) {
super@XiaomanActivity.onBackPressed()
}
override fun onFailure(p0: String?, p1: String?) {
finish()
}
})
}
}
}
}
\ No newline at end of file
......@@ -153,6 +153,9 @@ class MyFragment : BaseFragment(),
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FIVE) {
// 防止首次加载两次
if (AntiShake.check(item_title_id?.id)) return
DownloadApkManager.tryOnceInstallApk()
if (!TextUtils.isEmpty(userManager.userID)) {
......@@ -245,7 +248,7 @@ class MyFragment : BaseFragment(),
// 生成热门活动数据
private fun generateGridData(data: List<BannerBean.ListBean>) {
val inflater = LayoutInflater.from(mContext)
for (i in 0..data.size-1) {
for (i in 0..data.size - 1) {
if (data.get(i).toUrl.equals(Constant.HOT_ACTIVITY_SHEEP)) {
XmManager.loadMater(data.get(i).xmPlaceId)
break
......
package com.mints.goodmoney.ui.fragment
import android.os.Bundle
import android.view.View
import androidx.fragment.app.FragmentTransaction
import com.chineseall.reader17ksdk.ChineseAllReaderApplication
......@@ -10,6 +11,7 @@ import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.presenters.BookPresenter
import com.mints.goodmoney.mvp.views.BookView
import com.mints.goodmoney.ui.activitys.AwardActivity
import com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import com.mints.goodmoney.utils.LogUtil
import com.mints.goodmoney.utils.SpanUtils
......@@ -56,6 +58,12 @@ class ReaderFragment : LazyLoadBaseFragment(), BookView, OnReadCallBack {
}
override fun readSecondsSuc(coin: Int) {
if (coin > 0) {
val bundle = Bundle()
bundle.putString(Constant.MAIN_CARRIER_TYPE, Constant.CARRIER_ZHANGYUE)
bundle.putInt(Constant.MAIN_CUR_COIN, coin)
readyGo(AwardActivity::class.java, bundle)
}
}
override fun readInfo(sumTime: Int, sumCoin: Int, readTime: Int) {
......
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