From a7697313c644fa777d7ced137b43a17e970881b6 Mon Sep 17 00:00:00 2001 From: alZerNest <2223976172@qq.com> Date: Tue, 25 Aug 2026 09:27:39 +0800 Subject: [PATCH] Address device list review feedback --- .../ui/devicecontrollist/DeviceListScreen.kt | 17 +++ docs/device-list-compose-ui-pr-description.md | 133 ++++++++++++++++++ 2 files changed, 150 insertions(+) create mode 100644 docs/device-list-compose-ui-pr-description.md diff --git a/android/app/src/main/kotlin/com/flagship/abox/manager/ui/devicecontrollist/DeviceListScreen.kt b/android/app/src/main/kotlin/com/flagship/abox/manager/ui/devicecontrollist/DeviceListScreen.kt index c398b25..32c51d9 100644 --- a/android/app/src/main/kotlin/com/flagship/abox/manager/ui/devicecontrollist/DeviceListScreen.kt +++ b/android/app/src/main/kotlin/com/flagship/abox/manager/ui/devicecontrollist/DeviceListScreen.kt @@ -5,14 +5,18 @@ import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.flagship.abox.manager.designsystem.ABoxButton +import com.flagship.abox.manager.designsystem.ABoxTheme @Composable fun DeviceListScreen( @@ -24,6 +28,7 @@ fun DeviceListScreen( Column( modifier = modifier .fillMaxSize() + .verticalScroll(rememberScrollState()) .padding(32.dp), horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center, @@ -78,3 +83,15 @@ private fun DeviceEntryButton( } } } + +@Preview(showBackground = true) +@Composable +private fun DeviceListScreenPreview() { + ABoxTheme { + DeviceListScreen( + onSocketClick = {}, + onTemperatureHumidityClick = {}, + onInfraredClick = {}, + ) + } +} diff --git a/docs/device-list-compose-ui-pr-description.md b/docs/device-list-compose-ui-pr-description.md new file mode 100644 index 0000000..28d50e7 --- /dev/null +++ b/docs/device-list-compose-ui-pr-description.md @@ -0,0 +1,133 @@ +# WIP: Add device list Compose screen + +## Summary + +This MR adds only the reusable Kotlin Jetpack Compose device list screen for my assigned scope. + +The screen displays the three ABox device categories: + +- Smart socket +- Temperature/humidity sensor +- Infrared controller + +This MR intentionally does not modify the app entry point, login flow, app shell routing, or any device detail/control screen. Those parts are handled by other feature branches. + +## Changes + +- Add `DeviceListScreen`. +- Expose click callbacks for each device category: + - `onSocketClick` + - `onTemperatureHumidityClick` + - `onInfraredClick` +- Update the device-list change log document. +- Remove the earlier out-of-scope temporary device control screens from this branch. + +## Scope + +Included: + +- Device list Compose UI component +- Device category entry UI +- Callback API for future route integration + +Not included: + +- App entry point changes +- Login flow changes +- Device control navigation graph +- Smart socket control screen +- Temperature/humidity status screen +- Infrared controller screen +- Direct ABSDK calls +- Java Activity classes +- XML layout files + +## Integration Notes + +The screen is designed to be hosted by the app shell or routing owner later: + +```kotlin +DeviceListScreen( + onSocketClick = { /* route to socket module */ }, + onTemperatureHumidityClick = { /* route to temperature/humidity module */ }, + onInfraredClick = { /* route to infrared controller module */ }, +) +``` + +The current branch keeps these callbacks external so other feature owners can connect their modules without this MR taking ownership of routing. + +## Verification + +- Built and ran `android.app` locally from Android Studio. +- `:android:app:assembleDebug` completed successfully after trimming this branch to the device-list component scope. + +## Notes + +`settings.gradle.kts` is intentionally not part of this MR. Local Gradle/JDK/toolchain setup is handled on the developer machine and should not modify the team-provided project configuration. + +--- + +# WIP: 新增设备列表 Compose 页面 + +## 概要 + +本 MR 只新增我当前分工负责的 Kotlin Jetpack Compose 设备列表页面组件。 + +设备列表展示三类 ABox 设备入口: + +- 智能插座 +- 温湿度传感器 +- 红外控制器 + +本 MR 故意不修改 App 入口、登录流程、应用壳路由,也不实现任何设备详情/控制页面。这些部分由其他功能分支负责。 + +## 修改内容 + +- 新增 `DeviceListScreen`。 +- 为三类设备入口暴露点击回调: + - `onSocketClick` + - `onTemperatureHumidityClick` + - `onInfraredClick` +- 更新设备列表变更说明文档。 +- 从本分支中移除早期临时加入、但不属于当前分工范围的设备控制页面。 + +## 本 MR 包含 + +- 设备列表 Compose UI 组件 +- 设备类别入口 UI +- 后续路由接入所需的 callback API + +## 本 MR 不包含 + +- App 入口修改 +- 登录流程修改 +- 设备控制 navigation graph +- 智能插座控制页面 +- 温湿度状态页面 +- 红外控制器页面 +- Compose UI 中直接调用 ABSDK +- Java Activity +- XML layout + +## 对接说明 + +该页面后续可以由 App shell 或路由负责人挂载: + +```kotlin +DeviceListScreen( + onSocketClick = { /* 后续跳转到智能插座模块 */ }, + onTemperatureHumidityClick = { /* 后续跳转到温湿度模块 */ }, + onInfraredClick = { /* 后续跳转到红外控制器模块 */ }, +) +``` + +当前分支只提供页面和回调 API,不负责具体跳转目标,以便其他模块负责人对接自己的功能页面。 + +## 验证 + +- 已在本地通过 Android Studio 成功 build/run `android.app`。 +- 修剪为设备列表组件范围后,`:android:app:assembleDebug` 构建成功。 + +## 备注 + +`settings.gradle.kts` 不属于本 MR 范围。本地 Gradle/JDK/toolchain 配置在开发者本机处理,不修改团队提供的项目配置文件。