Skip to content

Commit d0389a2

Browse files
committed
Identicon issues fixed.
1 parent d833f99 commit d0389a2

File tree

16 files changed

+50
-47
lines changed

16 files changed

+50
-47
lines changed

.editorconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[*.{kt,kts}]
2-
ktlint_function_naming_ignore_when_annotated_with=Composable
3-
indent_size = 4
2+
ktlint_function_naming_ignore_when_annotated_with = Composable
3+
indent_size = 4
4+
5+
[/sceneview-android/**.*]
6+
ktlint_standard = disabled

sceneview-android

Binary file not shown.
-5.2 MB
Binary file not shown.

subvt/src/main/assets/material/cube.mtl

Lines changed: 0 additions & 12 deletions
This file was deleted.
-3.6 MB
Binary file not shown.

subvt/src/main/java/io/helikon/subvt/ui/modifier/ScrollHeader.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ fun Modifier.scrollHeader(
3636
color =
3737
Color
3838
.headerSectionBg(isDark)
39-
.copy(alpha = min(0.97f, scrolledRatio)),
39+
// is slightly transparent
40+
.copy(alpha = min(0.93f, scrolledRatio)),
4041
shape = clipShape,
4142
)
4243
.fillMaxWidth()

subvt/src/main/java/io/helikon/subvt/ui/screen/network/selection/NetworkSelectionScreen.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ private fun NetworkSelectionScreenContent(
119119
Modifier
120120
.size(dimensionResource(id = R.dimen.common_progress_size))
121121
.align(Alignment.Center),
122+
strokeWidth = dimensionResource(id = R.dimen.common_progress_stroke_width),
122123
color = Color.lightGray(),
123124
trackColor = Color.transparent(),
124125
)

subvt/src/main/java/io/helikon/subvt/ui/screen/network/status/NetworkStatusScreen.kt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ import androidx.compose.runtime.DisposableEffect
2121
import androidx.compose.runtime.getValue
2222
import androidx.compose.runtime.livedata.observeAsState
2323
import androidx.compose.runtime.mutableStateOf
24+
import androidx.compose.runtime.remember
2425
import androidx.compose.runtime.rememberCoroutineScope
2526
import androidx.compose.runtime.saveable.rememberSaveable
2627
import androidx.compose.runtime.setValue
2728
import androidx.compose.ui.Alignment
2829
import androidx.compose.ui.Modifier
2930
import androidx.compose.ui.draw.alpha
3031
import androidx.compose.ui.draw.clipToBounds
32+
import androidx.compose.ui.platform.LocalContext
3133
import androidx.compose.ui.platform.LocalLifecycleOwner
3234
import androidx.compose.ui.res.dimensionResource
3335
import androidx.compose.ui.res.stringResource
@@ -131,8 +133,18 @@ fun NetworkStatusScreenContent(
131133
}
132134
val scrollState = rememberScrollState()
133135
val scope = rememberCoroutineScope()
134-
val scrolledRatio = scrollState.value.toFloat() / scrollState.maxValue.toFloat() * 4.0f
135-
Box(modifier = modifier.clipToBounds().fillMaxSize()) {
136+
val context = LocalContext.current
137+
val headerFullAlphaScrollAmount =
138+
remember {
139+
context.resources.getDimension(R.dimen.common_header_full_alpha_scroll_amount)
140+
}
141+
val scrolledRatio = scrollState.value.toFloat() / headerFullAlphaScrollAmount
142+
Box(
143+
modifier =
144+
modifier
145+
.clipToBounds()
146+
.fillMaxSize(),
147+
) {
136148
if (networkSwitcherIsVisible) {
137149
NetworkSwitcherView(
138150
modifier =

subvt/src/main/java/io/helikon/subvt/ui/screen/network/status/view/BlockWaveView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fun BlockWaveView(
4141
LaunchedEffect(blockNumber) {
4242
progress.snapTo(0.0f)
4343
frequency = (Math.random() * 0.5 + 0.85).toFloat()
44-
speed = (Math.random() * 130 + 200).toInt()
44+
speed = -(Math.random() * 130 + 200).toInt()
4545
progress.animateTo(
4646
1.0f,
4747
animationSpec =
@@ -55,7 +55,7 @@ fun BlockWaveView(
5555
val height = progress.value + heightFluctuation
5656
val offset = (progress.value * speed).toInt()
5757
val amplitude =
58-
sin(Math.PI * height).toFloat() * 0.035f / (frequency * frequency / 1.2f)
58+
sin(Math.PI * height).toFloat() * 0.04f / (frequency * frequency / 1.2f)
5959
val points = mutableListOf<Float>()
6060
for (i in offset..(120 + offset)) {
6161
points.add(sin(Math.PI * 2 * frequency / 120 * i).toFloat() * amplitude + height)

subvt/src/main/java/io/helikon/subvt/ui/screen/validator/details/ValidatorDetailsScreen.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ fun ValidatorDetailsScreenContent(
160160
onBack: () -> Unit,
161161
) {
162162
val scrollState = rememberScrollState()
163-
val scrolledRatio =
164-
if (scrollState.maxValue == 0) {
165-
0.0f
166-
} else {
167-
scrollState.value.toFloat() / scrollState.maxValue.toFloat() * 4.0f
163+
val context = LocalContext.current
164+
val headerFullAlphaScrollAmount =
165+
remember {
166+
context.resources.getDimension(R.dimen.common_header_full_alpha_scroll_amount)
168167
}
168+
val scrolledRatio = scrollState.value.toFloat() / headerFullAlphaScrollAmount
169169
SnackbarScaffold(
170170
zIndex = 15.0f,
171171
snackbarText = stringResource(id = R.string.validator_details_my_validators_fetch_error),
@@ -254,7 +254,7 @@ fun ValidatorDetailsScreenContent(
254254
Modifier
255255
.size(dimensionResource(id = R.dimen.common_small_progress_size))
256256
.align(Alignment.Center),
257-
strokeWidth = 1.dp,
257+
strokeWidth = dimensionResource(id = R.dimen.common_small_progress_stroke_width),
258258
color = Color.text(isDark).copy(alpha = 0.85f),
259259
trackColor = Color.transparent(),
260260
)

subvt/src/main/java/io/helikon/subvt/ui/screen/validator/details/view/IdenticonView.kt

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ fun IdenticonView(
4646
}
4747

4848
Scene(
49-
modifier =
50-
modifier,
51-
// alpha is zero to make the background transparent
52-
// .alpha(0.0f),
49+
modifier = modifier,
5350
engine = engine,
5451
modelLoader = modelLoader,
5552
isOpaque = false,
@@ -65,15 +62,6 @@ fun IdenticonView(
6562
clear = true
6663
}
6764

68-
// this.setZOrderOnTop(true)
69-
// this.setZOrderMediaOverlay(true)
70-
71-
/*
72-
this.uiHelper.isOpaque = true
73-
this.view.blendMode = com.google.android.filament.View.BlendMode.TRANSLUCENT
74-
this.scene.skybox = null
75-
*/
76-
7765
val identiconColors = getIdenticonColors(accountId)
7866

7967
for (i in 0..<19) {

subvt/src/main/java/io/helikon/subvt/ui/screen/validator/list/ValidatorListScreen.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ fun ValidatorListScreenContent(
171171
var scrollOffset by rememberSaveable {
172172
mutableFloatStateOf(0.0f)
173173
}
174-
val scrolledRatio = abs(scrollOffset) / 52.0f
174+
val headerFullAlphaScrollAmount =
175+
remember {
176+
context.resources.getDimension(R.dimen.common_header_full_alpha_scroll_amount)
177+
}
178+
val scrolledRatio = abs(scrollOffset) / headerFullAlphaScrollAmount
175179
val focusManager = LocalFocusManager.current
176180
var filterSortViewIsVisible by rememberSaveable {
177181
mutableStateOf(false)
@@ -199,6 +203,7 @@ fun ValidatorListScreenContent(
199203
Modifier
200204
.size(dimensionResource(id = R.dimen.common_progress_size))
201205
.align(Alignment.Center),
206+
strokeWidth = dimensionResource(id = R.dimen.common_progress_stroke_width),
202207
color = Color.lightGray(),
203208
trackColor = Color.transparent(),
204209
)
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources>
33
<style name="Theme.SubVT" parent="android:Theme.Material.Light.NoActionBar">
4+
<item name="android:windowBackground">@color/background</item>
45
<item name="android:windowSplashScreenBackground">@color/background</item>
56
<item name="android:windowSplashScreenIconBackgroundColor">@color/background</item>
67
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_screen_icon</item>
7-
<item name="android:background">@color/background</item>
8+
<!--item name="android:background">@color/background</item-->
89
</style>
910
</resources>

subvt/src/main/res/values/dimens.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
<dimen name="common_padding">16dp</dimen>
44
<dimen name="common_panel_padding">8dp</dimen>
55
<dimen name="common_panel_border_radius">16dp</dimen>
6-
<dimen name="common_progress_size">36dp</dimen>
6+
<dimen name="common_progress_size">26dp</dimen>
7+
<dimen name="common_progress_stroke_width">3dp</dimen>
78
<dimen name="common_small_progress_size">14dp</dimen>
9+
<dimen name="common_small_progress_stroke_width">1dp</dimen>
810
<dimen name="common_content_margin_top">24dp</dimen>
911
<dimen name="common_data_panel_content_margin_top">12dp</dimen>
1012
<dimen name="common_bottom_gradient_height">104dp</dimen>
1113
<dimen name="common_scrollable_content_margin_bottom">54dp</dimen>
14+
<dimen name="common_header_full_alpha_scroll_amount">42dp</dimen>
1215

1316
<dimen name="action_button_width">266dp</dimen>
1417
<dimen name="action_button_height">64dp</dimen>
@@ -56,5 +59,5 @@
5659
<dimen name="validator_details_identicon_height">230dp</dimen>
5760
<dimen name="validator_details_content_padding_top">128dp</dimen>
5861
<dimen name="validator_details_nomination_list_max_height">120dp</dimen>
59-
<dimen name="validator_details_icon_size">34dp</dimen>
62+
<dimen name="validator_details_icon_size">38dp</dimen>
6063
</resources>

subvt/src/main/res/values/themes.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
<resources>
33

44
<style name="Theme.SubVT" parent="android:Theme.Material.Wallpaper.NoTitleBar">
5-
<!--item name="windowSplashScreenBackground">@color/background</item>
6-
<item name="windowSplashScreenIconBackgroundColor">@color/background</item>
7-
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_screen_icon</item-->
8-
<item name="android:background">@color/background</item>
5+
<item name="android:windowBackground">@color/background</item>
6+
<!--item name="android:windowSplashScreenBackground">@color/background</item>
7+
<item name="android:windowSplashScreenIconBackgroundColor">@color/background</item>
8+
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_screen_icon</item-->
9+
<!--item name="android:background">@color/background</item-->
910
</style>
1011
</resources>

0 commit comments

Comments
 (0)