mirror of
http://180.163.74.83:13000/zhangzhenghao/MPVN_Android.git
synced 2025-12-12 23:34:28 +00:00
功能特性: - 玻璃态/新拟态设计风格的现代UI - 侧边栏导航(控制台、最近、收藏、下载、支持、设置) - 房间管理:可添加、删除房间,支持横向滚动 - 长按房间标签进入编辑模式,带旋转晃动动画 - 三个场景模式按钮(回家、出门、玩乐) - 空调控制卡片 - 使用状态图表 - 灯光控制 - 设备网格展示 - 设置页面(账户、设备管理、显示设置、关于) - 使用SharedPreferences持久化存储房间列表 - 响应式设计,支持多种屏幕尺寸
26 lines
747 B
Kotlin
26 lines
747 B
Kotlin
package com.example.smarthome
|
|
|
|
import androidx.compose.runtime.CompositionLocalProvider
|
|
import androidx.compose.ui.platform.LocalDensity
|
|
import androidx.compose.ui.test.junit4.createAndroidComposeRule
|
|
import androidx.compose.ui.unit.Density
|
|
import com.example.smarthome.ui.ControlPanel
|
|
import org.junit.Rule
|
|
import org.junit.Test
|
|
|
|
class UiAdaptationTest {
|
|
@get:Rule
|
|
val rule = createAndroidComposeRule<MainActivity>()
|
|
|
|
@Test
|
|
fun dpiAdaptation160to640() {
|
|
listOf(160f, 240f, 320f, 480f, 640f).forEach { dpi ->
|
|
rule.setContent {
|
|
CompositionLocalProvider(LocalDensity provides Density(dpi / 160f)) {
|
|
ControlPanel(roomIndex = 0)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|