summaryrefslogtreecommitdiffstats
path: root/app/src/main/java/com/example/alcagotchi/RequestTest.kt
blob: 4f4535ee09edf9966c238ab3f2e55eb6a572dc30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package com.example.alcagotchi

import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import com.example.alcagotchi.ui.theme.AlcaGotchiTheme
import java.lang.reflect.Modifier
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember

// @Composable
// fun GetAmiiboItems(modifier: Modifier) {
//     val amiiboList = remember { mutableStateOf<List<AmiiboItem>>(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())
//                 }
//             }
//         }
//     }
// }