-
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
29 changed files
with
493 additions
and
267 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
23 changes: 23 additions & 0 deletions
23
desktopApp/src/main/kotlin/dev/dimension/flare/ui/screen/home/HomeTimelineScreen.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,16 +1,39 @@ | ||
package dev.dimension.flare.ui.screen.home | ||
|
||
import androidx.compose.foundation.layout.Box | ||
import androidx.compose.foundation.layout.PaddingValues | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.remember | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import dev.dimension.flare.ui.component.status.LazyStatusVerticalStaggeredGrid | ||
import dev.dimension.flare.ui.component.status.status | ||
import dev.dimension.flare.ui.presenter.home.HomeTimelinePresenter | ||
import dev.dimension.flare.ui.presenter.invoke | ||
import moe.tlaster.precompose.molecule.producePresenter | ||
|
||
@Composable | ||
internal fun HomeTimelineScreen() { | ||
val state by producePresenter { | ||
presenter() | ||
} | ||
Box( | ||
modifier = | ||
Modifier | ||
.fillMaxSize(), | ||
) { | ||
LazyStatusVerticalStaggeredGrid( | ||
contentPadding = PaddingValues(16.dp), | ||
) { | ||
status(state.listState) | ||
} | ||
} | ||
} | ||
|
||
@Composable | ||
private fun presenter() = | ||
run { | ||
remember { HomeTimelinePresenter(dev.dimension.flare.model.AccountType.Guest) }.invoke() | ||
} |
29 changes: 29 additions & 0 deletions
29
shared/src/androidJvmMain/kotlin/dev/dimension/flare/ui/render/UiDateTime.androidJvm.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,29 @@ | ||
package dev.dimension.flare.ui.render | ||
|
||
import kotlinx.datetime.Instant | ||
import java.time.LocalDateTime | ||
|
||
internal expect fun Instant.shortTime(): LocalizedShortTime | ||
|
||
public actual data class UiDateTime internal constructor( | ||
val value: Instant, | ||
) { | ||
val shortTime: LocalizedShortTime | ||
get() = value.shortTime() | ||
} | ||
|
||
internal actual fun Instant.toUi(): UiDateTime = UiDateTime(this) | ||
|
||
public sealed interface LocalizedShortTime { | ||
public data class String( | ||
val value: kotlin.String, | ||
) : LocalizedShortTime | ||
|
||
public data class YearMonthDay( | ||
val localDateTime: LocalDateTime, | ||
) : LocalizedShortTime | ||
|
||
public data class MonthDay( | ||
val localDateTime: LocalDateTime, | ||
) : LocalizedShortTime | ||
} |
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.