refactor: 注释移除 Compose 相关代码,统一入口替换为 HomeActivity
- 注释掉全部 Compose UI 代码(ui/、theme/、NavController、MainActivity、InitActivity 等) - BorderExt、TextExt、ToastUtils、LoadingState 中的 Compose 逻辑全部注释 - LoadingState 保留 show()/hide() 空方法避免编译报错 - 注释 SensorScaleUtils、BaseViewModel、DeviceViewModel 中的 ToastUtils 调用 - BootReceiver、CrashHandler 中 MainActivity 替换为 HomeActivity - UserViewModel、PurchaseOrderActivity 删除残余 Compose import - build.gradle.kts 替换为非 Compose 的 activity-ktx 和 coil 依赖 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,33 +1,33 @@
|
||||
package com.sw.inbound.ext
|
||||
|
||||
import androidx.annotation.ColorRes
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.text.TextStyle
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.TextUnit
|
||||
import androidx.compose.ui.unit.sp
|
||||
|
||||
// 快速修改颜色
|
||||
fun TextStyle.withColor(color: Color): TextStyle = this.copy(color = color)
|
||||
|
||||
@Composable
|
||||
fun TextStyle.withColorRes(@ColorRes colorRes: Int): TextStyle {
|
||||
return this.copy(color = colorResource(id = colorRes))
|
||||
}
|
||||
|
||||
// 快速修改字体大小
|
||||
fun TextStyle.withSize(size: TextUnit): TextStyle = this.copy(fontSize = size)
|
||||
|
||||
fun TextStyle.withSizeSp(sp: Float): TextStyle = this.copy(fontSize = sp.sp)
|
||||
|
||||
// 快速修改字体粗细
|
||||
fun TextStyle.withWeight(weight: FontWeight): TextStyle = this.copy(fontWeight = weight)
|
||||
|
||||
fun TextStyle.bold(): TextStyle = this.copy(fontWeight = FontWeight.Bold)
|
||||
fun TextStyle.medium(): TextStyle = this.copy(fontWeight = FontWeight.Medium)
|
||||
fun TextStyle.light(): TextStyle = this.copy(fontWeight = FontWeight.Light)
|
||||
|
||||
fun TextStyle.textAlign(textAlign: TextAlign): TextStyle = this.copy(textAlign = textAlign)
|
||||
//package com.sw.inbound.ext
|
||||
//
|
||||
//import androidx.annotation.ColorRes
|
||||
//import androidx.compose.runtime.Composable
|
||||
//import androidx.compose.ui.graphics.Color
|
||||
//import androidx.compose.ui.res.colorResource
|
||||
//import androidx.compose.ui.text.TextStyle
|
||||
//import androidx.compose.ui.text.font.FontWeight
|
||||
//import androidx.compose.ui.text.style.TextAlign
|
||||
//import androidx.compose.ui.unit.TextUnit
|
||||
//import androidx.compose.ui.unit.sp
|
||||
//
|
||||
//// 快速修改颜色
|
||||
//fun TextStyle.withColor(color: Color): TextStyle = this.copy(color = color)
|
||||
//
|
||||
//@Composable
|
||||
//fun TextStyle.withColorRes(@ColorRes colorRes: Int): TextStyle {
|
||||
// return this.copy(color = colorResource(id = colorRes))
|
||||
//}
|
||||
//
|
||||
//// 快速修改字体大小
|
||||
//fun TextStyle.withSize(size: TextUnit): TextStyle = this.copy(fontSize = size)
|
||||
//
|
||||
//fun TextStyle.withSizeSp(sp: Float): TextStyle = this.copy(fontSize = sp.sp)
|
||||
//
|
||||
//// 快速修改字体粗细
|
||||
//fun TextStyle.withWeight(weight: FontWeight): TextStyle = this.copy(fontWeight = weight)
|
||||
//
|
||||
//fun TextStyle.bold(): TextStyle = this.copy(fontWeight = FontWeight.Bold)
|
||||
//fun TextStyle.medium(): TextStyle = this.copy(fontWeight = FontWeight.Medium)
|
||||
//fun TextStyle.light(): TextStyle = this.copy(fontWeight = FontWeight.Light)
|
||||
//
|
||||
//fun TextStyle.textAlign(textAlign: TextAlign): TextStyle = this.copy(textAlign = textAlign)
|
||||
|
||||
Reference in New Issue
Block a user