Commit 07e9a8f8 authored by mengcuiguang's avatar mengcuiguang

代码合并

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