Kensuke Sano
04/15/2023, 12:49 PMagrosner
04/15/2023, 12:55 PMagrosner
04/15/2023, 12:56 PMKensuke Sano
04/15/2023, 1:22 PMKensuke Sano
04/15/2023, 1:28 PMMaterialDatePicker.Builder.datePicker()
.setSelection(date?.toEpochMilli() ?: Instant.now().toEpochMilli())
.build()
.apply {
show(context.supportFragmentManager, "DatePicker")
addOnPositiveButtonClickListener {
setDate(Instant.ofEpochMilli(it))
}
}
}
Dima Avdeev
04/15/2023, 2:04 PMon common:
expect class PlatformContext
@Composable
expect fun getPlatformContext(): PlatformContext
on Android:
actual class PlatformContext(val androidContext: Context)
@Composable
actual fun getPlatformContext(): PlatformContext = PlatformContext(LocalContext.current)
https://github.com/JetBrains/compose-multiplatform/blob/1d955a2e6da60f695aee1efb0f[…]dMain/kotlin/example/imageviewer/filter/BitmapFilter.android.ktDima Avdeev
04/15/2023, 2:05 PM@Composable
expect fun PlatformDatePicker
@Composable
actual fun PlatfromDatePicker {
with android implementation
}
and some different one for iOSKensuke Sano
04/16/2023, 3:42 AMKensuke Sano
04/16/2023, 4:06 AMmichaelv
04/29/2023, 7:50 AMcomposeTestRule.onNode(hasContentDescription(value = "Tuesday, 12 October 2021")).performClick()