-
-
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
20 changed files
with
466 additions
and
107 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
31 changes: 31 additions & 0 deletions
31
...ed/src/androidMain/kotlin/dev/datlag/burningseries/ui/custom/VerticalScrollbar.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,31 @@ | ||
package dev.datlag.burningseries.ui.custom | ||
|
||
import androidx.compose.foundation.lazy.grid.LazyGridState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
|
||
@Composable | ||
actual fun VerticalScrollbar(adapter: ScrollbarAdapter, modifier: Modifier) { | ||
} | ||
|
||
@Composable | ||
actual fun rememberScrollbarAdapter( | ||
scrollState: LazyGridState, | ||
): ScrollbarAdapter = remember { object : ScrollbarAdapter { | ||
override val scrollOffset: Double | ||
get() = 0.0 | ||
override val contentSize: Double | ||
get() = 0.0 | ||
override val viewportSize: Double | ||
get() = 0.0 | ||
|
||
override suspend fun scrollTo(scrollOffset: Double) { } | ||
} } | ||
|
||
actual interface ScrollbarAdapter { | ||
actual val scrollOffset: Double | ||
actual val contentSize: Double | ||
actual val viewportSize: Double | ||
actual suspend fun scrollTo(scrollOffset: Double) | ||
} |
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
10 changes: 9 additions & 1 deletion
10
app/shared/src/commonMain/kotlin/dev/datlag/burningseries/common/PlatformExtendCompose.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,10 +1,18 @@ | ||
package dev.datlag.burningseries.common | ||
|
||
import androidx.compose.ui.Modifier | ||
import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.StackAnimation | ||
import com.arkivanov.decompose.router.stack.StackNavigation | ||
import com.arkivanov.essenty.backhandler.BackHandler | ||
|
||
expect fun Modifier.onClick( | ||
enabled: Boolean = true, | ||
onDoubleClick: (() -> Unit)? = null, | ||
onLongClick: (() -> Unit)? = null, | ||
onClick: () -> Unit | ||
) : Modifier | ||
) : Modifier | ||
|
||
expect fun <C : Any, T : Any> backAnimation( | ||
backHandler: BackHandler, | ||
onBack: () -> Unit | ||
) : StackAnimation<C, T> |
21 changes: 21 additions & 0 deletions
21
app/shared/src/commonMain/kotlin/dev/datlag/burningseries/ui/custom/VerticalScrollbar.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.custom | ||
|
||
import androidx.compose.foundation.lazy.grid.LazyGridState | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
|
||
@Composable | ||
expect fun VerticalScrollbar(adapter: ScrollbarAdapter, modifier: Modifier = Modifier) | ||
|
||
@Composable | ||
expect fun rememberScrollbarAdapter( | ||
scrollState: LazyGridState, | ||
): ScrollbarAdapter | ||
|
||
expect interface ScrollbarAdapter { | ||
val scrollOffset: Double | ||
val contentSize: Double | ||
val viewportSize: Double | ||
suspend fun scrollTo(scrollOffset: Double) | ||
} |
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
Oops, something went wrong.