Browse Source

Resolved Search item UI issue for multi lingual

Khubaib 9 tháng trước cách đây
mục cha
commit
2d7380297a

+ 28 - 16
app/src/main/java/com/vpn/fastestvpnservice/customItems/ServerItem.kt

@@ -456,9 +456,9 @@ fun ServerSearchItem(
             .background(color = MaterialTheme.colorScheme.onBackground)
             .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)
@@ -488,7 +488,8 @@ fun ServerSearchItem(
                     }
 
                 }
-        ) {
+        )
+        {
 //            var ping by rememberSaveable { mutableIntStateOf(0) }
 //            fun updatePing(newPing: Int) {
 //                ping = newPing
@@ -519,7 +520,7 @@ fun ServerSearchItem(
                 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)
@@ -527,27 +528,38 @@ fun ServerSearchItem(
                         painter = painterResource(id = icon),
                         contentScale = ContentScale.FillBounds
                     )
+                    .align(Alignment.CenterStart)
             )
-            Text(text = server.server_name!!,
-                color = textColor,
-                style = MaterialTheme.typography.labelMedium,
+            Surface(
                 modifier = Modifier
-                    .padding(start = 16.dp, bottom = 18.dp)
-                    .align(Alignment.CenterVertically)
-            )
-            Spacer(modifier = Modifier.weight(1F))
+                    .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 = textColor,
+                    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 = 30.dp, bottom = 18.dp)
-                    .align(Alignment.CenterVertically)
+                    .padding(end = 50.dp, bottom = 15.dp)
+                    .align(Alignment.CenterEnd)
             )
 
             IconButton(
                 modifier = Modifier
-                    .padding(bottom = 18.dp, end = 8.dp)
-                    .size(25.dp),
+                    .padding(bottom = 15.dp, end = 4.dp)
+                    .size(25.dp)
+                    .align(Alignment.CenterEnd),
                 onClick = {
                 isFavorite = !isFavorite!!
                 serverListViewModelSplash.favAndUnFav(server)