Browse Source

App:настройка аунтефикации

ПроваленкоЛН 2 weeks ago
parent
commit
d07a918825

+ 2 - 2
OscellaMobile/.idea/deploymentTargetSelector.xml

@@ -4,10 +4,10 @@
     <selectionStates>
       <SelectionState runConfigName="app">
         <option name="selectionMode" value="DROPDOWN" />
-        <DropdownSelection timestamp="2024-11-06T09:06:38.545721200Z">
+        <DropdownSelection timestamp="2024-11-14T10:55:12.762967700Z">
           <Target type="DEFAULT_BOOT">
             <handle>
-              <DeviceId pluginId="PhysicalDevice" identifier="serial=3f99f7b3" />
+              <DeviceId pluginId="LocalEmulator" identifier="path=C:\AndroidSettings\.android\avd\Pixel_7_Pro_API_34_2.avd" />
             </handle>
           </Target>
         </DropdownSelection>

+ 12 - 0
OscellaMobile/.idea/inspectionProfiles/Project_Default.xml

@@ -31,12 +31,24 @@
     <inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
       <option name="composableFile" value="true" />
     </inspection_tool>
+    <inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
     <inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
       <option name="composableFile" value="true" />
     </inspection_tool>
     <inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
       <option name="composableFile" value="true" />
     </inspection_tool>
+    <inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
+    <inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
+      <option name="composableFile" value="true" />
+    </inspection_tool>
     <inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
       <option name="composableFile" value="true" />
     </inspection_tool>

+ 0 - 1
OscellaMobile/app/src/main/java/com/example/oscellamobile/Auth.kt

@@ -38,7 +38,6 @@ class Auth(): ViewModel() {
                 println(user.toString())
                 println(Constant.supabase.auth.currentUserOrNull()!!.id)
                 println("Success")
-                onSignInEmailCode(emailUser)
                 navController.navigate("AuthWithEmail")
             } catch (e: Exception) {
                 println("Error")

+ 11 - 0
OscellaMobile/app/src/main/java/com/example/oscellamobile/models/Users.kt

@@ -0,0 +1,11 @@
+package com.example.oscellamobile.models
+
+import kotlinx.serialization.Serializable
+
+@Serializable
+data class Users(
+    val id: Int,
+    val user: String,
+    val login: String,
+    val code: Int
+)

+ 19 - 0
OscellaMobile/app/src/main/java/com/example/oscellamobile/screens/Registration.kt

@@ -41,6 +41,7 @@ fun Registration(navController: NavHostController) {
     val kdamFontFamily = FontFamily(Font(R.font.kdam))
     var text = ""
 
+
     val gradientButton = Brush.linearGradient(
         colors = listOf(
             Color(0xFF2EC4B6),
@@ -131,6 +132,24 @@ fun Registration(navController: NavHostController) {
                 .height(66.dp)
         )
         Spacer(modifier = Modifier.height(20.dp))
+        TextField(
+            value = text,
+            onValueChange = {
+                if (it.length <= 6 && it.all { char -> char.isDigit() }) {
+                    text = it
+                }
+            },
+            placeholder = { Text("Enter code (6 digits)", fontSize = 24.sp, fontFamily = kdamFontFamily) },
+            shape = RoundedCornerShape(20.dp),
+            colors = TextFieldDefaults.textFieldColors(
+                focusedIndicatorColor = Color.Transparent,
+                unfocusedIndicatorColor = Color.Transparent
+            ),
+            modifier = Modifier
+                .width(330.dp)
+                .height(66.dp)
+        )
+        Spacer(modifier = Modifier.height(20.dp))
         Button(
             onClick = {navController.navigate("RegistrationWithEmail")},
             modifier = Modifier