您的位置:首页 > 游戏 > 游戏 > 网页多少钱_产品宣传片公司_搜狗搜索引擎优化论文_二级分销小程序

网页多少钱_产品宣传片公司_搜狗搜索引擎优化论文_二级分销小程序

2025/1/5 10:43:16 来源:https://blog.csdn.net/u012127961/article/details/144468567  浏览:    关键词:网页多少钱_产品宣传片公司_搜狗搜索引擎优化论文_二级分销小程序
网页多少钱_产品宣传片公司_搜狗搜索引擎优化论文_二级分销小程序
预览

在这里插入图片描述

Composable
@OptIn(ExperimentalMaterialApi::class)
@Composable
@Preview
fun ImageSheetDialogExample() {var sheetState = rememberModalBottomSheetState(initialValue = ModalBottomSheetValue.Hidden)var coroutineScope = rememberCoroutineScope()Column(modifier = Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {Button(modifier = Modifier.padding(top = 10.dp), onClick = {coroutineScope.launch {sheetState.show()}}) {Text(text = "照片添加")}}ImageSheetDialog(sheetState, onTake = {}, onAlbum = {}, onCancel = {coroutineScope.launch {sheetState.hide()}})
}/*** 底部图片操作dialog* @param sheetState 状态* @param onTake 拍照点击* @param onAlbum 相册点击* @param onCancel 取消点击* @param textColor 文字颜色* @param fontSize 文字大小**/
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun ImageSheetDialog(sheetState: ModalBottomSheetState,onTake: () -> Unit,onAlbum: () -> Unit,onCancel: () -> Unit,color: Color = Color(0xFFF9F9F9),textColor: Color = Color(0xFF2D85FF),fontSize: TextUnit = TextUnit(16f, TextUnitType.Sp),
) {ModalBottomSheetLayout(sheetContent = {Column(modifier = Modifier.padding(horizontal = 10.dp).background(color = Color.Transparent,).fillMaxWidth()) {Column(modifier = Modifier.background(color = color,shape = RoundedCornerShape(8.dp))) {TextButton(modifier = Modifier.fillMaxWidth(),shape = RoundedCornerShape(topStart = 8.dp, topEnd = 8.dp),onClick = {onTake()}) {Text(modifier = Modifier.padding(vertical = 5.dp),text = "拍照",color = textColor,fontSize = fontSize)}Divider(color = Color(0xffD4D4D4))TextButton(modifier = Modifier.fillMaxWidth(),shape = RoundedCornerShape(bottomStart = 8.dp, bottomEnd = 8.dp),onClick = {onAlbum()}) {Text(modifier = Modifier.padding(vertical = 5.dp),text = "相册",color = textColor,fontSize = fontSize)}}TextButton(modifier = Modifier.fillMaxWidth().padding(top = 5.dp, bottom = 10.dp),shape = RoundedCornerShape(8.dp),colors = ButtonDefaults.textButtonColors(containerColor = color),onClick = {onCancel()}) {Text(modifier = Modifier.padding(vertical = 5.dp),text = "取消",color = textColor,fontSize = fontSize)}}}, sheetState = sheetState, sheetBackgroundColor = Color.Transparent, sheetElevation = 0.dp){}
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com