|
|
@ -84,7 +84,7 @@ fun MemoryScreen( |
|
|
|
Box(modifier = Modifier.background(MaterialTheme.colors.background)) { |
|
|
|
Box(modifier = Modifier.background(MaterialTheme.colors.background)) { |
|
|
|
Column(horizontalAlignment = Alignment.CenterHorizontally) { |
|
|
|
Column(horizontalAlignment = Alignment.CenterHorizontally) { |
|
|
|
Headliner("Note") |
|
|
|
Headliner("Note") |
|
|
|
Collapsible(picture.description) |
|
|
|
Collapsible(picture.description, onEdit = { edit = true }) |
|
|
|
Headliner("Related memories") |
|
|
|
Headliner("Related memories") |
|
|
|
RelatedMemoriesVisualizer( |
|
|
|
RelatedMemoriesVisualizer( |
|
|
|
pictures = remember { (pictures - picture).shuffled().take(8) }, |
|
|
|
pictures = remember { (pictures - picture).shuffled().take(8) }, |
|
|
@ -227,8 +227,9 @@ fun BoxScope.MemoryTextOverlay(picture: PictureData) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@OptIn(ExperimentalFoundationApi::class) |
|
|
|
@Composable |
|
|
|
@Composable |
|
|
|
fun Collapsible(s: String) { |
|
|
|
fun Collapsible(s: String, onEdit: () -> Unit) { |
|
|
|
val interctionSource = remember { MutableInteractionSource() } |
|
|
|
val interctionSource = remember { MutableInteractionSource() } |
|
|
|
var isCollapsed by remember { mutableStateOf(true) } |
|
|
|
var isCollapsed by remember { mutableStateOf(true) } |
|
|
|
val text = if (isCollapsed) s.lines().first() + "... (see more)" else s |
|
|
|
val text = if (isCollapsed) s.lines().first() + "... (see more)" else s |
|
|
@ -245,10 +246,15 @@ fun Collapsible(s: String) { |
|
|
|
dampingRatio = Spring.DampingRatioLowBouncy, |
|
|
|
dampingRatio = Spring.DampingRatioLowBouncy, |
|
|
|
stiffness = Spring.StiffnessLow |
|
|
|
stiffness = Spring.StiffnessLow |
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
).combinedClickable( |
|
|
|
.clickable(interactionSource = interctionSource, indication = null) { |
|
|
|
interactionSource = interctionSource, indication = null, |
|
|
|
|
|
|
|
onClick = { |
|
|
|
isCollapsed = !isCollapsed |
|
|
|
isCollapsed = !isCollapsed |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
onLongClick = { |
|
|
|
|
|
|
|
onEdit() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
.fillMaxWidth(), |
|
|
|
.fillMaxWidth(), |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|