Explorar o código

Вывела табличку

ПроваленкоЛН hai 1 mes
pai
achega
0ca8d3cb45

+ 1 - 0
.idea/gradle.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
 <project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
       <GradleProjectSettings>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 8 - 6
app/build.gradle.kts

@@ -1,8 +1,11 @@
 plugins {
 plugins {
     alias(libs.plugins.android.application)
     alias(libs.plugins.android.application)
-    alias(libs.plugins.jetbrains.kotlin.android)
+    alias(libs.plugins.kotlin.android)
+    kotlin("plugin.serialization") version "1.9.22"
 }
 }
 
 
+
+
 android {
 android {
     namespace = "com.example.test"
     namespace = "com.example.test"
     compileSdk = 34
     compileSdk = 34
@@ -69,11 +72,10 @@ dependencies {
 
 
 
 
     implementation(platform(libs.bom))
     implementation(platform(libs.bom))
-    implementation(libs.postgrest.kt)
-    implementation(libs.gotrue.kt)
-    implementation(libs.realtime.kt)
+    implementation(libs.supabase.postgrest.kt)
+    implementation(libs.supabase.realtime.kt)
+    implementation(libs.ktor.client.android)
 
 
     implementation(libs.coil.compose)
     implementation(libs.coil.compose)
-
-
+    implementation(libs.storage.kt)
 }
 }

+ 1 - 1
app/src/main/AndroidManifest.xml

@@ -15,7 +15,7 @@
         android:theme="@style/Theme.Test"
         android:theme="@style/Theme.Test"
         tools:targetApi="31">
         tools:targetApi="31">
         <activity
         <activity
-            android:name=".view.ui.theme.MainActivity"
+            android:name="com.example.test.view.ui.view.MainActivity"
             android:exported="true"
             android:exported="true"
             android:label="@string/app_name"
             android:label="@string/app_name"
             android:theme="@style/Theme.Test">
             android:theme="@style/Theme.Test">

+ 0 - 9
app/src/main/java/com/example/test/Model/Film.kt

@@ -1,9 +0,0 @@
-package com.example.test.Model
-
-import kotlinx.serialization.Serializable
-
-@Serializable
-data class Film(
-    val id: Int,
-    val name: String
-)

+ 0 - 17
app/src/main/java/com/example/test/domain/Constant.kt

@@ -1,17 +0,0 @@
-package com.example.test.domain
-
-import io.github.jan.supabase.createSupabaseClient
-import io.github.jan.supabase.gotrue.Auth
-import io.github.jan.supabase.gotrue.FlowType
-import io.github.jan.supabase.postgrest.Postgrest
-import io.ktor.http.auth.parseAuthorizationHeader
-
-object Constant {
-    val supabase = createSupabaseClient(
-        supabaseUrl = "https://bdxftijaebxgfssqqfhr.supabase.co",
-        supabaseKey = "public-anon-key"
-    ){
-        install(Postgrest)
-        install(Auth)
-    }
-}

+ 17 - 0
app/src/main/java/com/example/test/domain/utlls/Constant.kt

@@ -0,0 +1,17 @@
+package com.example.test.domain.utlls
+
+import io.github.jan.supabase.createSupabaseClient
+import io.github.jan.supabase.gotrue.Auth
+import io.github.jan.supabase.postgrest.Postgrest
+import io.github.jan.supabase.storage.Storage
+
+object Constant {
+    val supabase = createSupabaseClient(
+        supabaseUrl = "https://bdxftijaebxgfssqqfhr.supabase.co",
+        supabaseKey = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImJkeGZ0aWphZWJ4Z2Zzc3FxZmhyIiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjU1MjY2MjEsImV4cCI6MjA0MTEwMjYyMX0.pkNIcD2Zgstp4WtocEBPrd9vX-kabRZfBIfnQ6IguHo"
+    ){
+        install(Auth)
+        install(Postgrest)
+        install(Storage)
+    }
+}

+ 10 - 0
app/src/main/java/com/example/test/model/films.kt

@@ -0,0 +1,10 @@
+package com.example.test.model
+
+import kotlinx.serialization.Serializable
+
+@Serializable
+data class films(
+    val id: Int,
+    val films_name: String,
+    val foto: String?
+)

+ 0 - 34
app/src/main/java/com/example/test/view/ui/theme/MainActivity.kt

@@ -1,34 +0,0 @@
-package com.example.test.view.ui.theme
-
-import android.os.Bundle
-import androidx.activity.ComponentActivity
-import androidx.activity.compose.setContent
-import androidx.activity.enableEdgeToEdge
-import androidx.compose.foundation.layout.Arrangement
-import androidx.compose.foundation.layout.Column
-import androidx.compose.foundation.layout.fillMaxSize
-import androidx.compose.foundation.layout.padding
-import androidx.compose.material3.Scaffold
-import androidx.compose.material3.Text
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.tooling.preview.Preview
-import com.example.test.ui.theme.TestTheme
-
-class MainActivity : ComponentActivity() {
-    override fun onCreate(savedInstanceState: Bundle?) {
-        super.onCreate(savedInstanceState)
-        enableEdgeToEdge()
-        setContent {
-            TestTheme {
-                Column(
-                    verticalArrangement = Arrangement.Center,
-                    horizontalAlignment = Alignment.CenterHorizontally
-                ) {
-
-                }
-                }
-            }
-        }
-    }

+ 0 - 16
app/src/main/java/com/example/test/view/ui/theme/components/itemfilm.kt

@@ -1,16 +0,0 @@
-package com.example.test.view.ui.theme.components
-
-import androidx.compose.foundation.layout.padding
-import androidx.compose.material3.Text
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.unit.dp
-import com.example.test.Model.Film
-
-@Composable
-fun itemfilm(film: Film){
-    Text(
-        film.name,
-        modifier = Modifier.padding(8.dp),
-    )
-}

+ 0 - 11
app/src/main/java/com/example/test/view/ui/theme/theme/Color.kt

@@ -1,11 +0,0 @@
-package com.example.test.ui.theme
-
-import androidx.compose.ui.graphics.Color
-
-val Purple80 = Color(0xFFD0BCFF)
-val PurpleGrey80 = Color(0xFFCCC2DC)
-val Pink80 = Color(0xFFEFB8C8)
-
-val Purple40 = Color(0xFF6650a4)
-val PurpleGrey40 = Color(0xFF625b71)
-val Pink40 = Color(0xFF7D5260)

+ 0 - 57
app/src/main/java/com/example/test/view/ui/theme/theme/Theme.kt

@@ -1,57 +0,0 @@
-package com.example.test.ui.theme
-
-import android.os.Build
-import androidx.compose.foundation.isSystemInDarkTheme
-import androidx.compose.material3.MaterialTheme
-import androidx.compose.material3.darkColorScheme
-import androidx.compose.material3.dynamicDarkColorScheme
-import androidx.compose.material3.dynamicLightColorScheme
-import androidx.compose.material3.lightColorScheme
-import androidx.compose.runtime.Composable
-import androidx.compose.ui.platform.LocalContext
-
-private val DarkColorScheme = darkColorScheme(
-    primary = Purple80,
-    secondary = PurpleGrey80,
-    tertiary = Pink80
-)
-
-private val LightColorScheme = lightColorScheme(
-    primary = Purple40,
-    secondary = PurpleGrey40,
-    tertiary = Pink40
-
-    /* Other default colors to override
-    background = Color(0xFFFFFBFE),
-    surface = Color(0xFFFFFBFE),
-    onPrimary = Color.White,
-    onSecondary = Color.White,
-    onTertiary = Color.White,
-    onBackground = Color(0xFF1C1B1F),
-    onSurface = Color(0xFF1C1B1F),
-    */
-)
-
-@Composable
-fun TestTheme(
-    darkTheme: Boolean = isSystemInDarkTheme(),
-    // Dynamic color is available on Android 12+
-    dynamicColor: Boolean = true,
-    content: @Composable () -> Unit
-) {
-    val colorScheme = when {
-        dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
-            val context = LocalContext.current
-            if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
-        }
-
-        darkTheme -> DarkColorScheme
-        else -> LightColorScheme
-    }
-
-    MaterialTheme(
-        colorScheme = colorScheme,
-        typography = Typography,
-        content = content
-    )
-}

+ 0 - 34
app/src/main/java/com/example/test/view/ui/theme/theme/Type.kt

@@ -1,34 +0,0 @@
-package com.example.test.ui.theme
-
-import androidx.compose.material3.Typography
-import androidx.compose.ui.text.TextStyle
-import androidx.compose.ui.text.font.FontFamily
-import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.unit.sp
-
-// Set of Material typography styles to start with
-val Typography = Typography(
-    bodyLarge = TextStyle(
-        fontFamily = FontFamily.Default,
-        fontWeight = FontWeight.Normal,
-        fontSize = 16.sp,
-        lineHeight = 24.sp,
-        letterSpacing = 0.5.sp
-    )
-    /* Other default text styles to override
-    titleLarge = TextStyle(
-        fontFamily = FontFamily.Default,
-        fontWeight = FontWeight.Normal,
-        fontSize = 22.sp,
-        lineHeight = 28.sp,
-        letterSpacing = 0.sp
-    ),
-    labelSmall = TextStyle(
-        fontFamily = FontFamily.Default,
-        fontWeight = FontWeight.Medium,
-        fontSize = 11.sp,
-        lineHeight = 16.sp,
-        letterSpacing = 0.5.sp
-    )
-    */
-)

+ 1 - 1
build.gradle.kts

@@ -1,5 +1,5 @@
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 // Top-level build file where you can add configuration options common to all sub-projects/modules.
 plugins {
 plugins {
     alias(libs.plugins.android.application) apply false
     alias(libs.plugins.android.application) apply false
-    alias(libs.plugins.jetbrains.kotlin.android) apply false
+    alias(libs.plugins.kotlin.android) apply false
 }
 }

+ 24 - 11
gradle/libs.versions.toml

@@ -1,20 +1,27 @@
 [versions]
 [versions]
 agp = "8.5.1"
 agp = "8.5.1"
-bom = "2.6.1"
-kotlin = "1.9.0"
+bom = "2.6.0"
 coilCompose = "2.4.0"
 coilCompose = "2.4.0"
-coreKtx = "1.13.1"
+kotlin = "1.9.0"
+coreKtx = "1.10.1"
 junit = "4.13.2"
 junit = "4.13.2"
-junitVersion = "1.2.1"
-espressoCore = "3.6.1"
-lifecycleRuntimeKtx = "2.8.5"
-activityCompose = "1.9.2"
+junitVersion = "1.1.5"
+espressoCore = "3.5.1"
+ktor_version="2.3.12"
+ktorClientAndroid = "2.3.12"
+lifecycleRuntimeKtx = "2.6.1"
+activityCompose = "1.8.0"
 composeBom = "2024.04.01"
 composeBom = "2024.04.01"
+storageKt = "2.0.4"
+xmodule_z = "2.6.0"
+volley = "1.2.1"
 
 
 [libraries]
 [libraries]
 androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
 androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
-coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coilCompose" }
 bom = { module = "io.github.jan-tennert.supabase:bom", version.ref = "bom" }
 bom = { module = "io.github.jan-tennert.supabase:bom", version.ref = "bom" }
+coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coilCompose" }
+github-postgrest-kt = { module = "io.github.jan-tennert.supabase:postgrest-kt" }
+github-realtime-kt = { module = "io.github.jan-tennert.supabase:realtime-kt" }
 gotrue-kt = { module = "io.github.jan-tennert.supabase:gotrue-kt" }
 gotrue-kt = { module = "io.github.jan-tennert.supabase:gotrue-kt" }
 junit = { group = "junit", name = "junit", version.ref = "junit" }
 junit = { group = "junit", name = "junit", version.ref = "junit" }
 androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
 androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
@@ -29,10 +36,16 @@ 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-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
 androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
 androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
 androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
 androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
-postgrest-kt = { module = "io.github.jan-tennert.supabase:postgrest-kt" }
+ktor-client-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor_version" }
+ktor-ktor-client-android = { module = "io.ktor:ktor-client-Android", version.ref = "ktorClientAndroid" }
 realtime-kt = { module = "io.github.jan-tennert.supabase:realtime-kt" }
 realtime-kt = { module = "io.github.jan-tennert.supabase:realtime-kt" }
+postgrest-kt = { module = "io.github.jan-tennert.supabase:postgrest-kt" }
+storage-kt = { module = "io.github.jan-tennert.supabase:storage-kt", version.ref = "storageKt" }
+supabase-realtime-kt = { module = "io.github.jan-tennert.supabase:realtime-kt" }
+supabase-postgrest-kt = { module = "io.github.jan-tennert.supabase:postgrest-kt" }
+xmodule_z = { module = "io.github.jan-tennert.supabase:[module]", version.ref = "xmodule_z" }
+volley = { group = "com.android.volley", name = "volley", version.ref = "volley" }
 
 
 [plugins]
 [plugins]
 android-application = { id = "com.android.application", version.ref = "agp" }
 android-application = { id = "com.android.application", version.ref = "agp" }
-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
-
+kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }

+ 6 - 1
settings.gradle.kts

@@ -1,3 +1,5 @@
+import org.gradle.api.initialization.resolve.RepositoriesMode.FAIL_ON_PROJECT_REPOS
+
 pluginManagement {
 pluginManagement {
     repositories {
     repositories {
         google {
         google {
@@ -11,8 +13,11 @@ pluginManagement {
         gradlePluginPortal()
         gradlePluginPortal()
     }
     }
 }
 }
+
+
+
 dependencyResolutionManagement {
 dependencyResolutionManagement {
-    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+    repositoriesMode.set(FAIL_ON_PROJECT_REPOS)
     repositories {
     repositories {
         google()
         google()
         mavenCentral()
         mavenCentral()