Browse Source

fix: fix mini bags; update: update models and requests

Maksutka 1 day ago
parent
commit
ddaa10d21f

BIN
TripHelper/app/release/app-release.apk


BIN
TripHelper/app/release/baselineProfiles/0/app-release.dm


BIN
TripHelper/app/release/baselineProfiles/1/app-release.dm


+ 37 - 0
TripHelper/app/release/output-metadata.json

@@ -0,0 +1,37 @@
+{
+  "version": 3,
+  "artifactType": {
+    "type": "APK",
+    "kind": "Directory"
+  },
+  "applicationId": "com.example.testirovanye_supabase",
+  "variantName": "release",
+  "elements": [
+    {
+      "type": "SINGLE",
+      "filters": [],
+      "attributes": [],
+      "versionCode": 1,
+      "versionName": "1.0",
+      "outputFile": "app-release.apk"
+    }
+  ],
+  "elementType": "File",
+  "baselineProfiles": [
+    {
+      "minApi": 28,
+      "maxApi": 30,
+      "baselineProfiles": [
+        "baselineProfiles/1/app-release.dm"
+      ]
+    },
+    {
+      "minApi": 31,
+      "maxApi": 2147483647,
+      "baselineProfiles": [
+        "baselineProfiles/0/app-release.dm"
+      ]
+    }
+  ],
+  "minSdkVersionForDexing": 24
+}

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

@@ -6,6 +6,7 @@
     <application
         android:name="com.example.triphelper.view.mainActivity.MainApplication"
         android:allowBackup="true"
+        android:screenOrientation="portrait"
         android:dataExtractionRules="@xml/data_extraction_rules"
         android:fullBackupContent="@xml/backup_rules"
         android:icon="@mipmap/ic_launcher"
@@ -18,7 +19,8 @@
             android:name="com.example.triphelper.view.mainActivity.MainActivity"
             android:exported="true"
             android:label="@string/app_name"
-            android:theme="@style/Theme.TripHelper">
+            android:theme="@style/Theme.TripHelper"
+            android:screenOrientation="portrait">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
 

+ 2 - 1
TripHelper/app/src/main/java/com/example/triphelper/model/Attractions.kt

@@ -19,5 +19,6 @@ data class Attractions(
     val route: String,
     val schedule_more: String,
     val price: String,
-    val coordinates: String
+    val coordinates_x: Float,
+    val coordinates_y: Float
 )

+ 3 - 1
TripHelper/app/src/main/java/com/example/triphelper/model/Hotels.kt

@@ -21,5 +21,7 @@ data class Hotels(
     val photo_room: String,
     val services: String,
     val price: String,
-    val coordinates: String
+    val coordinates_x: Float,
+    val coordinates_y: Float,
+    val check_in_out: String
 )

+ 2 - 1
TripHelper/app/src/main/java/com/example/triphelper/model/Restaurants.kt

@@ -19,5 +19,6 @@ data class Restaurants(
     val recommendations: String,
     val price: String,
     val average_check: Int,
-    val coordinates: String
+    val coordinates_x: Float,
+    val coordinates_y: Float
 )

+ 2 - 1
TripHelper/app/src/main/java/com/example/triphelper/view/MainScreen/MainScreenViewModel.kt

@@ -47,7 +47,8 @@ class MainScreenViewModel@Inject constructor(): ViewModel(){
                         "route, "+
                         "schedule_more, "+
                         "price, "+
-                        "coordinates"
+                        "coordinates_x, "+
+                        "coordinates_y"
                     )
                 ).decodeList<Attractions>()
                 _attractions.value = responce

+ 10 - 10
TripHelper/app/src/main/java/com/example/triphelper/view/RouteScreens/HotelsDesc.kt

@@ -261,16 +261,16 @@ fun HotelsDesc(navController: NavController, iconsRouteIsActivity: MutableState<
                                 fontWeight = FontWeight.Bold,
                                 textAlign = TextAlign.Start
                             )
-//                            Text(
-//                                text = hotels.,
-//                                color = Color(0xFF000000),
-//                                fontSize = 20.sp,
-//                                fontFamily = Roboto,
-//                                fontWeight = FontWeight.Bold,
-//                                textAlign = TextAlign.Start,
-//                                modifier = Modifier
-//                                    .padding(bottom = 40.dp)
-//                            )
+                            Text(
+                                text = hotels.check_in_out,
+                                color = Color(0xFF000000),
+                                fontSize = 20.sp,
+                                fontFamily = Roboto,
+                                fontWeight = FontWeight.Bold,
+                                textAlign = TextAlign.Start,
+                                modifier = Modifier
+                                    .padding(bottom = 40.dp)
+                            )
                         }
                     }
                 }

+ 25 - 25
TripHelper/app/src/main/java/com/example/triphelper/view/RouteScreens/RouteViewModel.kt

@@ -177,31 +177,27 @@ class RouteViewModel @Inject constructor() : ViewModel() {
 
     fun GetOrgTour(numberTour: Int, titleCity:String) {
         viewModelScope.launch {
-            try {
-                GetMetro(titleCity)
-                withContext(Dispatchers.IO) {
-                    val columns = Columns.raw(
-                        """
+            GetMetro(titleCity)
+            withContext(Dispatchers.IO) {
+                val columns = Columns.raw(
+                    """
                     id,
                     tours!inner(id,title),
-                    attractions!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,visiting,work_schedule,price_showing,photo,history,address,route,schedule_more,price,coordinates),
-                    hotels!inner(id,city!inner(id,country!inner(id,title,flag),title),rating,quantity_of_rooms,floors,name,photo_hotel,address,basic_info,interior,photo_interior,rooms,photo_room,services,price,coordinates),
-                    restaurants!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,work_schedule,phone,photo,address,basic_info,interior,recommendations,price,average_check,coordinates)
+                    attractions!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,visiting,work_schedule,price_showing,photo,history,address,route,schedule_more,price,coordinates_x, coordinates_y),
+                    hotels!inner(id,city!inner(id,country!inner(id,title,flag),title),rating,quantity_of_rooms,floors,name,photo_hotel,address,basic_info,interior,photo_interior,rooms,photo_room,services,price,coordinates_x, coordinates_y, check_in_out),
+                    restaurants!inner(id,city!inner(id,country!inner(id,title,flag),title),currency!inner(id,country!inner(id,title,flag),title),name,work_schedule,phone,photo,address,basic_info,interior,recommendations,price,average_check,coordinates_x,coordinates_y)
                 """.trimIndent()
-                    )
-                    val responce = Constants.supabase.from("organization_of_tours").select(
-                        columns = columns
-                    ) {
-                        filter {
-                            eq("attractions.city.title", titleCity)
-                        }
-                    }.decodeList<Organization_of_tours>()
-                    val new_responce = responce.filter { it.tours.id == numberTour }
-                    _orgTour.value = new_responce
-                    Log.i("orgTour", titleCity)
-                }
-            }catch (e:Exception){
-                Log.e("orgTour", "Error")
+                )
+                val responce = Constants.supabase.from("organization_of_tours").select(
+                    columns = columns
+                ) {
+                    filter {
+                        eq("attractions.city.title", titleCity)
+                    }
+                }.decodeList<Organization_of_tours>()
+                val new_responce = responce.filter { it.tours.id == numberTour }
+                _orgTour.value = new_responce
+                Log.i("orgTour", titleCity)
             }
         }
     }
@@ -223,7 +219,8 @@ class RouteViewModel @Inject constructor() : ViewModel() {
                     route,
                     schedule_more,
                     price,
-                    coordinates
+                    coordinates_x,
+                    coordinates_y
                 """.trimIndent()
                     )
                     val responce = Constants.supabase.from("attractions").select(
@@ -261,7 +258,9 @@ class RouteViewModel @Inject constructor() : ViewModel() {
                     photo_room,
                     services,
                     price,
-                    coordinates
+                    coordinates_x,
+                    coordinates_y,
+                    check_in_out
                 """.trimIndent()
                     )
                     val responce = Constants.supabase.from("hotels").select(
@@ -297,7 +296,8 @@ class RouteViewModel @Inject constructor() : ViewModel() {
                     recommendations,
                     price,
                     average_check,
-                    coordinates
+                    coordinates_x,
+                    coordinates_y
                 """.trimIndent()
                     )
                     val responce = Constants.supabase.from("restaurants").select(

+ 1 - 1
TripHelper/app/src/main/java/com/example/triphelper/view/navigation/Navigation.kt

@@ -30,7 +30,7 @@ fun Navigation(controller: NavHostController, barsIsVisible: MutableState<Boolea
                iconsLawIsActivity: MutableState<Boolean>, iconsProfileIsActivity: MutableState<Boolean>,
                iconsAdviceIsActivity: MutableState<Boolean>,iconsMainIsActivity: MutableState<Boolean>, iconsRoutsIsActivity: MutableState<Boolean>) {
     NavHost(navController = controller,
-        startDestination = NavigationRoutes.AUTH)
+        startDestination = NavigationRoutes.SPLASH)
     {
         composable( NavigationRoutes.SPLASH){
             barsIsVisible.value = false

+ 3 - 0
TripHelper/app/src/main/java/com/example/triphelper/view/style/StyleFone.kt

@@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.res.painterResource
 import com.example.testirovanye_supabase.R
 
@@ -15,6 +16,7 @@ fun StyleAutorisationFone(){
         Image(
             painter = painterResource(id = R.drawable.foneauth),
             contentDescription = null,
+            contentScale = ContentScale.Crop,
             modifier = Modifier.fillMaxSize()
         )
     }
@@ -26,6 +28,7 @@ fun StyleMainFone(){
         Image(
             painter = painterResource(id = R.drawable.mainfone),
             contentDescription = null,
+            contentScale = ContentScale.Crop,
             modifier = Modifier.fillMaxSize()
         )
     }

BIN
TripHelper/trip_helper.jks