-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67d9cd5
commit 44723cb
Showing
61 changed files
with
547 additions
and
473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 0 additions & 39 deletions
39
...ommon-kmp/src/androidMain/kotlin/org/michaelbel/movies/common/gender/GrammaticalGender.kt
This file was deleted.
Oops, something went wrong.
40 changes: 34 additions & 6 deletions
40
...common-kmp/src/commonMain/kotlin/org/michaelbel/movies/common/gender/GrammaticalGender.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,36 @@ | ||
@file:Suppress( | ||
"EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING", | ||
"EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE" | ||
) | ||
|
||
package org.michaelbel.movies.common.gender | ||
|
||
expect sealed class GrammaticalGender | ||
import org.michaelbel.movies.common.SealedString | ||
import org.michaelbel.movies.common.gender.exceptions.InvalidGenderException | ||
|
||
sealed class GrammaticalGender( | ||
val value: Int | ||
): SealedString { | ||
|
||
data object NotSpecified: GrammaticalGender(0) | ||
|
||
data object Neutral: GrammaticalGender(1) | ||
|
||
data object Feminine: GrammaticalGender(2) | ||
|
||
data object Masculine: GrammaticalGender(3) | ||
|
||
companion object { | ||
val VALUES = listOf( | ||
NotSpecified, | ||
Neutral, | ||
Feminine, | ||
Masculine | ||
) | ||
|
||
fun transform(gender: Int): GrammaticalGender { | ||
return when (gender) { | ||
0 -> NotSpecified | ||
1 -> Neutral | ||
2 -> Feminine | ||
3 -> Masculine | ||
else -> throw InvalidGenderException | ||
} | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
core/common-kmp/src/desktopMain/kotlin/org/michaelbel/movies/common/browser/Browser.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.michaelbel.movies.common.browser | ||
|
||
import java.awt.Desktop | ||
import java.net.URI | ||
|
||
fun openUrlDesktop(url: String) { | ||
val desktop = if (Desktop.isDesktopSupported()) Desktop.getDesktop() else null | ||
if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) { | ||
desktop.browse(URI.create(url)) | ||
} | ||
} |
38 changes: 0 additions & 38 deletions
38
...ommon-kmp/src/desktopMain/kotlin/org/michaelbel/movies/common/gender/GrammaticalGender.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...interactor-kmp/src/androidMain/kotlin/org/michaelbel/movies/interactor/entity/Password.kt
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...interactor-kmp/src/androidMain/kotlin/org/michaelbel/movies/interactor/entity/Username.kt
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...interactor-kmp/src/androidMain/kotlin/org/michaelbel/movies/interactor/ktx/PasswordKtx.kt
This file was deleted.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
...interactor-kmp/src/androidMain/kotlin/org/michaelbel/movies/interactor/ktx/UsernameKtx.kt
This file was deleted.
Oops, something went wrong.
7 changes: 1 addition & 6 deletions
7
.../interactor-kmp/src/commonMain/kotlin/org/michaelbel/movies/interactor/entity/Password.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
@file:Suppress( | ||
"EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING", | ||
"EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE" | ||
) | ||
|
||
package org.michaelbel.movies.interactor.entity | ||
|
||
@JvmInline | ||
expect value class Password( | ||
value class Password( | ||
val value: String | ||
) |
7 changes: 1 addition & 6 deletions
7
.../interactor-kmp/src/commonMain/kotlin/org/michaelbel/movies/interactor/entity/Username.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,6 @@ | ||
@file:Suppress( | ||
"EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING", | ||
"EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE" | ||
) | ||
|
||
package org.michaelbel.movies.interactor.entity | ||
|
||
@JvmInline | ||
expect value class Username( | ||
value class Username( | ||
val value: String | ||
) |
14 changes: 9 additions & 5 deletions
14
.../interactor-kmp/src/commonMain/kotlin/org/michaelbel/movies/interactor/ktx/PasswordKtx.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
@file:Suppress("EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE") | ||
|
||
package org.michaelbel.movies.interactor.ktx | ||
|
||
import androidx.compose.runtime.MutableState | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.saveable.Saver | ||
import org.michaelbel.movies.interactor.entity.Password | ||
|
||
expect val Password.isNotEmpty: Boolean | ||
val Password.isNotEmpty: Boolean | ||
get() = value.isNotEmpty() | ||
|
||
expect val Password.trim: Password | ||
val Password.trim: Password | ||
get() = Password(value.trim()) | ||
|
||
expect val PasswordSaver: Saver<MutableState<Password>, String> | ||
val PasswordSaver: Saver<MutableState<Password>, String> | ||
get() = Saver( | ||
save = { it.value.value }, | ||
restore = { mutableStateOf(Password(it)) } | ||
) |
14 changes: 9 additions & 5 deletions
14
.../interactor-kmp/src/commonMain/kotlin/org/michaelbel/movies/interactor/ktx/UsernameKtx.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
@file:Suppress("EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE") | ||
|
||
package org.michaelbel.movies.interactor.ktx | ||
|
||
import androidx.compose.runtime.MutableState | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.saveable.Saver | ||
import org.michaelbel.movies.interactor.entity.Username | ||
|
||
expect val Username.isNotEmpty: Boolean | ||
val Username.isNotEmpty: Boolean | ||
get() = value.isNotEmpty() | ||
|
||
expect val Username.trim: Username | ||
val Username.trim: Username | ||
get() = Username(value.trim()) | ||
|
||
expect val UsernameSaver: Saver<MutableState<Username>, String> | ||
val UsernameSaver: Saver<MutableState<Username>, String> | ||
get() = Saver( | ||
save = { it.value.value }, | ||
restore = { mutableStateOf(Username(it)) } | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.