Skip to content

Commit e116e47

Browse files
authored
Merge pull request #621 from mindbox-cloud/release/2.13.5
Release 2.13.5
2 parents 39b89eb + 37d97a3 commit e116e47

File tree

13 files changed

+216
-114
lines changed

13 files changed

+216
-114
lines changed

.github/workflows/publish-reusable.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,27 @@ jobs:
9696
echo '${{secrets.GPGKEYCONTENTS}}' | base64 -d > /tmp/publish_key.gpg
9797
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRETPASSPHRASE}}" \
9898
--output /tmp/secret.gpg /tmp/publish_key.gpg
99-
echo -e "\nsigning.password=$signingpassword" >> gradle.properties
100-
echo -e "\nsigning.keyId=$signingkeyId" >> gradle.properties
101-
echo -e "\nsigning.secretKeyRingFile=/tmp/secret.gpg" >> gradle.properties
99+
echo "signing.password=${{secrets.signingpassword}}" >> gradle.properties
100+
echo "signing.keyId=${{secrets.signingkeyId}}" >> gradle.properties
101+
echo "signing.secretKeyRingFile=/tmp/secret.gpg" >> gradle.properties
102+
echo "mavenCentralUsername=${{secrets.CENTER_PORTAL_USERNAME}}" >> gradle.properties
103+
echo "mavenCentralPassword=${{secrets.CENTER_PORTAL_PASSWORD}}" >> gradle.properties
102104
env:
103105
signingpassword: ${{secrets.signingpassword}}
104106
signingkeyId: ${{secrets.signingkeyId}}
105107
SECRETPASSPHRASE: ${{secrets.SECRETPASSPHRASE}}
106108
GPGKEYCONTENTS: ${{secrets.GPGKEYCONTENTS}}
109+
SONATYPE_CONNECT_TIMEOUT_SECONDS: 60
110+
SONATYPE_CLOSE_TIMEOUT_SECONDS: 900
107111
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
108-
- name: Publish to Sonatype
109-
run: ./gradlew --no-daemon publish -PsonatypeUsername=${{secrets.OSSRHTOKEN}} -PsonatypePassword=${{secrets.OSSRHTOKENPASSWORD}}
112+
- name: Publish to Central Portal
113+
# Change github variable CENTER_PORTAL_AUTO_RELEASE to set up auto release Maven Central
114+
run: |
115+
if [ "${{ vars.CENTER_PORTAL_AUTO_RELEASE }}" = "true" ]; then
116+
./gradlew publishAndReleaseToMavenCentral --no-configuration-cache
117+
else
118+
./gradlew publishToMavenCentral --no-configuration-cache
119+
fi
110120
111121
release-github:
112122
needs: [publish]

example/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ dependencies {
7575
implementation 'com.google.code.gson:gson:2.11.0'
7676

7777
//Mindbox
78-
implementation 'cloud.mindbox:mobile-sdk:2.13.4'
78+
implementation 'cloud.mindbox:mobile-sdk:2.13.5'
7979
implementation 'cloud.mindbox:mindbox-firebase'
8080
implementation 'cloud.mindbox:mindbox-huawei'
8181
implementation 'cloud.mindbox:mindbox-rustore'

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ android.enableJetifier=true
2020
# Kotlin code style for this project: "official" or "obsolete":
2121
kotlin.code.style=official
2222
# SDK version property
23-
SDK_VERSION_NAME=2.13.4
23+
SDK_VERSION_NAME=2.13.5
2424
android.nonTransitiveRClass=false

gradle/libs.versions.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ androidx_annotations = "1.3.0"
2424
constraint_layout = "2.1.4"
2525
threetenapb = "1.4.6"
2626
glide = "4.15.1"
27+
app_compat = "1.7.1"
2728

2829
junit = "4.13.2"
2930
androidx_junit = "1.1.3"
@@ -36,6 +37,7 @@ turbine = "0.12.1"
3637
agcp = "1.6.0.300"
3738
ktlint-plugin = "12.1.1"
3839
ksp = "1.9.22-1.0.17"
40+
maven_publish = "0.32.0"
3941

4042
pushclient = "6.5.1"
4143

@@ -46,7 +48,8 @@ buildscript-plugins = [
4648
"google_services",
4749
"agcp",
4850
"ktlint_gradle_plugin",
49-
"ksp_gradle_plugin"
51+
"ksp_gradle_plugin",
52+
"maven_publish_plugin",
5053
]
5154

5255
test = [
@@ -88,6 +91,7 @@ constraint_layout = { group = "androidx.constraintlayout", name = "constraintlay
8891
threetenabp = { group = "com.jakewharton.threetenabp", name = "threetenabp", version.ref = "threetenapb" }
8992
glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" }
9093
glide_compiler = { group = "com.github.bumptech.glide", name = "compiler", version.ref = "glide" }
94+
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "app_compat" }
9195

9296
# RuStore libraries
9397
rustore_pushclient = { module = "ru.rustore.sdk:pushclient", version.ref = "pushclient" }
@@ -110,4 +114,5 @@ kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", v
110114
google_services = { module = "com.google.gms:google-services", version.ref = "google_services" }
111115
agcp = { module = "com.huawei.agconnect:agcp", version.ref = "agcp" }
112116
ktlint_gradle_plugin = { module = "org.jlleitschuh.gradle:ktlint-gradle", version.ref = "ktlint-plugin" }
113-
ksp_gradle_plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
117+
ksp_gradle_plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
118+
maven_publish_plugin = { module = "com.vanniktech:gradle-maven-publish-plugin", version.ref = "maven_publish" }

modulesCommon.gradle

Lines changed: 25 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'signing'
4-
apply plugin: 'maven-publish'
54
apply plugin: 'org.jlleitschuh.gradle.ktlint'
5+
apply plugin: 'com.vanniktech.maven.publish'
66

77
group = 'com.github.mindbox-cloud'
88

@@ -42,80 +42,43 @@ android {
4242
jvmTarget = '1.8'
4343
}
4444

45-
publishing {
46-
singleVariant("release") {
47-
withSourcesJar()
48-
}
49-
}
50-
5145
kotlin {
5246
explicitApi()
5347
}
5448
}
5549

56-
afterEvaluate {
57-
publishing {
58-
publications {
59-
release(MavenPublication) {
60-
from components.release
61-
groupId = 'cloud.mindbox'
62-
artifactId = ARTIFACT_ID
63-
version = SDK_VERSION_NAME
64-
pom {
65-
name = ARTIFACT_NAME
66-
description = 'Android Mindbox SDK'
67-
url = 'https://github.com/mindbox-cloud/android-sdk'
68-
licenses {
69-
license {
70-
name = 'The Mindbox License'
71-
url = 'https://github.com/mindbox-cloud/android-sdk/blob/master/LICENSE.md'
72-
}
73-
}
50+
mavenPublishing {
51+
publishToMavenCentral("CENTRAL_PORTAL")
52+
53+
if ((System.getenv("CI") == "true")) {
54+
signAllPublications()
55+
}
7456

75-
developers {
76-
developer {
77-
id = 'Mindbox'
78-
name = 'Mindbox'
79-
80-
}
81-
}
57+
coordinates('cloud.mindbox', ARTIFACT_ID, SDK_VERSION_NAME)
8258

83-
scm {
84-
connection = 'scm:https://github.com/mindbox-cloud/android-sdk.git'
85-
developerConnection = 'scm:git://github.com/mindbox-cloud/android-sdk.git'
86-
url = 'https://github.com/mindbox-cloud/android-sdk'
87-
}
88-
}
59+
pom {
60+
name = ARTIFACT_NAME
61+
description = 'Android Mindbox SDK'
62+
url = 'https://github.com/mindbox-cloud/android-sdk'
63+
licenses {
64+
license {
65+
name = 'The Mindbox License'
66+
url = 'https://github.com/mindbox-cloud/android-sdk/blob/master/LICENSE.md'
8967
}
9068
}
9169

92-
repositories {
93-
if (!project.hasProperty("sonatypeUsername")) {
94-
ext.sonatypeUsername = "sonatypeUsername"
95-
}
96-
if (!project.hasProperty("sonatypePassword")) {
97-
ext.sonatypePassword = "sonatypePassword"
98-
}
99-
maven {
100-
name = "OSSRH"
101-
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
102-
credentials {
103-
username = sonatypeUsername
104-
password = sonatypePassword
105-
}
70+
developers {
71+
developer {
72+
id = 'Mindbox'
73+
name = 'Mindbox'
74+
10675
}
10776
}
108-
}
10977

110-
signing {
111-
def signingKeyId = findProperty("signing.keyId")
112-
def signingKey = findProperty("signing.secretKeyRingFile")
113-
def signingPassword = findProperty("signing.password")
114-
if (signingKeyId && signingKey && signingPassword) {
115-
println("Signing applied")
116-
sign publishing.publications.release
117-
} else {
118-
println("Signing not applied")
78+
scm {
79+
connection = 'scm:https://github.com/mindbox-cloud/android-sdk.git'
80+
developerConnection = 'scm:git://github.com/mindbox-cloud/android-sdk.git'
81+
url = 'https://github.com/mindbox-cloud/android-sdk'
11982
}
12083
}
12184
}

sdk/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ dependencies {
4747
// Implementation dependencies
4848
implementation libs.kotlin.stdlib
4949
implementation libs.androidx.core.ktx
50+
implementation libs.appcompat
5051

5152
// ConstraintLayout
5253
implementation libs.constraint.layout

sdk/src/main/java/cloud/mindbox/mobile_sdk/Extensions.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,10 @@ internal inline fun <T> Result<T>.getOrNull(runIfNull: (Throwable) -> Unit): T?
258258
null
259259
}
260260

261+
internal inline fun <reified T> Any?.safeAs(): T? {
262+
return this as? T
263+
}
264+
261265
/**
262266
* Adds Mindbox push button unique keys extras to the [Intent].
263267
*

sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/AbstractInAppViewHolder.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ internal abstract class AbstractInAppViewHolder<T : InAppType> : InAppViewHolder
2929

3030
protected open var isInAppMessageActive = false
3131

32+
private var positionController: InAppPositionController? = null
33+
3234
private var _currentDialog: InAppConstraintLayout? = null
3335
protected val currentDialog: InAppConstraintLayout
3436
get() = _currentDialog!!
@@ -174,13 +176,18 @@ internal abstract class AbstractInAppViewHolder<T : InAppType> : InAppViewHolder
174176
}
175177

176178
override fun show(currentRoot: MindboxView) {
177-
isInAppMessageActive = true
178179
initView(currentRoot.container)
180+
val isRepositioningEnabled = currentRoot.container.context.resources.getBoolean(R.bool.mindbox_support_inapp_on_fragment)
181+
positionController = isRepositioningEnabled.takeIf { it }?.run {
182+
InAppPositionController().apply { start(currentDialog) }
183+
}
179184
hideKeyboard(currentRoot.container)
180185
inAppActionHandler.mindboxView = currentRoot
181186
}
182187

183188
override fun hide() {
189+
positionController?.stop()
190+
positionController = null
184191
(currentDialog.parent as? ViewGroup?)?.apply {
185192
removeView(_currentDialog)
186193
}

sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/InAppConstraintLayout.kt

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ import android.util.AttributeSet
66
import android.view.Gravity
77
import android.view.KeyEvent
88
import android.view.MotionEvent
9-
import android.view.animation.TranslateAnimation
9+
import android.view.animation.AccelerateDecelerateInterpolator
1010
import android.widget.FrameLayout
1111
import androidx.constraintlayout.widget.ConstraintLayout
12-
import androidx.core.view.doOnLayout
13-
import androidx.core.view.marginBottom
14-
import androidx.core.view.marginTop
15-
import androidx.core.view.updateLayoutParams
16-
import androidx.interpolator.view.animation.LinearOutSlowInInterpolator
12+
import androidx.core.view.*
1713
import cloud.mindbox.mobile_sdk.SnackbarPosition
1814
import cloud.mindbox.mobile_sdk.inapp.domain.models.InAppType
1915
import cloud.mindbox.mobile_sdk.isTop
2016
import cloud.mindbox.mobile_sdk.px
21-
import cloud.mindbox.mobile_sdk.setOnAnimationEnd
2217
import kotlin.math.abs
2318

2419
internal class InAppConstraintLayout : ConstraintLayout, BackButtonLayout {
@@ -131,40 +126,41 @@ internal class InAppConstraintLayout : ConstraintLayout, BackButtonLayout {
131126
}
132127
}
133128

134-
fun slideUp(
135-
isReverse: Boolean = false,
136-
onAnimationEnd: Runnable = Runnable { }
137-
) {
138-
animateY(
139-
if (!isReverse) height.toFloat() else 0f,
140-
if (!isReverse) 0f else height.toFloat() + marginBottom,
141-
onAnimationEnd
142-
)
143-
}
144-
145-
fun slideDown(
146-
isReverse: Boolean = false,
147-
onAnimationEnd: Runnable = Runnable { }
148-
) {
149-
animateY(
150-
if (!isReverse) -height.toFloat() else 0f,
151-
if (!isReverse) 0f else -height.toFloat() - marginTop,
152-
onAnimationEnd
153-
)
129+
fun slideUp(isReverse: Boolean = false, onAnimationEnd: Runnable = Runnable { }) {
130+
val travelDistance = (height + marginBottom).toFloat()
131+
if (isReverse) {
132+
animate().translationY(travelDistance)
133+
.setDuration(ANIM_DURATION)
134+
.setInterpolator(AccelerateDecelerateInterpolator())
135+
.withEndAction(onAnimationEnd)
136+
.start()
137+
} else {
138+
translationY = travelDistance
139+
isVisible = true
140+
animate().translationY(0f)
141+
.setDuration(ANIM_DURATION)
142+
.setInterpolator(AccelerateDecelerateInterpolator())
143+
.withEndAction(onAnimationEnd)
144+
.start()
145+
}
154146
}
155147

156-
private fun animateY(
157-
from: Float,
158-
to: Float,
159-
onAnimationEnd: Runnable
160-
) {
161-
TranslateAnimation(0f, 0f, from, to).apply {
162-
duration = ANIM_DURATION
163-
fillAfter = true
164-
interpolator = LinearOutSlowInInterpolator()
165-
setOnAnimationEnd(onAnimationEnd)
166-
}.also {
167-
startAnimation(it)
148+
fun slideDown(isReverse: Boolean = false, onAnimationEnd: Runnable = Runnable { }) {
149+
val travelDistance = -(height + marginTop).toFloat()
150+
if (isReverse) {
151+
animate().translationY(travelDistance)
152+
.setDuration(ANIM_DURATION)
153+
.setInterpolator(AccelerateDecelerateInterpolator())
154+
.withEndAction(onAnimationEnd)
155+
.start()
156+
} else {
157+
translationY = travelDistance
158+
isVisible = true
159+
animate().translationY(0f)
160+
.setDuration(ANIM_DURATION)
161+
.setInterpolator(AccelerateDecelerateInterpolator())
162+
.withEndAction(onAnimationEnd)
163+
.start()
168164
}
169165
}
170166

sdk/src/main/java/cloud/mindbox/mobile_sdk/inapp/presentation/view/InAppImageView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package cloud.mindbox.mobile_sdk.inapp.presentation.view
22

33
import android.content.Context
4-
import android.widget.ImageView
4+
import androidx.appcompat.widget.AppCompatImageView
55
import androidx.constraintlayout.widget.ConstraintLayout
66
import androidx.constraintlayout.widget.ConstraintSet
77
import androidx.core.view.updateLayoutParams
88
import cloud.mindbox.mobile_sdk.dp
99
import cloud.mindbox.mobile_sdk.inapp.domain.models.Size
1010
import kotlin.math.roundToInt
1111

12-
internal class InAppImageView(context: Context) : ImageView(context) {
12+
internal class InAppImageView(context: Context) : AppCompatImageView(context) {
1313

1414
companion object {
1515
private const val MODAL_WINDOW_ASPECT_RATIO = "H,3:4"

0 commit comments

Comments
 (0)