@@ -95,68 +95,68 @@ fun ConnectionsContent(
9595 modifier : Modifier = Modifier ,
9696) {
9797 LazyColumn (
98- modifier = modifier.fillMaxSize(),
98+ modifier = modifier
99+ .fillMaxSize()
100+ .padding(horizontal = 16 .dp),
99101 verticalArrangement = Arrangement .spacedBy(12 .dp),
100102 ) {
101103 // Summary Card
102104 item(key = " summary" ) {
103- Box (modifier = Modifier .padding(horizontal = 16 .dp)) {
104- Card (
105- modifier = Modifier .fillMaxWidth(),
106- elevation = CardDefaults .cardElevation(defaultElevation = 2 .dp),
105+ Card (
106+ modifier = Modifier .fillMaxWidth(),
107+ elevation = CardDefaults .cardElevation(defaultElevation = 2 .dp),
108+ ) {
109+ Column (
110+ modifier = Modifier .padding(16 .dp),
111+ verticalArrangement = Arrangement .spacedBy(8 .dp),
107112 ) {
108- Column (
109- modifier = Modifier .padding(16 .dp),
110- verticalArrangement = Arrangement .spacedBy(8 .dp),
113+ Text (
114+ text = stringResource(R .string.connections_summary),
115+ style = MaterialTheme .typography.titleMedium,
116+ fontWeight = FontWeight .Bold ,
117+ )
118+ Row (
119+ modifier = Modifier .fillMaxWidth(),
120+ horizontalArrangement = Arrangement .SpaceBetween ,
111121 ) {
112- Text (
113- text = stringResource(R .string.connections_summary),
114- style = MaterialTheme .typography.titleMedium,
115- fontWeight = FontWeight .Bold ,
116- )
117- Row (
118- modifier = Modifier .fillMaxWidth(),
119- horizontalArrangement = Arrangement .SpaceBetween ,
120- ) {
121- Column {
122- Text (
123- text = stringResource(R .string.connections_count),
124- style = MaterialTheme .typography.bodyMedium,
125- color = MaterialTheme .colorScheme.secondary,
126- )
127- Text (
128- text = " ${connections.size} " ,
129- style = MaterialTheme .typography.titleLarge,
130- fontWeight = FontWeight .Bold ,
131- color = MaterialTheme .colorScheme.primary,
132- )
133- }
134- Column (horizontalAlignment = Alignment .End ) {
135- Text (
136- text = stringResource(R .string.stat_download),
137- style = MaterialTheme .typography.bodyMedium,
138- color = MaterialTheme .colorScheme.secondary,
139- )
140- Text (
141- text = formatSize(downloadTotal),
142- style = MaterialTheme .typography.titleLarge,
143- fontWeight = FontWeight .Bold ,
144- color = MaterialTheme .colorScheme.primary,
145- )
146- }
147- Column (horizontalAlignment = Alignment .End ) {
148- Text (
149- text = stringResource(R .string.stat_upload),
150- style = MaterialTheme .typography.bodyMedium,
151- color = MaterialTheme .colorScheme.secondary,
152- )
153- Text (
154- text = formatSize(uploadTotal),
155- style = MaterialTheme .typography.titleLarge,
156- fontWeight = FontWeight .Bold ,
157- color = MaterialTheme .colorScheme.primary,
158- )
159- }
122+ Column {
123+ Text (
124+ text = stringResource(R .string.connections_count),
125+ style = MaterialTheme .typography.bodyMedium,
126+ color = MaterialTheme .colorScheme.secondary,
127+ )
128+ Text (
129+ text = " ${connections.size} " ,
130+ style = MaterialTheme .typography.titleLarge,
131+ fontWeight = FontWeight .Bold ,
132+ color = MaterialTheme .colorScheme.primary,
133+ )
134+ }
135+ Column (horizontalAlignment = Alignment .End ) {
136+ Text (
137+ text = stringResource(R .string.stat_download),
138+ style = MaterialTheme .typography.bodyMedium,
139+ color = MaterialTheme .colorScheme.secondary,
140+ )
141+ Text (
142+ text = formatSize(downloadTotal),
143+ style = MaterialTheme .typography.titleLarge,
144+ fontWeight = FontWeight .Bold ,
145+ color = MaterialTheme .colorScheme.primary,
146+ )
147+ }
148+ Column (horizontalAlignment = Alignment .End ) {
149+ Text (
150+ text = stringResource(R .string.stat_upload),
151+ style = MaterialTheme .typography.bodyMedium,
152+ color = MaterialTheme .colorScheme.secondary,
153+ )
154+ Text (
155+ text = formatSize(uploadTotal),
156+ style = MaterialTheme .typography.titleLarge,
157+ fontWeight = FontWeight .Bold ,
158+ color = MaterialTheme .colorScheme.primary,
159+ )
160160 }
161161 }
162162 }
@@ -166,20 +166,18 @@ fun ConnectionsContent(
166166 // Error message
167167 if (errorMessage != null ) {
168168 item(key = " error" ) {
169- Box (modifier = Modifier .padding(horizontal = 16 .dp)) {
170- Card (
171- modifier = Modifier .fillMaxWidth(),
172- colors =
173- CardDefaults .cardColors(
174- containerColor = MaterialTheme .colorScheme.errorContainer,
175- ),
176- ) {
177- Text (
178- text = errorMessage,
179- modifier = Modifier .padding(16 .dp),
180- color = MaterialTheme .colorScheme.onErrorContainer,
181- )
182- }
169+ Card (
170+ modifier = Modifier .fillMaxWidth(),
171+ colors =
172+ CardDefaults .cardColors(
173+ containerColor = MaterialTheme .colorScheme.errorContainer,
174+ ),
175+ ) {
176+ Text (
177+ text = errorMessage,
178+ modifier = Modifier .padding(16 .dp),
179+ color = MaterialTheme .colorScheme.onErrorContainer,
180+ )
183181 }
184182 }
185183 }
@@ -228,9 +226,7 @@ fun ConnectionsContent(
228226 ),
229227 exit = fadeOut(animationSpec = tween(durationMillis = 200 )),
230228 ) {
231- Box (modifier = Modifier .padding(horizontal = 16 .dp)) {
232- ConnectionItem (connection = connection)
233- }
229+ ConnectionItem (connection = connection)
234230 }
235231 }
236232 }
0 commit comments