Skip to content

Commit

Permalink
Overall UI fine-tuning pt.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Feb 22, 2024
1 parent 30dfde9 commit 717c561
Show file tree
Hide file tree
Showing 21 changed files with 154 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inline fun Modifier.noRippleClickable(crossinline onClick: () -> Unit): Modifier
var enableAgain by remember { mutableStateOf(true) }
LaunchedEffect(enableAgain, block = {
if (enableAgain) return@LaunchedEffect
delay(timeMillis = 500L)
delay(timeMillis = 750L)
enableAgain = true
})
this.then(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ private fun IntroductionScreenContent(
) {
AnimatedBackground(
modifier =
Modifier
.fillMaxSize()
.zIndex(0.0f),
Modifier
.fillMaxSize()
.zIndex(0.0f),
)
Box(
Modifier.fillMaxHeight(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun BlockNumberView(
Text(
text = title,
textAlign = TextAlign.Center,
style = Font.light(dimensionResource(id = R.dimen.network_status_panel_title_font_size).value.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
color = Color.text(isDark),
)
Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fun EraEpochView(
text = titleIndexed,
color = Color.text(isDark),
textAlign = TextAlign.Center,
style = Font.light(dimensionResource(id = R.dimen.network_status_panel_title_font_size).value.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
)
Spacer(modifier = Modifier.height(10.dp))
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun EraPointsView(
text = stringResource(R.string.network_status_era_points),
textAlign = TextAlign.Center,
color = Color.text(isDark),
style = Font.light(dimensionResource(id = R.dimen.network_status_panel_title_font_size).value.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
)
Spacer(modifier = Modifier.height(12.dp))
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun LastEraTotalRewardView(
text = stringResource(id = R.string.network_status_last_era_total_reward),
textAlign = TextAlign.Center,
color = Color.text(isDark),
style = Font.light(dimensionResource(id = R.dimen.network_status_panel_title_font_size).value.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
)
Spacer(modifier = Modifier.weight(1f))
Row {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ fun ValidatorBackingsView(
) {
Column(
modifier =
modifier
.clip(shape = RoundedCornerShape(dimensionResource(id = R.dimen.common_panel_border_radius)))
.background(Color.panelBg(isDark))
.padding(dimensionResource(id = R.dimen.common_padding)),
modifier
.clip(shape = RoundedCornerShape(dimensionResource(id = R.dimen.common_panel_border_radius)))
.background(Color.panelBg(isDark))
.padding(dimensionResource(id = R.dimen.common_padding)),
) {
Text(
text = stringResource(id = R.string.network_status_validator_backings),
textAlign = TextAlign.Center,
style = Font.light(dimensionResource(id = R.dimen.network_status_panel_title_font_size).value.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
color = Color.text(isDark),
)
Spacer(modifier = Modifier.height(16.dp))
Expand All @@ -69,24 +69,24 @@ fun ValidatorBackingsView(
)
Text(
text =
if (minStake != null) {
formatDecimal(
if (network.id == 1L) {
minStake
} else {
minStake.div(BigInteger("${1_000_000}"))
},
network.tokenDecimalCount,
formatDecimalCount =
if (network.id == 1L) {
0
} else {
4
},
)
} else {
"-"
},
if (minStake != null) {
formatDecimal(
if (network.id == 1L) {
minStake
} else {
minStake.div(BigInteger("${1_000_000}"))
},
network.tokenDecimalCount,
formatDecimalCount =
if (network.id == 1L) {
0
} else {
4
},
)
} else {
"-"
},
textAlign = TextAlign.Center,
style = Font.semiBold(20.sp),
color = Color.text(isDark),
Expand All @@ -110,24 +110,24 @@ fun ValidatorBackingsView(
)
Text(
text =
if (averageStake != null) {
formatDecimal(
if (network.id == 1L) {
averageStake
} else {
averageStake.div(BigInteger("${1_000_000}"))
},
network.tokenDecimalCount,
formatDecimalCount =
if (network.id == 1L) {
0
} else {
4
},
)
} else {
"-"
},
if (averageStake != null) {
formatDecimal(
if (network.id == 1L) {
averageStake
} else {
averageStake.div(BigInteger("${1_000_000}"))
},
network.tokenDecimalCount,
formatDecimalCount =
if (network.id == 1L) {
0
} else {
4
},
)
} else {
"-"
},
textAlign = TextAlign.Center,
style = Font.semiBold(20.sp),
color = Color.text(isDark),
Expand All @@ -151,24 +151,24 @@ fun ValidatorBackingsView(
)
Text(
text =
if (maxStake != null) {
formatDecimal(
if (network.id == 1L) {
maxStake
} else {
maxStake.div(BigInteger("${1_000_000}"))
},
network.tokenDecimalCount,
formatDecimalCount =
if (network.id == 1L) {
0
} else {
4
},
)
} else {
"-"
},
if (maxStake != null) {
formatDecimal(
if (network.id == 1L) {
maxStake
} else {
maxStake.div(BigInteger("${1_000_000}"))
},
network.tokenDecimalCount,
formatDecimalCount =
if (network.id == 1L) {
0
} else {
4
},
)
} else {
"-"
},
color = Color.text(isDark),
textAlign = TextAlign.Center,
style = Font.semiBold(20.sp),
Expand All @@ -177,11 +177,11 @@ fun ValidatorBackingsView(
Text(
modifier = Modifier.alpha(0.4f),
text =
if (network.id == 1L) {
network.tokenTicker
} else {
"M${network.tokenTicker}"
},
if (network.id == 1L) {
network.tokenTicker
} else {
"M${network.tokenTicker}"
},
textAlign = TextAlign.Center,
style = Font.normal(20.sp),
color = Color.text(isDark),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fun ValidatorCountPanel(
) {
Text(
text = title,
style = Font.light(dimensionResource(id = R.dimen.network_status_panel_title_font_size).value.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
color = Color.text(isDark),
)
Spacer(modifier = Modifier.weight(1f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ fun ValidatorDetailsScreenContent(
) {
Text(
text = stringResource(id = R.string.validator_details_rewards_icon),
style = Font.light(16.sp),
style = Font.light(14.sp),
color = Color.text(isDark),
)
}
Expand All @@ -369,7 +369,7 @@ fun ValidatorDetailsScreenContent(
) {
Text(
text = stringResource(id = R.string.validator_details_para_validation_icon),
style = Font.light(14.sp),
style = Font.light(12.sp),
color = Color.text(isDark),
)
}
Expand Down Expand Up @@ -437,6 +437,7 @@ fun ValidatorDetailsScreenContent(
)
}
IdentityView(validator = state.validator)
Spacer(modifier = Modifier.height(4.dp))
// Spacer(modifier = Modifier.height(dimensionResource(id = R.dimen.common_panel_padding) / 2))
BalanceView(
titleResourceId = R.string.validator_details_nomination_total,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ fun AccountAgeView(
) {
Text(
text = stringResource(id = R.string.validator_details_account_age),
style = Font.light(12.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
color = Color.text(isDark),
)
Spacer(
modifier = Modifier.height(dimensionResource(id = R.dimen.common_data_panel_content_margin_top)),
)
Text(
text = periodText.trim(),
style = Font.semiBold(20.sp),
style = Font.semiBold(18.sp),
color = Color.text(isDark),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fun BalanceView(
) {
Text(
text = stringResource(id = titleResourceId),
style = Font.light(12.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
color = Color.text(isDark),
)
Spacer(
Expand All @@ -64,13 +64,13 @@ fun BalanceView(
} else {
"-"
},
style = Font.semiBold(28.sp),
style = Font.semiBold(26.sp),
color = Color.text(isDark),
)
if (network != null) {
Text(
text = network.tokenTicker,
style = Font.normal(28.sp),
style = Font.normal(26.sp),
color = Color.text(isDark).copy(alpha = 0.6f),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ fun HorizontalDataView(
) {
Text(
text = stringResource(id = titleResourceId),
style = Font.light(12.sp),
style = Font.light(dimensionResource(id = R.dimen.common_panel_title_font_size).value.sp),
color = Color.text(isDark),
)
Spacer(modifier = Modifier.weight(1.0f))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fun IconsView(
color = Color.bg(isDark),
shape = RoundedCornerShape(8.dp),
)
.padding(12.dp, 8.dp),
.padding(12.dp, 10.dp),
color = Color.text(isDark),
style = Font.light(11.sp),
text = stringResource(id = it.textResourceId()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ private val sphereOrdering =
private fun getLightNode(
engine: Engine,
position: Float3,
intensity: Float = 1.0f,
) = LightNode(
engine = engine,
type = LightManager.Type.POINT,
apply = {
color(SceneView.DEFAULT_MAIN_LIGHT_COLOR)
intensity(SceneView.DEFAULT_MAIN_LIGHT_COLOR_INTENSITY * 0.10f)
intensity(SceneView.DEFAULT_MAIN_LIGHT_COLOR_INTENSITY * 0.10f * intensity)
falloff(0.5f)
position(position.x, position.y, position.z)
castShadows(false)
Expand All @@ -53,7 +54,7 @@ fun IdenticonView(
assetFileLocation = "environment/cube_environment_1k.hdr",
)!!
}.apply {
this.indirectLight?.intensity = 40_000f
this.indirectLight?.intensity = 50_000f
}

val cameraNode =
Expand Down Expand Up @@ -97,6 +98,7 @@ fun IdenticonView(
getLightNode(
engine,
Float3(0.0f, 0.4f, 0.25f),
1.5f,
),
// top-right
getLightNode(
Expand All @@ -117,6 +119,7 @@ fun IdenticonView(
getLightNode(
engine,
Float3(0.0f, -0.4f, 0.25f),
1.5f,
),
// bottom-left
getLightNode(
Expand Down
Loading

0 comments on commit 717c561

Please sign in to comment.