build: 删除未引用的 kotlin-test 条目,移除 @Preview,uiTooling 改为 debugImplementation
- 删除 libs.versions.toml 中未被任何模块引用的 kotlin-test 孤儿条目 - 移除所有 @Preview 注解和 Preview 函数(5 个文件) - app/core 模块的 compose-uiTooling 从 implementation 改为 debugImplementation,避免打包到 release APK Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5acad54384
commit
e02459e8c9
@ -94,6 +94,6 @@ dependencies {
|
||||
|
||||
implementation(platform(libs.compose.bom))
|
||||
implementation(libs.androidx.activity.compose)
|
||||
implementation(libs.compose.uiToolingPreview)
|
||||
implementation(libs.compose.uiTooling)
|
||||
debugImplementation(libs.compose.uiToolingPreview)
|
||||
debugImplementation(libs.compose.uiTooling)
|
||||
}
|
||||
|
||||
@ -7,7 +7,6 @@ import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import plus.rua.project.ui.CalendarMonthView
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
@ -28,9 +27,3 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
fun AppAndroidPreview() {
|
||||
CalendarMonthView()
|
||||
}
|
||||
|
||||
@ -49,8 +49,8 @@ dependencies {
|
||||
implementation(libs.compose.animation)
|
||||
implementation(libs.compose.material3)
|
||||
implementation(libs.compose.ui)
|
||||
implementation(libs.compose.uiToolingPreview)
|
||||
implementation(libs.compose.uiTooling)
|
||||
debugImplementation(libs.compose.uiToolingPreview)
|
||||
debugImplementation(libs.compose.uiTooling)
|
||||
|
||||
implementation(libs.kotlinx.datetime)
|
||||
implementation(libs.tyme4kt)
|
||||
|
||||
@ -27,7 +27,6 @@ import androidx.compose.ui.input.pointer.pointerInput
|
||||
import androidx.compose.ui.platform.LocalDensity
|
||||
import androidx.compose.ui.semantics.contentDescription
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import kotlinx.datetime.LocalDate
|
||||
@ -182,19 +181,3 @@ fun BottomCard(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun BottomCardPreview() {
|
||||
BottomCard(
|
||||
isCollapsed = false,
|
||||
selectedDate = kotlinx.datetime.LocalDate(2026, 5, 21),
|
||||
today = kotlinx.datetime.LocalDate(2026, 5, 21),
|
||||
shiftKind = plus.rua.project.ShiftKind.WORK,
|
||||
onDrag = {},
|
||||
onDragEnd = {},
|
||||
onExpandDrag = {},
|
||||
onExpandDragEnd = {},
|
||||
dragRangePx = 300f
|
||||
)
|
||||
}
|
||||
|
||||
@ -31,7 +31,6 @@ import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.zIndex
|
||||
@ -276,17 +275,3 @@ fun DayCell(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun DayCellPreview() {
|
||||
DayCell(
|
||||
date = LocalDate(2026, 5, 21),
|
||||
isCurrentMonth = true,
|
||||
isSelected = true,
|
||||
isToday = true,
|
||||
shiftKind = ShiftKind.WORK,
|
||||
showLegalHoliday = false,
|
||||
onClick = {}
|
||||
)
|
||||
}
|
||||
|
||||
@ -23,7 +23,6 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.graphics.graphicsLayer
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
@ -109,15 +108,3 @@ fun MonthHeader(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun MonthHeaderPreview() {
|
||||
MonthHeader(
|
||||
year = 2026,
|
||||
month = 5,
|
||||
weekNumber = 21,
|
||||
showToday = true,
|
||||
onToday = {}
|
||||
)
|
||||
}
|
||||
|
||||
@ -10,7 +10,6 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.semantics.semantics
|
||||
import androidx.compose.ui.semantics.heading
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
private val WEEKDAY_LABELS = listOf("一", "二", "三", "四", "五", "六", "日")
|
||||
@ -39,9 +38,3 @@ fun WeekdayHeader(modifier: Modifier = Modifier) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun WeekdayHeaderPreview() {
|
||||
WeekdayHeader()
|
||||
}
|
||||
|
||||
@ -36,7 +36,6 @@ compose-runtime = { module = "androidx.compose.runtime:runtime" }
|
||||
compose-ui = { module = "androidx.compose.ui:ui" }
|
||||
compose-uiTooling = { module = "androidx.compose.ui:ui-tooling" }
|
||||
compose-uiToolingPreview = { module = "androidx.compose.ui:ui-tooling-preview" }
|
||||
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
||||
kotlinx-coroutines-test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.11.0"
|
||||
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
|
||||
sketch-animated-gif = { module = "io.github.panpf.sketch4:sketch-animated-gif", version.ref = "sketch" }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user