feat: ui
This commit is contained in:
1 parent
fc36c4f308
commit
3dc7ab02bc
9 files changed
+30
-47
No files matched your search
@@ -22,6 +22,7 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.composed
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.draw.paint
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.geometry.CornerRadius
|
||||
import androidx.compose.ui.geometry.Rect
|
||||
@@ -30,8 +31,10 @@ import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.Path
|
||||
import androidx.compose.ui.graphics.PathOperation
|
||||
import androidx.compose.ui.input.pointer.pointerInput
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.layout.layout
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
@@ -81,8 +84,6 @@ fun CameraScreen(
|
||||
val useMultiFrame by viewModel.useMultiFrame.collectAsState()
|
||||
val useSuperResolution by viewModel.useSuperResolution.collectAsState()
|
||||
|
||||
val backgroundColor = Color(0xFF434A5D)
|
||||
|
||||
// 标记相机是否已打开
|
||||
var cameraOpened by remember { mutableStateOf(false) }
|
||||
|
||||
@@ -140,7 +141,7 @@ fun CameraScreen(
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.background(backgroundColor)
|
||||
.paint(painterResource(R.drawable.camera_bg), contentScale = ContentScale.Crop)
|
||||
) {
|
||||
// 顶部控制条
|
||||
CameraTopBar(
|
||||
@@ -225,6 +226,22 @@ fun CameraScreen(
|
||||
)
|
||||
}
|
||||
|
||||
// 网格线覆盖
|
||||
if (state.showGrid) {
|
||||
GridOverlay(
|
||||
aspectRatio = state.aspectRatio,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
)
|
||||
}
|
||||
|
||||
// 水平仪覆盖
|
||||
if (showLevelIndicator) {
|
||||
LevelIndicatorOverlay(
|
||||
aspectRatio = state.aspectRatio,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
)
|
||||
}
|
||||
|
||||
if (activePanel == ActivePanel.NONE) {
|
||||
// Zoom Control Bar (Overlay at bottom of preview)
|
||||
ZoomControlBar(
|
||||
@@ -243,22 +260,6 @@ fun CameraScreen(
|
||||
)
|
||||
}
|
||||
|
||||
// 网格线覆盖
|
||||
if (state.showGrid) {
|
||||
GridOverlay(
|
||||
aspectRatio = state.aspectRatio,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
)
|
||||
}
|
||||
|
||||
// 水平仪覆盖
|
||||
if (showLevelIndicator) {
|
||||
LevelIndicatorOverlay(
|
||||
aspectRatio = state.aspectRatio,
|
||||
modifier = Modifier.fillMaxSize()
|
||||
)
|
||||
}
|
||||
|
||||
// 倒计时覆盖
|
||||
if (state.countdownValue > 0) {
|
||||
CountdownOverlay(
|
||||
@@ -520,29 +521,21 @@ fun CaptureButton(
|
||||
.clickable(enabled = !isCapturing) { onClick() },
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
// Outer White Ring
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.border(2.dp, Color.White, CircleShape)
|
||||
)
|
||||
|
||||
// Inner Yellow Ring
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(4.dp)
|
||||
.fillMaxSize()
|
||||
.border(4.dp, Color(0xFFFFD700), CircleShape)
|
||||
.border(2.dp, Color(0xFFFFD700), CircleShape)
|
||||
)
|
||||
|
||||
// Center Solid Button (When not capturing)
|
||||
if (!isCapturing) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.padding(12.dp)
|
||||
.padding(4.dp)
|
||||
.fillMaxSize()
|
||||
.clip(CircleShape)
|
||||
.background(Color(0xFF434A5D))
|
||||
.background(Color.White)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ fun CameraTopSheet(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.clip(RoundedCornerShape(bottomStart = 24.dp, bottomEnd = 24.dp))
|
||||
.background(Color(0xFF2C3141))
|
||||
.background(Color.Black.copy(alpha = 0.8f))
|
||||
.padding(top = 48.dp, bottom = 24.dp, start = 24.dp, end = 24.dp)
|
||||
) {
|
||||
// Aspect Ratio Section
|
||||
|
||||
@@ -34,7 +34,7 @@ fun LutEditBottomSheet(
|
||||
) {
|
||||
val viewModel: LutEditViewModel = viewModel()
|
||||
val sheetState = rememberModalBottomSheetState(skipPartiallyExpanded = true)
|
||||
val backgroundColor = Color(0xFF434A5D)
|
||||
val backgroundColor = Color(0xFF151515)
|
||||
|
||||
var editingParams by remember { mutableStateOf(ColorRecipeParams.DEFAULT) }
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ fun GalleryScreen(
|
||||
}
|
||||
},
|
||||
colors = TopAppBarDefaults.topAppBarColors(
|
||||
containerColor = Color(0xFF434A5D)
|
||||
containerColor = Color(0xFF151515)
|
||||
)
|
||||
)
|
||||
},
|
||||
@@ -233,7 +233,7 @@ fun GalleryScreen(
|
||||
}
|
||||
}
|
||||
},
|
||||
containerColor = Color(0xFF434A5D),
|
||||
containerColor = Color(0xFF151515),
|
||||
modifier = modifier
|
||||
) { paddingValues ->
|
||||
Box(
|
||||
|
||||
@@ -237,7 +237,7 @@ fun FilterManagementScreen(
|
||||
}
|
||||
}
|
||||
|
||||
val backgroundColor = Color(0xFF434A5D)
|
||||
val backgroundColor = Color(0xFF151515)
|
||||
|
||||
Column(
|
||||
modifier = modifier
|
||||
|
||||
@@ -146,7 +146,7 @@ fun FrameManagementScreen(
|
||||
}
|
||||
}
|
||||
|
||||
val backgroundColor = Color(0xFF434A5D)
|
||||
val backgroundColor = Color(0xFF151515)
|
||||
|
||||
Column(
|
||||
modifier = modifier
|
||||
|
||||
@@ -86,7 +86,7 @@ fun SettingsScreen(
|
||||
var softwareProcessingExpanded by remember { mutableStateOf(false) }
|
||||
var calibrationExpanded by remember { mutableStateOf(false) }
|
||||
|
||||
val backgroundColor = Color(0xFF434A5D)
|
||||
val backgroundColor = Color(0xFF151515)
|
||||
|
||||
Column(
|
||||
modifier = modifier
|
||||
|
||||
@@ -68,13 +68,3 @@ fun PhotonCameraTheme(
|
||||
content = content
|
||||
)
|
||||
}
|
||||
|
||||
// 保持旧主题函数用于兼容
|
||||
@Composable
|
||||
fun MyCameraTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
dynamicColor: Boolean = true,
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
PhotonCameraTheme(darkTheme = darkTheme, dynamicColor = dynamicColor, content = content)
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 929 KiB |
Reference in new issue
Block a user