Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PrictureTranslate
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
bixing
PrictureTranslate
Commits
9b1df793
Commit
9b1df793
authored
Jan 16, 2026
by
bixing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新TOPONSDK
parent
bf7ccfd2
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
308 additions
and
247 deletions
+308
-247
build.gradle
app/build.gradle
+35
-33
core-release.aar
app/libs/core-release.aar
+0
-0
proguard-rules.pro
app/proguard-rules.pro
+83
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+9
-62
XGENAdData.aidl
app/src/main/aidl/com/android/gem/core/XGENAdData.aidl
+2
-0
TopOnAppOpenAdManager.java
...a/com/ads/cal/picturetranslate/TopOnAppOpenAdManager.java
+12
-11
TopOnItAdManager.java
...n/java/com/ads/cal/picturetranslate/TopOnItAdManager.java
+13
-12
TopOnManager.java
.../main/java/com/ads/cal/picturetranslate/TopOnManager.java
+4
-5
PictureTranslateListMainActivity.java
...etranslate/activity/PictureTranslateListMainActivity.java
+0
-3
InitA.java
app/src/main/java/com/gem/media/InitA.java
+1
-7
NActivity.java
app/src/main/java/com/gem/media/NActivity.java
+3
-3
AdData.java
app/src/main/java/com/gem/media/ad/AdData.java
+0
-1
CpAdData.java
app/src/main/java/com/gem/media/ad/CpAdData.java
+4
-5
InterstitialAdManager.java
...src/main/java/com/gem/media/ad/InterstitialAdManager.java
+16
-16
InterstitialHalfAdManager.java
...main/java/com/gem/media/ad/InterstitialHalfAdManager.java
+15
-15
NativeAdManager.java
app/src/main/java/com/gem/media/ad/NativeAdManager.java
+29
-29
OpenAdManager.java
app/src/main/java/com/gem/media/ad/OpenAdManager.java
+20
-20
SelfRenderViewUtil.java
app/src/main/java/com/gem/media/ad/SelfRenderViewUtil.java
+15
-15
MyDataService.java
...src/main/java/com/gem/media/ad/service/MyDataService.java
+37
-0
MutiImageView.java
app/src/main/java/com/gem/media/ad/view/MutiImageView.java
+2
-2
NativeAdView.java
app/src/main/java/com/gem/media/ad/view/NativeAdView.java
+3
-3
layout_native_adview.xml
app/src/main/res/layout/layout_native_adview.xml
+2
-2
layout_native_self.xml
app/src/main/res/layout/layout_native_self.xml
+1
-1
n_layout.xml
app/src/main/res/layout/n_layout.xml
+2
-2
No files found.
app/build.gradle
View file @
9b1df793
...
...
@@ -56,7 +56,8 @@ android {
applicationId
"com.ads.cal.picturetranslate"
versionName
"1.0.0.0"
signingConfig
signingConfigs
.
toolsTest
manifestPlaceholders
=
[
google_ad_app_id:
"ca-app-pub-9356757350640102~6934070860"
,
signature:
"04ced0bb5c9f0b2adf2f27dd57538cc8"
,
flavor_name:
"GemHeart"
,
authorities:
"$applicationId-media-AProvider"
,
media_version:
"1"
]
manifestPlaceholders
=
[
google_ad_app_id:
"ca-app-pub-9356757350640102~6934070860"
,
signature:
"04ced0bb5c9f0b2adf2f27dd57538cc8"
,
flavor_name:
"GemHeart"
,
authorities:
"$applicationId-media-AProvider"
,
media_version:
"3"
]
}
}
}
...
...
@@ -71,8 +72,8 @@ dependencies {
androidTestImplementation
'androidx.test.ext:junit:1.1.5'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.5.1'
implementation
(
platform
(
"org.jetbrains.kotlin:kotlin-bom:1.8.0"
))
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
,
'*.aar'
])
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
'com.or.ange:likepal:2.2.2'
...
...
@@ -116,63 +117,64 @@ dependencies {
implementation
'com.facebook.android:facebook-android-sdk:latest.release'
//Anythink
(Necessary)
api
"com.
anythink.sdk:core:6.4.69
"
api
"com.
anythink.sdk:nativead:6.4.69
"
api
"com.
anythink.sdk:banner:6.4.69
"
api
"com.
anythink.sdk:interstitial:6.4.69
"
api
"com.
anythink.sdk:rewardedvideo:6.4.69
"
api
"com.
anythink.sdk:splash:6.4.69
"
//TU
(Necessary)
api
"com.
thinkup.sdk:core-tpn:6.5.36.2
"
api
"com.
thinkup.sdk:nativead-tpn:6.5.36.2
"
api
"com.
thinkup.sdk:banner-tpn:6.5.36.2
"
api
"com.
thinkup.sdk:interstitial-tpn:6.5.36.2
"
api
"com.
thinkup.sdk:rewardedvideo-tpn:6.5.36.2
"
api
"com.
thinkup.sdk:splash-tpn:6.5.36.2
"
//Androidx (Necessary)
api
"androidx.appcompat:appcompat:1.6.1"
api
"androidx.browser:browser:1.4.0"
//Vungle
api
"com.
anythink.sdk:adapter-vungle:6.4.69
"
api
"com.vungle:vungle-ads:7.
4.3
"
api
"com.
thinkup.sdk:adapter-tpn-vungle:6.5.36.4
"
api
"com.vungle:vungle-ads:7.
6.1
"
api
"com.google.android.gms:play-services-basement:18.1.0"
api
"com.google.android.gms:play-services-ads-identifier:18.0.1"
//UnityAds
api
"com.
anythink.sdk:adapter-unityads:6.4.69
"
api
"com.unity3d.ads:unity-ads:4.1
4.0
"
api
"com.
thinkup.sdk:adapter-tpn-unityads:6.5.36
"
api
"com.unity3d.ads:unity-ads:4.1
6.1
"
//Bigo
api
"com.
anythink.sdk:adapter-bigo:6.4.69
"
api
"com.bigossp:bigo-ads:5.
1.0
"
api
"com.
thinkup.sdk:adapter-tpn-bigo:6.5.36
"
api
"com.bigossp:bigo-ads:5.
5.1
"
//Pubnative
api
"com.
anythink.sdk:adapter-pubnative:6.4.69
"
api
"net.pubnative:hybid.sdk:3.
2.1
"
api
"com.
thinkup.sdk:adapter-tpn-pubnative:6.5.36
"
api
"net.pubnative:hybid.sdk:3.
6.2
"
//Pangle
api
"com.anythink.sdk:adapter-pangle-nonchina:6.4.69"
api
"com.pangle.global:ads-sdk:6.5.0.6"
api
"com.google.android.gms:play-services-ads-identifier:18.0.1"
api
"com.thinkup.sdk:adapter-tpn-pangle:6.5.36"
api
"com.pangle.global:pag-sdk:7.6.0.2"
api
"com.google.android.gms:play-services-ads-identifier:18.2.0"
//Admob
api
"com.thinkup.sdk:adapter-tpn-admob:6.5.36"
api
"com.google.android.gms:play-services-ads:24.6.0"
//
Inmobi
api
"com.
anythink.sdk:adapter-inmobi:6.4.69
"
api
"com.
inmobi.monetization:inmobi-ads-kotlin:10.8.2
"
//
TU Adx SDK(Necessary)
api
"com.
thinkup.sdk:adapter-tpn-sdm:6.5.36.8
"
api
"com.
smartdigimkttech.sdk:smartdigimkttech-sdk:6.5.47
"
//AppLovin
api
"com.
anythink.sdk:adapter-applovin:6.4.69.2
"
api
"com.applovin:applovin-sdk:13.
2
.0"
api
"com.
thinkup.sdk:adapter-tpn-applovin:6.5.36
"
api
"com.applovin:applovin-sdk:13.
4
.0"
//Mintegral
api
"com.
anythink.sdk:adapter-mintegral-nonchina:6.4.69.2
"
api
"com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.
1
1"
api
"com.
thinkup.sdk:adapter-tpn-mintegral:6.5.36
"
api
"com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.
9
1"
api
"androidx.recyclerview:recyclerview:1.1.0"
//Admob
api
"com.anythink.sdk:adapter-admob:6.4.69.2"
api
"com.google.android.gms:play-services-ads:24.0.0"
//Tramini
api
"com.anythink.sdk:tramini-plugin:6.4.69"
//Tramini
api
"com.thinkup.sdk:tramini-plugin-tpn:6.5.36"
// implementation 'com.tencent.bugly:crashreport:latest.release'
implementation
'androidx.cardview:cardview:1.0.0'
api
"com.airbnb.android:lottie:6.1.0"
}
\ No newline at end of file
app/libs/core-release.aar
0 → 100644
View file @
9b1df793
File added
app/proguard-rules.pro
View file @
9b1df793
...
...
@@ -258,3 +258,86 @@
#org.
-
keep
class
org
.
**
{
*
;
}
#topon start
# Vungle
-
dontwarn
com
.
vungle
.
ads
.
**
-
keepclassmembers
class
com
.
vungle
.
ads
.
**
{
*
;
}
-
keep
class
com
.
vungle
.
ads
.
**
# Google
-
keep
class
com
.
google
.
android
.
gms
.
**
{
*
;
}
-
dontwarn
com
.
google
.
android
.
gms
.
**
# START OkHttp + Okio
# JSR 305 annotations are for embedding nullability information.
-
dontwarn
javax
.
annotation
.
**
# A resource is loaded with a relative path so the package of this class must be preserved.
-
adaptresourcefilenames
okhttp3
/
internal
/
publicsuffix
/
PublicSuffixDatabase
.
gz
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-
dontwarn
org
.
codehaus
.
mojo
.
animal_sniffer
.
*
# OkHttp platform used only on JVM and when Conscrypt and other security providers are available.
-
dontwarn
okhttp3
.
internal
.
platform
.
**
-
dontwarn
org
.
conscrypt
.
**
-
dontwarn
org
.
bouncycastle
.
**
-
dontwarn
org
.
openjsse
.
**
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-
dontwarn
org
.
codehaus
.
mojo
.
animal_sniffer
.
*
# END OkHttp + Okio
# START Protobuf
-
dontwarn
com
.
google
.
protobuf
.
**
-
keepclassmembers
class
com
.
google
.
protobuf
.
**
{
*
;
}
-
keep
class
*
extends
com
.
google
.
protobuf
.
GeneratedMessageLite
{
*
;
}
# END Protobuf
-
keepattributes
Signature
-
keep
class
net
.
pubnative
.
**
{
*
;
}
-
keep
class
com
.
iab
.
omid
.
library
.
pubnativenet
.
**
{
*
;
}
-
keep
class
com
.
bytedance
.
sdk
.
**
{
*
;
}
-
keepattributes
Signature
-
keepattributes
*
Annotation
*
-
keep
class
com
.
mbridge
.
**
{
*
;
}
-
keep
interface
com
.
mbridge
.
**
{
*
;
}
-
dontwarn
com
.
mbridge
.
**
-
keepclassmembers
class
**.
R
$
*
{
public
static
final
int
mbridge
*
;
}
-
keep
public
class
com
.
mbridge
.
*
extends
androidx
.
**
{
*
;
}
-
keep
public
class
androidx
.
viewpager
.
widget
.
PagerAdapter
{
*
;}
-
keep
public
class
androidx
.
viewpager
.
widget
.
ViewPager
.
OnPageChangeListener
{
*
;}
-
keep
interface
androidx
.
annotation
.
IntDef
{
*
;}
-
keep
interface
androidx
.
annotation
.
Nullable
{
*
;}
-
keep
interface
androidx
.
annotation
.
CheckResult
{
*
;}
-
keep
interface
androidx
.
annotation
.
NonNull
{
*
;}
-
keep
public
class
androidx
.
fragment
.
app
.
Fragment
{
*
;}
-
keep
public
class
androidx
.
core
.
content
.
FileProvider
{
*
;}
-
keep
public
class
androidx
.
core
.
app
.
NotificationCompat
{
*
;}
-
keep
public
class
androidx
.
appcompat
.
widget
.
AppCompatImageView
{
*
;}
-
keep
public
class
androidx
.
recyclerview
.
*
{
*
;}
-
keep
class
com
.
mbridge
.
msdk
.
foundation
.
tools
.
FastKV
{
*
;}
-
keep
class
com
.
mbridge
.
msdk
.
foundation
.
tools
.
FastKV
$
Builder
{
*
;}
#topon end
app/src/main/AndroidManifest.xml
View file @
9b1df793
...
...
@@ -407,15 +407,6 @@
<!-- mintegral start-->
<activity
android:name=
"com.mbridge.msdk.newreward.player.MBRewardVideoActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:excludeFromRecents=
"true"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.mbridge.msdk.reward.player.MBRewardVideoActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
...
...
@@ -448,29 +439,9 @@
<!-- mintegral end-->
<!-- topon start-->
<activity
android:name=
"com.anythink.expressad.reward.player.ATRewardVideoActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize|screenLayout"
android:exported=
"false"
android:launchMode=
"standard"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.anythink.basead.ui.RewardExitConfirmDialogActivity"
android:exported=
"false"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label"
/>
<activity
android:name=
"com.anythink.basead.ui.activity.ATMixSplashActivity"
android:name=
"com.thinkup.core.common.inner.ui.activity.TUMixSplashActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:exported=
"false"
android:launchMode=
"standard"
...
...
@@ -478,11 +449,10 @@
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.
anythink
.core.basead.ui.web.WebLandPageActivity"
android:name=
"com.
thinkup
.core.basead.ui.web.WebLandPageActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:exported=
"false"
android:launchMode=
"singleTop"
...
...
@@ -491,11 +461,10 @@
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.
anythink.core.activity.AnyThink
GdprAuthActivity"
android:name=
"com.
thinkup.core.activity.TU
GdprAuthActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:exported=
"false"
android:launchMode=
"singleTask"
...
...
@@ -503,11 +472,10 @@
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.
anythink.basead.ui.AT
LandscapeActivity"
android:name=
"com.
thinkup.core.common.inner.ui.TU
LandscapeActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:exported=
"false"
android:launchMode=
"standard"
...
...
@@ -516,11 +484,10 @@
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.
anythink.basead.ui.AT
PortraitActivity"
android:name=
"com.
thinkup.core.common.inner.ui.TU
PortraitActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:exported=
"false"
android:launchMode=
"standard"
...
...
@@ -529,33 +496,30 @@
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.
anythink.basead.ui.AT
LandscapeTranslucentActivity"
android:name=
"com.
thinkup.core.common.inner.ui.TU
LandscapeTranslucentActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:exported=
"false"
android:launchMode=
"standard"
android:screenOrientation=
"sensorLandscape"
android:theme=
"@style/
anythink
_myoffer_half_screen"
android:theme=
"@style/
thinkup
_myoffer_half_screen"
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<activity
android:name=
"com.
anythink.basead.ui.AT
PortraitTranslucentActivity"
android:name=
"com.
thinkup.core.common.inner.ui.TU
PortraitTranslucentActivity"
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:exported=
"false"
android:launchMode=
"standard"
android:screenOrientation=
"sensorPortrait"
android:theme=
"@style/
anythink
_myoffer_half_screen"
android:theme=
"@style/
thinkup
_myoffer_half_screen"
android:excludeFromRecents=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:noHistory=
"true"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<!-- topon end-->
...
...
@@ -624,23 +588,6 @@
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<!--unity3d end-->
<!--inmobi start-->
<activity
android:name=
"com.inmobi.ads.rendering.InMobiAdActivity"
android:configChanges=
"keyboardHidden|orientation|keyboard|smallestScreenSize|screenSize|screenLayout|locale|fontScale|uiMode"
android:hardwareAccelerated=
"true"
android:theme=
"@android:style/Theme.NoTitleBar"
tools:ignore=
"UnusedAttribute"
android:excludeFromRecents=
"true"
android:noHistory=
"true"
android:icon=
"@android:drawable/divider_horizontal_bright"
android:label=
"@string/heart_lable"
android:screenOrientation=
"behind"
tools:replace=
"android:icon, android:excludeFromRecents, android:label, android:configChanges"
/>
<!--inmobi end-->
<!--verve start-->
<activity
android:name=
"net.pubnative.lite.sdk.interstitial.activity.MraidInterstitialActivity"
...
...
app/src/main/aidl/com/android/gem/core/XGENAdData.aidl
View file @
9b1df793
...
...
@@ -32,4 +32,6 @@ interface XGENAdData {
boolean
adIsLoading
();
void
transferData
(
int
type
,
String
data
);
}
\ No newline at end of file
app/src/main/java/com/ads/cal/picturetranslate/TopOnAppOpenAdManager.java
View file @
9b1df793
...
...
@@ -5,10 +5,11 @@ import android.view.ViewGroup;
import
androidx.annotation.NonNull
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.splashad.api.ATSplashAd
;
import
com.anythink.splashad.api.ATSplashAdExtraInfo
;
import
com.anythink.splashad.api.ATSplashAdListener
;
import
com.thinkup.core.api.AdError
;
import
com.thinkup.core.api.TUAdInfo
;
import
com.thinkup.splashad.api.TUSplashAd
;
import
com.thinkup.splashad.api.TUSplashAdExtraInfo
;
import
com.thinkup.splashad.api.TUSplashAdListener
;
import
java.util.Date
;
...
...
@@ -18,7 +19,7 @@ public class TopOnAppOpenAdManager {
private
static
final
String
LOG_TAG
=
"TopOnAppOpenAdManager"
;
private
static
final
String
AD_UNIT_ID
=
"b1f138leh1o4gp"
;
private
AT
SplashAd
appOpenAd
=
null
;
private
TU
SplashAd
appOpenAd
=
null
;
private
boolean
isLoadingAd
=
false
;
private
boolean
isShowingAd
=
false
;
...
...
@@ -61,8 +62,8 @@ public class TopOnAppOpenAdManager {
isLoadingAd
=
true
;
appOpenAd
=
new
AT
SplashAd
(
PictureApplication
.
getApplication
(),
AD_UNIT_ID
,
null
);
appOpenAd
.
setAdListener
(
new
AT
SplashAdListener
()
{
appOpenAd
=
new
TU
SplashAd
(
PictureApplication
.
getApplication
(),
AD_UNIT_ID
,
null
);
appOpenAd
.
setAdListener
(
new
TU
SplashAdListener
()
{
@Override
public
void
onAdLoaded
(
boolean
b
)
{
LogUtils
.
d
(
LOG_TAG
,
"onAdLoaded."
);
...
...
@@ -85,7 +86,7 @@ public class TopOnAppOpenAdManager {
}
@Override
public
void
onNoAdError
(
com
.
anythink
.
core
.
api
.
AdError
adError
)
{
public
void
onNoAdError
(
AdError
adError
)
{
isLoadingAd
=
false
;
if
(
null
!=
onLoadAdCompleteListener
)
{
onLoadAdCompleteListener
.
onLoadAdFailed
(
adError
.
getPlatformMSG
());
...
...
@@ -95,15 +96,15 @@ public class TopOnAppOpenAdManager {
}
@Override
public
void
onAdShow
(
AT
AdInfo
atAdInfo
)
{
public
void
onAdShow
(
TU
AdInfo
atAdInfo
)
{
}
@Override
public
void
onAdClick
(
AT
AdInfo
atAdInfo
)
{
public
void
onAdClick
(
TU
AdInfo
atAdInfo
)
{
}
@Override
public
void
onAdDismiss
(
ATAdInfo
atAdInfo
,
AT
SplashAdExtraInfo
atSplashAdExtraInfo
)
{
public
void
onAdDismiss
(
TUAdInfo
atAdInfo
,
TU
SplashAdExtraInfo
atSplashAdExtraInfo
)
{
appOpenAd
=
null
;
isShowingAd
=
false
;
...
...
app/src/main/java/com/ads/cal/picturetranslate/TopOnItAdManager.java
View file @
9b1df793
...
...
@@ -2,14 +2,15 @@ package com.ads.cal.picturetranslate;
import
android.app.Activity
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.core.api.AdError
;
import
com.anythink.interstitial.api.ATInterstitial
;
import
com.anythink.interstitial.api.ATInterstitialListener
;
import
com.thinkup.core.api.AdError
;
import
com.thinkup.core.api.TUAdInfo
;
import
com.thinkup.interstitial.api.TUInterstitial
;
import
com.thinkup.interstitial.api.TUInterstitialListener
;
public
class
TopOnItAdManager
{
private
static
final
String
IT_AD_UNIT_ID
=
"b6509805ed0208"
;
private
static
AT
Interstitial
itAd
=
null
;
private
static
TU
Interstitial
itAd
=
null
;
private
static
OnItAdListener
listener
=
null
;
public
static
void
loadItAd
()
{
...
...
@@ -18,8 +19,8 @@ public class TopOnItAdManager {
return
;
}
itAd
=
new
AT
Interstitial
(
PictureApplication
.
getApplication
(),
IT_AD_UNIT_ID
);
itAd
.
setAdListener
(
new
AT
InterstitialListener
()
{
itAd
=
new
TU
Interstitial
(
PictureApplication
.
getApplication
(),
IT_AD_UNIT_ID
);
itAd
.
setAdListener
(
new
TU
InterstitialListener
()
{
@Override
public
void
onInterstitialAdLoaded
()
{
...
...
@@ -31,18 +32,18 @@ public class TopOnItAdManager {
}
@Override
public
void
onInterstitialAdClicked
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdClicked
(
TU
AdInfo
atAdInfo
)
{
}
@Override
public
void
onInterstitialAdShow
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdShow
(
TU
AdInfo
atAdInfo
)
{
if
(
listener
!=
null
)
{
listener
.
onShow
();
}
}
@Override
public
void
onInterstitialAdClose
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdClose
(
TU
AdInfo
atAdInfo
)
{
if
(
listener
!=
null
)
{
listener
.
onClose
();
}
...
...
@@ -51,12 +52,12 @@ public class TopOnItAdManager {
}
@Override
public
void
onInterstitialAdVideoStart
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdVideoStart
(
TU
AdInfo
atAdInfo
)
{
}
@Override
public
void
onInterstitialAdVideoEnd
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdVideoEnd
(
TU
AdInfo
atAdInfo
)
{
}
@Override
...
...
app/src/main/java/com/ads/cal/picturetranslate/TopOnManager.java
View file @
9b1df793
package
com
.
ads
.
cal
.
picturetranslate
;
import
static
com
.
anythink
.
network
.
pangle
.
PangleATConst
.
DEBUGGER_CONFIG
.
Pangle_NETWORK
;
import
android.content.Context
;
import
com.
anythink.core.api.ATDebuggerConfig
;
import
com.anythink.core.api.ATSDK
;
import
com.
thinkup.core.api.TUSDK
;
public
class
TopOnManager
{
private
TopOnManager
()
{
...
...
@@ -36,9 +35,9 @@ public class TopOnManager {
// new ATDebuggerConfig.Builder(Pangle_NETWORK).build());
AT
SDK
.
init
(
context
,
TOPON_APP_ID
,
TOPON_APP_KEY
);
TU
SDK
.
init
(
context
,
TOPON_APP_ID
,
TOPON_APP_KEY
);
//SDK版本
LogUtils
.
d
(
"TopOn SDK version: "
+
AT
SDK
.
getSDKVersionName
());
LogUtils
.
d
(
"TopOn SDK version: "
+
TU
SDK
.
getSDKVersionName
());
//(v5.7.77新增) 打印当前设备的设备信息(IMEI、OAID、GAID、AndroidID等)
// ATSDK.testModeDeviceInfo(context, new DeviceInfoCallback() {
...
...
app/src/main/java/com/ads/cal/picturetranslate/activity/PictureTranslateListMainActivity.java
View file @
9b1df793
...
...
@@ -414,9 +414,6 @@ public class PictureTranslateListMainActivity extends BaseActivity implements Ac
@Override
public
boolean
onKeyDown
(
int
keyCode
,
KeyEvent
event
)
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
return
true
;
}
return
super
.
onKeyDown
(
keyCode
,
event
);
}
...
...
app/src/main/java/com/gem/media/InitA.java
View file @
9b1df793
...
...
@@ -97,13 +97,7 @@ public class InitA {
private
void
initBugly
(
Context
context
)
{
try
{
String
pkgName
=
context
.
getPackageName
();
String
buglyAppId
=
"66bcabe3b5"
;
if
(
"com.solide.filemanager.lte"
.
equals
(
pkgName
))
{
buglyAppId
=
"77338e3566"
;
}
else
if
(
"com.mystickers.stickermaker"
.
equals
(
pkgName
))
{
buglyAppId
=
"220dc0dc54"
;
}
String
buglyAppId
=
"e14a3c14f8"
;
// CrashReport.initCrashReport(context, buglyAppId, false);
}
catch
(
Exception
e
)
{
}
...
...
app/src/main/java/com/gem/media/NActivity.java
View file @
9b1df793
...
...
@@ -15,12 +15,12 @@ import androidx.annotation.Nullable;
import
com.ads.cal.picturetranslate.R
;
import
com.android.gem.core.ReportBean
;
import
com.anythink.nativead.api.ATNativeView
;
import
com.gem.media.ad.AdData
;
import
com.gem.media.ad.InterstitialHalfAdManager
;
import
com.gem.media.ad.NativeAdManager
;
import
com.gem.media.splash.base.protocol.Constants
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.thinkup.nativead.api.TUNativeView
;
import
java.util.HashMap
;
...
...
@@ -76,7 +76,7 @@ public class NActivity extends Activity {
getData
();
if
(
adType
.
equals
(
AdData
.
AD_TYPE_HALF_INTERSTITIAL
))
{
if
(
InterstitialHalfAdManager
.
getInstance
().
isInterstitialHalfAdReady
())
{
AT
NativeView
mATNativeView
=
findViewById
(
R
.
id
.
native_ad_view
);
TU
NativeView
mATNativeView
=
findViewById
(
R
.
id
.
native_ad_view
);
mATNativeView
.
setVisibility
(
View
.
GONE
);
InterstitialHalfAdManager
.
getInstance
().
showAd
(
this
);
}
else
{
...
...
@@ -86,7 +86,7 @@ public class NActivity extends Activity {
}
}
else
if
(
adType
.
equals
(
AdData
.
AD_TYPE_NATIVE
))
{
if
(
NativeAdManager
.
getInstance
().
isNativeAdReady
())
{
AT
NativeView
mATNativeView
=
findViewById
(
R
.
id
.
native_ad_view
);
TU
NativeView
mATNativeView
=
findViewById
(
R
.
id
.
native_ad_view
);
View
mSelfRenderView
=
findViewById
(
R
.
id
.
native_selfrender_view
);
mATNativeView
.
setVisibility
(
View
.
VISIBLE
);
NativeAdManager
.
getInstance
().
showAd
(
mATNativeView
,
mSelfRenderView
);
...
...
app/src/main/java/com/gem/media/ad/AdData.java
View file @
9b1df793
...
...
@@ -2,7 +2,6 @@ package com.gem.media.ad;
import
android.text.TextUtils
;
import
com.anythink.core.api.ATSDK
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.gem.media.splash.base.utils.PROP
;
...
...
app/src/main/java/com/gem/media/ad/CpAdData.java
View file @
9b1df793
...
...
@@ -11,12 +11,11 @@ import android.text.TextUtils;
//import com.anythink.core.api.ATDebuggerConfig;
import
com.ads.cal.picturetranslate.PictureApplication
;
import
com.anythink.core.api.ATDebuggerConfig
;
import
com.anythink.core.api.ATSDK
;
import
com.anythink.core.api.ATSDKInitListener
;
import
com.gem.media.StatsStaticHelper
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.gem.media.splash.base.utils.PROP
;
import
com.thinkup.core.api.TUSDK
;
import
com.thinkup.core.api.TUSDKInitListener
;
import
java.util.HashMap
;
...
...
@@ -87,9 +86,9 @@ public class CpAdData {
//5c72931-a53c-4449-b17b-022706322d67
// ATSDK.setDebuggerConfig(PictureApplication.getApplication(), "748d98dc-455b-4aee-b85a-4f3db6c1b7dd", new ATDebuggerConfig.Builder(Pangle_NETWORK).build());
AT
SDK
.
setChannel
(
channelId
);
TU
SDK
.
setChannel
(
channelId
);
//初始化SDK
ATSDK
.
init
(
PictureApplication
.
getApplication
(),
adAppId
,
appKey
,
null
,
new
AT
SDKInitListener
()
{
TUSDK
.
init
(
PictureApplication
.
getApplication
(),
adAppId
,
appKey
,
null
,
new
TU
SDKInitListener
()
{
@Override
public
void
onSuccess
()
{
isInit
=
true
;
...
...
app/src/main/java/com/gem/media/ad/InterstitialAdManager.java
View file @
9b1df793
...
...
@@ -7,11 +7,6 @@ import android.content.Context;
import
android.text.TextUtils
;
import
com.ads.cal.picturetranslate.PictureApplication
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.core.api.ATAdStatusInfo
;
import
com.anythink.core.api.AdError
;
import
com.anythink.interstitial.api.ATInterstitial
;
import
com.anythink.interstitial.api.ATInterstitialListener
;
import
com.gem.media.AdReqHasCallBackUtil
;
import
com.gem.media.NetworkUtils
;
import
com.gem.media.StatsStaticHelper
;
...
...
@@ -20,6 +15,11 @@ import com.gem.media.splash.base.protocol.AdCallback;
import
com.gem.media.splash.base.protocol.AdLoadedCallback
;
import
com.gem.media.splash.base.protocol.Constants
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.thinkup.core.api.AdError
;
import
com.thinkup.core.api.TUAdInfo
;
import
com.thinkup.core.api.TUAdStatusInfo
;
import
com.thinkup.interstitial.api.TUInterstitial
;
import
com.thinkup.interstitial.api.TUInterstitialListener
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -38,7 +38,7 @@ public class InterstitialAdManager {
}
//注意:广告对象必须要全局引用,如果广告对象是临时变量会导致广告加载过程中有可能被回收,无法接收广告事件回调
private
static
AT
Interstitial
mInterstitialAd
;
private
static
TU
Interstitial
mInterstitialAd
;
private
static
String
sAdId
;
...
...
@@ -47,8 +47,8 @@ public class InterstitialAdManager {
return
;
}
if
(
null
==
mInterstitialAd
)
{
mInterstitialAd
=
new
AT
Interstitial
(
PictureApplication
.
getApplication
(),
sAdId
);
mInterstitialAd
.
setAdListener
(
new
AT
InterstitialListener
()
{
mInterstitialAd
=
new
TU
Interstitial
(
PictureApplication
.
getApplication
(),
sAdId
);
mInterstitialAd
.
setAdListener
(
new
TU
InterstitialListener
()
{
@Override
public
void
onInterstitialAdLoaded
()
{
AdReqHasCallBackUtil
.
setValue
(-
1
);
...
...
@@ -87,7 +87,7 @@ public class InterstitialAdManager {
}
@Override
public
void
onInterstitialAdClicked
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdClicked
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdClicked "
);
if
(
null
!=
adCallback
)
{
...
...
@@ -100,7 +100,7 @@ public class InterstitialAdManager {
}
@Override
public
void
onInterstitialAdShow
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdShow
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdShow "
+
" "
+
atAdInfo
.
getAdsourceId
()
+
" "
+
atAdInfo
.
getChannel
()
...
...
@@ -121,7 +121,7 @@ public class InterstitialAdManager {
}
@Override
public
void
onInterstitialAdClose
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdClose
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdClose "
+
" "
+
atAdInfo
.
getNetworkFirmId
());
if
(
null
!=
adCallback
)
{
adCallback
.
onAdClose
(
Constants
.
NODE_CLOSE_EID
,
"interstitial"
,
"close type: "
+
atAdInfo
.
getDismissType
(),
-
1
);
...
...
@@ -136,7 +136,7 @@ public class InterstitialAdManager {
}
@Override
public
void
onInterstitialAdVideoStart
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdVideoStart
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdVideoStart: "
+
" "
+
atAdInfo
.
getNetworkFirmId
());
if
(
null
!=
adStatusCallBack
)
{
...
...
@@ -145,7 +145,7 @@ public class InterstitialAdManager {
}
@Override
public
void
onInterstitialAdVideoEnd
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdVideoEnd
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdVideoEnd: "
);
if
(
null
!=
adStatusCallBack
)
{
adStatusCallBack
.
onInterstitialAdVideoEnd
(
Constants
.
NODE_INTERSTITIAL_AD_VIDEO_END
,
"interstitial"
,
"end video"
,
-
1
);
...
...
@@ -203,7 +203,7 @@ public class InterstitialAdManager {
ALog
.
w
(
TAG
,
" mInterstitialAd == null"
+
" "
);
return
-
3
;
}
AT
AdStatusInfo
atAdStatusInfo
=
mInterstitialAd
.
checkAdStatus
();
TU
AdStatusInfo
atAdStatusInfo
=
mInterstitialAd
.
checkAdStatus
();
ALog
.
w
(
TAG
,
"mInterstitialAd atAdStatusInfo: "
+
atAdStatusInfo
+
" "
+
mInterstitialAd
);
if
(
atAdStatusInfo
.
isReady
())
{
ALog
.
w
(
TAG
,
"mInterstitialAd is Ready"
);
...
...
@@ -250,7 +250,7 @@ public class InterstitialAdManager {
// }
}
if
(!
TextUtils
.
isEmpty
(
sAdId
))
{
AT
Interstitial
.
entryAdScenario
(
sAdId
,
"f65bf35b235ce0"
);
TU
Interstitial
.
entryAdScenario
(
sAdId
,
"f65bf35b235ce0"
);
}
if
(
null
!=
mInterstitialAd
&&
mInterstitialAd
.
isAdReady
())
{
mInterstitialAd
.
show
(
activity
,
"f65bf35b235ce0"
);
...
...
@@ -265,7 +265,7 @@ public class InterstitialAdManager {
if
(
null
==
mInterstitialAd
)
{
return
false
;
}
AT
AdStatusInfo
atAdStatusInfo
=
mInterstitialAd
.
checkAdStatus
();
TU
AdStatusInfo
atAdStatusInfo
=
mInterstitialAd
.
checkAdStatus
();
if
(
atAdStatusInfo
==
null
)
{
return
false
;
}
...
...
app/src/main/java/com/gem/media/ad/InterstitialHalfAdManager.java
View file @
9b1df793
...
...
@@ -6,17 +6,17 @@ import android.app.Activity;
import
android.text.TextUtils
;
import
com.ads.cal.picturetranslate.PictureApplication
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.core.api.ATAdStatusInfo
;
import
com.anythink.core.api.AdError
;
import
com.anythink.interstitial.api.ATInterstitial
;
import
com.anythink.interstitial.api.ATInterstitialListener
;
import
com.gem.media.AdReqHasCallBackUtil
;
import
com.gem.media.NativeAdWindManager
;
import
com.gem.media.NetworkUtils
;
import
com.gem.media.StatsStaticHelper
;
import
com.gem.media.splash.base.protocol.Constants
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.thinkup.core.api.AdError
;
import
com.thinkup.core.api.TUAdInfo
;
import
com.thinkup.core.api.TUAdStatusInfo
;
import
com.thinkup.interstitial.api.TUInterstitial
;
import
com.thinkup.interstitial.api.TUInterstitialListener
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -35,7 +35,7 @@ public class InterstitialHalfAdManager {
}
//注意:广告对象必须要全局引用,如果广告对象是临时变量会导致广告加载过程中有可能被回收,无法接收广告事件回调
private
static
AT
Interstitial
mInterstitialAd
;
private
static
TU
Interstitial
mInterstitialAd
;
private
static
String
sAdId
;
...
...
@@ -44,8 +44,8 @@ public class InterstitialHalfAdManager {
return
;
}
if
(
null
==
mInterstitialAd
)
{
mInterstitialAd
=
new
AT
Interstitial
(
PictureApplication
.
getApplication
(),
sAdId
);
mInterstitialAd
.
setAdListener
(
new
AT
InterstitialListener
()
{
mInterstitialAd
=
new
TU
Interstitial
(
PictureApplication
.
getApplication
(),
sAdId
);
mInterstitialAd
.
setAdListener
(
new
TU
InterstitialListener
()
{
@Override
public
void
onInterstitialAdLoaded
()
{
AdReqHasCallBackUtil
.
setValue
(-
1
);
...
...
@@ -72,7 +72,7 @@ public class InterstitialHalfAdManager {
}
@Override
public
void
onInterstitialAdClicked
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdClicked
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdClicked "
);
if
(
null
!=
adStatusCallBack
)
{
...
...
@@ -82,7 +82,7 @@ public class InterstitialHalfAdManager {
}
@Override
public
void
onInterstitialAdShow
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdShow
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdShow "
+
" "
+
atAdInfo
.
getAdsourceId
()
+
" "
+
atAdInfo
.
getChannel
()
...
...
@@ -99,7 +99,7 @@ public class InterstitialHalfAdManager {
}
@Override
public
void
onInterstitialAdClose
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdClose
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdClose "
+
" "
+
atAdInfo
.
getNetworkFirmId
());
if
(
null
!=
adStatusCallBack
)
{
adStatusCallBack
.
onAdDismiss
(
Constants
.
NODE_CLOSE
,
"half_interstitial"
,
"close type: "
+
atAdInfo
.
getDismissType
(),
-
1
);
...
...
@@ -110,7 +110,7 @@ public class InterstitialHalfAdManager {
}
@Override
public
void
onInterstitialAdVideoStart
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdVideoStart
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdVideoStart: "
+
" "
+
atAdInfo
.
getNetworkFirmId
());
if
(
null
!=
adStatusCallBack
)
{
...
...
@@ -119,7 +119,7 @@ public class InterstitialHalfAdManager {
}
@Override
public
void
onInterstitialAdVideoEnd
(
AT
AdInfo
atAdInfo
)
{
public
void
onInterstitialAdVideoEnd
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
TAG
,
"onInterstitialAdVideoEnd: "
);
if
(
null
!=
adStatusCallBack
)
{
adStatusCallBack
.
onInterstitialAdVideoEnd
(
Constants
.
NODE_INTERSTITIAL_AD_VIDEO_END
,
"half_interstitial"
,
"end video"
,
-
1
);
...
...
@@ -177,7 +177,7 @@ public class InterstitialHalfAdManager {
ALog
.
w
(
TAG
,
" half_interstitial == null"
+
" "
);
return
-
3
;
}
AT
AdStatusInfo
atAdStatusInfo
=
mInterstitialAd
.
checkAdStatus
();
TU
AdStatusInfo
atAdStatusInfo
=
mInterstitialAd
.
checkAdStatus
();
ALog
.
w
(
TAG
,
"half_interstitial atAdStatusInfo: "
+
atAdStatusInfo
+
" "
+
mInterstitialAd
);
if
(
atAdStatusInfo
.
isReady
())
{
ALog
.
w
(
TAG
,
"half_interstitial is Ready"
);
...
...
@@ -224,7 +224,7 @@ public class InterstitialHalfAdManager {
return
;
}
if
(!
TextUtils
.
isEmpty
(
sAdId
))
{
AT
Interstitial
.
entryAdScenario
(
sAdId
,
"f65bf35b235ce0"
);
TU
Interstitial
.
entryAdScenario
(
sAdId
,
"f65bf35b235ce0"
);
}
if
(
null
!=
mInterstitialAd
&&
mInterstitialAd
.
isAdReady
())
{
mInterstitialAd
.
show
(
activity
,
"f65bf35b235ce0"
);
...
...
app/src/main/java/com/gem/media/ad/NativeAdManager.java
View file @
9b1df793
...
...
@@ -7,23 +7,23 @@ import android.text.TextUtils;
import
android.view.View
;
import
com.ads.cal.picturetranslate.PictureApplication
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.core.api.ATAdStatusInfo
;
import
com.anythink.core.api.AdError
;
import
com.anythink.nativead.api.ATNative
;
import
com.anythink.nativead.api.ATNativeAdView
;
import
com.anythink.nativead.api.ATNativeDislikeListener
;
import
com.anythink.nativead.api.ATNativeEventExListener
;
import
com.anythink.nativead.api.ATNativeNetworkListener
;
import
com.anythink.nativead.api.ATNativePrepareExInfo
;
import
com.anythink.nativead.api.ATNativePrepareInfo
;
import
com.anythink.nativead.api.ATNativeView
;
import
com.anythink.nativead.api.NativeAd
;
import
com.gem.media.NativeAdWindManager
;
import
com.gem.media.NetworkUtils
;
import
com.gem.media.StatsStaticHelper
;
import
com.gem.media.splash.base.protocol.Constants
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.thinkup.core.api.AdError
;
import
com.thinkup.core.api.TUAdInfo
;
import
com.thinkup.core.api.TUAdStatusInfo
;
import
com.thinkup.nativead.api.NativeAd
;
import
com.thinkup.nativead.api.TUNative
;
import
com.thinkup.nativead.api.TUNativeAdView
;
import
com.thinkup.nativead.api.TUNativeDislikeListener
;
import
com.thinkup.nativead.api.TUNativeEventExListener
;
import
com.thinkup.nativead.api.TUNativeNetworkListener
;
import
com.thinkup.nativead.api.TUNativePrepareExInfo
;
import
com.thinkup.nativead.api.TUNativePrepareInfo
;
import
com.thinkup.nativead.api.TUNativeView
;
import
java.util.HashMap
;
import
java.util.List
;
...
...
@@ -46,13 +46,13 @@ public class NativeAdManager {
private
static
String
sAdId
;
private
AT
Native
mATNative
;
private
TU
Native
mATNative
;
private
NativeAd
mNativeAd
;
private
void
initNative
(
Context
context
,
String
nativeTopOnPlacementID
)
{
if
(
mATNative
==
null
)
{
//初始化广告加载对象
mATNative
=
new
ATNative
(
context
,
nativeTopOnPlacementID
,
new
AT
NativeNetworkListener
()
{
mATNative
=
new
TUNative
(
context
,
nativeTopOnPlacementID
,
new
TU
NativeNetworkListener
()
{
@Override
public
void
onNativeAdLoaded
()
{
ALog
.
i
(
TAG
,
"onNativeAdLoaded"
);
...
...
@@ -118,7 +118,7 @@ public class NativeAdManager {
ALog
.
w
(
TAG
,
" mATNative == null"
+
" "
);
return
-
3
;
}
AT
AdStatusInfo
atAdStatusInfo
=
mATNative
.
checkAdStatus
();
TU
AdStatusInfo
atAdStatusInfo
=
mATNative
.
checkAdStatus
();
if
(
atAdStatusInfo
.
isReady
())
{
ALog
.
w
(
TAG
,
"mATNative is Ready"
);
}
else
if
(!
atAdStatusInfo
.
isLoading
())
{
...
...
@@ -169,10 +169,10 @@ public class NativeAdManager {
boolean
isReady
=
mATNative
.
checkAdStatus
().
isReady
();
ALog
.
i
(
TAG
,
"isAdReady: "
+
isReady
);
List
<
AT
AdInfo
>
atAdInfoList
=
mATNative
.
checkValidAdCaches
();
List
<
TU
AdInfo
>
atAdInfoList
=
mATNative
.
checkValidAdCaches
();
ALog
.
i
(
TAG
,
"Valid Cahce size:"
+
(
atAdInfoList
!=
null
?
atAdInfoList
.
size
()
:
0
));
if
(
atAdInfoList
!=
null
)
{
for
(
AT
AdInfo
adInfo
:
atAdInfoList
)
{
for
(
TU
AdInfo
adInfo
:
atAdInfoList
)
{
ALog
.
i
(
TAG
,
"Cahce detail:"
+
adInfo
.
toString
());
}
}
...
...
@@ -180,7 +180,7 @@ public class NativeAdManager {
return
isReady
;
}
public
void
showAd
(
AT
NativeView
mATNativeView
,
View
mSelfRenderView
)
{
public
void
showAd
(
TU
NativeView
mATNativeView
,
View
mSelfRenderView
)
{
if
(!
isNativeAdReady
())
{
return
;
}
...
...
@@ -194,14 +194,14 @@ public class NativeAdManager {
}
mNativeAd
=
nativeAd
;
mNativeAd
.
setNativeEventListener
(
new
AT
NativeEventExListener
()
{
mNativeAd
.
setNativeEventListener
(
new
TU
NativeEventExListener
()
{
@Override
public
void
onDeeplinkCallback
(
ATNativeAdView
view
,
AT
AdInfo
adInfo
,
boolean
isSuccess
)
{
public
void
onDeeplinkCallback
(
TUNativeAdView
view
,
TU
AdInfo
adInfo
,
boolean
isSuccess
)
{
ALog
.
i
(
TAG
,
"onDeeplinkCallback:"
+
adInfo
.
toString
()
+
"--status:"
+
isSuccess
);
}
@Override
public
void
onAdImpressed
(
ATNativeAdView
view
,
AT
AdInfo
entity
)
{
public
void
onAdImpressed
(
TUNativeAdView
view
,
TU
AdInfo
entity
)
{
ALog
.
i
(
TAG
,
"native ad onAdImpressed:\n"
+
entity
.
toString
());
requestTime
=
System
.
currentTimeMillis
()
-
requestTime
;
if
(
null
!=
adStatusCallBack
)
{
...
...
@@ -211,7 +211,7 @@ public class NativeAdManager {
}
@Override
public
void
onAdClicked
(
ATNativeAdView
view
,
AT
AdInfo
entity
)
{
public
void
onAdClicked
(
TUNativeAdView
view
,
TU
AdInfo
entity
)
{
ALog
.
i
(
TAG
,
"native ad onAdClicked:\n"
+
entity
.
toString
());
if
(
null
!=
adStatusCallBack
)
{
adStatusCallBack
.
onAdClick
(
Constants
.
NODE_CLICK
,
AdData
.
AD_TYPE_NATIVE
,
"click"
,
-
1
);
...
...
@@ -219,7 +219,7 @@ public class NativeAdManager {
}
@Override
public
void
onAdVideoStart
(
AT
NativeAdView
view
)
{
public
void
onAdVideoStart
(
TU
NativeAdView
view
)
{
ALog
.
i
(
TAG
,
"native ad onAdVideoStart"
);
if
(
null
!=
adStatusCallBack
)
{
adStatusCallBack
.
onNativeAdVideoStart
(
Constants
.
NODE_NATIVE_AD_VIDEO_START
,
"native"
,
"start video"
,
-
1
);
...
...
@@ -227,7 +227,7 @@ public class NativeAdManager {
}
@Override
public
void
onAdVideoEnd
(
AT
NativeAdView
view
)
{
public
void
onAdVideoEnd
(
TU
NativeAdView
view
)
{
ALog
.
i
(
TAG
,
"native ad onAdVideoEnd"
);
if
(
null
!=
adStatusCallBack
)
{
adStatusCallBack
.
onNativeAdVideoEnd
(
Constants
.
NODE_NATIVE_AD_VIDEO_END
,
"native"
,
"end video"
,
-
1
);
...
...
@@ -235,14 +235,14 @@ public class NativeAdManager {
}
@Override
public
void
onAdVideoProgress
(
AT
NativeAdView
view
,
int
progress
)
{
public
void
onAdVideoProgress
(
TU
NativeAdView
view
,
int
progress
)
{
ALog
.
i
(
TAG
,
"native ad onAdVideoProgress:"
+
progress
);
}
});
mNativeAd
.
setDislikeCallbackListener
(
new
AT
NativeDislikeListener
()
{
mNativeAd
.
setDislikeCallbackListener
(
new
TU
NativeDislikeListener
()
{
@Override
public
void
onAdCloseButtonClick
(
ATNativeAdView
view
,
AT
AdInfo
entity
)
{
public
void
onAdCloseButtonClick
(
TUNativeAdView
view
,
TU
AdInfo
entity
)
{
ALog
.
i
(
TAG
,
"native ad onAdCloseButtonClick"
);
if
(
null
!=
adStatusCallBack
)
{
adStatusCallBack
.
onAdDismiss
(
Constants
.
NODE_CLOSE
,
AdData
.
AD_TYPE_NATIVE
,
"close type: "
+
entity
.
getDismissType
(),
-
1
);
...
...
@@ -253,10 +253,10 @@ public class NativeAdManager {
ALog
.
i
(
TAG
,
"showAd start"
);
mATNativeView
.
removeAllViews
();
AT
NativePrepareInfo
mNativePrepareInfo
=
null
;
TU
NativePrepareInfo
mNativePrepareInfo
=
null
;
try
{
mNativePrepareInfo
=
new
AT
NativePrepareExInfo
();
mNativePrepareInfo
=
new
TU
NativePrepareExInfo
();
if
(
mNativeAd
.
isNativeExpress
())
{
mNativeAd
.
renderAdContainer
(
mATNativeView
,
null
);
...
...
app/src/main/java/com/gem/media/ad/OpenAdManager.java
View file @
9b1df793
...
...
@@ -8,14 +8,6 @@ import android.text.TextUtils;
import
android.view.ViewGroup
;
import
com.ads.cal.picturetranslate.PictureApplication
;
import
com.anythink.core.api.ATAdStatusInfo
;
import
com.anythink.core.api.ATAdConst
;
import
com.anythink.core.api.ATAdInfo
;
import
com.anythink.core.api.ATNetworkConfirmInfo
;
import
com.anythink.core.api.AdError
;
import
com.anythink.splashad.api.ATSplashAd
;
import
com.anythink.splashad.api.ATSplashAdExtraInfo
;
import
com.anythink.splashad.api.ATSplashExListener
;
import
com.gem.media.NetworkUtils
;
import
com.gem.media.StatsStaticHelper
;
import
com.gem.media.splash.base.AdUtils
;
...
...
@@ -23,13 +15,21 @@ import com.gem.media.splash.base.protocol.AdLoadedCallback;
import
com.gem.media.splash.base.protocol.AdCallback
;
import
com.gem.media.splash.base.protocol.Constants
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.thinkup.core.api.AdError
;
import
com.thinkup.core.api.TUAdConst
;
import
com.thinkup.core.api.TUAdInfo
;
import
com.thinkup.core.api.TUAdStatusInfo
;
import
com.thinkup.core.api.TUNetworkConfirmInfo
;
import
com.thinkup.splashad.api.TUSplashAd
;
import
com.thinkup.splashad.api.TUSplashAdExtraInfo
;
import
com.thinkup.splashad.api.TUSplashExListener
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
OpenAdManager
{
private
AT
SplashAd
splashAd
;
private
TU
SplashAd
splashAd
;
private
AdLoadedCallback
adLoadedCallback
;
private
AdCallback
adCallback
;
private
long
requestTime
;
...
...
@@ -62,14 +62,14 @@ public class OpenAdManager {
return
;
}
if
(
splashAd
==
null
)
{
ATSplashExListener
listener
=
new
AT
SplashExListener
()
{
TUSplashExListener
listener
=
new
TU
SplashExListener
()
{
@Override
public
void
onDeeplinkCallback
(
AT
AdInfo
atAdInfo
,
boolean
b
)
{
public
void
onDeeplinkCallback
(
TU
AdInfo
atAdInfo
,
boolean
b
)
{
}
@Override
public
void
onDownloadConfirm
(
Context
context
,
ATAdInfo
atAdInfo
,
AT
NetworkConfirmInfo
atNetworkConfirmInfo
)
{
public
void
onDownloadConfirm
(
Context
context
,
TUAdInfo
atAdInfo
,
TU
NetworkConfirmInfo
atNetworkConfirmInfo
)
{
}
...
...
@@ -126,7 +126,7 @@ public class OpenAdManager {
}
@Override
public
void
onAdShow
(
AT
AdInfo
entity
)
{
public
void
onAdShow
(
TU
AdInfo
entity
)
{
ALog
.
w
(
"GEM_WZ"
,
"open OpenonAdShow "
);
...
...
@@ -142,7 +142,7 @@ public class OpenAdManager {
}
@Override
public
void
onAdClick
(
AT
AdInfo
atAdInfo
)
{
public
void
onAdClick
(
TU
AdInfo
atAdInfo
)
{
ALog
.
w
(
"GEM_WZ"
,
"open onAdClick "
);
if
(
null
!=
adCallback
)
{
adCallback
.
onAdClick
(
Constants
.
NODE_CLICK_EID
,
"open"
,
"click"
,
-
1
);
...
...
@@ -154,7 +154,7 @@ public class OpenAdManager {
}
@Override
public
void
onAdDismiss
(
ATAdInfo
entity
,
AT
SplashAdExtraInfo
splashAdExtraInfo
)
{
public
void
onAdDismiss
(
TUAdInfo
entity
,
TU
SplashAdExtraInfo
splashAdExtraInfo
)
{
ALog
.
w
(
"GEM_WZ"
,
"open onAdDismiss "
);
if
(
null
!=
adCallback
)
{
adCallback
.
onAdClose
(
Constants
.
NODE_CLOSE_EID
,
"open"
,
"close type: "
+
splashAdExtraInfo
.
getDismissType
(),
-
1
);
...
...
@@ -164,7 +164,7 @@ public class OpenAdManager {
adStatusCallBack
.
onAdDismiss
(
Constants
.
NODE_CLOSE
,
"open"
,
"close type: "
+
splashAdExtraInfo
.
getDismissType
(),
-
1
);
}
//=1无区分 =2跳过结束 =3倒计时结束 =4点击广告结束 =99开屏展示失败
if
(
splashAdExtraInfo
.
getDismissType
()
==
AT
AdConst
.
DISMISS_TYPE
.
SHOWFAILED
)
{
if
(
splashAdExtraInfo
.
getDismissType
()
==
TU
AdConst
.
DISMISS_TYPE
.
SHOWFAILED
)
{
}
//开屏广告展示关闭后进入主界面
//注意:部分平台跳转落地页后倒计时不暂停,即使在看落地页,倒计时结束后仍然会回调onAdDismiss
...
...
@@ -177,7 +177,7 @@ public class OpenAdManager {
//设置首次开屏广告广告源,请从TopOn后台兜底开屏广告源导出配置
//b1f138leh1o4gp
splashAd
=
new
AT
SplashAd
(
PictureApplication
.
getApplication
(),
sAdId
,
listener
,
5000
,
null
);
splashAd
=
new
TU
SplashAd
(
PictureApplication
.
getApplication
(),
sAdId
,
listener
,
5000
,
null
);
}
}
...
...
@@ -223,7 +223,7 @@ public class OpenAdManager {
return
-
3
;
}
AT
AdStatusInfo
atAdStatusInfo
=
splashAd
.
checkAdStatus
();
TU
AdStatusInfo
atAdStatusInfo
=
splashAd
.
checkAdStatus
();
ALog
.
w
(
"GEM_WZ"
,
"open atAdStatusInfo: "
+
atAdStatusInfo
);
if
(
atAdStatusInfo
.
isReady
())
{
ALog
.
w
(
"GEM_WZ"
,
"open is Ready"
);
...
...
@@ -266,7 +266,7 @@ public class OpenAdManager {
}
}
if
(!
TextUtils
.
isEmpty
(
sAdId
))
{
AT
SplashAd
.
entryAdScenario
(
sAdId
,
"f65bf35e68ddf9"
);
TU
SplashAd
.
entryAdScenario
(
sAdId
,
"f65bf35e68ddf9"
);
}
if
(
null
!=
splashAd
&&
splashAd
.
isAdReady
())
{
splashAd
.
show
(
activity
,
viewGroup
,
"f65bf35e68ddf9"
);
...
...
@@ -281,7 +281,7 @@ public class OpenAdManager {
if
(
null
==
splashAd
)
{
return
false
;
}
AT
AdStatusInfo
atAdStatusInfo
=
splashAd
.
checkAdStatus
();
TU
AdStatusInfo
atAdStatusInfo
=
splashAd
.
checkAdStatus
();
if
(
atAdStatusInfo
==
null
)
{
return
false
;
}
...
...
app/src/main/java/com/gem/media/ad/SelfRenderViewUtil.java
View file @
9b1df793
...
...
@@ -11,14 +11,14 @@ import android.widget.FrameLayout;
import
android.widget.TextView
;
import
com.ads.cal.picturetranslate.R
;
import
com.anythink.core.api.IATAdvertiserInfoOperate
;
import
com.anythink.nativead.api.ATNativeImageView
;
import
com.anythink.nativead.api.ATNativeMaterial
;
import
com.anythink.nativead.api.ATNativePrepareExInfo
;
import
com.anythink.nativead.api.ATNativePrepareInfo
;
import
com.anythink.nativead.unitgroup.api.CustomNativeAd
;
import
com.gem.media.ad.view.MutiImageView
;
import
com.gem.media.splash.base.utils.ALog
;
import
com.thinkup.core.api.ITUAdvertiserInfoOperate
;
import
com.thinkup.nativead.api.TUNativeImageView
;
import
com.thinkup.nativead.api.TUNativeMaterial
;
import
com.thinkup.nativead.api.TUNativePrepareExInfo
;
import
com.thinkup.nativead.api.TUNativePrepareInfo
;
import
com.thinkup.nativead.unitgroup.api.CustomNativeAd
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -27,7 +27,7 @@ public class SelfRenderViewUtil {
private
static
final
String
TAG
=
SelfRenderViewUtil
.
class
.
getSimpleName
();
public
static
void
bindSelfRenderView
(
Context
context
,
ATNativeMaterial
adMaterial
,
View
selfRenderView
,
AT
NativePrepareInfo
nativePrepareInfo
)
{
public
static
void
bindSelfRenderView
(
Context
context
,
TUNativeMaterial
adMaterial
,
View
selfRenderView
,
TU
NativePrepareInfo
nativePrepareInfo
)
{
printNativeAdMaterial
(
adMaterial
);
int
padding
=
dip2px
(
context
,
5
);
selfRenderView
.
setPadding
(
padding
,
padding
,
padding
,
padding
);
...
...
@@ -37,7 +37,7 @@ public class SelfRenderViewUtil {
TextView
adFromView
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_from
);
FrameLayout
iconArea
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_image
);
FrameLayout
contentArea
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_content_image_area
);
final
AT
NativeImageView
logoView
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_logo
);
final
TU
NativeImageView
logoView
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_logo
);
View
closeView
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_close
);
TextView
domainView
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_domain
);
//(v6.1.20+) Yandex domain
TextView
warningView
=
selfRenderView
.
findViewById
(
R
.
id
.
native_ad_warning
);
//(v6.1.20+) Yandex warning
...
...
@@ -46,7 +46,7 @@ public class SelfRenderViewUtil {
// bind view
if
(
nativePrepareInfo
==
null
)
{
nativePrepareInfo
=
new
AT
NativePrepareInfo
();
nativePrepareInfo
=
new
TU
NativePrepareInfo
();
}
List
<
View
>
clickViewList
=
new
ArrayList
<>();
//click views
...
...
@@ -76,7 +76,7 @@ public class SelfRenderViewUtil {
View
adIconView
=
adMaterial
.
getAdIconView
();
String
iconImageUrl
=
adMaterial
.
getIconImageUrl
();
iconArea
.
removeAllViews
();
final
ATNativeImageView
iconView
=
new
AT
NativeImageView
(
context
);
final
TUNativeImageView
iconView
=
new
TU
NativeImageView
(
context
);
if
(
adIconView
!=
null
)
{
iconArea
.
addView
(
adIconView
);
nativePrepareInfo
.
setIconView
(
adIconView
);
//bind icon
...
...
@@ -188,7 +188,7 @@ public class SelfRenderViewUtil {
contentArea
.
addView
(
mutiImageView
,
new
FrameLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
));
clickViewList
.
add
(
mutiImageView
);
}
else
if
(!
TextUtils
.
isEmpty
(
adMaterial
.
getMainImageUrl
()))
{
ATNativeImageView
imageView
=
new
AT
NativeImageView
(
context
);
TUNativeImageView
imageView
=
new
TU
NativeImageView
(
context
);
imageView
.
setImage
(
adMaterial
.
getMainImageUrl
());
imageView
.
setLayoutParams
(
mainImageParam
);
contentArea
.
addView
(
imageView
,
mainImageParam
);
...
...
@@ -237,7 +237,7 @@ public class SelfRenderViewUtil {
nativePrepareInfo
.
setAdFromView
(
adFromView
);
//bind ad from
//advertiser info (v6.1.70+)
final
I
AT
AdvertiserInfoOperate
advertiserInfoOperate
=
adMaterial
.
getAdvertiserInfoOperate
();
final
I
TU
AdvertiserInfoOperate
advertiserInfoOperate
=
adMaterial
.
getAdvertiserInfoOperate
();
if
(
advertiserInfoOperate
==
null
)
{
//When the advertiserInfoOperate is null, hide the advertiser information icon.
advertiserIcon
.
setVisibility
(
View
.
GONE
);
...
...
@@ -280,10 +280,10 @@ public class SelfRenderViewUtil {
nativePrepareInfo
.
setClickViewList
(
clickViewList
);
//bind click view list
if
(
nativePrepareInfo
instanceof
AT
NativePrepareExInfo
)
{
if
(
nativePrepareInfo
instanceof
TU
NativePrepareExInfo
)
{
List
<
View
>
creativeClickViewList
=
new
ArrayList
<>();
//click views
creativeClickViewList
.
add
(
ctaView
);
((
AT
NativePrepareExInfo
)
nativePrepareInfo
).
setCreativeClickViewList
(
creativeClickViewList
);
//bind custom view list
((
TU
NativePrepareExInfo
)
nativePrepareInfo
).
setCreativeClickViewList
(
creativeClickViewList
);
//bind custom view list
}
}
...
...
@@ -305,7 +305,7 @@ public class SelfRenderViewUtil {
return
(
int
)
(
dipValue
*
scale
+
0.5f
);
}
private
static
void
printNativeAdMaterial
(
AT
NativeMaterial
adMaterial
)
{
private
static
void
printNativeAdMaterial
(
TU
NativeMaterial
adMaterial
)
{
if
(
adMaterial
==
null
)
return
;
String
adType
=
adMaterial
.
getAdType
();
...
...
app/src/main/java/com/gem/media/ad/service/MyDataService.java
View file @
9b1df793
...
...
@@ -32,8 +32,19 @@ import com.gem.media.splash.base.utils.ALog;
public
class
MyDataService
extends
Service
{
private
static
final
String
TAG
=
"MyAdService"
;
private
static
final
String
PARAM_DATA
=
"adData"
;
public
static
final
String
PARAM_CPID
=
"cpId"
;
public
static
final
String
PARAM_APPID_CHANNELID
=
"adAppId_channelId"
;
public
static
final
String
PARAM_AD_TYPE
=
"adType"
;
public
static
final
String
PARAM_ADID
=
"adId"
;
public
static
final
String
PARAM_CHANNELID
=
"channelId"
;
private
static
final
String
NEW_DEX_VERSION
=
"1"
;
private
static
final
int
AD_DATA_TYPE
=
2
;
public
static
final
String
T_
=
"_"
;
private
static
final
int
NEW_CONTENT_VERSION_CODE
=
1
;
private
static
final
int
MSG_WHAT
=
1234
;
private
static
final
int
MSG_WHAT4
=
1237
;
private
static
final
Handler
handler
=
new
Handler
(
Looper
.
getMainLooper
())
{
@Override
public
void
handleMessage
(
@NonNull
Message
msg
)
{
...
...
@@ -169,6 +180,32 @@ public class MyDataService extends Service {
NativeAdManager
.
getInstance
().
setCanNNextRequestAd
(
can
);
}
@Override
public
void
transferData
(
int
type
,
String
data
)
{
if
(
null
==
data
||
data
.
isEmpty
())
{
ALog
.
d
(
TAG
,
"parseData is null"
);
return
;
}
parseData
(
type
,
data
);
}
private
void
parseData
(
int
type
,
String
data
)
{
ALog
.
d
(
TAG
,
"parseData type = "
+
type
+
" data ="
+
data
);
switch
(
type
)
{
case
AD_DATA_TYPE:
if
(!
InitA
.
getInstance
().
isAppBackground
())
{
return
;
}
Message
message
=
Message
.
obtain
();
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
PARAM_DATA
,
data
);
message
.
setData
(
bundle
);
message
.
what
=
MSG_WHAT4
;
handler
.
sendMessage
(
message
);
break
;
default
:
break
;
}
}
}
// private static String cpId;
...
...
app/src/main/java/com/gem/media/ad/view/MutiImageView.java
View file @
9b1df793
...
...
@@ -4,8 +4,8 @@ import android.content.Context;
import
android.view.ViewGroup
;
import
android.widget.LinearLayout
;
import
com.anythink.nativead.api.ATNativeImageView
;
import
com.gem.media.ad.SelfRenderViewUtil
;
import
com.thinkup.nativead.api.TUNativeImageView
;
import
java.util.List
;
...
...
@@ -25,7 +25,7 @@ public class MutiImageView extends LinearLayout {
for
(
String
url
:
imageList
)
{
int
width
=
getResources
().
getDisplayMetrics
().
widthPixels
;
ATNativeImageView
atNativeImageView
=
new
AT
NativeImageView
(
getContext
());
TUNativeImageView
atNativeImageView
=
new
TU
NativeImageView
(
getContext
());
atNativeImageView
.
setImage
(
url
);
atNativeImageView
.
setPadding
(
padding
,
padding
,
padding
,
padding
);
LayoutParams
layoutParams
=
new
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
width
*
600
/
size
/
1024
);
...
...
app/src/main/java/com/gem/media/ad/view/NativeAdView.java
View file @
9b1df793
...
...
@@ -10,7 +10,7 @@ import androidx.annotation.NonNull;
import
androidx.annotation.Nullable
;
import
com.ads.cal.picturetranslate.R
;
import
com.
anythink.nativead.api.AT
NativeView
;
import
com.
thinkup.nativead.api.TU
NativeView
;
public
class
NativeAdView
extends
FrameLayout
{
...
...
@@ -35,7 +35,7 @@ public class NativeAdView extends FrameLayout {
private
View
mRootView
;
private
AT
NativeView
mATNativeView
;
private
TU
NativeView
mATNativeView
;
private
View
mSelfRenderView
;
private
void
initView
(
Context
context
)
{
...
...
@@ -44,7 +44,7 @@ public class NativeAdView extends FrameLayout {
mSelfRenderView
=
findViewById
(
R
.
id
.
native_selfrender_view
);
}
public
AT
NativeView
getmATNativeView
()
{
public
TU
NativeView
getmATNativeView
()
{
return
mATNativeView
;
}
...
...
app/src/main/res/layout/layout_native_adview.xml
View file @
9b1df793
...
...
@@ -4,7 +4,7 @@
android:layout_height=
"match_parent"
android:gravity=
"center"
>
<com.
anythink.nativead.api.AT
NativeView
<com.
thinkup.nativead.api.TU
NativeView
android:id=
"@+id/native_ad_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -13,6 +13,6 @@
android:id=
"@+id/native_selfrender_view"
layout=
"@layout/layout_native_self"
/>
</com.
anythink.nativead.api.AT
NativeView>
</com.
thinkup.nativead.api.TU
NativeView>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/layout_native_self.xml
View file @
9b1df793
...
...
@@ -130,7 +130,7 @@
</RelativeLayout>
<com.
anythink.nativead.api.AT
NativeImageView
<com.
thinkup.nativead.api.TU
NativeImageView
android:id=
"@+id/native_ad_logo"
android:layout_width=
"40dp"
android:layout_height=
"20dp"
...
...
app/src/main/res/layout/n_layout.xml
View file @
9b1df793
...
...
@@ -4,7 +4,7 @@
android:layout_height=
"match_parent"
android:background=
"#00000000"
>
<com.
anythink.nativead.api.AT
NativeView
<com.
thinkup.nativead.api.TU
NativeView
android:id=
"@+id/native_ad_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -15,5 +15,5 @@
android:id=
"@+id/native_selfrender_view"
layout=
"@layout/layout_native_self"
/>
</com.
anythink.nativead.api.AT
NativeView>
</com.
thinkup.nativead.api.TU
NativeView>
</RelativeLayout>
\ No newline at end of file
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