From 2dda6f6574bb4db5db1d9828b9d860ef08692278 Mon Sep 17 00:00:00 2001 From: beaulaton Date: Mon, 10 Feb 2025 15:17:25 +0100 Subject: [PATCH] Pages --- What_The_Fantasy/app/build.gradle.kts | 2 ++ .../example/what_the_fantasy/AccueilPage.kt | 6 +++++ .../example/what_the_fantasy/FavoritePage.kt | 12 +++------- .../com/example/what_the_fantasy/LoginPage.kt | 12 +++------- .../example/what_the_fantasy/MainActivity.kt | 23 ++----------------- .../example/what_the_fantasy/ProfilPage.kt | 11 ++------- .../com/example/what_the_fantasy/QuizPage.kt | 12 +++------- .../com/example/what_the_fantasy/QuotePage.kt | 12 +++------- .../example/what_the_fantasy/SearchPage.kt | 12 +++------- .../example/what_the_fantasy/SignUpPage.kt | 12 +++------- .../what_the_fantasy/SubmitQuotePage.kt | 12 +++------- What_The_Fantasy/gradle/libs.versions.toml | 4 ++++ 12 files changed, 37 insertions(+), 93 deletions(-) create mode 100644 What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/AccueilPage.kt diff --git a/What_The_Fantasy/app/build.gradle.kts b/What_The_Fantasy/app/build.gradle.kts index 3a053c8..9cccb1b 100644 --- a/What_The_Fantasy/app/build.gradle.kts +++ b/What_The_Fantasy/app/build.gradle.kts @@ -59,6 +59,8 @@ dependencies { implementation(libs.androidx.ui.graphics) implementation(libs.androidx.ui.tooling.preview) implementation(libs.androidx.material3) + implementation(libs.androidx.navigation.compose) + implementation(libs.androidx.navigation.common.android) testImplementation(libs.junit) androidTestImplementation(libs.androidx.junit) androidTestImplementation(libs.androidx.espresso.core) diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/AccueilPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/AccueilPage.kt new file mode 100644 index 0000000..31eb178 --- /dev/null +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/AccueilPage.kt @@ -0,0 +1,6 @@ +package com.example.what_the_fantasy + +import androidx.compose.runtime.Composable + +@Composable +fun AccueilPage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/FavoritePage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/FavoritePage.kt index 682ac23..aa2fb2b 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/FavoritePage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/FavoritePage.kt @@ -4,14 +4,8 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class FavoritePage: ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun FavoritePage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/LoginPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/LoginPage.kt index 2cb77eb..7b00ac6 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/LoginPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/LoginPage.kt @@ -4,14 +4,8 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class LoginPage : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun LoginPage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/MainActivity.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/MainActivity.kt index e59a4dd..016cadb 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/MainActivity.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/MainActivity.kt @@ -12,6 +12,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme +import com.example.what_the_fantasy.LoginPage class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { @@ -19,28 +20,8 @@ class MainActivity : ComponentActivity() { enableEdgeToEdge() setContent { What_The_FantasyTheme { - Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> - Title( - title = "What The Fantasy", - modifier = Modifier.padding(innerPadding) - ) - } + LoginPage() } } } } - -@Composable -fun Title(title: String, modifier: Modifier = Modifier) { - Text( - text = "Welcome to $title!", - modifier = modifier - ) -} - -@Composable -fun GreetingPreview() { - What_The_FantasyTheme { - Title("What the fantasy") - } -} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ProfilPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ProfilPage.kt index cd7ddca..ee4af3d 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ProfilPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/ProfilPage.kt @@ -13,12 +13,5 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.tooling.preview.Preview import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class ProfilPage : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun ProfilPage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuizPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuizPage.kt index c9d2a0c..27e558f 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuizPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuizPage.kt @@ -4,14 +4,8 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class QuizPage : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun QuizPage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuotePage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuotePage.kt index 73d2da0..7ac8b66 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuotePage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/QuotePage.kt @@ -4,14 +4,8 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class QuotePage : ComponentActivity(){ - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun QuotePage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SearchPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SearchPage.kt index bc5b8d4..af89024 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SearchPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SearchPage.kt @@ -4,14 +4,8 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class SearchPage : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun SearchPage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SignUpPage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SignUpPage.kt index 8122360..63b2819 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SignUpPage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SignUpPage.kt @@ -4,14 +4,8 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class SignUpPage : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun SignUpPage() {} \ No newline at end of file diff --git a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SubmitQuotePage.kt b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SubmitQuotePage.kt index e2dd0dd..7230412 100644 --- a/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SubmitQuotePage.kt +++ b/What_The_Fantasy/app/src/main/java/com/example/what_the_fantasy/SubmitQuotePage.kt @@ -4,14 +4,8 @@ import android.os.Bundle import androidx.activity.ComponentActivity import androidx.activity.compose.setContent import androidx.activity.enableEdgeToEdge +import androidx.compose.runtime.Composable import com.example.what_the_fantasy.ui.theme.What_The_FantasyTheme -class SubmitQuotePage : ComponentActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enableEdgeToEdge() - setContent { - What_The_FantasyTheme {} - } - } -} \ No newline at end of file +@Composable +fun SubmitQuotePage() {} \ No newline at end of file diff --git a/What_The_Fantasy/gradle/libs.versions.toml b/What_The_Fantasy/gradle/libs.versions.toml index a5f2151..302bb60 100644 --- a/What_The_Fantasy/gradle/libs.versions.toml +++ b/What_The_Fantasy/gradle/libs.versions.toml @@ -8,6 +8,8 @@ espressoCore = "3.5.1" lifecycleRuntimeKtx = "2.6.1" activityCompose = "1.8.0" composeBom = "2024.04.01" +navigationCompose = "2.8.6" +navigationCommonAndroid = "2.9.0-alpha05" [libraries] androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } @@ -24,6 +26,8 @@ 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-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" } +androidx-navigation-common-android = { group = "androidx.navigation", name = "navigation-common-android", version.ref = "navigationCommonAndroid" } [plugins] android-application = { id = "com.android.application", version.ref = "agp" }