diff options
| -rw-r--r-- | app/build.gradle.kts | 9 | ||||
| -rw-r--r-- | app/src/main/AndroidManifest.xml | 24 | ||||
| -rw-r--r-- | app/src/main/java/com/example/alcagotchi/DrinkingActivity.kt | 291 | ||||
| -rw-r--r-- | app/src/main/java/com/example/alcagotchi/MainActivity.kt | 35 | ||||
| -rw-r--r-- | app/src/main/java/com/example/alcagotchi/RequestTest.kt | 64 | ||||
| -rw-r--r-- | app/src/main/res/drawable/dice_1.xml | 66 | ||||
| -rw-r--r-- | app/src/main/res/drawable/dice_2.xml | 66 | ||||
| -rw-r--r-- | app/src/main/res/drawable/dice_3.xml | 66 | ||||
| -rw-r--r-- | app/src/main/res/drawable/dice_4.xml | 69 | ||||
| -rw-r--r-- | app/src/main/res/drawable/dice_5.xml | 75 | ||||
| -rw-r--r-- | app/src/main/res/drawable/dice_6.xml | 81 | ||||
| -rw-r--r-- | app/src/main/res/values/strings.xml | 5 | ||||
| -rw-r--r-- | gradle/libs.versions.toml | 8 | ||||
| -rw-r--r-- | settings.gradle.kts | 1 |
14 files changed, 852 insertions, 8 deletions
diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 042ed2f..a651dab 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -59,6 +59,10 @@ dependencies { implementation(libs.androidx.ui.graphics) implementation(libs.androidx.ui.tooling.preview) implementation(libs.androidx.material3) + implementation(libs.androidx.navigation.runtime.ktx) + implementation(libs.androidx.navigation.compose) + implementation(libs.cronet.api) + implementation(libs.firebase.crashlytics.buildtools) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) @@ -66,4 +70,9 @@ dependencies { androidTestImplementation(libs.androidx.ui.test.junit4) debugImplementation(libs.androidx.ui.tooling) debugImplementation(libs.androidx.ui.test.manifest) + implementation("com.google.android.gms:play-services-cronet:18.0.1") + implementation("com.google.code.gson:gson:2.8.8") + implementation ("com.squareup.okhttp3:logging-interceptor:4.4.0") + implementation ("com.squareup.retrofit2:retrofit:2.9.0") + implementation ("com.squareup.retrofit2:converter-gson:2.9.0") }
\ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6193984..90a3443 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ android:theme="@style/Theme.AlcaGotchi" tools:targetApi="31"> <activity - android:name=".MainActivity" + android:name="MainActivity" android:exported="true" android:label="@string/app_name" android:theme="@style/Theme.AlcaGotchi"> @@ -34,6 +34,28 @@ <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> + <activity + android:name=".DrinkingActivity" + android:exported="true" + android:label="@string/app_name" + android:theme="@style/Theme.AlcaGotchi"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> + <activity + android:name=".RequestTest" + android:exported="true" + android:label="@string/app_name" + android:theme="@style/Theme.AlcaGotchi"> + <intent-filter> + <action android:name="android.intent.action.MAIN" /> + + <category android:name="android.intent.category.LAUNCHER" /> + </intent-filter> + </activity> </application> </manifest>
\ No newline at end of file diff --git a/app/src/main/java/com/example/alcagotchi/DrinkingActivity.kt b/app/src/main/java/com/example/alcagotchi/DrinkingActivity.kt new file mode 100644 index 0000000..4c5e3aa --- /dev/null +++ b/app/src/main/java/com/example/alcagotchi/DrinkingActivity.kt @@ -0,0 +1,291 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.example.alcagotchi + +//import kotlinx.coroutines.flow.internal.NoOpContinuation.context +//import kotlin.coroutines.jvm.internal.CompletedContinuation.context +import android.content.Intent +import android.os.Bundle +import android.util.Log +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Button +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Surface +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.example.alcagotchi.ui.theme.AlcaGotchiTheme +import com.google.firebase.crashlytics.buildtools.reloc.org.apache.http.HttpRequest +import com.google.firebase.crashlytics.buildtools.reloc.org.apache.http.client.HttpClient +import com.google.gson.Gson +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import okhttp3.OkHttpClient +import java.io.BufferedReader +import java.io.IOException +import java.io.InputStreamReader +import java.net.HttpURLConnection +import java.net.URI +import java.net.URL +//import java.net.HttpURLConnection +//import java.net.URL +// + +//val myBuilder = CronetEngine.Builder(context) +//val cronetEngine: CronetEngine = myBuilder.build() +//var client: OkHttpClient? = OkHttpClient() + +fun PostHttpRequest(url_name: String = "http://httpbin.org/post", json_string: String = """{"name":"John Doe", "age": 30}"""){ + val url = URL(url_name) + val json = json_string + val connection = url.openConnection() as HttpURLConnection + connection.apply { + requestMethod = "POST" + doOutput = true + setRequestProperty("Content-Type", "application/json") + } + + val outputStream = connection.outputStream + outputStream.write(json.toByteArray()) + outputStream.flush() + outputStream.close() + + val response = connection.inputStream.use { it.reader().use { reader -> reader.readText() } } + println(response) + connection.disconnect() +} +fun asyncGetHttpRequest( + endpoint: String, + onSuccess: (ApiResponse<AmiiboResponse>) -> Unit, + onError: (Exception) -> Unit +) { + CoroutineScope(Dispatchers.IO).launch { + val url = URL(endpoint) + val openedConnection = url.openConnection() as HttpURLConnection + openedConnection.requestMethod = "GET" + + val responseCode = openedConnection.responseCode + try { + val reader = BufferedReader(InputStreamReader(openedConnection.inputStream)) + val response = reader.readText() + val apiResponse = ApiResponse( + responseCode, + parseJson<AmiiboResponse>(response) + ) + print(response) + reader.close() + // Call the success callback on the main thread + launch(Dispatchers.Main) { + onSuccess(apiResponse) + } + } catch (e: Exception) { + Log.d("Error", e.message.toString()) + // Handle error cases and call the error callback on the main thread + launch(Dispatchers.Main) { + onError(Exception("HTTP Request failed with response code $responseCode")) + } + } finally { + + } + } +} + + +//fun sendPost(urlString: String = "http://127.0.0.1:8080/test", +// bodyContent: String = "test") { +// +// val client = HttpClient.newBuilder().build(); +// val request = HttpRequest.newBuilder() +// .uri(URI.create(urlString)) +// //.header("Content-Type", "application/json") +// .POST(HttpRequest.BodyPublishers.ofString(bodyContent)) +// .build() +// val response = client.send(request, HttpResponse.BodyHandlers.ofString()) +// val answer = response.body() +// println(answer) +//} + +private inline fun <reified T>parseJson(text: String): T = + Gson().fromJson(text, T::class.java) + +data class ApiResponse<T>( + val responseCode: Int, + val response: T +) + +data class AmiiboResponse( + val amiibo: List<AmiiboItem> +) + +data class AmiiboItem( + val amiiboSeries: String, + val character: String, + val gameSeries: String, + val head: String, + val image: String, + val name: String, + val tail: String, + val type: String +) +class DrinkingActivity : ComponentActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + AlcaGotchiTheme { + Surface( + modifier = Modifier.fillMaxSize(), + color = MaterialTheme.colorScheme.background + ) { + DrinkingGreeting( + stringResource(R.string.welcome_to_casino), + ) + } + } + } + } +} + + + +@Composable +fun DrinkingGreetingText(message: String, from: String, modifier: Modifier = Modifier) { + // Create a column so that texts don't overlap + Column( + verticalArrangement = Arrangement.Center, + modifier = modifier + ) { + Text( + text = message, + fontSize = 100.sp, + lineHeight = 116.sp, + textAlign = TextAlign.Center, + color = Color(0xFF00FF00), + modifier = Modifier.padding(top = 16.dp) + ) + Text( + text = from, + fontSize = 36.sp, + color = Color(0xFF00FF00), + modifier = Modifier + .padding(top = 16.dp) + .padding(end = 16.dp) + .align(alignment = Alignment.End) + + ) + } +} + +@Composable +fun DrinkingOptions(modifier: Modifier = Modifier) { + Column( + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + Text( + text = "What would you like to drink?", + fontSize = 36.sp, + color = Color(0xFF00FF00), + modifier = Modifier + .padding(top = 16.dp) + .padding(end = 16.dp) + ) + Button(onClick = { + PostHttpRequest("http://192.168.4.1/drink") + }) + { + Text( + text = "Drink Beer" + ) + } + Button(onClick = { + PostHttpRequest("http://192.168.4.1/drink") + }) + { + Text( + text = "Drink Whisky" + ) + } + Button(onClick = { + PostHttpRequest("http://192.168.4.1/drink") + }) + { + Text( + text = "Drink Wine" + ) + } + Button(onClick = { + PostHttpRequest("http://192.168.4.1/drink") + }) + { + Text( + text = "Drink Lemonade" + ) + } + } +} + +@Composable +fun DrinkingGreeting(message: String, modifier: Modifier = Modifier) { + // Create a box to overlap image and texts + val context = LocalContext.current + + Box(modifier) { + Image( + painter = painterResource(id = R.drawable.spoons), + contentDescription = null, + contentScale = ContentScale.Crop, + alpha = 1F, + modifier = Modifier.fillMaxSize() + + + ) + Button(onClick = { + val intent = Intent(context, MainActivity::class.java) + context.startActivity(intent) + }) { + Text("Go back") + } + DrinkingOptions() + } +} + +@Preview(showBackground = false) +@Composable +private fun DrinkingPreview() { + AlcaGotchiTheme { + DrinkingGreeting( + stringResource(R.string.welcome_to_casino), + ) + } +} diff --git a/app/src/main/java/com/example/alcagotchi/MainActivity.kt b/app/src/main/java/com/example/alcagotchi/MainActivity.kt index 968b661..34afa63 100644 --- a/app/src/main/java/com/example/alcagotchi/MainActivity.kt +++ b/app/src/main/java/com/example/alcagotchi/MainActivity.kt @@ -19,31 +19,43 @@ import android.content.Intent import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent +import androidx.annotation.StringRes import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.padding +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.material3.Button +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold import androidx.compose.material3.Surface import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.colorResource import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import androidx.core.content.ContextCompat.startActivity -import com.example.alcagotchi.ui.theme.AlcaGotchiTheme +import androidx.navigation.NavHostController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.currentBackStackEntryAsState +import androidx.navigation.compose.rememberNavController import com.example.alcagotchi.ui.theme.AlcaGotchiTheme class MainActivity : ComponentActivity() { @@ -99,13 +111,22 @@ fun GreetingText(message: String, from: String, modifier: Modifier = Modifier) { }) { Text("Casino") } + Button(onClick = { + val intent = Intent(context, DrinkingActivity::class.java) + context.startActivity(intent) + }) { + Text("Drinking") + } } } - @Composable -fun GreetingImage(message: String, from: String, modifier: Modifier = Modifier) { +fun GreetingImage(message: String, from: String, modifier: Modifier = Modifier, + navController: NavHostController = rememberNavController(), +// viewModel: OrderViewModel = viewModel(), + +) { // Create a box to overlap image and texts - Box(modifier) { + Box { Image( painter = painterResource(id = R.drawable.alcogotchi), contentDescription = null, @@ -126,7 +147,7 @@ fun GreetingImage(message: String, from: String, modifier: Modifier = Modifier) } } -@Preview(showBackground = false) +@Preview @Composable private fun BirthdayCardPreview() { AlcaGotchiTheme { diff --git a/app/src/main/java/com/example/alcagotchi/RequestTest.kt b/app/src/main/java/com/example/alcagotchi/RequestTest.kt new file mode 100644 index 0000000..513bb69 --- /dev/null +++ b/app/src/main/java/com/example/alcagotchi/RequestTest.kt @@ -0,0 +1,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()) + } + } + } + } +}
\ No newline at end of file diff --git a/app/src/main/res/drawable/dice_1.xml b/app/src/main/res/drawable/dice_1.xml new file mode 100644 index 0000000..2bd436b --- /dev/null +++ b/app/src/main/res/drawable/dice_1.xml @@ -0,0 +1,66 @@ +<!-- + ~ Copyright 2022, The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="200dp" + android:height="250dp" + android:viewportWidth="800" + android:viewportHeight="1000"> + <path + android:fillAlpha="0.5" + android:fillColor="#C5C4C4" + android:pathData="M740.8,635.42c-68.27,90.47 -249.77,201.76 -316,240.63a50.7,50.7 0,0 1,-49.93 0.81c-64.19,-35 -234.09,-133.88 -315.65,-242a14.69,14.69 0,0 1,-0.12 -17.49c77.58,-106.29 159.67,-258.89 341.06,-258.89 182,0 242.19,139.08 340.27,258.88A14.62,14.62 0,0 1,740.8 635.42Z" + android:strokeAlpha="0.5" /> + <path + android:fillColor="#AA93AE" + android:pathData="M704.9,630l-294.29,191.06l0,-340.85l294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#C0A4C5" + android:pathData="M97.59,630l294.29,191.06l0,-340.85l-294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#E1BEE7" + android:pathData="M400.14,464.73l-293.19,-191.45l293.19,-156.31l295.39,156.31l-295.39,191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M106.95,273.28l-9.36,15.87l294.29,191.06l8.26,-15.48l-293.19,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M695.53,273.28l9.37,15.87l-294.29,191.06l-10.47,-15.48l295.39,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M391.88,480.21h18.73v340.85h-18.73z" /> + <path + android:fillColor="#E7DCE8" + android:pathData="M400.14,464.73l-8.26,15.48l18.73,0l-10.47,-15.48z" /> + <path + android:fillColor="#000000" + android:pathData="M397.45,297.62a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M297.17,539.02a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M161.96,588.24a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M551.15,579.45a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> + <path + android:fillColor="#000000" + android:pathData="M469.12,549.58a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> + <path + android:fillColor="#000000" + android:pathData="M633.17,609.29a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> +</vector> diff --git a/app/src/main/res/drawable/dice_2.xml b/app/src/main/res/drawable/dice_2.xml new file mode 100644 index 0000000..30fb235 --- /dev/null +++ b/app/src/main/res/drawable/dice_2.xml @@ -0,0 +1,66 @@ +<!-- + ~ Copyright 2022, The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="200dp" + android:height="250dp" + android:viewportWidth="800" + android:viewportHeight="1000"> + <path + android:fillAlpha="0.5" + android:fillColor="#C5C4C4" + android:pathData="M740.8,635.42c-68.27,90.47 -249.77,201.76 -316,240.63a50.7,50.7 0,0 1,-49.93 0.81c-64.19,-35 -234.09,-133.88 -315.65,-242a14.69,14.69 0,0 1,-0.12 -17.49c77.58,-106.29 159.67,-258.89 341.06,-258.89 182,0 242.19,139.08 340.27,258.88A14.62,14.62 0,0 1,740.8 635.42Z" + android:strokeAlpha="0.5" /> + <path + android:fillColor="#AA93AE" + android:pathData="M704.9,630l-294.29,191.06l0,-340.85l294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#C0A4C5" + android:pathData="M97.59,630l294.29,191.06l0,-340.85l-294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#E1BEE7" + android:pathData="M400.14,464.73l-293.19,-191.45l293.19,-156.31l295.39,156.31l-295.39,191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M106.95,273.28l-9.36,15.87l294.29,191.06l8.26,-15.48l-293.19,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M695.53,273.28l9.37,15.87l-294.29,191.06l-10.47,-15.48l295.39,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M391.88,480.21h18.73v340.85h-18.73z" /> + <path + android:fillColor="#E7DCE8" + android:pathData="M400.14,464.73l-8.26,15.48l18.73,0l-10.47,-15.48z" /> + <path + android:fillColor="#000000" + android:pathData="M520.85,303.25a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M273.33,291.99a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M229.56,563.64a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M311.58,533.77a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M147.54,593.49a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M551.15,579.45a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> +</vector> diff --git a/app/src/main/res/drawable/dice_3.xml b/app/src/main/res/drawable/dice_3.xml new file mode 100644 index 0000000..20bf472 --- /dev/null +++ b/app/src/main/res/drawable/dice_3.xml @@ -0,0 +1,66 @@ +<!-- + ~ Copyright 2022, The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="200dp" + android:height="250dp" + android:viewportWidth="800" + android:viewportHeight="1000"> + <path + android:fillAlpha="0.5" + android:fillColor="#C5C4C4" + android:pathData="M740.8,635.42c-68.27,90.47 -249.77,201.76 -316,240.63a50.7,50.7 0,0 1,-49.93 0.81c-64.19,-35 -234.09,-133.88 -315.65,-242a14.69,14.69 0,0 1,-0.12 -17.49c77.58,-106.29 159.67,-258.89 341.06,-258.89 182,0 242.19,139.08 340.27,258.88A14.62,14.62 0,0 1,740.8 635.42Z" + android:strokeAlpha="0.5" /> + <path + android:fillColor="#AA93AE" + android:pathData="M704.9,630l-294.29,191.06l0,-340.85l294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#C0A4C5" + android:pathData="M97.59,630l294.29,191.06l0,-340.85l-294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#E1BEE7" + android:pathData="M400.14,464.73l-293.19,-191.45l293.19,-156.31l295.39,156.31l-295.39,191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M106.95,273.28l-9.36,15.87l294.29,191.06l8.26,-15.48l-293.19,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M695.53,273.28l9.37,15.87l-294.29,191.06l-10.47,-15.48l295.39,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M391.88,480.21h18.73v340.85h-18.73z" /> + <path + android:fillColor="#E7DCE8" + android:pathData="M400.14,464.73l-8.26,15.48l18.73,0l-10.47,-15.48z" /> + <path + android:fillColor="#000000" + android:pathData="M398.11,297.62a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M548.27,304.46a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M247.95,290.79a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M229.56,563.64a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M483.54,554.83a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> + <path + android:fillColor="#000000" + android:pathData="M618.75,604.04a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> +</vector> diff --git a/app/src/main/res/drawable/dice_4.xml b/app/src/main/res/drawable/dice_4.xml new file mode 100644 index 0000000..772737d --- /dev/null +++ b/app/src/main/res/drawable/dice_4.xml @@ -0,0 +1,69 @@ +<!-- + ~ Copyright 2022, The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="200dp" + android:height="250dp" + android:viewportWidth="800" + android:viewportHeight="1000"> + <path + android:fillAlpha="0.5" + android:fillColor="#C5C4C4" + android:pathData="M740.8,635.42c-68.27,90.47 -249.77,201.76 -316,240.63a50.7,50.7 0,0 1,-49.93 0.81c-64.19,-35 -234.09,-133.88 -315.65,-242a14.69,14.69 0,0 1,-0.12 -17.49c77.58,-106.29 159.67,-258.89 341.06,-258.89 182,0 242.19,139.08 340.27,258.88A14.62,14.62 0,0 1,740.8 635.42Z" + android:strokeAlpha="0.5" /> + <path + android:fillColor="#AA93AE" + android:pathData="M704.9,630l-294.29,191.06l0,-340.85l294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#C0A4C5" + android:pathData="M97.59,630l294.29,191.06l0,-340.85l-294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#E1BEE7" + android:pathData="M400.14,464.73l-293.19,-191.45l293.19,-156.31l295.39,156.31l-295.39,191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M106.95,273.28l-9.36,15.87l294.29,191.06l8.26,-15.48l-293.19,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M695.53,273.28l9.37,15.87l-294.29,191.06l-10.47,-15.48l295.39,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M391.88,480.21h18.73v340.85h-18.73z" /> + <path + android:fillColor="#E7DCE8" + android:pathData="M400.14,464.73l-8.26,15.48l18.73,0l-10.47,-15.48z" /> + <path + android:fillColor="#000000" + android:pathData="M530.08,303.65a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M389.68,218.17a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M405.35,377.09a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M264.95,291.6a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M297.17,541.59a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M161.96,590.81a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M551.15,579.45a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> +</vector> diff --git a/app/src/main/res/drawable/dice_5.xml b/app/src/main/res/drawable/dice_5.xml new file mode 100644 index 0000000..b1e6afe --- /dev/null +++ b/app/src/main/res/drawable/dice_5.xml @@ -0,0 +1,75 @@ +<!-- + ~ Copyright 2022, The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="200dp" + android:height="250dp" + android:viewportWidth="800" + android:viewportHeight="1000"> + <path + android:fillAlpha="0.5" + android:fillColor="#C5C4C4" + android:pathData="M740.8,635.42c-68.27,90.47 -249.77,201.76 -316,240.63a50.7,50.7 0,0 1,-49.93 0.81c-64.19,-35 -234.09,-133.88 -315.65,-242a14.69,14.69 0,0 1,-0.12 -17.49c77.58,-106.29 159.67,-258.89 341.06,-258.89 182,0 242.19,139.08 340.27,258.88A14.62,14.62 0,0 1,740.8 635.42Z" + android:strokeAlpha="0.5" /> + <path + android:fillColor="#AA93AE" + android:pathData="M704.9,630l-294.29,191.06l0,-340.85l294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#C0A4C5" + android:pathData="M97.59,630l294.29,191.06l0,-340.85l-294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#E1BEE7" + android:pathData="M400.14,464.73l-293.19,-191.45l293.19,-156.31l295.39,156.31l-295.39,191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M106.95,273.28l-9.36,15.87l294.29,191.06l8.26,-15.48l-293.19,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M695.53,273.28l9.37,15.87l-294.29,191.06l-10.47,-15.48l295.39,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M391.88,480.21h18.73v340.85h-18.73z" /> + <path + android:fillColor="#E7DCE8" + android:pathData="M400.14,464.73l-8.26,15.48l18.73,0l-10.47,-15.48z" /> + <path + android:fillColor="#000000" + android:pathData="M397.05,297.63a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M547.21,304.45a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M388.17,207.62a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M405.93,387.62a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M246.89,290.79a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M229.56,563.64a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M551.15,579.45a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> + <path + android:fillColor="#000000" + android:pathData="M469.12,549.58a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> + <path + android:fillColor="#000000" + android:pathData="M633.17,609.29a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> +</vector> diff --git a/app/src/main/res/drawable/dice_6.xml b/app/src/main/res/drawable/dice_6.xml new file mode 100644 index 0000000..484f92e --- /dev/null +++ b/app/src/main/res/drawable/dice_6.xml @@ -0,0 +1,81 @@ +<!-- + ~ Copyright 2022, The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="200dp" + android:height="250dp" + android:viewportWidth="800" + android:viewportHeight="1000"> + <path + android:fillAlpha="0.5" + android:fillColor="#C5C4C4" + android:pathData="M740.8,635.42c-68.27,90.47 -249.77,201.76 -316,240.63a50.7,50.7 0,0 1,-49.93 0.81c-64.19,-35 -234.09,-133.88 -315.65,-242a14.69,14.69 0,0 1,-0.12 -17.49c77.58,-106.29 159.67,-258.89 341.06,-258.89 182,0 242.19,139.08 340.27,258.88A14.62,14.62 0,0 1,740.8 635.42Z" + android:strokeAlpha="0.5" /> + <path + android:fillColor="#AA93AE" + android:pathData="M704.9,630l-294.29,191.06l0,-340.85l294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#C0A4C5" + android:pathData="M97.59,630l294.29,191.06l0,-340.85l-294.29,-191.06l0,340.85z" /> + <path + android:fillColor="#E1BEE7" + android:pathData="M400.14,464.73l-293.19,-191.45l293.19,-156.31l295.39,156.31l-295.39,191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M106.95,273.28l-9.36,15.87l294.29,191.06l8.26,-15.48l-293.19,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M695.53,273.28l9.37,15.87l-294.29,191.06l-10.47,-15.48l295.39,-191.45z" /> + <path + android:fillColor="#E2D3E4" + android:pathData="M391.88,480.21h18.73v340.85h-18.73z" /> + <path + android:fillColor="#E7DCE8" + android:pathData="M400.14,464.73l-8.26,15.48l18.73,0l-10.47,-15.48z" /> + <path + android:fillColor="#000000" + android:pathData="M326.53,254.89a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M537.57,298.78a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M397.17,213.3a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M396.31,381.95a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M255.91,296.47a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M466.93,340.37a16.9,28.71 97.07,1 0,4.16 -33.54a16.9,28.71 97.07,1 0,-4.16 33.54z" /> + <path + android:fillColor="#000000" + android:pathData="M230,563.64a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M312.02,533.78a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M147.96,593.48a30.12,16.11 53.82,1 0,26.01 -19.02a30.12,16.11 53.82,1 0,-26.01 19.02z" /> + <path + android:fillColor="#000000" + android:pathData="M483.54,554.83a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> + <path + android:fillColor="#000000" + android:pathData="M618.75,604.04a30.12,16.11 126.18,1 0,35.56 -48.62a30.12,16.11 126.18,1 0,-35.56 48.62z" /> +</vector> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 386c707..ad1db5e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,11 @@ <resources> <string name="app_name">AlcaGotchi</string> + <string name="drink_name">Drink</string> + <string name="casino_name">Genting</string> + <string name="back_button">Back</string> + <string name="signature_text">Mes Amigos\n</string> <string name="happy_birthday_text">It\'s Boozing Time</string> <string name="welcome_to_casino">It\'s Genting Time</string> + <string name="welcome_to_pub">Welcome to the pub</string> </resources>
\ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 46e6d9f..f18727d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,6 +8,10 @@ espressoCore = "3.6.0" lifecycleRuntimeKtx = "2.8.2" activityCompose = "1.9.0" composeBom = "2024.04.01" +navigationRuntimeKtx = "2.8.4" +navigationCompose = "2.8.4" +cronetApi = "119.6045.31" +firebaseCrashlyticsBuildtools = "3.0.2" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -24,6 +28,10 @@ androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-toolin androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } androidx-material3 = { group = "androidx.compose.material3", name = "material3" } +androidx-navigation-runtime-ktx = { group = "androidx.navigation", name = "navigation-runtime-ktx", version.ref = "navigationRuntimeKtx" } +androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" } +cronet-api = { group = "org.chromium.net", name = "cronet-api", version.ref = "cronetApi" } +firebase-crashlytics-buildtools = { group = "com.google.firebase", name = "firebase-crashlytics-buildtools", version.ref = "firebaseCrashlyticsBuildtools" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 2f2a03c..a03270e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,6 +10,7 @@ pluginManagement { mavenCentral() gradlePluginPortal() } + } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) |
