Merge remote-tracking branch 'origin/main' into claude/design-system-extraction-c49naf
This commit is contained in:
commit
af330d081f
@ -224,24 +224,38 @@ fun ColumnBrowser(
|
|||||||
}
|
}
|
||||||
// Reader view: the page has the whole screen, and one button, at the edge the
|
// Reader view: the page has the whole screen, and one button, at the edge the
|
||||||
// columns went to, brings them back as they were.
|
// columns went to, brings them back as they were.
|
||||||
AnimatedVisibility(
|
ShowColumnsButton(
|
||||||
visible = hidden,
|
visible = hidden,
|
||||||
enter = scaleIn() + fadeIn(),
|
onShow = { settings.update { it.copy(columnsHidden = false) } },
|
||||||
exit = scaleOut() + fadeOut(),
|
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.align(Alignment.BottomStart)
|
.align(Alignment.BottomStart)
|
||||||
.navigationBarsPadding()
|
.navigationBarsPadding()
|
||||||
.padding(16.dp),
|
.padding(16.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Brings the columns back from reader view.
|
||||||
|
*
|
||||||
|
* In its own composable because the Box it is placed in sits inside the browser's Row: with
|
||||||
|
* RowScope still an implicit receiver there, `AnimatedVisibility` resolves to the row overload,
|
||||||
|
* which takes no alignment and does not compile. A function of its own has only its own scope.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
private fun ShowColumnsButton(visible: Boolean, onShow: () -> Unit, modifier: Modifier = Modifier) {
|
||||||
|
AnimatedVisibility(
|
||||||
|
visible = visible,
|
||||||
|
enter = scaleIn() + fadeIn(),
|
||||||
|
exit = scaleOut() + fadeOut(),
|
||||||
|
modifier = modifier,
|
||||||
) {
|
) {
|
||||||
SmallFloatingActionButton(
|
SmallFloatingActionButton(onClick = onShow) {
|
||||||
onClick = { settings.update { it.copy(columnsHidden = false) } },
|
|
||||||
) {
|
|
||||||
Icon(Icons.Default.Menu, stringResource(R.string.show_columns))
|
Icon(Icons.Default.Menu, stringResource(R.string.show_columns))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Folds the columns away so the page has the whole screen (reader view). */
|
/** Folds the columns away so the page has the whole screen (reader view). */
|
||||||
@Composable
|
@Composable
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user