11package com.hackeros.app.ui.screens
22
33import androidx.compose.animation.*
4- import androidx.compose.animation.core.tween
4+ import androidx.compose.animation.core.*
55import androidx.compose.foundation.layout.*
66import androidx.compose.foundation.lazy.LazyColumn
77import androidx.compose.foundation.lazy.itemsIndexed
@@ -22,7 +22,6 @@ import com.hackeros.app.ui.components.VersionCard
2222import com.hackeros.app.ui.theme.LocalAppTheme
2323import com.hackeros.app.ui.theme.mutedColor
2424import com.hackeros.app.ui.theme.primaryColor
25- import com.hackeros.app.ui.theme.textColor
2625import com.hackeros.app.utils.Translations
2726
2827@Composable
@@ -38,37 +37,36 @@ fun ReleasesScreen(
3837
3938 LazyColumn (
4039 contentPadding = PaddingValues (start = 16 .dp, end = 16 .dp, top = 8 .dp, bottom = 100 .dp),
41- verticalArrangement = Arrangement .spacedBy(16 .dp)
40+ verticalArrangement = Arrangement .spacedBy(16 .dp)
4241 ) {
4342 item {
44- // Header
4543 Row (
4644 verticalAlignment = Alignment .CenterVertically ,
4745 modifier = Modifier .padding(horizontal = 4 .dp, vertical = 8 .dp)
4846 ) {
4947 Text (
5048 text = " HackerOS" ,
51- fontFamily = FontFamily .Monospace ,
52- fontWeight = FontWeight .Bold ,
53- fontSize = 28 .sp,
54- color = Color .White
49+ fontFamily = FontFamily .Monospace ,
50+ fontWeight = FontWeight .Bold ,
51+ fontSize = 28 .sp,
52+ color = Color .White
5553 )
5654 Spacer (Modifier .width(12 .dp))
5755 Surface (
5856 shape = androidx.compose.foundation.shape.RoundedCornerShape (6 .dp),
59- color = theme.primaryColor().copy(alpha = 0.15f ),
60- border = androidx.compose.foundation.BorderStroke (
61- 1 .dp, theme.primaryColor().copy(alpha = 0.5f )
62- )
57+ color = theme.primaryColor().copy(alpha = 0.15f ),
58+ border = androidx.compose.foundation.BorderStroke (
59+ 1 .dp, theme.primaryColor().copy(alpha = 0.5f )
60+ )
6361 ) {
6462 Text (
6563 text = t.sub_releases,
66- fontSize = 9 .sp,
67- fontFamily = FontFamily .Monospace ,
68- fontWeight = FontWeight .Bold ,
69- color = theme.primaryColor(),
70- letterSpacing = 0.5 .sp,
71- modifier = Modifier .padding(horizontal = 8 .dp, vertical = 4 .dp)
64+ fontSize = 9 .sp,
65+ fontFamily = FontFamily .Monospace ,
66+ fontWeight = FontWeight .Bold ,
67+ color = theme.primaryColor(),
68+ letterSpacing = 0.5 .sp,
69+ modifier = Modifier .padding(horizontal = 8 .dp, vertical = 4 .dp)
7270 )
7371 }
7472 }
@@ -91,7 +89,7 @@ fun ReleasesScreen(
9189 AnimatedVisibility (
9290 visible = true ,
9391 enter = fadeIn(tween(300 + index * 80 )) +
94- slideInVertically(tween(300 + index * 80 )) { it / 2 }
92+ slideInVertically(tween(300 + index * 80 )) { it / 2 }
9593 ) {
9694 VersionCard (
9795 release = release,
@@ -104,22 +102,22 @@ fun ReleasesScreen(
104102 Column (
105103 horizontalAlignment = Alignment .CenterHorizontally ,
106104 modifier = Modifier
107- .fillMaxWidth()
108- .padding(vertical = 24 .dp)
105+ .fillMaxWidth()
106+ .padding(vertical = 24 .dp)
109107 ) {
110108 Icon (
111109 Icons .Default .Terminal ,
112- contentDescription = null ,
113- tint = theme.mutedColor().copy(alpha = 0.4f ),
114- modifier = Modifier .size(24 .dp)
110+ contentDescription = null ,
111+ tint = theme.mutedColor().copy(alpha = 0.4f ),
112+ modifier = Modifier .size(24 .dp)
115113 )
116114 Spacer (Modifier .height(8 .dp))
117115 Text (
118116 text = t.end_of_log.uppercase(),
119- fontSize = 9 .sp,
120- fontFamily = FontFamily .Monospace ,
121- color = theme.mutedColor().copy(alpha = 0.4f ),
122- letterSpacing = 2 .sp
117+ fontSize = 9 .sp,
118+ fontFamily = FontFamily .Monospace ,
119+ color = theme.mutedColor().copy(alpha = 0.4f ),
120+ letterSpacing = 2 .sp
123121 )
124122 }
125123 }
@@ -133,23 +131,27 @@ private fun LoadingState(primaryColor: Color, label: String) {
133131 Column (
134132 horizontalAlignment = Alignment .CenterHorizontally ,
135133 modifier = Modifier
136- .fillMaxWidth()
137- .height(300 .dp),
138- verticalArrangement = Arrangement .Center
134+ .fillMaxWidth()
135+ .height(300 .dp),
136+ verticalArrangement = Arrangement .Center
139137 ) {
140138 CircularProgressIndicator (color = primaryColor, modifier = Modifier .size(48 .dp))
141139 Spacer (Modifier .height(16 .dp))
142140 val infiniteTransition = rememberInfiniteTransition(label = " pulse" )
143141 val alpha by infiniteTransition.animateFloat(
144- initialValue = 0.3f , targetValue = 1f ,
145- animationSpec = infiniteRepeatable(tween(800 ), RepeatMode .Reverse ),
142+ initialValue = 0.3f ,
143+ targetValue = 1f ,
144+ animationSpec = infiniteRepeatable(
145+ animation = tween(800 ),
146+ repeatMode = RepeatMode .Reverse
147+ ),
146148 label = " alpha"
147149 )
148150 Text (
149151 text = label,
150- fontSize = 11 .sp,
151- fontFamily = FontFamily .Monospace ,
152- color = primaryColor.copy(alpha = alpha)
152+ fontSize = 11 .sp,
153+ fontFamily = FontFamily .Monospace ,
154+ color = primaryColor.copy(alpha = alpha)
153155 )
154156 }
155157}
@@ -164,25 +166,25 @@ private fun ErrorState(
164166 Column (
165167 horizontalAlignment = Alignment .CenterHorizontally ,
166168 modifier = Modifier
167- .fillMaxWidth()
168- .height(300 .dp)
169- .padding(horizontal = 32 .dp),
170- verticalArrangement = Arrangement .Center
169+ .fillMaxWidth()
170+ .height(300 .dp)
171+ .padding(horizontal = 32 .dp),
172+ verticalArrangement = Arrangement .Center
171173 ) {
172174 Surface (
173175 shape = androidx.compose.foundation.shape.CircleShape ,
174176 color = Color (0xFFEF4444 ).copy(alpha = 0.1f ),
175- border = androidx.compose.foundation.BorderStroke (
176- 1 .dp, Color (0xFFEF4444 ).copy(alpha = 0.2f )
177- ),
178- modifier = Modifier .size(72 .dp)
177+ border = androidx.compose.foundation.BorderStroke (
178+ 1 .dp, Color (0xFFEF4444 ).copy(alpha = 0.2f )
179+ ),
180+ modifier = Modifier .size(72 .dp)
179181 ) {
180182 Box (contentAlignment = Alignment .Center ) {
181183 Icon (
182184 Icons .Default .WifiOff ,
183- contentDescription = null ,
184- tint = Color (0xFFEF4444 ),
185- modifier = Modifier .size(36 .dp)
185+ contentDescription = null ,
186+ tint = Color (0xFFEF4444 ),
187+ modifier = Modifier .size(36 .dp)
186188 )
187189 }
188190 }
0 commit comments