Skip to content

Commit cdf99dc

Browse files
committed
Update to v6.72
1 parent a39b8c2 commit cdf99dc

27 files changed

Lines changed: 151 additions & 59 deletions

AnLinux/.idea/caches/deviceStreaming.xml

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

AnLinux/.idea/deploymentTargetSelector.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AnLinux/.idea/gradle.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AnLinux/app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ android {
44
defaultConfig {
55
applicationId "exa.lnx.a"
66
minSdkVersion 24
7-
targetSdkVersion 36
8-
compileSdk 36
9-
versionCode 671
10-
versionName "6.71 Stable"
7+
targetSdkVersion 37
8+
compileSdk 37
9+
versionCode 672
10+
versionName "6.72 Stable"
1111
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1212
}
1313
configurations.configureEach {
@@ -26,6 +26,7 @@ android {
2626
dependencies {
2727
implementation fileTree(dir: 'libs', include: ['*.jar'])
2828
implementation 'androidx.work:work-runtime:2.11.2'
29+
implementation "androidx.core:core-splashscreen:1.2.0"
2930
implementation 'androidx.annotation:annotation:1.10.0'
3031
implementation 'androidx.appcompat:appcompat:1.7.1'
3132
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
-27.1 KB
Binary file not shown.
30 Bytes
Binary file not shown.
115 Bytes
Binary file not shown.

AnLinux/app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"type": "SINGLE",
1212
"filters": [],
1313
"attributes": [],
14-
"versionCode": 671,
15-
"versionName": "6.71 Stable",
14+
"versionCode": 672,
15+
"versionName": "6.72 Stable",
1616
"outputFile": "app-release.apk"
1717
}
1818
],

AnLinux/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
android:exported="true"
2626
android:screenOrientation="portrait"
2727
android:label="@string/app_name"
28-
android:theme="@style/AppTheme.NoActionBar">
28+
android:theme="@style/Theme.MyApp.Splash">
2929
<intent-filter>
3030
<action android:name="android.intent.action.MAIN" />
3131

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
import android.app.Activity;
44
import android.content.Context;
5+
import android.content.SharedPreferences;
56
import android.util.Log;
67

78
import androidx.annotation.NonNull;
89

9-
import com.google.android.gms.ads.AdError;
1010
import com.google.android.libraries.ads.mobile.sdk.appopen.AppOpenAd;
1111
import com.google.android.libraries.ads.mobile.sdk.appopen.AppOpenAdEventCallback;
1212
import com.google.android.libraries.ads.mobile.sdk.common.AdLoadCallback;
@@ -17,8 +17,6 @@
1717

1818
import org.jetbrains.annotations.NotNull;
1919

20-
import java.util.Date;
21-
2220
public class AppOpenAdManager {
2321
private static final String LOG_TAG = "AppOpenAdManager";
2422
private static final String AD_UNIT_ID = "ca-app-pub-5748356089815497/7922138881";
@@ -39,7 +37,7 @@ public interface OnShowAdCompleteListener {
3937
/** Request an ad. */
4038
public void loadAd(Context context) {
4139
// Do not load ad if there is an unused ad or one is already loading.
42-
if (isLoadingAd || isAdAvailable()) {
40+
if (isLoadingAd || isAdAvailable(context)) {
4341
return;
4442
}
4543

@@ -64,13 +62,17 @@ public void onAdFailedToLoad(@NonNull LoadAdError adError) {
6462
});
6563
}
6664
/** Check if ad exists and can be shown. */
67-
private boolean wasLoadTimeLessThanNHoursAgo(long numHours) {
68-
long dateDifference = (new Date()).getTime() - this.loadTime;
69-
long numMilliSecondsPerHour = 3600000;
70-
return (dateDifference < (numMilliSecondsPerHour * numHours));
71-
}
72-
private boolean isAdAvailable() {
73-
return appOpenAd != null && !wasLoadTimeLessThanNHoursAgo(4);
65+
private boolean isAdAvailable(Context context) {
66+
final long APP_OPEN_AD_INTERVAL = 4 * 60 * 60 *1000;
67+
SharedPreferences sharedPreferences = context.getSharedPreferences("GlobalPreferences", 0);
68+
SharedPreferences.Editor editor = sharedPreferences.edit();
69+
long lastShown = sharedPreferences.getLong("LastShownTime", 0);
70+
long now = System.currentTimeMillis();
71+
if(now - lastShown >= APP_OPEN_AD_INTERVAL && appOpenAd != null){
72+
editor.putLong("LastShownTime", now).apply();
73+
return true;
74+
}
75+
return false;
7476
}
7577
public void showAdIfAvailable(
7678
@NonNull final Activity activity,
@@ -82,7 +84,7 @@ public void showAdIfAvailable(
8284
}
8385

8486
// If the app open ad is not available yet, invoke the callback then load the ad.
85-
if (!isAdAvailable()) {
87+
if (!isAdAvailable(activity)) {
8688
Log.d(LOG_TAG, "The app open ad is not ready yet.");
8789
onShowAdCompleteListener.onShowAdComplete();
8890
loadAd(activity);

0 commit comments

Comments
 (0)