Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.3.1 #755

Merged
merged 60 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
bda35fd
Added logger to AlertPresenter so dialog actions can be logged.
ChristoferAlexander Oct 10, 2023
3041654
Git feedback
ChristoferAlexander Oct 11, 2023
2702dcb
Git feedback - moved logging of display and dismiss to BaseAlertPrese…
ChristoferAlexander Oct 11, 2023
e3ebdc8
Fixed issues for iOS, Js and JVM
ChristoferAlexander Oct 11, 2023
d6d1913
PR feedback - moved action logs to Alerts.kt after handler and added …
ChristoferAlexander Oct 17, 2023
affcc46
Merge pull request #744 from splendo/master
Daeda88 Nov 13, 2023
867b4c7
Move to s01 sonatype
Daeda88 Nov 13, 2023
5f4a706
Update README.md
Daeda88 Nov 13, 2023
623a37f
Reverted Mtaspace size, should only be local
Daeda88 Nov 13, 2023
22a6c87
remove blank line from DEVELOP.md
thoutbeckers Nov 13, 2023
62660d5
Merge pull request #745 from splendo/feature/move-to-sonatype-s01
Daeda88 Nov 13, 2023
aedb1e0
IMprovements to KoinTests that ensure proper cleanup on unexpected fa…
Daeda88 Nov 22, 2023
33ff69a
Cleanup
Daeda88 Nov 22, 2023
f5185a8
API dump
Daeda88 Nov 22, 2023
1227712
Merge branch 'develop' into feature/733-dialog-logging
ChristoferAlexander Nov 22, 2023
b618e46
Fixes after merging develop
ChristoferAlexander Nov 22, 2023
049d1ef
Fixed mocks
ChristoferAlexander Nov 22, 2023
d58c738
Linted iOSMain
ChristoferAlexander Nov 22, 2023
be16a68
Fixed issues with JVM api
ChristoferAlexander Nov 22, 2023
591367a
Fixed issues with JVM api that broke public API
ChristoferAlexander Nov 22, 2023
a29009e
Reversed change that is no longer relevant
ChristoferAlexander Nov 22, 2023
2e9fe31
Merge pull request #747 from splendo/bugfix/732-koin-cleanup-improvem…
Daeda88 Nov 23, 2023
a60cdad
Upgrade to Kotlin 1.9.21
Daeda88 Nov 27, 2023
2cf79ba
Use latest kotlinter
Daeda88 Nov 27, 2023
1a70494
MockDevice support connect/disconnect
avdyushin Nov 27, 2023
f706b27
apiDump
avdyushin Nov 27, 2023
4d86bac
Lint
avdyushin Nov 27, 2023
80ef62a
MockDeviceBuilder added
avdyushin Dec 1, 2023
77df749
MockDeviceTest added
avdyushin Dec 1, 2023
ce34d0f
Update README.md
avdyushin Dec 1, 2023
c687f2d
apiDump
avdyushin Dec 1, 2023
e09b167
Update README.md
avdyushin Dec 1, 2023
ccfbb1c
add coroutines test dependency
thoutbeckers Dec 12, 2023
b64f311
use iPhone 15 by default
thoutbeckers Dec 12, 2023
7ec4e34
add missing copyright
thoutbeckers Dec 12, 2023
e6d8568
Use a StateFlow as backing rather than concurrentMap #554
thoutbeckers Dec 12, 2023
9d8c535
Upgrade Compose compiler
Daeda88 Dec 12, 2023
6ef9129
Correct koin import
Daeda88 Dec 12, 2023
56ac997
Tests for verifyWithin method #554
thoutbeckers Dec 12, 2023
4b9537d
verifyWithin method #554
thoutbeckers Dec 12, 2023
113447d
fix some typos
thoutbeckers Dec 12, 2023
3a5e084
make default duration private #554
thoutbeckers Dec 12, 2023
ba516a8
apiDump #554
thoutbeckers Dec 12, 2023
1731e4a
use XCode 15
thoutbeckers Dec 13, 2023
e9e7dd9
Merge pull request #751 from splendo/feature/750-mock-device-connect
avdyushin Dec 13, 2023
b4dcf2b
change max API level emulator to 34
ci-splendo Dec 13, 2023
36faa86
extend README for `verifyWithin` #554
thoutbeckers Dec 13, 2023
d9f1130
add missing . in exception message #554
thoutbeckers Dec 13, 2023
6194f8e
adds some extra tests for `verifyWithin` #554
thoutbeckers Dec 13, 2023
ba2cec3
Try to fix rerun_emulator.yaml
thoutbeckers Dec 13, 2023
99bdb59
Merge pull request #749 from splendo/feature/748-kotlin.19.21
Daeda88 Dec 13, 2023
66479f7
improve documentation of `verifyWithin`
thoutbeckers Dec 13, 2023
9bb8411
Merge remote-tracking branch 'origin/develop' into feature/733-dialog…
Daeda88 Dec 15, 2023
d13ce13
PR Remarks
Daeda88 Dec 15, 2023
f8e8aef
Merge pull request #753 from splendo/feature/554-verifyWitin
thoutbeckers Dec 15, 2023
7aa15f7
Merge pull request #754 from splendo/feature/emulator_34
thoutbeckers Dec 18, 2023
21aa38a
Fixed tests
Daeda88 Dec 18, 2023
a366087
Merge remote-tracking branch 'origin/develop' into feature/733-dialog…
Daeda88 Dec 18, 2023
bc87257
Fixed example
Daeda88 Dec 18, 2023
6c2add2
Merge pull request #734 from splendo/feature/733-dialog-logging
Daeda88 Dec 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/emulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
strategy:
fail-fast: false
matrix:
api-level: [23, 33]
api-level: [23, 34]
project: ${{ fromJSON(needs.build.outputs.projects) }}
steps:
- name: checkout
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/rerun_emulator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Rerun failed emulator tests
permissions:
contents: write

on:
workflow_run:
workflows: ["Android Emulator tests"]
Expand All @@ -9,5 +12,7 @@ jobs:
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.run_attempt < 2 }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- run: gh run rerun ${{ github.event.workflow_run.id }} --failed
- run: gh run rerun ${{ github.event.workflow_run.id }} --failed
5 changes: 5 additions & 0 deletions .github/workflows/setup_tools_macos/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ runs:
distribution: 'temurin'
java-version: 17

- name: use Xcode 15
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15'

- name: Gradle cache
uses: gradle/gradle-build-action@v2
with:
Expand Down
11 changes: 5 additions & 6 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ For example if the base version is `1.1` and `feature/123_fix_bug` is the curren

#### Local Testing

Before doing any publishing, make sure that changes are working with the one available in [Nexus Repository Manager](`oss.sonatype.org`).
Before doing any publishing, make sure that changes are working with the one available in [Nexus Repository Manager](`s01.oss.sonatype.org`).
Just adding the following code inside the `local.properties` file you can test both Android and iOS example app in `kaluga/example/`.
```
kaluga.exampleEmbeddingMethod=repo
kaluga.exampleMavenRepo=https://oss.sonatype.org/service/local/repositories/comsplendo-REPO_NUMBER/
kaluga.exampleMavenRepo=https://s01.oss.sonatype.org/service/local/repositories/comsplendo-REPO_NUMBER/
kaluga.libraryVersion=LIBRARY_VERSION
```
Where
`REPO_NUMBER` is the id of the staging repository created to do the release (normally done automatically by GitHub Actions upon a `master` commit, the number can be found on the https://oss.sonatype.org console under "staging repositories")
`REPO_NUMBER` is the id of the staging repository created to do the release (normally done automatically by GitHub Actions upon a `master` commit, the number can be found on the https://s01.oss.sonatype.org console under "staging repositories")
`LIBRARY_VERSION` is the version of the library that we are publish

Don't forget to remove these when you are done.
Expand Down Expand Up @@ -127,11 +127,11 @@ If these values are present as environment variables they will also be picked up

#### Publishing via CI

GitHub Actions automatically publishes every branch (except `master`) to the Sonatype snapshot repository (`https://oss.sonatype.org/content/repositories/snapshots/`). Commits on `master` are send to the Sonatype staging repository as the first step of a Maven Central release.
GitHub Actions automatically publishes every branch (except `master`) to the Sonatype snapshot repository (`https://s01.oss.sonatype.org/content/repositories/snapshots/`). Commits on `master` are send to the Sonatype staging repository as the first step of a Maven Central release.

#### Releasing to Maven Central

Projects publishing to Sonatype's staging repository need to be manually closed and released (promoted) before they will appear on Maven Central. This can only be done by people with access to https://oss.sonatype.org.
Projects publishing to Sonatype's staging repository need to be manually closed and released (promoted) before they will appear on Maven Central. This can only be done by people with access to https://s01.oss.sonatype.org.

#### Increase version after publishing

Expand Down Expand Up @@ -175,4 +175,3 @@ e: org.jetbrains.kotlin.konan.KonanExternalToolFailure: The /usr/bin/xcrun comma
Go to `XCode` -> `Preferences` -> `Locations tab` -> `Command Line Tools` dropdown.

It should show none selected, so select any item.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ You can also use the `SNAPSHOT` version based on the latest in the `develop` bra

```kotlin
repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
implementation("com.splendo.kaluga:alerts:$kalugaDevelopVersion-SNAPSHOT")
Expand Down
29 changes: 20 additions & 9 deletions alerts/api/androidLib/alerts.api
Original file line number Diff line number Diff line change
Expand Up @@ -103,33 +103,40 @@ public final class com/splendo/kaluga/alerts/AlertActions$DefaultImpls {
}

public final class com/splendo/kaluga/alerts/AlertPresenter : com/splendo/kaluga/alerts/BaseAlertPresenter, kotlinx/coroutines/CoroutineScope {
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/architecture/lifecycle/LifecycleManagerObserver;Lkotlinx/coroutines/CoroutineScope;)V
public synthetic fun <init> (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/architecture/lifecycle/LifecycleManagerObserver;Lkotlinx/coroutines/CoroutineScope;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/architecture/lifecycle/LifecycleManagerObserver;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;)V
public synthetic fun <init> (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/architecture/lifecycle/LifecycleManagerObserver;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun getCoroutineContext ()Lkotlin/coroutines/CoroutineContext;
}

public final class com/splendo/kaluga/alerts/AlertPresenter$Builder : com/splendo/kaluga/alerts/BaseAlertPresenter$Builder, com/splendo/kaluga/architecture/lifecycle/ActivityLifecycleSubscribable {
public fun <init> ()V
public fun <init> (Lcom/splendo/kaluga/architecture/lifecycle/LifecycleManagerObserver;)V
public synthetic fun <init> (Lcom/splendo/kaluga/architecture/lifecycle/LifecycleManagerObserver;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun create (Lcom/splendo/kaluga/alerts/Alert;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/AlertPresenter;
public synthetic fun create (Lcom/splendo/kaluga/alerts/Alert;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public fun create (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/AlertPresenter;
public synthetic fun create (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public fun getManager ()Lcom/splendo/kaluga/architecture/lifecycle/ActivityLifecycleSubscribable$LifecycleManager;
public fun subscribe (Lcom/splendo/kaluga/architecture/lifecycle/ActivityLifecycleSubscribable$LifecycleManager;)V
public fun unsubscribe ()V
}

public final class com/splendo/kaluga/alerts/AlertsKt {
public static final fun buildActionSheet (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlert (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlertWithInput (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildActionSheet (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun buildActionSheet$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlert (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun buildAlert$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlertWithInput (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun buildAlertWithInput$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
}

public abstract class com/splendo/kaluga/alerts/BaseAlertPresenter : com/splendo/kaluga/alerts/AlertActions {
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;)V
public static final field Companion Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Companion;
public static final field TAG Ljava/lang/String;
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;)V
public fun dismiss (Z)V
protected abstract fun dismissAlert (Z)V
public static synthetic fun dismissAlert$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter;ZILjava/lang/Object;)V
protected final fun dismissAlertWithLog (Z)V
public static synthetic fun dismissAlertWithLog$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter;ZILjava/lang/Object;)V
public fun show (ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
protected abstract fun showAlert (ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun showAlert$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
Expand All @@ -138,6 +145,10 @@ public abstract class com/splendo/kaluga/alerts/BaseAlertPresenter : com/splendo

public abstract class com/splendo/kaluga/alerts/BaseAlertPresenter$Builder : com/splendo/kaluga/architecture/lifecycle/LifecycleSubscribable {
public fun <init> ()V
public abstract fun create (Lcom/splendo/kaluga/alerts/Alert;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public abstract fun create (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun create$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
}

public final class com/splendo/kaluga/alerts/BaseAlertPresenter$Companion {
}

27 changes: 19 additions & 8 deletions alerts/api/jvm/alerts.api
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,36 @@ public final class com/splendo/kaluga/alerts/AlertActions$DefaultImpls {
}

public final class com/splendo/kaluga/alerts/AlertPresenter : com/splendo/kaluga/alerts/BaseAlertPresenter {
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;)V
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;)V
public fun dismiss (Z)V
public fun show (ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun showAsync (ZLkotlin/jvm/functions/Function0;)V
}

public final class com/splendo/kaluga/alerts/AlertPresenter$Builder : com/splendo/kaluga/alerts/BaseAlertPresenter$Builder {
public fun <init> ()V
public fun create (Lcom/splendo/kaluga/alerts/Alert;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/AlertPresenter;
public synthetic fun create (Lcom/splendo/kaluga/alerts/Alert;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public fun create (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/AlertPresenter;
public synthetic fun create (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
}

public final class com/splendo/kaluga/alerts/AlertsKt {
public static final fun buildActionSheet (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlert (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlertWithInput (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildActionSheet (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun buildActionSheet$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlert (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun buildAlert$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static final fun buildAlertWithInput (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun buildAlertWithInput$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lkotlinx/coroutines/CoroutineScope;Lcom/splendo/kaluga/logging/Logger;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
}

public abstract class com/splendo/kaluga/alerts/BaseAlertPresenter : com/splendo/kaluga/alerts/AlertActions {
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;)V
public static final field Companion Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Companion;
public static final field TAG Ljava/lang/String;
public fun <init> (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;)V
public fun dismiss (Z)V
protected abstract fun dismissAlert (Z)V
public static synthetic fun dismissAlert$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter;ZILjava/lang/Object;)V
protected final fun dismissAlertWithLog (Z)V
public static synthetic fun dismissAlertWithLog$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter;ZILjava/lang/Object;)V
public fun show (ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
protected abstract fun showAlert (ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)V
public static synthetic fun showAlert$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter;ZLkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)V
Expand All @@ -134,6 +141,10 @@ public abstract class com/splendo/kaluga/alerts/BaseAlertPresenter : com/splendo

public abstract class com/splendo/kaluga/alerts/BaseAlertPresenter$Builder : com/splendo/kaluga/architecture/lifecycle/LifecycleSubscribable {
public fun <init> ()V
public abstract fun create (Lcom/splendo/kaluga/alerts/Alert;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public abstract fun create (Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
public static synthetic fun create$default (Lcom/splendo/kaluga/alerts/BaseAlertPresenter$Builder;Lcom/splendo/kaluga/alerts/Alert;Lcom/splendo/kaluga/logging/Logger;Lkotlinx/coroutines/CoroutineScope;ILjava/lang/Object;)Lcom/splendo/kaluga/alerts/BaseAlertPresenter;
}

public final class com/splendo/kaluga/alerts/BaseAlertPresenter$Companion {
}

1 change: 1 addition & 0 deletions alerts/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ kotlin {
dependencies {
implementation(project(":architecture", ""))
implementation(project(":base", ""))
implementation(project(":logging", ""))
implementation(project(":resources", ""))
}
}
Expand Down
20 changes: 15 additions & 5 deletions alerts/src/androidLibMain/kotlin/AlertPresenter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import android.widget.LinearLayout
import com.splendo.kaluga.architecture.lifecycle.ActivityLifecycleSubscribable
import com.splendo.kaluga.architecture.lifecycle.LifecycleManagerObserver
import com.splendo.kaluga.base.utils.applyIf
import com.splendo.kaluga.logging.Logger
import com.splendo.kaluga.resources.dpToPixel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableStateFlow
Expand All @@ -44,7 +45,8 @@ actual class AlertPresenter(
private val alert: Alert,
private val lifecycleManagerObserver: LifecycleManagerObserver = LifecycleManagerObserver(),
coroutineScope: CoroutineScope,
) : BaseAlertPresenter(alert), CoroutineScope by coroutineScope {
logger: Logger,
) : BaseAlertPresenter(alert, logger), CoroutineScope by coroutineScope {

/**
* A [BaseAlertPresenter.Builder] for creating an [AlertPresenter]
Expand All @@ -58,10 +60,11 @@ actual class AlertPresenter(
* Creates an [AlertPresenter]
*
* @param alert The [Alert] to be presented with the built presenter.
* @param logger The [Logger] that logs the logs of the presenter.
* @param coroutineScope The [CoroutineScope] managing the alert lifecycle.
* @return The created [AlertPresenter]
*/
actual override fun create(alert: Alert, coroutineScope: CoroutineScope) = AlertPresenter(alert, lifecycleManagerObserver, coroutineScope)
actual override fun create(alert: Alert, logger: Logger, coroutineScope: CoroutineScope) = AlertPresenter(alert, lifecycleManagerObserver, coroutineScope, logger)
}

private companion object {
Expand Down Expand Up @@ -97,7 +100,10 @@ actual class AlertPresenter(
is DialogPresentation.Showing -> contextPresentation.first?.activity?.let {
presentDialog(it, dialogPresentation)
} ?: run { alertDialog = null }
is DialogPresentation.Hidden -> alertDialog?.dismiss()

is DialogPresentation.Hidden -> {
alertDialog?.dismiss()
}
}
}
}
Expand All @@ -118,7 +124,9 @@ actual class AlertPresenter(
.applyIf(alert.style == Alert.Style.ACTION_LIST) {
val titles = alert.actions.map { it.title }.toTypedArray()
setItems(titles) { _, which ->
val action = alert.actions[which].apply { handler() }
val action = alert.actions[which].apply {
handler()
}
presentation.afterHandler(action)
}
}
Expand Down Expand Up @@ -151,7 +159,9 @@ actual class AlertPresenter(
alertDialog = null
[email protected] = DialogPresentation.Hidden
}
setOnCancelListener { presentation.afterHandler(null) }
setOnCancelListener {
presentation.afterHandler(null)
}
show()
}
presentation.completion()
Expand Down
Loading
Loading