From 25a3947a1dc4233b43b2e4e8e79b127fa7dc57f7 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Sun, 17 Nov 2024 00:11:08 +0000 Subject: genting --- .../java/com/example/alcagotchi/RequestTest.kt | 90 +++++++++++----------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'app/src/main/java/com/example/alcagotchi/RequestTest.kt') diff --git a/app/src/main/java/com/example/alcagotchi/RequestTest.kt b/app/src/main/java/com/example/alcagotchi/RequestTest.kt index 513bb69..4f4535e 100644 --- a/app/src/main/java/com/example/alcagotchi/RequestTest.kt +++ b/app/src/main/java/com/example/alcagotchi/RequestTest.kt @@ -17,48 +17,48 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember -@Composable -fun GetAmiiboItems(modifier: Modifier) { - val amiiboList = remember { mutableStateOf>(listOf()) } - Column { - Button(onClick = { - asyncGetHttpRequest( - endpoint = "https://www.amiiboapi.com/api/amiibo/", - onSuccess = { - amiiboList.value = it.response.amiibo - Log.d("SUCCESS", amiiboList.toString()) - }, - onError = { - Log.d("ERROR", it.message.toString()) - } - ) - }) - { - Text( - text = "Get Amiibos" - ) - } - } - Column( -// modifier = Modifier.fillMaxSize(), -// contentPadding = PaddingValues(16.dp) - ) { - Text(text = amiiboList.value.toString()) - } -} -class RequestTest : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContent { - AlcaGotchiTheme { - // A surface container using the 'background' color from the theme - Surface( - color = MaterialTheme.colorScheme.background - ) { - // Let's create a composable function named GetAmiiboItems - GetAmiiboItems(modifier = Modifier()) - } - } - } - } -} \ No newline at end of file +// @Composable +// fun GetAmiiboItems(modifier: Modifier) { +// val amiiboList = remember { mutableStateOf>(listOf()) } +// Column { +// Button(onClick = { +// asyncGetHttpRequest( +// endpoint = "https://www.amiiboapi.com/api/amiibo/", +// onSuccess = { +// amiiboList.value = it.response.amiibo +// Log.d("SUCCESS", amiiboList.toString()) +// }, +// onError = { +// Log.d("ERROR", it.message.toString()) +// } +// ) +// }) +// { +// Text( +// text = "Get Amiibos" +// ) +// } +// } +// Column( +// // modifier = Modifier.fillMaxSize(), +// // contentPadding = PaddingValues(16.dp) +// ) { +// Text(text = amiiboList.value.toString()) +// } +// } +// class RequestTest : ComponentActivity() { +// override fun onCreate(savedInstanceState: Bundle?) { +// super.onCreate(savedInstanceState) +// setContent { +// AlcaGotchiTheme { +// // A surface container using the 'background' color from the theme +// Surface( +// color = MaterialTheme.colorScheme.background +// ) { +// // Let's create a composable function named GetAmiiboItems +// GetAmiiboItems(modifier = Modifier()) +// } +// } +// } +// } +// } \ No newline at end of file -- cgit v1.2.3-70-g09d2