1 year ago

#291545

test-img

Gnanesh023

LazyColumn list not showing in jetpack compose

I m new To Jetpack Compose , i'm trying to create a Proxy list app , used lazy column to list proxies but its now showing .. app runs successfully but result not getting , Give Me a Solution . Thx Lib : https://github.com/gumify/hiper


@Preview
@Composable
fun App(){
    val hiper = Hiper.getInstance().async() // for asynchronous requests
    val Proxies = remember {mutableStateListOf<String>() }
    Surface(modifier = Modifier
        .fillMaxHeight()
        .fillMaxWidth()) {

           Column(modifier = Modifier
               .background(Color.Blue)
               .height(20.dp),
               horizontalAlignment = Alignment.CenterHorizontally) {

               Button (
                   modifier = Modifier.padding(all = Dp(10F)),

                   onClick = {
                       hiper.get("http://spys.me/proxy.txt") { response ->
                           if (response.isSuccessful) {
                               val lines = response.text.toString().split("\n")
                               for (line in lines) {
                                   Proxies.add(line)
                               }
                           }

                       }

                   }) {  Text(text = "Get Proxies") }

               LazyColumn( modifier = Modifier.background( color = Color.Gray)){
                   items(Proxies){item ->
                       Text(text = item)
                   }

           }
        }
    }

}

}

android-jetpack-compose

android-jetpack-compose-list

0 Answers

Your Answer

Accepted video resources