feat: 新增扫码功能
- 添加 CameraX 和 ML Kit Barcode Scanning 依赖,用于实现二维码扫描。 - 在 AndroidManifest.xml 中添加相机权限声明。 - 新增 `ScanQrScreen` 扫码页面及相应的 `ScanQr` 导航路由。 - 在首页右上角菜单中,为“扫一扫”按钮添加跳转到扫码页面的功能。
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
||||
|
||||
<application
|
||||
android:name=".RaveNowApplication"
|
||||
|
||||
@@ -78,6 +78,7 @@ import com.aiosman.ravenow.ui.post.PostScreen
|
||||
import com.aiosman.ravenow.ui.profile.AccountProfileV2
|
||||
import com.aiosman.ravenow.ui.index.tabs.profile.vip.VipSelPage
|
||||
import com.aiosman.ravenow.ui.notification.NotificationScreen
|
||||
import com.aiosman.ravenow.ui.scan.ScanQrScreen
|
||||
|
||||
sealed class NavigationRoute(
|
||||
val route: String,
|
||||
@@ -130,6 +131,7 @@ sealed class NavigationRoute(
|
||||
data object NotificationScreen : NavigationRoute("NotificationScreen")
|
||||
data object MbtiSelect : NavigationRoute("MbtiSelect")
|
||||
data object ZodiacSelect : NavigationRoute("ZodiacSelect")
|
||||
data object ScanQr : NavigationRoute("ScanQr")
|
||||
}
|
||||
|
||||
|
||||
@@ -453,6 +455,9 @@ fun NavigationController(
|
||||
SearchScreen()
|
||||
}
|
||||
}
|
||||
composable(route = NavigationRoute.ScanQr.route) {
|
||||
ScanQrScreen()
|
||||
}
|
||||
composable(
|
||||
route = NavigationRoute.FollowerList.route,
|
||||
arguments = listOf(navArgument("id") { type = NavType.IntType })
|
||||
|
||||
@@ -586,7 +586,11 @@ fun SideMenuContent(
|
||||
.align(Alignment.TopEnd)
|
||||
.offset(x = (-112).dp, y = 88.dp)
|
||||
.noRippleClickable {
|
||||
// TODO: 实现扫一扫功能
|
||||
// 扫一扫功能:跳转到扫码页面
|
||||
coroutineScope.launch {
|
||||
onClose()
|
||||
navController.navigate(NavigationRoute.ScanQr.route)
|
||||
}
|
||||
},
|
||||
horizontalArrangement = Arrangement.spacedBy(16.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
|
||||
Reference in New Issue
Block a user