-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
21 changed files
with
381 additions
and
19 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...n/dev/datlag/burningseries/ui/screen/initial/series/activate/component/WebView.android.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
40 changes: 40 additions & 0 deletions
40
...atlag/burningseries/ui/screen/initial/series/activate/dialog/error/ErrorDialog.android.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,40 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.error | ||
|
||
import androidx.compose.material3.AlertDialog | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import dev.datlag.burningseries.SharedRes | ||
import dev.icerock.moko.resources.compose.stringResource | ||
|
||
@Composable | ||
actual fun ErrorDialog(component: ErrorComponent) { | ||
AlertDialog( | ||
onDismissRequest = { | ||
component.dismiss() | ||
}, | ||
title = { | ||
Text( | ||
text = stringResource(SharedRes.strings.activate_error_title), | ||
style = MaterialTheme.typography.headlineMedium, | ||
maxLines = 2, | ||
overflow = TextOverflow.Ellipsis, | ||
softWrap = true | ||
) | ||
}, | ||
text = { | ||
Text(text = stringResource(SharedRes.strings.activate_error_text)) | ||
}, | ||
confirmButton = { | ||
Button( | ||
onClick = { | ||
component.dismiss() | ||
} | ||
) { | ||
Text(text = stringResource(SharedRes.strings.close)) | ||
} | ||
} | ||
) | ||
} |
53 changes: 53 additions & 0 deletions
53
...g/burningseries/ui/screen/initial/series/activate/dialog/success/SuccessDialog.android.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,53 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.success | ||
|
||
import androidx.compose.material3.AlertDialog | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import dev.datlag.burningseries.SharedRes | ||
import dev.icerock.moko.resources.compose.stringResource | ||
|
||
@Composable | ||
actual fun SuccessDialog(component: SuccessComponent) { | ||
AlertDialog( | ||
onDismissRequest = { | ||
component.dismiss() | ||
}, | ||
title = { | ||
Text( | ||
text = stringResource(SharedRes.strings.activate_success_title), | ||
style = MaterialTheme.typography.headlineMedium, | ||
maxLines = 2, | ||
overflow = TextOverflow.Ellipsis, | ||
softWrap = true | ||
) | ||
}, | ||
text = { | ||
Text(text = stringResource(SharedRes.strings.activate_success_text)) | ||
}, | ||
confirmButton = { | ||
Button( | ||
onClick = { | ||
component.dismiss() | ||
} | ||
) { | ||
Text(text = stringResource(SharedRes.strings.close)) | ||
} | ||
}, | ||
dismissButton = if (component.stream != null) { | ||
{ | ||
Button( | ||
onClick = { | ||
|
||
} | ||
) { | ||
Text(text = stringResource(SharedRes.strings.watch)) | ||
} | ||
} | ||
} else { | ||
null | ||
} | ||
) | ||
} |
6 changes: 6 additions & 0 deletions
6
...in/kotlin/dev/datlag/burningseries/ui/screen/initial/series/activate/ActivateComponent.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,13 +1,19 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate | ||
|
||
import com.arkivanov.decompose.router.slot.ChildSlot | ||
import com.arkivanov.decompose.value.Value | ||
import dev.datlag.burningseries.model.Series | ||
import dev.datlag.burningseries.ui.navigation.Component | ||
import dev.datlag.burningseries.ui.navigation.DialogComponent | ||
import dev.datlag.burningseries.ui.screen.initial.series.activate.component.DialogConfig | ||
|
||
interface ActivateComponent : Component { | ||
|
||
val episode: Series.Episode | ||
val scrapingJs: String | ||
|
||
val dialog: Value<ChildSlot<DialogConfig, DialogComponent>> | ||
|
||
fun back() | ||
fun onScraped(data: String) | ||
} |
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
15 changes: 15 additions & 0 deletions
15
...tlin/dev/datlag/burningseries/ui/screen/initial/series/activate/component/DialogConfig.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,15 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.component | ||
|
||
import com.arkivanov.essenty.parcelable.Parcelable | ||
import com.arkivanov.essenty.parcelable.Parcelize | ||
import dev.datlag.burningseries.model.Stream | ||
|
||
@Parcelize | ||
sealed class DialogConfig : Parcelable { | ||
|
||
@Parcelize | ||
data class Success(val stream: Stream?) : DialogConfig(), Parcelable | ||
|
||
@Parcelize | ||
data object Error : DialogConfig(), Parcelable | ||
} |
6 changes: 6 additions & 0 deletions
6
...dev/datlag/burningseries/ui/screen/initial/series/activate/dialog/error/ErrorComponent.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,6 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.error | ||
|
||
import dev.datlag.burningseries.ui.navigation.DialogComponent | ||
|
||
interface ErrorComponent : DialogComponent { | ||
} |
13 changes: 13 additions & 0 deletions
13
...in/dev/datlag/burningseries/ui/screen/initial/series/activate/dialog/error/ErrorDialog.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,13 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.error | ||
|
||
import androidx.compose.material3.AlertDialog | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import dev.icerock.moko.resources.compose.stringResource | ||
import dev.datlag.burningseries.SharedRes | ||
|
||
@Composable | ||
expect fun ErrorDialog(component: ErrorComponent) |
21 changes: 21 additions & 0 deletions
21
...tlag/burningseries/ui/screen/initial/series/activate/dialog/error/ErrorDialogComponent.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,21 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.error | ||
|
||
import androidx.compose.runtime.Composable | ||
import com.arkivanov.decompose.ComponentContext | ||
import org.kodein.di.DI | ||
|
||
class ErrorDialogComponent( | ||
componentContext: ComponentContext, | ||
override val di: DI, | ||
private val onDismissed: () -> Unit | ||
) : ErrorComponent, ComponentContext by componentContext { | ||
|
||
@Composable | ||
override fun render() { | ||
ErrorDialog(this) | ||
} | ||
|
||
override fun dismiss() { | ||
onDismissed() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...datlag/burningseries/ui/screen/initial/series/activate/dialog/success/SuccessComponent.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,9 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.success | ||
|
||
import dev.datlag.burningseries.model.Stream | ||
import dev.datlag.burningseries.ui.navigation.DialogComponent | ||
|
||
interface SuccessComponent : DialogComponent { | ||
|
||
val stream: Stream? | ||
} |
13 changes: 13 additions & 0 deletions
13
...ev/datlag/burningseries/ui/screen/initial/series/activate/dialog/success/SuccessDialog.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,13 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.success | ||
|
||
import androidx.compose.material3.AlertDialog | ||
import androidx.compose.material3.Button | ||
import androidx.compose.material3.MaterialTheme | ||
import androidx.compose.material3.Text | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.text.style.TextOverflow | ||
import dev.icerock.moko.resources.compose.stringResource | ||
import dev.datlag.burningseries.SharedRes | ||
|
||
@Composable | ||
expect fun SuccessDialog(component: SuccessComponent) |
23 changes: 23 additions & 0 deletions
23
.../burningseries/ui/screen/initial/series/activate/dialog/success/SuccessDialogComponent.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,23 @@ | ||
package dev.datlag.burningseries.ui.screen.initial.series.activate.dialog.success | ||
|
||
import androidx.compose.runtime.Composable | ||
import com.arkivanov.decompose.ComponentContext | ||
import dev.datlag.burningseries.model.Stream | ||
import org.kodein.di.DI | ||
|
||
class SuccessDialogComponent( | ||
componentContext: ComponentContext, | ||
override val di: DI, | ||
override val stream: Stream?, | ||
private val onDismissed: () -> Unit | ||
) : SuccessComponent, ComponentContext by componentContext { | ||
|
||
@Composable | ||
override fun render() { | ||
SuccessDialog(this) | ||
} | ||
|
||
override fun dismiss() { | ||
onDismissed() | ||
} | ||
} |
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
Oops, something went wrong.