From d04ab3fbff4e5e61157548b93416885b586f03e0 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Sun, 16 Aug 2026 20:04:00 -0700 Subject: [PATCH] app: resize LogLevelBadge using Material 3 Badge Replace custom padded Box in LogLevelBadge with Material 3's Badge component to make log level indicators more compact and consistent with the rest of the application's badge styling. Assisted-by: Gemini 3.7 Flash --- .../com/topjohnwu/magisk/ui/log/LogScreen.kt | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/app/apk-ng/src/main/java/com/topjohnwu/magisk/ui/log/LogScreen.kt b/app/apk-ng/src/main/java/com/topjohnwu/magisk/ui/log/LogScreen.kt index cb61742df..aaeeb9935 100644 --- a/app/apk-ng/src/main/java/com/topjohnwu/magisk/ui/log/LogScreen.kt +++ b/app/apk-ng/src/main/java/com/topjohnwu/magisk/ui/log/LogScreen.kt @@ -1,7 +1,6 @@ package com.topjohnwu.magisk.ui.log import androidx.compose.foundation.Image -import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -18,7 +17,6 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.rememberLazyListState -import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Delete import androidx.compose.material.icons.filled.Download @@ -45,7 +43,6 @@ import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.input.nestedscroll.NestedScrollConnection import androidx.compose.ui.input.nestedscroll.nestedScroll @@ -389,19 +386,10 @@ private fun LogLevelBadge(level: Char) { 'F' -> Color(0xFF9C27B0) to Color.White else -> Color(0xFF757575) to Color.White } - Box( - modifier = Modifier - .clip(RoundedCornerShape(4.dp)) - .background(bg) - .padding(horizontal = 5.dp, vertical = 1.dp), - contentAlignment = Alignment.Center + Badge( + containerColor = bg, + contentColor = fg, ) { - Text( - text = level.toString(), - fontSize = 10.sp, - fontWeight = FontWeight.Bold, - fontFamily = FontFamily.Monospace, - color = fg, - ) + Text(text = level.toString()) } }