Skip to content

Commit a922f05

Browse files
vasctMGaetan89
andauthored
Release 7.7.0 (#579)
* Update to Robolectric 4.12.2 (#577) This PR updates Robolectric to version 4.12.2. This is the latest version to support API 19. Changes: - Remove unnecessary shadows declaration in `@Config`. - Replace deprecated `RuntimeEnvironment.application` with `RuntimeEnvironment.getApplication()`. - Remove `org.robolectric:shadows-play-services` since it's not needed. - Remove some unused imports. * CT 7.3 support (#578) * Set AGP to 8.6.0 Set Gradle wrapper to 8.11.1 Set Kotlin plugin to 2.0.10 * Update CleverTap version to 7.3.1 Update minSDK to 21 Update compileSDK to 35 * Ignore LeanplumLocationManagerTest in release builds * Fix publication build script * Update Gradle Maven publication * Fix banner in-apps position on Android 15 * Fix in-app system bars margins * Change Maven Central deployment from OSSRH to Portal * Set version to 7.7.0 --------- Co-authored-by: Gaëtan Muller <[email protected]>
1 parent 21629db commit a922f05

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+195
-136
lines changed

.travis.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ android:
1818
- tools
1919
- platform-tools
2020
- tools
21-
- build-tools-34.0.0
22-
- android-34
21+
- build-tools;35.0.0
22+
- platforms;android-35
2323
- extras;android;m2repository
2424
# Uncomment for snapshot tests
2525
#- sys-img-x86-android-22
@@ -55,7 +55,7 @@ script:
5555

5656
before_deploy:
5757
- ./Tools/verifyTag.sh
58-
- ./gradlew assembleRelease generatePomFileForAarPublication
58+
- ./gradlew assembleRelease generatePomFileForReleasePublication
5959

6060
after_deploy:
6161
- ./Tools/triggerRondo.sh
@@ -64,7 +64,15 @@ after_deploy:
6464
deploy:
6565
- provider: script
6666
skip_cleanup: true
67-
script: ./gradlew artifactoryPublish publishAarPublicationToSonatypeRepository
67+
script: ./gradlew artifactoryPublish
6868
dpl_version: 1.10.16
6969
on:
7070
tags: true
71+
72+
- provider: script
73+
skip_cleanup: true
74+
script: ./gradlew AndroidSDKCore:publishToMavenCentralPortal AndroidSDKPush:publishToMavenCentralPortal AndroidSDKFcm:publishToMavenCentralPortal AndroidSDKHms:publishToMavenCentralPortal AndroidSDKLocation:publishToMavenCentralPortal
75+
dpl_version: 1.10.16
76+
on:
77+
tags: true
78+
condition: $(cat sdk-version.txt) != *"beta"*

AndroidSDK/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'com.jfrog.artifactory' version '4.25.5'
55
id 'maven-publish'
66
id 'signing'
7+
id 'tech.yanand.maven-central-publish' version '1.3.0'
78
}
89
apply from: "../common-methods.gradle"
910

@@ -40,6 +41,10 @@ android {
4041
targetCompatibility JAVA_VERSION
4142
}
4243

44+
kotlinOptions {
45+
jvmTarget = JAVA_VERSION
46+
}
47+
4348
sourceSets {
4449
main {
4550
manifest.srcFile 'AndroidManifest.xml'

AndroidSDKCore/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'com.jfrog.artifactory' version '4.25.5'
55
id 'maven-publish'
66
id 'signing'
7+
id 'tech.yanand.maven-central-publish' version '1.3.0'
78
}
89
apply from: "../common-methods.gradle"
910

AndroidSDKCore/src/main/java/com/leanplum/messagetemplates/controllers/BaseController.java

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@
2424
import android.app.Activity;
2525
import android.app.Dialog;
2626
import android.graphics.Color;
27-
import android.os.Build;
2827
import android.view.View;
28+
import android.view.ViewGroup;
2929
import android.view.ViewGroup.LayoutParams;
30-
import android.view.WindowManager;
3130
import android.view.animation.Animation;
3231
import android.widget.RelativeLayout;
3332

3433
import androidx.annotation.VisibleForTesting;
34+
import androidx.core.graphics.Insets;
35+
import androidx.core.view.ViewCompat;
36+
import androidx.core.view.WindowInsetsCompat;
37+
3538
import com.leanplum.core.R;
36-
import com.leanplum.messagetemplates.DialogCustomizer;
37-
import com.leanplum.messagetemplates.MessageTemplates;
3839
import com.leanplum.utils.SizeUtil;
3940
import com.leanplum.views.CloseButton;
4041
import com.leanplum.views.ViewUtils;
@@ -74,6 +75,21 @@ protected void init() {
7475
setContentView(contentView, contentView.getLayoutParams());
7576

7677
contentView.setAnimation(ViewUtils.createFadeInAnimation(350));
78+
ViewCompat.setOnApplyWindowInsetsListener(contentView, (v, insets) -> {
79+
Insets bars = insets.getInsets(
80+
WindowInsetsCompat.Type.statusBars()
81+
| WindowInsetsCompat.Type.navigationBars()
82+
| WindowInsetsCompat.Type.displayCutout()
83+
);
84+
LayoutParams lp = v.getLayoutParams();
85+
if (lp instanceof ViewGroup.MarginLayoutParams) {
86+
ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) lp;
87+
mlp.bottomMargin = bars.bottom;
88+
mlp.topMargin = bars.top;
89+
v.setLayoutParams(lp);
90+
}
91+
return WindowInsetsCompat.CONSUMED;
92+
});
7793
}
7894

7995
private RelativeLayout createContentView() {

AndroidSDKCore/src/main/java/com/leanplum/messagetemplates/controllers/RichHtmlController.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,23 @@
4040
import android.webkit.WebView;
4141
import android.webkit.WebViewClient;
4242
import android.widget.RelativeLayout;
43+
4344
import androidx.annotation.NonNull;
45+
import androidx.core.view.WindowCompat;
46+
4447
import com.leanplum.ActionContext;
4548
import com.leanplum.Leanplum;
4649
import com.leanplum.internal.Log;
4750
import com.leanplum.messagetemplates.DialogCustomizer;
4851
import com.leanplum.messagetemplates.MessageTemplates;
4952
import com.leanplum.messagetemplates.options.RichHtmlOptions;
5053
import com.leanplum.utils.SizeUtil;
54+
55+
import org.json.JSONObject;
56+
5157
import java.io.UnsupportedEncodingException;
5258
import java.net.URLDecoder;
5359
import java.util.Map;
54-
import org.json.JSONObject;
5560

5661
/**
5762
* Registers a Leanplum action that displays a HTML message.
@@ -95,7 +100,10 @@ protected void applyWindowDecoration() {
95100
return;
96101
}
97102

103+
WindowCompat.setDecorFitsSystemWindows(window, false);
98104
window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
105+
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
106+
window.setStatusBarColor(Color.TRANSPARENT);
99107

100108
if (richOptions.isBannerWithTapOutsideFalse()) {
101109
// banners need to be positioned at the top manually

AndroidSDKCore/src/main/java/com/leanplum/migration/push/HmsMigrationHandler.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,29 @@ package com.leanplum.migration.push
2424
import android.content.Context
2525
import android.os.Bundle
2626
import com.clevertap.android.sdk.Utils
27-
import com.clevertap.android.sdk.pushnotification.PushConstants.PushType
2827
import com.clevertap.android.sdk.pushnotification.PushNotificationHandler
28+
import com.clevertap.android.sdk.pushnotification.PushType
29+
2930

3031
class HmsMigrationHandler internal constructor() {
3132

33+
companion object {
34+
internal val HPS_PUSH_TYPE = PushType(
35+
"hps",
36+
"hps_token",
37+
"com.clevertap.android.hms.HmsPushProvider",
38+
"com.huawei.hms.push.HmsMessageService"
39+
)
40+
}
41+
3242
fun createNotification(context: Context?, messageData: String?): Boolean {
3343
val messageBundle: Bundle = Utils.stringToBundle(messageData)
3444
val isSuccess = try {
3545
PushNotificationHandler.getPushNotificationHandler().onMessageReceived(
3646
context,
3747
messageBundle,
38-
PushType.HPS.toString())
48+
HPS_PUSH_TYPE.type
49+
)
3950
} catch (t: Throwable) {
4051
t.printStackTrace()
4152
false
@@ -49,7 +60,7 @@ class HmsMigrationHandler internal constructor() {
4960
PushNotificationHandler.getPushNotificationHandler().onNewToken(
5061
context,
5162
token,
52-
PushType.HPS.type
63+
HPS_PUSH_TYPE
5364
)
5465
isSuccess = true
5566
} catch (t: Throwable) {

AndroidSDKCore/src/main/java/com/leanplum/migration/wrapper/CTWrapper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ internal class CTWrapper(
158158
val hmsToken = SharedPreferencesUtil.getString(context,
159159
Constants.Defaults.LEANPLUM_PUSH, Constants.Defaults.PROPERTY_HMS_TOKEN_ID)
160160
if (!TextUtils.isEmpty(hmsToken)) {
161-
cleverTap.pushHuaweiRegistrationId(hmsToken, true)
161+
cleverTap.pushRegistrationToken(hmsToken, HmsMigrationHandler.HPS_PUSH_TYPE, true)
162162
Log.d("Wrapper: hms token sent")
163163
}
164164
}

AndroidSDKFcm/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'com.jfrog.artifactory' version '4.25.5'
55
id 'maven-publish'
66
id 'signing'
7+
id 'tech.yanand.maven-central-publish' version '1.3.0'
78
}
89
apply from: "../common-methods.gradle"
910

@@ -28,6 +29,9 @@ android {
2829
sourceCompatibility JAVA_VERSION
2930
targetCompatibility JAVA_VERSION
3031
}
32+
kotlinOptions {
33+
jvmTarget = JAVA_VERSION
34+
}
3135
}
3236

3337
dependencies {

AndroidSDKHms/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'com.jfrog.artifactory' version '4.25.5'
55
id 'maven-publish'
66
id 'signing'
7+
id 'tech.yanand.maven-central-publish' version '1.3.0'
78
}
89
apply from: "../common-methods.gradle"
910

@@ -28,13 +29,17 @@ android {
2829
sourceCompatibility JAVA_VERSION
2930
targetCompatibility JAVA_VERSION
3031
}
32+
33+
kotlinOptions {
34+
jvmTarget = JAVA_VERSION
35+
}
3136
}
3237

3338
dependencies {
3439
api project(':AndroidSDKCore')
3540
api project(':AndroidSDKPush')
3641

37-
implementation 'com.huawei.agconnect:agconnect-core:1.9.1.300'
42+
implementation 'com.huawei.agconnect:agconnect-core:1.9.1.301'
3843
implementation 'com.huawei.hms:push:6.11.0.300'
3944
}
4045

AndroidSDKLocation/build.gradle

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id 'com.jfrog.artifactory' version '4.25.5'
55
id 'maven-publish'
66
id 'signing'
7+
id 'tech.yanand.maven-central-publish' version '1.3.0'
78
}
89
apply from: "../common-methods.gradle"
910

@@ -28,13 +29,17 @@ android {
2829
sourceCompatibility JAVA_VERSION
2930
targetCompatibility JAVA_VERSION
3031
}
32+
33+
kotlinOptions {
34+
jvmTarget = JAVA_VERSION
35+
}
3136
}
3237

3338
dependencies {
3439
api project(':AndroidSDKCore')
3540

3641
// Provided dependencies are optional dependencies and will not show up in pom file.
37-
compileOnly('com.google.android.gms:play-services-location:[16.0.0,)') {
42+
compileOnly('com.google.android.gms:play-services-location:[21.3.0,)') {
3843
exclude module: 'support-v4'
3944
}
4045
}

0 commit comments

Comments
 (0)