Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
9d934027
Commit
9d934027
authored
Apr 19, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小满科技界面退出时添加拦截
parent
252dffef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
51 deletions
+29
-51
build.gradle
GoodMoney/app/build.gradle
+3
-16
XiaomanActivity.kt
.../java/com/mints/goodmoney/ui/activitys/XiaomanActivity.kt
+26
-35
No files found.
GoodMoney/app/build.gradle
View file @
9d934027
...
@@ -346,12 +346,6 @@ dependencies {
...
@@ -346,12 +346,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'
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//小满
//小满
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"
...
@@ -359,16 +353,9 @@ dependencies {
...
@@ -359,16 +353,9 @@ dependencies {
changing
=
true
changing
=
true
}
}
// implementation ('com.google.code.gson:gson:2.8.2'){
// testImplementation 'junit:junit:4.13'
// exclude group:"com.miit.sdk"
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// }
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
// implementation ('com.qq.e.union:union:4.310.1180'){
// exclude group:"com.miit.sdk"
// } // 普通版本
// compile(name: 'open_ad_sdk', ext: 'aar')
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/XiaomanActivity.kt
View file @
9d934027
...
@@ -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,9 +67,8 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
...
@@ -77,9 +67,8 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
* 为方便测试,demo中采用时间戳来标识用户唯一id
* 为方便测试,demo中采用时间戳来标识用户唯一id
* 媒体对接时注意替换
* 媒体对接时注意替换
*/
*/
val
fragment
=
CampaignFragment
.
newInstance
(
System
.
currentTimeMillis
().
toString
()
+
""
)
campaignFragment
.
setPlaceId
(
placeId
)
fragment
.
setPlaceId
(
placeId
)
campaignFragment
.
setCallback
(
object
:
CampaignCallback
()
{
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
)
/**
/**
...
@@ -90,9 +79,9 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
...
@@ -90,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
(
f
ragment
,
bean
)
loadBytedanceAd
(
campaignF
ragment
,
bean
)
}
else
if
(
bean
.
adType
.
equals
(
"2"
))
{
}
else
if
(
bean
.
adType
.
equals
(
"2"
))
{
loadGDTRewardVideo
(
f
ragment
,
bean
)
loadGDTRewardVideo
(
campaignF
ragment
,
bean
)
}
}
}
}
...
@@ -127,7 +116,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
...
@@ -127,7 +116,7 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
})
})
val
transaction
:
FragmentTransaction
=
supportFragmentManager
.
beginTransaction
()
val
transaction
:
FragmentTransaction
=
supportFragmentManager
.
beginTransaction
()
transaction
.
add
(
R
.
id
.
frame_layout
,
f
ragment
)
transaction
.
add
(
R
.
id
.
frame_layout
,
campaignF
ragment
)
transaction
.
commitAllowingStateLoss
()
transaction
.
commitAllowingStateLoss
()
}
}
...
@@ -503,23 +492,17 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
...
@@ -503,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
()
}
*/
}
}
}
/**
/**
...
@@ -539,7 +522,15 @@ class XiaomanActivity : BaseActivity(), View.OnClickListener {
...
@@ -539,7 +522,15 @@ 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
->
{
finish
()
campaignFragment
?.
backButtonClick
(
object
:
CampaignFragment
.
CallBack
{
override
fun
onSuccess
(
p0
:
String
?)
{
super
@XiaomanActivity
.
onBackPressed
()
}
override
fun
onFailure
(
p0
:
String
?,
p1
:
String
?)
{
finish
()
}
})
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment