Răsfoiți Sursa

add: new functionality - approximation of the metro map image; update: Hotel and Rest Desc

Maksutka 4 zile în urmă
părinte
comite
92f7c7c4e5

+ 0 - 329
TripHelper/.idea/other.xml

@@ -1,329 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="direct_access_persist.xml">
-    <option name="deviceSelectionList">
-      <list>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="27" />
-          <option name="brand" value="DOCOMO" />
-          <option name="codename" value="F01L" />
-          <option name="id" value="F01L" />
-          <option name="manufacturer" value="FUJITSU" />
-          <option name="name" value="F-01L" />
-          <option name="screenDensity" value="360" />
-          <option name="screenX" value="720" />
-          <option name="screenY" value="1280" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="28" />
-          <option name="brand" value="DOCOMO" />
-          <option name="codename" value="SH-01L" />
-          <option name="id" value="SH-01L" />
-          <option name="manufacturer" value="SHARP" />
-          <option name="name" value="AQUOS sense2 SH-01L" />
-          <option name="screenDensity" value="480" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2160" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="Lenovo" />
-          <option name="codename" value="TB370FU" />
-          <option name="id" value="TB370FU" />
-          <option name="manufacturer" value="Lenovo" />
-          <option name="name" value="Tab P12" />
-          <option name="screenDensity" value="340" />
-          <option name="screenX" value="1840" />
-          <option name="screenY" value="2944" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="31" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="a51" />
-          <option name="id" value="a51" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy A51" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2400" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="akita" />
-          <option name="id" value="akita" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 8a" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2400" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="33" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="b0q" />
-          <option name="id" value="b0q" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy S22 Ultra" />
-          <option name="screenDensity" value="600" />
-          <option name="screenX" value="1440" />
-          <option name="screenY" value="3088" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="32" />
-          <option name="brand" value="google" />
-          <option name="codename" value="bluejay" />
-          <option name="id" value="bluejay" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 6a" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2400" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="caiman" />
-          <option name="id" value="caiman" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 9 Pro" />
-          <option name="screenDensity" value="360" />
-          <option name="screenX" value="960" />
-          <option name="screenY" value="2142" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="comet" />
-          <option name="id" value="comet" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 9 Pro Fold" />
-          <option name="screenDensity" value="390" />
-          <option name="screenX" value="2076" />
-          <option name="screenY" value="2152" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="29" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="crownqlteue" />
-          <option name="id" value="crownqlteue" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy Note9" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="2220" />
-          <option name="screenY" value="1080" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="dm3q" />
-          <option name="id" value="dm3q" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy S23 Ultra" />
-          <option name="screenDensity" value="600" />
-          <option name="screenX" value="1440" />
-          <option name="screenY" value="3088" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="e1q" />
-          <option name="id" value="e1q" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy S24" />
-          <option name="screenDensity" value="480" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2340" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="33" />
-          <option name="brand" value="google" />
-          <option name="codename" value="felix" />
-          <option name="id" value="felix" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel Fold" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="2208" />
-          <option name="screenY" value="1840" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="felix" />
-          <option name="id" value="felix" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel Fold" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="2208" />
-          <option name="screenY" value="1840" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="33" />
-          <option name="brand" value="google" />
-          <option name="codename" value="felix_camera" />
-          <option name="id" value="felix_camera" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel Fold (Camera-enabled)" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="2208" />
-          <option name="screenY" value="1840" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="33" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="gts8uwifi" />
-          <option name="id" value="gts8uwifi" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy Tab S8 Ultra" />
-          <option name="screenDensity" value="320" />
-          <option name="screenX" value="1848" />
-          <option name="screenY" value="2960" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="husky" />
-          <option name="id" value="husky" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 8 Pro" />
-          <option name="screenDensity" value="390" />
-          <option name="screenX" value="1008" />
-          <option name="screenY" value="2244" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="30" />
-          <option name="brand" value="motorola" />
-          <option name="codename" value="java" />
-          <option name="id" value="java" />
-          <option name="manufacturer" value="Motorola" />
-          <option name="name" value="G20" />
-          <option name="screenDensity" value="280" />
-          <option name="screenX" value="720" />
-          <option name="screenY" value="1600" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="komodo" />
-          <option name="id" value="komodo" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 9 Pro XL" />
-          <option name="screenDensity" value="360" />
-          <option name="screenX" value="1008" />
-          <option name="screenY" value="2244" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="33" />
-          <option name="brand" value="google" />
-          <option name="codename" value="lynx" />
-          <option name="id" value="lynx" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 7a" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2400" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="31" />
-          <option name="brand" value="google" />
-          <option name="codename" value="oriole" />
-          <option name="id" value="oriole" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 6" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2400" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="33" />
-          <option name="brand" value="google" />
-          <option name="codename" value="panther" />
-          <option name="id" value="panther" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 7" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2400" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="q5q" />
-          <option name="id" value="q5q" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy Z Fold5" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1812" />
-          <option name="screenY" value="2176" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="samsung" />
-          <option name="codename" value="q6q" />
-          <option name="id" value="q6q" />
-          <option name="manufacturer" value="Samsung" />
-          <option name="name" value="Galaxy Z Fold6" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1856" />
-          <option name="screenY" value="2160" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="30" />
-          <option name="brand" value="google" />
-          <option name="codename" value="r11" />
-          <option name="id" value="r11" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel Watch" />
-          <option name="screenDensity" value="320" />
-          <option name="screenX" value="384" />
-          <option name="screenY" value="384" />
-          <option name="type" value="WEAR_OS" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="30" />
-          <option name="brand" value="google" />
-          <option name="codename" value="redfin" />
-          <option name="id" value="redfin" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 5" />
-          <option name="screenDensity" value="440" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2340" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="shiba" />
-          <option name="id" value="shiba" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 8" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2400" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="33" />
-          <option name="brand" value="google" />
-          <option name="codename" value="tangorpro" />
-          <option name="id" value="tangorpro" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel Tablet" />
-          <option name="screenDensity" value="320" />
-          <option name="screenX" value="1600" />
-          <option name="screenY" value="2560" />
-        </PersistentDeviceSelectionData>
-        <PersistentDeviceSelectionData>
-          <option name="api" value="34" />
-          <option name="brand" value="google" />
-          <option name="codename" value="tokay" />
-          <option name="id" value="tokay" />
-          <option name="manufacturer" value="Google" />
-          <option name="name" value="Pixel 9" />
-          <option name="screenDensity" value="420" />
-          <option name="screenX" value="1080" />
-          <option name="screenY" value="2424" />
-        </PersistentDeviceSelectionData>
-      </list>
-    </option>
-  </component>
-</project>

+ 3 - 1
TripHelper/app/build.gradle.kts

@@ -91,5 +91,7 @@ dependencies {
 
     implementation (libs.ui)
 
-    implementation("androidx.compose.animation:animation:1.7.5")
+    implementation(libs.androidx.animation)
+
+    implementation(libs.accompanist.coil)
 }

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

@@ -95,7 +95,7 @@ fun HotelsDesc(navController: NavController, iconsRouteIsActivity: MutableState<
                 if (imageStateHotel is AsyncImagePainter.State.Error || imageStateRoom is AsyncImagePainter.State.Error || imageStateInterior is AsyncImagePainter.State.Error) {
                     Box(
                         modifier = Modifier
-                            .fillMaxWidth()
+                            .fillMaxWidth(0.9f)
                             .height(200.dp),
                         contentAlignment = Alignment.Center
                     ) {
@@ -105,7 +105,7 @@ fun HotelsDesc(navController: NavController, iconsRouteIsActivity: MutableState<
                 if (imageStateHotel is AsyncImagePainter.State.Success && imageStateRoom is AsyncImagePainter.State.Success && imageStateInterior is AsyncImagePainter.State.Success) {
                     Column(
                         modifier = Modifier
-                            .fillMaxWidth()
+                            .fillMaxWidth(0.9f)
                     ) {
                         Box(
                             contentAlignment = Alignment.Center,
@@ -113,7 +113,7 @@ fun HotelsDesc(navController: NavController, iconsRouteIsActivity: MutableState<
                         ) {
                             Image(
                                 modifier = Modifier
-                                    .fillMaxWidth(0.9f)
+                                    .fillMaxWidth()
                                     .height(190.dp)
                                     .clip(RoundedCornerShape(10.dp)),
                                 painter = imageStateHotel.painter,
@@ -125,7 +125,7 @@ fun HotelsDesc(navController: NavController, iconsRouteIsActivity: MutableState<
                         Column(
                             horizontalAlignment = Alignment.Start,
                             verticalArrangement = Arrangement.spacedBy(20.dp),
-                            modifier = Modifier.padding(start = 20.dp).fillMaxWidth(0.9f)
+                            modifier = Modifier.fillMaxWidth()
                         ) {
                             Text(
                                 text = "Адрес",

+ 90 - 85
TripHelper/app/src/main/java/com/example/triphelper/view/RouteScreens/RestaurantsDesc.kt

@@ -115,92 +115,97 @@ fun RestaurantsDesc(navController: NavController, iconsRouteIsActivity: MutableS
                             )
                         }
                         Column(
-                            horizontalAlignment = Alignment.Start,
-                            verticalArrangement = Arrangement.spacedBy(20.dp),
-                            modifier = Modifier.padding(start = 20.dp).fillMaxWidth(0.9f)
+                            modifier = Modifier.fillMaxWidth(),
+                            horizontalAlignment = Alignment.CenterHorizontally
                         ) {
-                            Text(
-                                text = "Адрес",
-                                color = Color(0xFF510B3C),
-                                fontSize = 26.sp,
-                                fontFamily = SeoulBold,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start
-                            )
-                            Text(
-                                text = restaurants.address,
-                                color = Color(0xFF000000),
-                                fontSize = 20.sp,
-                                fontFamily = Roboto,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start,
-                            )
-                            Text(
-                                text = "Основная информация",
-                                color = Color(0xFF510B3C),
-                                fontSize = 26.sp,
-                                fontFamily = SeoulBold,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start
-                            )
-                            Text(
-                                text = restaurants.basic_info,
-                                color = Color(0xFF000000),
-                                fontSize = 20.sp,
-                                fontFamily = Roboto,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start
-                            )
-                            Text(
-                                text = "Интерьер",
-                                color = Color(0xFF510B3C),
-                                fontSize = 26.sp,
-                                fontFamily = SeoulBold,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start
-                            )
-                            Text(
-                                text = restaurants.interior,
-                                color = Color(0xFF000000),
-                                fontSize = 20.sp,
-                                fontFamily = Roboto,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start,
-                            )
-                            Text(
-                                text = "Цены",
-                                color = Color(0xFF510B3C),
-                                fontSize = 26.sp,
-                                fontFamily = SeoulBold,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start
-                            )
-                            Text(
-                                text = restaurants.price,
-                                color = Color(0xFF000000),
-                                fontSize = 20.sp,
-                                fontFamily = Roboto,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start,
-                            )
-                            Text(
-                                text = "Рекомендации",
-                                color = Color(0xFF510B3C),
-                                fontSize = 26.sp,
-                                fontFamily = SeoulBold,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start
-                            )
-                            Text(
-                                text = restaurants.recommendations,
-                                color = Color(0xFF000000),
-                                fontSize = 20.sp,
-                                fontFamily = Roboto,
-                                fontWeight = FontWeight.Bold,
-                                textAlign = TextAlign.Start,
-                                modifier = Modifier
-                                    .padding(bottom = 40.dp)
-                            )
+                            Column(
+                                horizontalAlignment = Alignment.Start,
+                                verticalArrangement = Arrangement.spacedBy(20.dp),
+                                modifier = Modifier.padding(start = 10.dp).fillMaxWidth(0.9f)
+                            ) {
+                                Text(
+                                    text = "Адрес",
+                                    color = Color(0xFF510B3C),
+                                    fontSize = 26.sp,
+                                    fontFamily = SeoulBold,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start
+                                )
+                                Text(
+                                    text = restaurants.address,
+                                    color = Color(0xFF000000),
+                                    fontSize = 20.sp,
+                                    fontFamily = Roboto,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start,
+                                )
+                                Text(
+                                    text = "Основная информация",
+                                    color = Color(0xFF510B3C),
+                                    fontSize = 26.sp,
+                                    fontFamily = SeoulBold,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start
+                                )
+                                Text(
+                                    text = restaurants.basic_info,
+                                    color = Color(0xFF000000),
+                                    fontSize = 20.sp,
+                                    fontFamily = Roboto,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start
+                                )
+                                Text(
+                                    text = "Интерьер",
+                                    color = Color(0xFF510B3C),
+                                    fontSize = 26.sp,
+                                    fontFamily = SeoulBold,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start
+                                )
+                                Text(
+                                    text = restaurants.interior,
+                                    color = Color(0xFF000000),
+                                    fontSize = 20.sp,
+                                    fontFamily = Roboto,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start,
+                                )
+                                Text(
+                                    text = "Цены",
+                                    color = Color(0xFF510B3C),
+                                    fontSize = 26.sp,
+                                    fontFamily = SeoulBold,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start
+                                )
+                                Text(
+                                    text = restaurants.price,
+                                    color = Color(0xFF000000),
+                                    fontSize = 20.sp,
+                                    fontFamily = Roboto,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start,
+                                )
+                                Text(
+                                    text = "Рекомендации",
+                                    color = Color(0xFF510B3C),
+                                    fontSize = 26.sp,
+                                    fontFamily = SeoulBold,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start
+                                )
+                                Text(
+                                    text = restaurants.recommendations,
+                                    color = Color(0xFF000000),
+                                    fontSize = 20.sp,
+                                    fontFamily = Roboto,
+                                    fontWeight = FontWeight.Bold,
+                                    textAlign = TextAlign.Start,
+                                    modifier = Modifier
+                                        .padding(bottom = 40.dp)
+                                )
+                            }
                         }
                     }
                 }

+ 1 - 0
TripHelper/app/src/main/java/com/example/triphelper/view/RouteScreens/Tours.kt

@@ -71,6 +71,7 @@ fun Tours(navController: NavController, iconsRouteIsActivity: MutableState<Boole
     Column(
         modifier = Modifier
             .fillMaxSize()
+            .fillMaxWidth()
             .padding(top = 65.dp),
         horizontalAlignment = Alignment.CenterHorizontally
     ) {

+ 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.SPLASH)
+        startDestination = NavigationRoutes.CH_LOC)
     {
         composable( NavigationRoutes.SPLASH){
             barsIsVisible.value = false

+ 71 - 35
TripHelper/app/src/main/java/com/example/triphelper/view/style/LazyColumnStyle.kt

@@ -4,11 +4,14 @@ import androidx.compose.foundation.Image
 import androidx.compose.foundation.background
 import androidx.compose.foundation.border
 import androidx.compose.foundation.clickable
+import androidx.compose.foundation.gestures.detectDragGestures
+import androidx.compose.foundation.gestures.detectTransformGestures
 import androidx.compose.foundation.layout.Arrangement
 import androidx.compose.foundation.layout.Box
 import androidx.compose.foundation.layout.Column
 import androidx.compose.foundation.layout.Row
 import androidx.compose.foundation.layout.fillMaxHeight
+import androidx.compose.foundation.layout.fillMaxSize
 import androidx.compose.foundation.layout.fillMaxWidth
 import androidx.compose.foundation.layout.height
 import androidx.compose.foundation.layout.padding
@@ -21,10 +24,17 @@ import androidx.compose.material3.CircularProgressIndicator
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.LaunchedEffect
+import androidx.compose.runtime.getValue
+import androidx.compose.runtime.mutableStateOf
+import androidx.compose.runtime.remember
+import androidx.compose.runtime.rememberCoroutineScope
+import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.Color
+import androidx.compose.ui.graphics.graphicsLayer
+import androidx.compose.ui.input.pointer.pointerInput
 import androidx.compose.ui.layout.ContentScale
 import androidx.compose.ui.platform.LocalContext
 import androidx.compose.ui.res.painterResource
@@ -33,9 +43,11 @@ import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import androidx.hilt.navigation.compose.hiltViewModel
 import androidx.navigation.NavController
+import coil.ImageLoader
 import coil.compose.AsyncImagePainter
 import coil.compose.rememberAsyncImagePainter
 import coil.request.ImageRequest
+import coil.size.Size
 import com.example.testirovanye_supabase.R
 import com.example.triphelper.model.Advice
 import com.example.triphelper.model.Metro
@@ -45,6 +57,8 @@ import com.example.triphelper.view.RouteScreens.RouteViewModel
 import com.example.triphelper.view.navigation.NavigationRoutes
 import com.example.triphelper.view.theme.Roboto
 import com.example.triphelper.view.theme.RobotoB
+import kotlinx.coroutines.delay
+import kotlinx.coroutines.launch
 
 @Composable
 fun AttractionsLazy(navController: NavController,orgTour:List<Organization_of_tours>,viewModel: RouteViewModel = hiltViewModel()){
@@ -497,52 +511,74 @@ fun RestaurantsLazy(navController: NavController,orgTour:List<Organization_of_to
 
 @Composable
 fun MetroLazy(metro:List<Metro>, viewModel: RouteViewModel = hiltViewModel()){
-    LazyColumn(
-        modifier = Modifier.fillMaxHeight(0.7f),
-        verticalArrangement = Arrangement.Center
-    ) {
-        items(
-            metro,
-            key = { metro -> metro.id },
-        ) { metroItem ->
+    var scale by remember { mutableStateOf(1f) }
+    var offsetX by remember { mutableStateOf(0f) }
+    var offsetY by remember { mutableStateOf(0f) }
+    val coroutineScope = rememberCoroutineScope()
+    if (metro.isNotEmpty()) {
+        metro.firstOrNull().let { metroItem ->
             //Не работает условие
-            if(metroItem.photo == ""){
-                Box(
-                    modifier = Modifier
-                        .fillMaxWidth()
-                        .fillMaxHeight()
-                        .background(Color.Red)
-                        .height(200.dp),
-                    contentAlignment = Alignment.Center
-                ) {
-                    Text(text = "kjhdwhjdwjjdw", fontSize = 50.sp)
-                }
-            }
-            else{
-                val imageState = rememberAsyncImagePainter(
-                    model = ImageRequest.Builder(LocalContext.current).data(metroItem.photo)
-                        .size(coil.size.Size.ORIGINAL).build()
-                ).state
-                if (imageState is AsyncImagePainter.State.Error) {
+            if (metroItem != null) {
+                if(metroItem.photo == ""){
                     Box(
                         modifier = Modifier
                             .fillMaxWidth()
+                            .fillMaxHeight()
+                            .background(Color.Red)
                             .height(200.dp),
                         contentAlignment = Alignment.Center
                     ) {
-                        CircularProgressIndicator()
+                        Text(text = "У данного города нет метро", fontSize = 50.sp)
                     }
                 }
-                if (imageState is AsyncImagePainter.State.Success) {
-                    Image(
-                        modifier = Modifier
-                            .fillMaxHeight()
-                            .fillMaxWidth(0.9f)
-                            .clip(RoundedCornerShape(5.dp)),
-                        painter = imageState.painter,
-                        contentDescription = "",
+                else{
+                    val imageLoader = ImageLoader(LocalContext.current)
+                    val painter = rememberAsyncImagePainter(
+                        model = metroItem.photo,
+                        imageLoader = imageLoader,
                         contentScale = ContentScale.Crop
                     )
+                    Box(
+                        modifier = Modifier
+                            .fillMaxWidth(0.9f)
+                            .fillMaxHeight(0.7f),
+                        contentAlignment = Alignment.Center) {
+                        Image(
+                            painter = painter,
+                            contentDescription = "Метро",
+                            contentScale = ContentScale.Fit,
+                            modifier = Modifier
+                                .fillMaxWidth()
+                                .fillMaxHeight()
+                                .clip(RoundedCornerShape(5.dp))
+                                .graphicsLayer {
+                                    scaleX = scale
+                                    scaleY = scale
+                                    translationX = offsetX
+                                    translationY = offsetY
+                                }
+                                .pointerInput(Unit) {
+                                    detectDragGestures(
+                                    onDragStart = {
+                                        scale = 1f
+                                        offsetX = 0f
+                                        offsetY = 0f
+                                    },
+                                    onDragEnd = {
+                                        scale = 1f
+                                        offsetX = 0f
+                                        offsetY = 0f
+                                    },
+                                    onDrag = { change, dragAmount ->
+                                        scale *= 1 + dragAmount.y / 100f
+                                        scale = maxOf(1f, minOf(scale, 5f))
+                                        offsetX += dragAmount.x
+                                        offsetY += dragAmount.y
+                                    }
+                                )
+                            }
+                        )
+                    }
                 }
             }
         }

+ 4 - 0
TripHelper/gradle/libs.versions.toml

@@ -1,7 +1,9 @@
 [versions]
+accompanistCoil = "0.15.0"
 accompanistPermissions = "0.31.2-alpha"
 agp = "8.5.1"
 androidMapsUtils = "3.5.0"
+animation = "1.7.5"
 bom = "2.6.1"
 bomVersion = "VERSION"
 coilCompose = "2.4.0"
@@ -38,10 +40,12 @@ yandexMapkitKmp = "0.1.0"
 yandexMapkitKmpCompose = "0.1.0"
 
 [libraries]
+accompanist-coil = { module = "com.google.accompanist:accompanist-coil", version.ref = "accompanistCoil" }
 accompanist-navigation-material = { module = "com.github.chrisbanes.accompanist:accompanist-navigation-material", version.ref = "accompanistPermissions" }
 accompanist-permissions = { module = "com.github.chrisbanes.accompanist:accompanist-permissions", version.ref = "accompanistPermissions" }
 accompanist-systemuicontroller = { module = "com.github.chrisbanes.accompanist:accompanist-systemuicontroller", version.ref = "accompanistPermissions" }
 android-maps-utils = { module = "com.google.maps.android:android-maps-utils", version.ref = "androidMapsUtils" }
+androidx-animation = { module = "androidx.compose.animation:animation", version.ref = "animation" }
 androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
 androidx-core-ktx-v1150 = { module = "androidx.core:core-ktx", version.ref = "coreKtxVersion" }
 androidx-hilt-navigation-compose = { module = "androidx.hilt:hilt-navigation-compose", version.ref = "hiltNavigationCompose" }