Procházet zdrojové kódy

Resolved Favorite item UI issue for multi lingual

Khubaib před 7 měsíci
rodič
revize
1f9146e040

+ 33 - 20
app/src/main/java/com/vpn/fastestvpnservice/customItems/ServerItem.kt

@@ -276,9 +276,9 @@ fun FavoriteServerItem(
             .background(MaterialTheme.colorScheme.background)
             .padding(bottom = 1.dp)
     ) {
-        Row(
-            verticalAlignment = Alignment.Top,
-            horizontalArrangement = Arrangement.Start,
+        Box(
+//            verticalAlignment = Alignment.Top,
+//            horizontalArrangement = Arrangement.Start,
             modifier = Modifier
                 .fillMaxWidth()
                 .padding(start = 12.dp, end = 7.dp, top = 12.dp)
@@ -326,7 +326,7 @@ fun FavoriteServerItem(
                     contentDescription = "Server Logo",
                     tint = Color.Unspecified,
                     modifier = Modifier
-                        .padding(bottom = 16.dp)
+                        .padding(bottom = 15.dp)
                         .size(24.dp)
                         .clip(CircleShape)
                         .border(1.dp, colorResource(id = R.color.gray_opac_04), CircleShape)
@@ -336,22 +336,34 @@ fun FavoriteServerItem(
                         )
                 )
             }
-
-            Text(text = server.server_name!!,
-                color = MaterialTheme.colorScheme.primary,
-                style = MaterialTheme.typography.labelMedium,
-                modifier = Modifier
-                    .padding(start = 16.dp, bottom = 18.dp)
-                    .align(Alignment.CenterVertically)
-            )
-            Spacer(modifier = Modifier.weight(1F))
-            Text(text = "$serverPing ms",
-                color = colorResource(id = R.color.blue_text),
-                style = MaterialTheme.typography.displayMedium,
+            Surface(
                 modifier = Modifier
-                    .padding(end = 30.dp, bottom = 18.dp)
-                    .align(Alignment.CenterVertically)
-            )
+                    .padding(start = 40.dp, bottom = 15.dp, end = 110.dp)
+                    .align(Alignment.CenterStart)
+                    .background(Color.Transparent),
+                color = Color.Transparent
+            ) {
+                Text(text = server.server_name!!,
+                    color = MaterialTheme.colorScheme.primary,
+                    style = MaterialTheme.typography.labelMedium,
+                    maxLines = 1,
+                    overflow = TextOverflow.Ellipsis,
+                    modifier = Modifier
+                        .align(Alignment.CenterStart)
+                )
+            }
+
+//            Spacer(modifier = Modifier.weight(1F))
+
+                Text(text = "$serverPing ms",
+                    color = colorResource(id = R.color.blue_text),
+                    style = MaterialTheme.typography.displayMedium,
+                    modifier = Modifier
+                        .padding(end = 50.dp, bottom = 15.dp)
+                        .align(Alignment.CenterEnd)
+                )
+
+
 //            Spacer(modifier = Modifier.weight(1F))
 
             IconButton(
@@ -360,8 +372,9 @@ fun FavoriteServerItem(
                     serverListViewModelSplash.favAndUnFav(server)
                           },
                 modifier = Modifier
-                    .padding(bottom = 18.dp, end = 0.dp)
+                    .padding(bottom = 15.dp, end = 4.dp)
                     .size(25.dp)
+                    .align(Alignment.CenterEnd),
 //                    .clickable(
 //                        indication = null,
 //                        interactionSource = remember { MutableInteractionSource() }