Improved the appearance of KiwixShowCaseView.

This commit is contained in:
MohitMaliFtechiz 2025-04-17 17:34:11 +05:30 committed by Kelson
parent 8920372198
commit 2d36f36aed
3 changed files with 15 additions and 11 deletions

View File

@ -67,6 +67,7 @@ import org.kiwix.kiwixmobile.core.ui.components.ShowcaseProperty
import org.kiwix.kiwixmobile.core.ui.models.ActionMenuItem
import org.kiwix.kiwixmobile.core.ui.theme.DodgerBlue
import org.kiwix.kiwixmobile.core.ui.theme.KiwixTheme
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.DEFAULT_TEXT_ALPHA
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.FIFTEEN_DP
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.FILE_FOR_TRANSFER_SHOW_CASE_VIEW_SIZE
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.FILE_FOR_TRANSFER_TEXT_SIZE
@ -189,7 +190,7 @@ fun NearbyDevicesSection(
.padding(top = FIVE_DP)
.align(Alignment.CenterHorizontally),
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.67f)
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DEFAULT_TEXT_ALPHA)
)
when {
@ -213,7 +214,7 @@ fun NearbyDevicesSection(
)
},
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.67f)
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DEFAULT_TEXT_ALPHA)
)
else -> LazyColumn(
@ -252,7 +253,7 @@ private fun TransferFilesSection(
)
},
textAlign = TextAlign.Center,
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.67f)
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DEFAULT_TEXT_ALPHA)
)
LazyColumn(modifier = Modifier.fillMaxSize()) {
@ -283,7 +284,7 @@ private fun YourDeviceHeader(
showCaseMessage = context.getString(string.your_device_name_message)
)
},
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.67f)
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DEFAULT_TEXT_ALPHA)
)
val contentDescription = stringResource(R.string.device_name)
Text(
@ -293,7 +294,7 @@ private fun YourDeviceHeader(
modifier = Modifier
.minimumInteractiveComponentSize()
.semantics { this.contentDescription = contentDescription },
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.67f)
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DEFAULT_TEXT_ALPHA)
)
}
}
@ -314,7 +315,7 @@ fun TransferFileItem(
modifier = Modifier
.weight(1f)
.padding(horizontal = FIVE_DP, vertical = ONE_DP),
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.67f)
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DEFAULT_TEXT_ALPHA)
)
val modifier = Modifier
@ -364,7 +365,7 @@ fun PeerDeviceItem(
modifier = Modifier
.weight(3f)
.padding(horizontal = FIVE_DP, vertical = ONE_DP),
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.67f)
color = MaterialTheme.colorScheme.onSurface.copy(alpha = DEFAULT_TEXT_ALPHA)
)
}
}

View File

@ -65,7 +65,7 @@ import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import org.kiwix.kiwixmobile.core.R
import org.kiwix.kiwixmobile.core.downloader.downloadManager.ZERO
import org.kiwix.kiwixmobile.core.ui.theme.CornflowerBlue
import org.kiwix.kiwixmobile.core.ui.theme.DodgerBlue
import org.kiwix.kiwixmobile.core.ui.theme.White
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.PULSE_ALPHA
import org.kiwix.kiwixmobile.core.utils.ComposeDimens.PULSE_ANIMATION_END
@ -154,7 +154,7 @@ private fun DrawScope.drawOverlay(
baseRadius: Float,
animatedFraction: Float
) {
drawRect(color = CornflowerBlue.copy(alpha = SHOWCASE_VIEW_BACKGROUND_COLOR_ALPHA), size = size)
drawRect(color = DodgerBlue.copy(alpha = SHOWCASE_VIEW_BACKGROUND_COLOR_ALPHA), size = size)
drawCircle(
color = Color.White,
radius = baseRadius * (ONE + animatedFraction),

View File

@ -64,6 +64,9 @@ object ComposeDimens {
// Default letter spacing in text according to theme
val DEFAULT_LETTER_SPACING = 0.0333.em
// Default Text alpha.
const val DEFAULT_TEXT_ALPHA = 0.67f
// Shape configuration sizes. See Shape.kt
val EXTRA_SMALL_ROUND_SHAPE_SIZE = 4.dp
val SMALL_ROUND_SHAPE_SIZE = 8.dp
@ -125,8 +128,8 @@ object ComposeDimens {
val NEARBY_DEVICES_TEXT_SIZE = 16.sp
// KiwixShowCase view dimens
val SHOWCASE_VIEW_MESSAGE_TEXT_SIZE = 14.sp
val SHOWCASE_VIEW_NEXT_BUTTON_TEXT_SIZE = 16.sp
val SHOWCASE_VIEW_MESSAGE_TEXT_SIZE = 17.sp
val SHOWCASE_VIEW_NEXT_BUTTON_TEXT_SIZE = 20.sp
val FILE_FOR_TRANSFER_SHOW_CASE_VIEW_SIZE = 100.dp
val NEARBY_DEVICES_SHOW_CASE_VIEW_SIZE = 100.dp
const val SHOWCASE_MESSAGE_SHADOW_BLUR_RADIUS = 3f