Skip to content

Commit

Permalink
Identicon issues fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
kukabi committed Feb 17, 2024
1 parent d833f99 commit d0389a2
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 47 deletions.
7 changes: 5 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[*.{kt,kts}]
ktlint_function_naming_ignore_when_annotated_with=Composable
indent_size = 4
ktlint_function_naming_ignore_when_annotated_with = Composable
indent_size = 4

[/sceneview-android/**.*]
ktlint_standard = disabled
2 changes: 1 addition & 1 deletion sceneview-android
Submodule sceneview-android updated 0 files
Binary file not shown.
Binary file removed subvt/src/main/assets/environment/sky_2k.hdr
Binary file not shown.
12 changes: 0 additions & 12 deletions subvt/src/main/assets/material/cube.mtl

This file was deleted.

Binary file removed subvt/src/main/assets/model/damaged_helmet.glb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ fun Modifier.scrollHeader(
color =
Color
.headerSectionBg(isDark)
.copy(alpha = min(0.97f, scrolledRatio)),
// is slightly transparent
.copy(alpha = min(0.93f, scrolledRatio)),
shape = clipShape,
)
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private fun NetworkSelectionScreenContent(
Modifier
.size(dimensionResource(id = R.dimen.common_progress_size))
.align(Alignment.Center),
strokeWidth = dimensionResource(id = R.dimen.common_progress_stroke_width),
color = Color.lightGray(),
trackColor = Color.transparent(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
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.alpha
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
Expand Down Expand Up @@ -131,8 +133,18 @@ fun NetworkStatusScreenContent(
}
val scrollState = rememberScrollState()
val scope = rememberCoroutineScope()
val scrolledRatio = scrollState.value.toFloat() / scrollState.maxValue.toFloat() * 4.0f
Box(modifier = modifier.clipToBounds().fillMaxSize()) {
val context = LocalContext.current
val headerFullAlphaScrollAmount =
remember {
context.resources.getDimension(R.dimen.common_header_full_alpha_scroll_amount)
}
val scrolledRatio = scrollState.value.toFloat() / headerFullAlphaScrollAmount
Box(
modifier =
modifier
.clipToBounds()
.fillMaxSize(),
) {
if (networkSwitcherIsVisible) {
NetworkSwitcherView(
modifier =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fun BlockWaveView(
LaunchedEffect(blockNumber) {
progress.snapTo(0.0f)
frequency = (Math.random() * 0.5 + 0.85).toFloat()
speed = (Math.random() * 130 + 200).toInt()
speed = -(Math.random() * 130 + 200).toInt()
progress.animateTo(
1.0f,
animationSpec =
Expand All @@ -55,7 +55,7 @@ fun BlockWaveView(
val height = progress.value + heightFluctuation
val offset = (progress.value * speed).toInt()
val amplitude =
sin(Math.PI * height).toFloat() * 0.035f / (frequency * frequency / 1.2f)
sin(Math.PI * height).toFloat() * 0.04f / (frequency * frequency / 1.2f)
val points = mutableListOf<Float>()
for (i in offset..(120 + offset)) {
points.add(sin(Math.PI * 2 * frequency / 120 * i).toFloat() * amplitude + height)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ fun ValidatorDetailsScreenContent(
onBack: () -> Unit,
) {
val scrollState = rememberScrollState()
val scrolledRatio =
if (scrollState.maxValue == 0) {
0.0f
} else {
scrollState.value.toFloat() / scrollState.maxValue.toFloat() * 4.0f
val context = LocalContext.current
val headerFullAlphaScrollAmount =
remember {
context.resources.getDimension(R.dimen.common_header_full_alpha_scroll_amount)
}
val scrolledRatio = scrollState.value.toFloat() / headerFullAlphaScrollAmount
SnackbarScaffold(
zIndex = 15.0f,
snackbarText = stringResource(id = R.string.validator_details_my_validators_fetch_error),
Expand Down Expand Up @@ -254,7 +254,7 @@ fun ValidatorDetailsScreenContent(
Modifier
.size(dimensionResource(id = R.dimen.common_small_progress_size))
.align(Alignment.Center),
strokeWidth = 1.dp,
strokeWidth = dimensionResource(id = R.dimen.common_small_progress_stroke_width),
color = Color.text(isDark).copy(alpha = 0.85f),
trackColor = Color.transparent(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ fun IdenticonView(
}

Scene(
modifier =
modifier,
// alpha is zero to make the background transparent
// .alpha(0.0f),
modifier = modifier,
engine = engine,
modelLoader = modelLoader,
isOpaque = false,
Expand All @@ -65,15 +62,6 @@ fun IdenticonView(
clear = true
}

// this.setZOrderOnTop(true)
// this.setZOrderMediaOverlay(true)

/*
this.uiHelper.isOpaque = true
this.view.blendMode = com.google.android.filament.View.BlendMode.TRANSLUCENT
this.scene.skybox = null
*/

val identiconColors = getIdenticonColors(accountId)

for (i in 0..<19) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ fun ValidatorListScreenContent(
var scrollOffset by rememberSaveable {
mutableFloatStateOf(0.0f)
}
val scrolledRatio = abs(scrollOffset) / 52.0f
val headerFullAlphaScrollAmount =
remember {
context.resources.getDimension(R.dimen.common_header_full_alpha_scroll_amount)
}
val scrolledRatio = abs(scrollOffset) / headerFullAlphaScrollAmount
val focusManager = LocalFocusManager.current
var filterSortViewIsVisible by rememberSaveable {
mutableStateOf(false)
Expand Down Expand Up @@ -199,6 +203,7 @@ fun ValidatorListScreenContent(
Modifier
.size(dimensionResource(id = R.dimen.common_progress_size))
.align(Alignment.Center),
strokeWidth = dimensionResource(id = R.dimen.common_progress_stroke_width),
color = Color.lightGray(),
trackColor = Color.transparent(),
)
Expand Down
3 changes: 2 additions & 1 deletion subvt/src/main/res/values-v31/themes.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.SubVT" parent="android:Theme.Material.Light.NoActionBar">
<item name="android:windowBackground">@color/background</item>
<item name="android:windowSplashScreenBackground">@color/background</item>
<item name="android:windowSplashScreenIconBackgroundColor">@color/background</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_screen_icon</item>
<item name="android:background">@color/background</item>
<!--item name="android:background">@color/background</item-->
</style>
</resources>
7 changes: 5 additions & 2 deletions subvt/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
<dimen name="common_padding">16dp</dimen>
<dimen name="common_panel_padding">8dp</dimen>
<dimen name="common_panel_border_radius">16dp</dimen>
<dimen name="common_progress_size">36dp</dimen>
<dimen name="common_progress_size">26dp</dimen>
<dimen name="common_progress_stroke_width">3dp</dimen>
<dimen name="common_small_progress_size">14dp</dimen>
<dimen name="common_small_progress_stroke_width">1dp</dimen>
<dimen name="common_content_margin_top">24dp</dimen>
<dimen name="common_data_panel_content_margin_top">12dp</dimen>
<dimen name="common_bottom_gradient_height">104dp</dimen>
<dimen name="common_scrollable_content_margin_bottom">54dp</dimen>
<dimen name="common_header_full_alpha_scroll_amount">42dp</dimen>

<dimen name="action_button_width">266dp</dimen>
<dimen name="action_button_height">64dp</dimen>
Expand Down Expand Up @@ -56,5 +59,5 @@
<dimen name="validator_details_identicon_height">230dp</dimen>
<dimen name="validator_details_content_padding_top">128dp</dimen>
<dimen name="validator_details_nomination_list_max_height">120dp</dimen>
<dimen name="validator_details_icon_size">34dp</dimen>
<dimen name="validator_details_icon_size">38dp</dimen>
</resources>
9 changes: 5 additions & 4 deletions subvt/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<resources>

<style name="Theme.SubVT" parent="android:Theme.Material.Wallpaper.NoTitleBar">
<!--item name="windowSplashScreenBackground">@color/background</item>
<item name="windowSplashScreenIconBackgroundColor">@color/background</item>
<item name="windowSplashScreenAnimatedIcon">@drawable/splash_screen_icon</item-->
<item name="android:background">@color/background</item>
<item name="android:windowBackground">@color/background</item>
<!--item name="android:windowSplashScreenBackground">@color/background</item>
<item name="android:windowSplashScreenIconBackgroundColor">@color/background</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_screen_icon</item-->
<!--item name="android:background">@color/background</item-->
</style>
</resources>

0 comments on commit d0389a2

Please sign in to comment.