File tree Expand file tree Collapse file tree 4 files changed +33
-7
lines changed
app/src/main/java/one/mixin/android Expand file tree Collapse file tree 4 files changed +33
-7
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,20 @@ import androidx.compose.runtime.compositionLocalOf
1616import androidx.compose.ui.graphics.Color
1717import androidx.compose.ui.graphics.colorspace.ColorSpaces
1818import androidx.compose.ui.platform.LocalContext
19+ import androidx.compose.ui.platform.LocalInspectionMode
1920import one.mixin.android.MixinApplication
2021import one.mixin.android.extension.isNightMode
2122import one.mixin.android.extension.isScreenWideColorGamut
2223import one.mixin.android.util.isCurrChinese
2324
24- val isP3Supported = MixinApplication .appContext.isScreenWideColorGamut()
25+ val isP3Supported by lazy {
26+ if (isP3Enabled) {
27+ MixinApplication .appContext.isScreenWideColorGamut()
28+ } else {
29+ false
30+ }
31+ }
32+ private var isP3Enabled = true
2533
2634class AppColors (
2735 val primary : Color ,
@@ -151,9 +159,10 @@ private val LocalColors = compositionLocalOf { LightColorPalette }
151159
152160@Composable
153161fun MixinAppTheme (
154- darkTheme : Boolean = MixinApplication .get().isNightMode(),
162+ darkTheme : Boolean = if ( LocalInspectionMode .current) false else MixinApplication .get().isNightMode(),
155163 content : @Composable () -> Unit ,
156164) {
165+ isP3Enabled = ! LocalInspectionMode .current
157166 val colors =
158167 if (darkTheme) {
159168 DarkColorPalette
Original file line number Diff line number Diff line change @@ -328,16 +328,17 @@ fun BrowserPage(
328328 Box (modifier = Modifier .height(10 .dp))
329329 }
330330 val fee = tipGas?.displayValue(transaction?.maxFeePerGas) ? : solanaFee?.stripTrailingZeros() ? : BigDecimal .ZERO
331+ val feeSymbol = asset?.symbol ? : chain.symbol
331332 if (fee == BigDecimal .ZERO ) {
332333 FeeInfo (
333- amount = " $fee " ,
334+ amount = " $fee $feeSymbol " ,
334335 fee = fee.multiply(asset.priceUSD()),
335336 isFree = isFeeWaived,
336337 onFreeClick = onFreeClick,
337338 )
338339 } else {
339340 FeeInfo (
340- amount = " $fee ${asset?.symbol ? : " " } " ,
341+ amount = " $fee $feeSymbol " ,
341342 fee = fee.multiply(asset.priceUSD()),
342343 gasPrice = tipGas?.displayGas(transaction?.maxFeePerGas)?.toPlainString(),
343344 isFree = isFeeWaived,
Original file line number Diff line number Diff line change @@ -204,9 +204,10 @@ fun ParsedTxPreview(
204204 if (parsedTx == null ) {
205205 BalanceChangeHead ()
206206 CircularProgressIndicator (
207- modifier = Modifier .size(32 .dp),
207+ modifier = Modifier .size(48 .dp),
208208 color = MixinAppTheme .colors.accent,
209209 )
210+ Box (modifier = Modifier .height(14 .dp))
210211 } else if (parsedTx.instructions?.isEmpty() == true ) {
211212 BalanceChangeHead ()
212213 Row (
@@ -521,6 +522,13 @@ private fun SingleBalanceChangeItem(
521522 maxLines = 1 ,
522523 fontSize = 12 .sp,
523524 )
525+ } else {
526+ Text (
527+ text = " " , // holder
528+ color = MixinAppTheme .colors.textAssist,
529+ maxLines = 1 ,
530+ fontSize = 12 .sp,
531+ )
524532 }
525533}
526534
@@ -558,6 +566,13 @@ private fun BalanceChangeItem(
558566 maxLines = 1 ,
559567 fontSize = 12 .sp,
560568 )
569+ } else {
570+ Text (
571+ text = " " , // holder
572+ color = MixinAppTheme .colors.textAssist,
573+ maxLines = 1 ,
574+ fontSize = 12 .sp,
575+ )
561576 }
562577 }
563578}
Original file line number Diff line number Diff line change @@ -326,16 +326,17 @@ fun SessionRequestPage(
326326 }
327327 Box (modifier = Modifier .height(20 .dp))
328328
329+ val feeSymbol = asset?.symbol ? : chain.symbol
329330 if (fee == BigDecimal .ZERO ) {
330331 FeeInfo (
331- amount = " $fee " ,
332+ amount = " $fee $feeSymbol " ,
332333 fee = fee.multiply(asset.priceUSD()),
333334 isFree = isFeeWaived,
334335 onFreeClick = onFreeClick,
335336 )
336337 } else {
337338 FeeInfo (
338- amount = " $fee ${asset?.symbol} " ,
339+ amount = " $fee $feeSymbol " ,
339340 fee = fee.multiply(asset.priceUSD()),
340341 gasPrice = tipGas?.displayGas(
341342 if (sessionRequestUI.data is WCEthereumTransaction ) {
You can’t perform that action at this time.
0 commit comments