Skip to content

Instantly share code, notes, and snippets.

View skydoves's full-sized avatar
💡
Practice is the only shortcut

Jaewoong Eum skydoves

💡
Practice is the only shortcut
View GitHub Profile
@skydoves
skydoves / 03_LazyInterface.kt
Created February 17, 2026 01:14
Kotlin Lazy Interface
public interface Lazy<out T> {
public val value: T
public fun isInitialized(): Boolean
}
@skydoves
skydoves / 02_DataClassDecompiled.java
Created February 17, 2026 01:14
Decompiled Data Class - Java Bytecode
public final class User {
@NotNull
private final String name;
private final int age;
// 1. Constructor with null-safety check
public User(@NotNull String name, int age) {
Intrinsics.checkNotNullParameter(name, "name");
this.name = name;
this.age = age;
@skydoves
skydoves / 01_DataClass.kt
Created February 17, 2026 01:14
Kotlin Data Class Definition
data class User(val name: String, val age: Int)
@skydoves
skydoves / PlaceDetailScreen.kt
Created February 15, 2026 07:19
FlexibleBottomSheet - Complete Google Maps style PlaceDetailScreen
@Composable
fun PlaceDetailScreen() {
var targetValue by remember {
mutableStateOf(FlexibleSheetValue.SlightlyExpanded)
}
Box(modifier = Modifier.fillMaxSize()) {
// Map content behind the sheet
MapView(modifier = Modifier.fillMaxSize())
@skydoves
skydoves / InitialState.kt
Created February 15, 2026 07:19
FlexibleBottomSheet - Setting initial state
rememberFlexibleBottomSheetState(
initialValue = FlexibleSheetValue.SlightlyExpanded,
isModal = false,
skipSlightlyExpanded = false,
)
@skydoves
skydoves / WrapContentMode.kt
Created February 15, 2026 07:19
FlexibleBottomSheet - Wrap content mode
rememberFlexibleBottomSheetState(
flexibleSheetSize = FlexibleSheetSize(
fullyExpanded = FlexibleSheetSize.WrapContent,
intermediatelyExpanded = 0.5f,
slightlyExpanded = FlexibleSheetSize.WrapContent,
),
isModal = false,
skipSlightlyExpanded = false,
)
@skydoves
skydoves / NestedScrolling.kt
Created February 15, 2026 07:18
FlexibleBottomSheet - Nested scrolling with LazyVerticalGrid
FlexibleBottomSheet(
onDismissRequest = onDismissRequest,
sheetState = rememberFlexibleBottomSheetState(
flexibleSheetSize = FlexibleSheetSize(
fullyExpanded = 0.9f,
intermediatelyExpanded = 0.5f,
slightlyExpanded = 0.18f,
),
isModal = false,
skipSlightlyExpanded = false,
@skydoves
skydoves / ConfirmValueChange.kt
Created February 15, 2026 07:18
FlexibleBottomSheet - Vetoing state changes with confirmValueChange
rememberFlexibleBottomSheetState(
confirmValueChange = { newValue ->
newValue != FlexibleSheetValue.Hidden
},
)
@skydoves
skydoves / ReadingState.kt
Created February 15, 2026 07:18
FlexibleBottomSheet - Reading state properties
val isSheetVisible = sheetState.isVisible
val currentState = sheetState.currentValue
val targetState = sheetState.targetValue
@skydoves
skydoves / ShowWithTarget.kt
Created February 15, 2026 07:18
FlexibleBottomSheet - Show with specific target
scope.launch { sheetState.show(FlexibleSheetValue.SlightlyExpanded) }