Skip to content

Commit a39b8c2

Browse files
committed
Update to v6.71
1 parent 6ae7bcf commit a39b8c2

9 files changed

Lines changed: 810 additions & 287 deletions

File tree

AnLinux/.idea/caches/deviceStreaming.xml

Lines changed: 584 additions & 113 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AnLinux/app/build.gradle

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ apply plugin: 'com.android.application'
33
android {
44
defaultConfig {
55
applicationId "exa.lnx.a"
6-
minSdkVersion 23
6+
minSdkVersion 24
77
targetSdkVersion 36
88
compileSdk 36
9-
versionCode 670
10-
versionName "6.70 Stable"
9+
versionCode 671
10+
versionName "6.71 Stable"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
13+
configurations.configureEach {
14+
exclude group: "com.google.android.gms", module: "play-services-ads"
15+
exclude group: "com.google.android.gms", module: "play-services-ads-lite"
16+
}
1317
buildTypes {
1418
release {
1519
minifyEnabled false
@@ -21,13 +25,13 @@ android {
2125

2226
dependencies {
2327
implementation fileTree(dir: 'libs', include: ['*.jar'])
24-
implementation 'androidx.work:work-runtime:2.11.0'
25-
implementation 'androidx.annotation:annotation:1.9.1'
28+
implementation 'androidx.work:work-runtime:2.11.2'
29+
implementation 'androidx.annotation:annotation:1.10.0'
2630
implementation 'androidx.appcompat:appcompat:1.7.1'
2731
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
2832
implementation("com.google.android.ump:user-messaging-platform:4.0.0")
29-
implementation 'com.google.android.material:material:1.13.0'
30-
implementation 'com.google.android.gms:play-services-ads:24.9.0'
33+
implementation 'com.google.android.material:material:1.14.0'
34+
implementation("com.google.android.libraries.ads.mobile.sdk:ads-mobile-sdk:1.0.1")
3135
testImplementation 'junit:junit:4.13.2'
3236
androidTestImplementation 'androidx.test:runner:1.7.0'
3337
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
1.27 MB
Binary file not shown.
-6 Bytes
Binary file not shown.
-3 Bytes
Binary file not shown.

AnLinux/app/release/output-metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 670,
15-
"versionName": "6.70 Stable",
14+
"versionCode": 671,
15+
"versionName": "6.71 Stable",
1616
"outputFile": "app-release.apk"
1717
}
1818
],
@@ -33,5 +33,5 @@
3333
]
3434
}
3535
],
36-
"minSdkVersionForDexing": 23
36+
"minSdkVersionForDexing": 24
3737
}

AnLinux/app/src/main/java/exa/lnx/a/AppOpenAdManager.java

Lines changed: 64 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@
77
import androidx.annotation.NonNull;
88

99
import com.google.android.gms.ads.AdError;
10-
import com.google.android.gms.ads.AdRequest;
11-
import com.google.android.gms.ads.FullScreenContentCallback;
12-
import com.google.android.gms.ads.LoadAdError;
13-
import com.google.android.gms.ads.appopen.AppOpenAd;
10+
import com.google.android.libraries.ads.mobile.sdk.appopen.AppOpenAd;
11+
import com.google.android.libraries.ads.mobile.sdk.appopen.AppOpenAdEventCallback;
12+
import com.google.android.libraries.ads.mobile.sdk.common.AdLoadCallback;
13+
import com.google.android.libraries.ads.mobile.sdk.common.AdRequest;
14+
import com.google.android.libraries.ads.mobile.sdk.common.AdValue;
15+
import com.google.android.libraries.ads.mobile.sdk.common.FullScreenContentError;
16+
import com.google.android.libraries.ads.mobile.sdk.common.LoadAdError;
17+
18+
import org.jetbrains.annotations.NotNull;
1419

1520
import java.util.Date;
1621

@@ -39,24 +44,22 @@ public void loadAd(Context context) {
3944
}
4045

4146
isLoadingAd = true;
42-
AdRequest request = new AdRequest.Builder().build();
4347
AppOpenAd.load(
44-
context, AD_UNIT_ID, request,
45-
new AppOpenAd.AppOpenAdLoadCallback() {
48+
new AdRequest.Builder(AD_UNIT_ID).build(),
49+
new AdLoadCallback<AppOpenAd>() {
4650
@Override
47-
public void onAdLoaded(AppOpenAd ad) {
48-
// Called when an app open ad has loaded.
49-
Log.d(LOG_TAG, "Ad was loaded.");
51+
public void onAdLoaded(@NonNull AppOpenAd ad) {
52+
// Called when an ad has loaded.
53+
ad.setAdEventCallback(new AppOpenAdEventCallback() {
54+
55+
});
5056
appOpenAd = ad;
51-
isLoadingAd = false;
52-
loadTime = (new Date()).getTime();
5357
}
5458

5559
@Override
56-
public void onAdFailedToLoad(LoadAdError loadAdError) {
57-
// Called when an app open ad has failed to load.
58-
Log.d(LOG_TAG, loadAdError.getMessage());
59-
isLoadingAd = false;
60+
public void onAdFailedToLoad(@NonNull LoadAdError adError) {
61+
// Called when ad fails to load.
62+
isShowingAd = false;
6063
}
6164
});
6265
}
@@ -67,7 +70,7 @@ private boolean wasLoadTimeLessThanNHoursAgo(long numHours) {
6770
return (dateDifference < (numMilliSecondsPerHour * numHours));
6871
}
6972
private boolean isAdAvailable() {
70-
return appOpenAd != null && wasLoadTimeLessThanNHoursAgo(4);
73+
return appOpenAd != null && !wasLoadTimeLessThanNHoursAgo(4);
7174
}
7275
public void showAdIfAvailable(
7376
@NonNull final Activity activity,
@@ -86,39 +89,50 @@ public void showAdIfAvailable(
8689
return;
8790
}
8891

89-
appOpenAd.setFullScreenContentCallback(
90-
new FullScreenContentCallback() {
91-
92-
@Override
93-
public void onAdDismissedFullScreenContent() {
94-
// Called when fullscreen content is dismissed.
95-
// Set the reference to null so isAdAvailable() returns false.
96-
Log.d(LOG_TAG, "Ad dismissed fullscreen content.");
97-
appOpenAd = null;
98-
isShowingAd = false;
99-
100-
onShowAdCompleteListener.onShowAdComplete();
101-
loadAd(activity);
102-
}
103-
104-
@Override
105-
public void onAdFailedToShowFullScreenContent(AdError adError) {
106-
// Called when fullscreen content failed to show.
107-
// Set the reference to null so isAdAvailable() returns false.
108-
Log.d(LOG_TAG, adError.getMessage());
109-
appOpenAd = null;
110-
isShowingAd = false;
111-
112-
onShowAdCompleteListener.onShowAdComplete();
113-
loadAd(activity);
114-
}
115-
116-
@Override
117-
public void onAdShowedFullScreenContent() {
118-
// Called when fullscreen content is shown.
119-
Log.d(LOG_TAG, "Ad showed fullscreen content.");
120-
}
121-
});
92+
appOpenAd.setAdEventCallback(new AppOpenAdEventCallback() {
93+
@Override
94+
public void onAdClicked() {
95+
AppOpenAdEventCallback.super.onAdClicked();
96+
}
97+
98+
@Override
99+
public void onAdDismissedFullScreenContent() {
100+
// Called when fullscreen content is dismissed.
101+
// Set the reference to null so isAdAvailable() returns false.
102+
Log.d(LOG_TAG, "Ad dismissed fullscreen content.");
103+
appOpenAd = null;
104+
isShowingAd = false;
105+
106+
onShowAdCompleteListener.onShowAdComplete();
107+
loadAd(activity);
108+
}
109+
110+
@Override
111+
public void onAdFailedToShowFullScreenContent(@NotNull FullScreenContentError fullScreenContentError) {
112+
AppOpenAdEventCallback.super.onAdFailedToShowFullScreenContent(fullScreenContentError);
113+
Log.d(LOG_TAG, fullScreenContentError.getMessage());
114+
appOpenAd = null;
115+
isShowingAd = false;
116+
117+
onShowAdCompleteListener.onShowAdComplete();
118+
loadAd(activity);
119+
}
120+
121+
@Override
122+
public void onAdImpression() {
123+
AppOpenAdEventCallback.super.onAdImpression();
124+
}
125+
126+
@Override
127+
public void onAdPaid(@NotNull AdValue value) {
128+
AppOpenAdEventCallback.super.onAdPaid(value);
129+
}
130+
131+
@Override
132+
public void onAdShowedFullScreenContent() {
133+
AppOpenAdEventCallback.super.onAdShowedFullScreenContent();
134+
}
135+
});
122136
isShowingAd = true;
123137
appOpenAd.show(activity);
124138
}

0 commit comments

Comments
 (0)