3 Incheckningar 6b57c0808a ... 1fdf71e74d

Upphovsman SHA1 Meddelande Datum
  x1tosi 1fdf71e74d AddingAuthPagess 2 månader sedan
  x1tosi d3a6d54ab4 AddingAuthPages 2 månader sedan
  unknown eecdae107a AddingAuthPagee 2 månader sedan

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

@@ -14,7 +14,6 @@
         tools:targetApi="31">
         <activity
 
-            android:name=".MainActivity"
             android:exported="true"
             android:label="@string/app_name"
             android:theme="@style/Theme.KuzminProjectApp">

+ 44 - 0
app/src/main/java/com/example/kuzminprojectapp/view/MainActivity.kt

@@ -0,0 +1,44 @@
+package com.example.kuzminprojectapp.view
+
+import android.os.Bundle
+import android.provider.SyncStateContract.Constants
+import androidx.activity.ComponentActivity
+import androidx.activity.compose.setContent
+import androidx.activity.enableEdgeToEdge
+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.Modifier
+import androidx.compose.ui.tooling.preview.Preview
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.ViewModelStore
+import com.example.kuzminprojectapp.ui.theme.KuzminProjectAppTheme
+import com.example.kuzminprojectapp.view.screens.AuthUser
+
+class MainActivity : ComponentActivity() {
+    override fun onCreate(savedInstanceState: Bundle?) {
+        super.onCreate(savedInstanceState)
+        enableEdgeToEdge()
+        setContent {
+            KuzminProjectAppTheme {
+                Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
+                    AuthUser(
+                        name = "Android",
+                        modifier = Modifier.padding(innerPadding)
+                    )
+                }
+            }
+        }
+    }
+}
+
+//class MainViewModel : ViewModel() {
+//    fun SignInWithEmail(email:String, password:String) {
+//        ViewModelStore.lenght {
+//            this.password = password
+//        }
+//        println(Constants.supabase)
+//    }
+//}asdasdasd

+ 44 - 0
app/src/main/java/com/example/kuzminprojectapp/view/screens/authScreen.kt

@@ -0,0 +1,44 @@
+package com.example.kuzminprojectapp.view.screens
+
+import androidx.compose.foundation.layout.Arrangement
+import androidx.compose.foundation.layout.Box
+import androidx.compose.foundation.layout.Column
+import androidx.compose.foundation.layout.padding
+import androidx.compose.material3.Button
+import androidx.compose.material3.Text
+import androidx.compose.material3.TextField
+import androidx.compose.runtime.Composable
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.ui.Alignment
+import androidx.compose.ui.Modifier
+import androidx.compose.ui.unit.dp
+import androidx.lifecycle.ViewModel
+import androidx.lifecycle.viewmodel.viewModelFactory
+
+@Composable
+fun AuthUser(name: String, modifier: Modifier = Modifier) {
+    //val ViewModel = MainViewModel()
+    Column (
+        Modifier.padding(20.dp),
+        horizontalAlignment = Alignment.CenterHorizontally,
+        verticalArrangement = Arrangement.Center
+    ) {
+        val email = remember { mutableStateOf("") }
+        val password = remember { mutableStateOf("") }
+
+        TextField(
+            value = email.value,
+            onValueChange = {newText -> email.value = newText}
+        )
+
+        TextField(
+            value = password.value,
+            onValueChange = {newText -> password.value = newText}
+        )
+
+        //Button(onClick = { ViewModel.SignInWithEmail(email.value, password.value) }) {
+        //    Text("SignIn")
+    }
+}
+