diff --git a/app/build.gradle b/app/build.gradle
index 73e5b883a..c66fa01d4 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -89,7 +89,6 @@ dependencies {
implementation projects.feature.detail
implementation projects.feature.search
implementation projects.feature.theater
- implementation projects.feature.theatermap
implementation projects.feature.settings
implementation projects.feature.theme.api
runtimeOnly projects.feature.theme.impl
diff --git a/app/dependencies/releaseRuntimeClasspath.txt b/app/dependencies/releaseRuntimeClasspath.txt
index cfa172037..e7407c49a 100644
--- a/app/dependencies/releaseRuntimeClasspath.txt
+++ b/app/dependencies/releaseRuntimeClasspath.txt
@@ -107,7 +107,6 @@ androidx.navigation:navigation-runtime-ktx:2.8.2
androidx.navigation:navigation-runtime:2.8.2
androidx.print:print:1.0.0
androidx.profileinstaller:profileinstaller:1.3.1
-androidx.recyclerview:recyclerview:1.3.2
androidx.resourceinspection:resourceinspection-annotation:1.0.1
androidx.room:room-common:2.6.1
androidx.room:room-ktx:2.6.1
@@ -117,7 +116,6 @@ androidx.savedstate:savedstate:1.2.1
androidx.sqlite:sqlite-framework:2.4.0
androidx.sqlite:sqlite:2.4.0
androidx.startup:startup-runtime:1.2.0
-androidx.swiperefreshlayout:swiperefreshlayout:1.1.0
androidx.tracing:tracing:1.0.0
androidx.vectordrawable:vectordrawable-animated:1.1.0
androidx.vectordrawable:vectordrawable:1.1.0
@@ -127,20 +125,15 @@ androidx.window.extensions.core:core:1.0.0
androidx.window:window:1.3.0
androidx.work:work-runtime-ktx:2.9.1
androidx.work:work-runtime:2.9.1
-com.getkeepsafe.relinker:relinker:1.4.4
-com.google.accompanist:accompanist-drawablepainter:0.36.0
-com.google.accompanist:accompanist-permissions:0.34.0
com.google.android.datatransport:transport-api:3.1.0
com.google.android.datatransport:transport-backend-cct:3.1.9
com.google.android.datatransport:transport-runtime:3.1.9
-com.google.android.gms:play-services-base:18.1.0
+com.google.android.gms:play-services-base:18.0.1
com.google.android.gms:play-services-basement:18.3.0
com.google.android.gms:play-services-cloud-messaging:17.2.0
-com.google.android.gms:play-services-location:21.0.1
com.google.android.gms:play-services-stats:17.0.2
com.google.android.gms:play-services-tasks:18.1.0
com.google.code.findbugs:jsr305:3.0.2
-com.google.code.gson:gson:2.8.6
com.google.dagger:dagger-lint-aar:2.52
com.google.dagger:dagger:2.52
com.google.dagger:hilt-android:2.52
@@ -170,9 +163,6 @@ com.google.firebase:protolite-well-known-types:18.0.0
com.google.guava:listenablefuture:1.0
com.google.protobuf:protobuf-javalite:3.21.11
com.jakewharton.timber:timber:5.0.1
-com.naver.maps:geometry:1.3.0
-com.naver.maps:map-sdk:3.18.0
-com.squareup.okhttp3:okhttp-brotli:4.10.0
com.squareup.okhttp3:okhttp:4.12.0
com.squareup.okio:okio-jvm:3.8.0
com.squareup.okio:okio:3.8.0
@@ -185,12 +175,9 @@ io.coil-kt:coil-compose-base:2.6.0
io.coil-kt:coil-compose:2.6.0
io.coil-kt:coil:2.6.0
io.github.fornewid:material-motion-compose-core:1.1.3
-io.github.fornewid:naver-map-compose:1.5.7
-io.github.fornewid:naver-map-location:21.0.1
io.github.fornewid:photo-compose:1.0.1
jakarta.inject:jakarta.inject-api:2.0.1
javax.inject:javax.inject:1
-org.brotli:dec:0.1.2
org.jetbrains.kotlin:kotlin-android-extensions-runtime:1.9.22
org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.22
org.jetbrains.kotlin:kotlin-stdlib-common:2.0.20
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 2b6e19795..efb682648 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -3,8 +3,6 @@
xmlns:tools="http://schemas.android.com/tools">
-
-
@@ -13,11 +11,6 @@
-
-
-
-
-
-
-
- prd264z8ie
-
diff --git a/app/src/main/res/values/dfm_theatermap.xml b/app/src/main/res/values/dfm_theatermap.xml
deleted file mode 100644
index 2e37a12b9..000000000
--- a/app/src/main/res/values/dfm_theatermap.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt b/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt
index 0fe8aec19..cff7b8505 100644
--- a/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt
+++ b/core/designsystem/src/main/java/soup/movie/core/designsystem/icon/MovieIcons.kt
@@ -27,7 +27,6 @@ import androidx.compose.material.icons.rounded.DragHandle
import androidx.compose.material.icons.rounded.Edit
import androidx.compose.material.icons.rounded.FilterList
import androidx.compose.material.icons.rounded.Info
-import androidx.compose.material.icons.rounded.Map
import androidx.compose.material.icons.rounded.Palette
import androidx.compose.material.icons.rounded.Search
import androidx.compose.material.icons.rounded.Settings
@@ -45,7 +44,6 @@ object MovieIcons {
val Edit = Icons.Rounded.Edit
val FilterList = Icons.Rounded.FilterList
val Info = Icons.Rounded.Info
- val Map = Icons.Rounded.Map
val Palette = Icons.Rounded.Palette
val PrivacyTip = Icons.Outlined.PrivacyTip
val Search = Icons.Rounded.Search
@@ -61,9 +59,6 @@ object MovieIcons {
val Imdb = R.drawable.ic_imdb
val LoadingLogo = R.drawable.ic_loading_logo
val YouTube = R.drawable.ic_logo_youtube
- val MarkerCgv = R.drawable.ic_marker_cgv
- val MarkerLotte = R.drawable.ic_marker_lotte
- val MarkerMegabox = R.drawable.ic_marker_megabox
val Metacritic = R.drawable.ic_metacritic
val NoTheaters = R.drawable.ic_round_no_theaters
val RottenTomatoes = R.drawable.ic_rt
diff --git a/core/designsystem/src/main/res/drawable/ic_marker_cgv.xml b/core/designsystem/src/main/res/drawable/ic_marker_cgv.xml
deleted file mode 100644
index 86cedbfa6..000000000
--- a/core/designsystem/src/main/res/drawable/ic_marker_cgv.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/core/designsystem/src/main/res/drawable/ic_marker_lotte.xml b/core/designsystem/src/main/res/drawable/ic_marker_lotte.xml
deleted file mode 100644
index 35938c722..000000000
--- a/core/designsystem/src/main/res/drawable/ic_marker_lotte.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/core/designsystem/src/main/res/drawable/ic_marker_megabox.xml b/core/designsystem/src/main/res/drawable/ic_marker_megabox.xml
deleted file mode 100644
index 74831d2f5..000000000
--- a/core/designsystem/src/main/res/drawable/ic_marker_megabox.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/core/resources/src/main/res/values-ko/strings.xml b/core/resources/src/main/res/values-ko/strings.xml
index 3406123a3..fa74ffd60 100644
--- a/core/resources/src/main/res/values-ko/strings.xml
+++ b/core/resources/src/main/res/values-ko/strings.xml
@@ -12,7 +12,6 @@
현재상영
개봉예정
즐겨찾기
- 지도
영화 필터
극장 필터
연령 필터
diff --git a/core/resources/src/main/res/values/strings.xml b/core/resources/src/main/res/values/strings.xml
index 5033a3f9b..c1d196085 100644
--- a/core/resources/src/main/res/values/strings.xml
+++ b/core/resources/src/main/res/values/strings.xml
@@ -12,7 +12,6 @@
Now
Plan
Favorite
- Map
Movie Filter
Theater Filter
Age Filter
diff --git a/feature/home/build.gradle b/feature/home/build.gradle
index f0bd73057..f9ff3e89a 100644
--- a/feature/home/build.gradle
+++ b/feature/home/build.gradle
@@ -18,7 +18,6 @@ dependencies {
implementation projects.data.repository.api
implementation projects.data.model
implementation projects.domain
- implementation projects.feature.theatermap
implementation projects.feature.settings
implementation libs.kotlin.stdlib
diff --git a/feature/home/src/main/java/soup/movie/feature/home/HomeUiModel.kt b/feature/home/src/main/java/soup/movie/feature/home/HomeUiModel.kt
index 391e5dc7c..09301ece9 100644
--- a/feature/home/src/main/java/soup/movie/feature/home/HomeUiModel.kt
+++ b/feature/home/src/main/java/soup/movie/feature/home/HomeUiModel.kt
@@ -16,7 +16,7 @@
package soup.movie.feature.home
enum class MainTabUiModel {
- Home, Favorite, TheaterMap, Settings
+ Home, Favorite, Settings
}
enum class HomeTabUiModel {
diff --git a/feature/home/src/main/java/soup/movie/feature/home/MainScreen.kt b/feature/home/src/main/java/soup/movie/feature/home/MainScreen.kt
index 49134abc6..48a2400d3 100644
--- a/feature/home/src/main/java/soup/movie/feature/home/MainScreen.kt
+++ b/feature/home/src/main/java/soup/movie/feature/home/MainScreen.kt
@@ -51,7 +51,6 @@ import soup.movie.core.designsystem.theme.MovieTheme
import soup.movie.core.designsystem.windowsizeclass.WindowWidthSizeClass
import soup.movie.feature.home.favorite.HomeFavoriteList
import soup.movie.feature.settings.SettingsNavGraph
-import soup.movie.feature.theatermap.TheaterMapScreen
import soup.movie.model.MovieModel
import soup.movie.resources.R
@@ -94,11 +93,6 @@ fun MainScreen(
},
)
}
- MainTabUiModel.TheaterMap -> {
- TheaterMapScreen(
- viewModel = hiltViewModel(),
- )
- }
MainTabUiModel.Settings -> {
SettingsNavGraph()
}
@@ -180,12 +174,6 @@ private fun CompactScreen(
contentDescription = null,
)
}
- MainTabUiModel.TheaterMap -> {
- Icon(
- rememberVectorPainter(MovieIcons.Map),
- contentDescription = null,
- )
- }
MainTabUiModel.Settings -> {
Icon(
rememberVectorPainter(MovieIcons.Settings),
@@ -199,7 +187,6 @@ private fun CompactScreen(
text = when (tab) {
MainTabUiModel.Home -> stringResource(R.string.menu_home)
MainTabUiModel.Favorite -> stringResource(R.string.menu_favorite)
- MainTabUiModel.TheaterMap -> stringResource(R.string.menu_map)
MainTabUiModel.Settings -> stringResource(R.string.menu_settings)
},
)
@@ -261,12 +248,6 @@ private fun MediumScreen(
contentDescription = null,
)
}
- MainTabUiModel.TheaterMap -> {
- Icon(
- rememberVectorPainter(MovieIcons.Map),
- contentDescription = null,
- )
- }
MainTabUiModel.Settings -> {
Icon(
rememberVectorPainter(MovieIcons.Settings),
@@ -280,7 +261,6 @@ private fun MediumScreen(
text = when (tab) {
MainTabUiModel.Home -> stringResource(R.string.menu_home)
MainTabUiModel.Favorite -> stringResource(R.string.menu_favorite)
- MainTabUiModel.TheaterMap -> stringResource(R.string.menu_map)
MainTabUiModel.Settings -> stringResource(R.string.menu_settings)
},
)
diff --git a/feature/theatermap/.gitignore b/feature/theatermap/.gitignore
deleted file mode 100644
index 796b96d1c..000000000
--- a/feature/theatermap/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
diff --git a/feature/theatermap/build.gradle b/feature/theatermap/build.gradle
deleted file mode 100644
index e66877543..000000000
--- a/feature/theatermap/build.gradle
+++ /dev/null
@@ -1,32 +0,0 @@
-plugins {
- id "moop.android.library"
- id "moop.android.compose"
- id "moop.android.hilt"
-}
-
-android {
- namespace "soup.movie.feature.theatermap"
-}
-
-dependencies {
- implementation projects.core.kotlin
- implementation projects.core.designsystem
- implementation projects.core.external
- implementation projects.core.logger
- implementation projects.core.resources
- implementation projects.data.repository.api
- implementation projects.data.model
-
- implementation libs.androidx.fragment
-
- implementation libs.androidx.activity.compose
- implementation libs.compose.foundation
- implementation libs.compose.material
- implementation libs.compose.ui
- implementation libs.accompanist.drawablepainter
-
- implementation libs.navermap.compose
-
- testImplementation projects.testing
- androidTestImplementation projects.testing
-}
diff --git a/feature/theatermap/src/main/AndroidManifest.xml b/feature/theatermap/src/main/AndroidManifest.xml
deleted file mode 100644
index cc947c567..000000000
--- a/feature/theatermap/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/TheaterMapScreen.kt b/feature/theatermap/src/main/java/soup/movie/feature/theatermap/TheaterMapScreen.kt
deleted file mode 100644
index 928c21408..000000000
--- a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/TheaterMapScreen.kt
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * Copyright 2021 SOUP
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package soup.movie.feature.theatermap
-
-import android.content.Context
-import android.content.Intent
-import android.graphics.drawable.Drawable
-import android.net.Uri
-import androidx.activity.compose.BackHandler
-import androidx.compose.foundation.Image
-import androidx.compose.foundation.clickable
-import androidx.compose.foundation.layout.Row
-import androidx.compose.foundation.layout.padding
-import androidx.compose.foundation.layout.requiredHeight
-import androidx.compose.foundation.layout.requiredSize
-import androidx.compose.foundation.layout.systemBarsPadding
-import androidx.compose.foundation.shape.CircleShape
-import androidx.compose.material.BottomSheetScaffold
-import androidx.compose.material.ExperimentalMaterialApi
-import androidx.compose.material.Icon
-import androidx.compose.material.IconButton
-import androidx.compose.material.Text
-import androidx.compose.material.TopAppBar
-import androidx.compose.material.rememberBottomSheetScaffoldState
-import androidx.compose.runtime.Composable
-import androidx.compose.runtime.LaunchedEffect
-import androidx.compose.runtime.derivedStateOf
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.remember
-import androidx.compose.runtime.rememberCoroutineScope
-import androidx.compose.ui.Alignment
-import androidx.compose.ui.Modifier
-import androidx.compose.ui.draw.shadow
-import androidx.compose.ui.layout.ContentScale
-import androidx.compose.ui.platform.LocalContext
-import androidx.compose.ui.res.stringResource
-import androidx.compose.ui.text.font.FontWeight
-import androidx.compose.ui.unit.dp
-import androidx.compose.ui.unit.sp
-import com.google.accompanist.drawablepainter.rememberDrawablePainter
-import com.naver.maps.geometry.LatLng
-import com.naver.maps.geometry.LatLngBounds
-import com.naver.maps.map.CameraAnimation
-import com.naver.maps.map.CameraPosition
-import com.naver.maps.map.CameraUpdate
-import com.naver.maps.map.compose.CameraPositionState
-import com.naver.maps.map.compose.ExperimentalNaverMapApi
-import com.naver.maps.map.compose.LocationTrackingMode
-import com.naver.maps.map.compose.MapProperties
-import com.naver.maps.map.compose.MapType
-import com.naver.maps.map.compose.MapUiSettings
-import com.naver.maps.map.compose.Marker
-import com.naver.maps.map.compose.NaverMap
-import com.naver.maps.map.compose.NaverMapConstants
-import com.naver.maps.map.compose.rememberCameraPositionState
-import com.naver.maps.map.compose.rememberFusedLocationSource
-import com.naver.maps.map.compose.rememberMarkerState
-import com.naver.maps.map.overlay.OverlayImage
-import kotlinx.coroutines.launch
-import soup.movie.core.designsystem.icon.MovieIcons
-import soup.movie.core.designsystem.theme.MovieTheme
-import soup.movie.core.external.Cgv
-import soup.movie.core.external.LotteCinema
-import soup.movie.core.external.Megabox
-import soup.movie.feature.theatermap.internal.CgvMarkerUiModel
-import soup.movie.feature.theatermap.internal.LauncherIcons
-import soup.movie.feature.theatermap.internal.LotteCinemaMarkerUiModel
-import soup.movie.feature.theatermap.internal.MegaboxMarkerUiModel
-import soup.movie.feature.theatermap.internal.TheaterMarkerUiModel
-import soup.movie.resources.R
-import kotlin.math.max
-import kotlin.math.min
-
-@OptIn(ExperimentalMaterialApi::class)
-@Composable
-fun TheaterMapScreen(
- viewModel: TheaterMapViewModel,
-) {
- val coroutineScope = rememberCoroutineScope()
- val bottomSheetScaffoldState = rememberBottomSheetScaffoldState()
- val bottomSheetState = bottomSheetScaffoldState.bottomSheetState
- val bottomSheetVisible by remember {
- derivedStateOf {
- viewModel.selectedTheater != null
- }
- }
- LaunchedEffect(bottomSheetVisible) {
- coroutineScope.launch {
- if (bottomSheetVisible) {
- bottomSheetState.expand()
- } else {
- bottomSheetState.collapse()
- }
- }
- }
- BackHandler(enabled = bottomSheetState.isExpanded) {
- viewModel.onTheaterUnselected()
- }
- BottomSheetScaffold(
- modifier = Modifier.systemBarsPadding(),
- scaffoldState = bottomSheetScaffoldState,
- sheetPeekHeight = 0.dp,
- sheetElevation = MovieTheme.elevations.bottomSheet,
- sheetContent = {
- TheaterMapFooter(
- selectedTheater = viewModel.selectedTheater,
- onClick = { viewModel.onTheaterUnselected() },
- )
- },
- topBar = {
- TopAppBar(
- title = {
- Text(text = stringResource(R.string.theater_map_title))
- },
- )
- },
- ) { paddingValues ->
- TheaterMapContents(
- modifier = Modifier.padding(paddingValues),
- theaters = viewModel.uiModel,
- selectedTheater = viewModel.selectedTheater,
- onTheaterClick = { viewModel.onTheaterSelected(it) },
- onMapClick = { viewModel.onTheaterUnselected() },
- onMapLoaded = { viewModel.onRefresh() },
- )
- }
-}
-
-@OptIn(ExperimentalNaverMapApi::class)
-@Composable
-private fun TheaterMapContents(
- theaters: List,
- selectedTheater: TheaterMarkerUiModel?,
- onTheaterClick: (TheaterMarkerUiModel) -> Unit,
- modifier: Modifier = Modifier,
- isLightTheme: Boolean = MovieTheme.colors.isLight,
- onMapClick: () -> Unit = {},
- onMapLoaded: () -> Unit = {},
-) {
- val cameraPositionState: CameraPositionState = rememberCameraPositionState {
- this.position = CameraPosition(LatLng.INVALID, 12.0)
- }
- NaverMap(
- modifier = modifier,
- cameraPositionState = cameraPositionState,
- properties = MapProperties(
- mapType = if (isLightTheme) {
- MapType.Basic
- } else {
- MapType.Navi
- },
- extent = LatLngBounds.from(
- LatLng(31.43, 122.37),
- LatLng(44.35, 132.0),
- ),
- minZoom = 6.0,
- isNightModeEnabled = isLightTheme.not(),
- backgroundColor = if (isLightTheme) {
- NaverMapConstants.DefaultBackgroundColorLight
- } else {
- NaverMapConstants.DefaultBackgroundColorDark
- },
- backgroundResource = if (isLightTheme) {
- NaverMapConstants.DefaultBackgroundDrawableLight
- } else {
- NaverMapConstants.DefaultBackgroundDrawableDark
- },
- locationTrackingMode = LocationTrackingMode.Follow,
- ),
- uiSettings = MapUiSettings(
- isScaleBarEnabled = false,
- ),
- locationSource = rememberFusedLocationSource(),
- onMapClick = { _, _ ->
- onMapClick()
- },
- onMapLoaded = { onMapLoaded() },
- ) {
- theaters.forEach { theater ->
- Marker(
- state = rememberMarkerState(
- position = LatLng(theater.lat, theater.lng),
- ),
- captionText = theater.name,
- icon = theater.getMarkerIcon(),
- isHideCollidedSymbols = true,
- isHideCollidedCaptions = true,
- onClick = {
- onTheaterClick(theater)
- true
- },
- )
- }
- }
-
- val coroutineScope = rememberCoroutineScope()
- LaunchedEffect(selectedTheater) {
- coroutineScope.launch {
- if (selectedTheater != null) {
- cameraPositionState.animate(
- update = CameraUpdate.scrollAndZoomTo(
- LatLng(selectedTheater.lat, selectedTheater.lng),
- max(cameraPositionState.position.zoom, 16.0),
- ),
- animation = CameraAnimation.Fly,
- )
- } else {
- cameraPositionState.animate(
- update = CameraUpdate.zoomTo(
- min(cameraPositionState.position.zoom, 12.0),
- ),
- animation = CameraAnimation.Easing,
- )
- }
- }
- }
-}
-
-@Composable
-private fun TheaterMapFooter(
- selectedTheater: TheaterMarkerUiModel?,
- onClick: () -> Unit,
-) {
- Row(
- verticalAlignment = Alignment.CenterVertically,
- modifier = Modifier
- .requiredHeight(100.dp)
- .clickable { onClick() },
- ) {
- val context = LocalContext.current
- val launcherIcons = remember(context) {
- LauncherIcons(context)
- }
- if (selectedTheater != null) {
- Text(
- text = selectedTheater.name,
- modifier = Modifier
- .weight(1f)
- .padding(start = 16.dp, end = 8.dp),
- fontSize = 15.sp,
- fontWeight = FontWeight.Bold,
- maxLines = 1,
- )
- val googleMapPackage = "com.google.android.apps.maps"
- MapButton(
- appIcon = remember(context, googleMapPackage) {
- launcherIcons.getAppIcon(context, googleMapPackage)
- },
- onClick = {
- val gmmIntentUri = selectedTheater.run {
- Uri.parse("geo:$lat,$lng?q=${Uri.encode(name)}")
- }
- val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
- mapIntent.setPackage(googleMapPackage)
- context.startActivity(mapIntent)
- },
- )
- val naverMapPackage = "com.nhn.android.nmap"
- MapButton(
- appIcon = remember(context, naverMapPackage) {
- launcherIcons.getAppIcon(context, naverMapPackage)
- },
- onClick = {
- val gmmIntentUri = selectedTheater.run {
- Uri.parse("nmap://place?lat=$lat&lng=$lng&name=${Uri.encode(name)}&appname=soup.movie")
- }
- val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
- mapIntent.setPackage(naverMapPackage)
- context.startActivity(mapIntent)
- },
- )
- val kakaoMapPackage = "net.daum.android.map"
- MapButton(
- appIcon = remember(context, kakaoMapPackage) {
- launcherIcons.getAppIcon(context, kakaoMapPackage)
- },
- onClick = {
- val gmmIntentUri = selectedTheater.run {
- Uri.parse("geo:$lat,$lng?q=${Uri.encode(name)}")
- }
- val mapIntent = Intent(Intent.ACTION_VIEW, gmmIntentUri)
- mapIntent.setPackage(kakaoMapPackage)
- context.startActivity(mapIntent)
- },
- )
- InfoButton(
- onClick = {
- selectedTheater.executeWeb(context)
- },
- )
- }
- }
-}
-
-@Composable
-private fun InfoButton(
- onClick: () -> Unit,
- modifier: Modifier = Modifier,
-) {
- IconButton(
- onClick = onClick,
- modifier = modifier
- .padding(8.dp)
- .requiredSize(48.dp),
- ) {
- Icon(
- MovieIcons.Info,
- contentDescription = null,
- )
- }
-}
-
-@Composable
-private fun MapButton(
- appIcon: Drawable?,
- onClick: () -> Unit,
- modifier: Modifier = Modifier,
-) {
- if (appIcon != null) {
- IconButton(
- onClick = onClick,
- modifier = modifier
- .padding(6.dp)
- .requiredSize(48.dp)
- .shadow(elevation = 12.dp, CircleShape),
- ) {
- Image(
- rememberDrawablePainter(appIcon),
- contentDescription = null,
- contentScale = ContentScale.Inside,
- )
- }
- }
-}
-
-private fun TheaterMarkerUiModel.getMarkerIcon(): OverlayImage {
- return when (this) {
- is CgvMarkerUiModel -> TheaterMarkerIcons.Cgv
- is LotteCinemaMarkerUiModel -> TheaterMarkerIcons.LotteCinema
- is MegaboxMarkerUiModel -> TheaterMarkerIcons.Megabox
- }
-}
-
-private object TheaterMarkerIcons {
- val Cgv = OverlayImage.fromResource(MovieIcons.MarkerCgv)
- val LotteCinema = OverlayImage.fromResource(MovieIcons.MarkerLotte)
- val Megabox = OverlayImage.fromResource(MovieIcons.MarkerMegabox)
-}
-
-private fun TheaterMarkerUiModel.executeWeb(ctx: Context) {
- return when (this) {
- is CgvMarkerUiModel ->
- Cgv.executeWeb(ctx, code)
- is LotteCinemaMarkerUiModel ->
- LotteCinema.executeWeb(ctx, code)
- is MegaboxMarkerUiModel ->
- Megabox.executeWeb(ctx, code)
- }
-}
diff --git a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/TheaterMapViewModel.kt b/feature/theatermap/src/main/java/soup/movie/feature/theatermap/TheaterMapViewModel.kt
deleted file mode 100644
index 102f723c0..000000000
--- a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/TheaterMapViewModel.kt
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2021 SOUP
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package soup.movie.feature.theatermap
-
-import androidx.compose.runtime.getValue
-import androidx.compose.runtime.mutableStateOf
-import androidx.compose.runtime.setValue
-import androidx.lifecycle.ViewModel
-import androidx.lifecycle.viewModelScope
-import dagger.hilt.android.lifecycle.HiltViewModel
-import kotlinx.coroutines.launch
-import soup.movie.data.repository.TheaterRepository
-import soup.movie.feature.theatermap.internal.CgvMarkerUiModel
-import soup.movie.feature.theatermap.internal.LotteCinemaMarkerUiModel
-import soup.movie.feature.theatermap.internal.MegaboxMarkerUiModel
-import soup.movie.feature.theatermap.internal.TheaterMarkerUiModel
-import soup.movie.log.Logger
-import soup.movie.model.TheaterAreaGroupModel
-import javax.inject.Inject
-
-@HiltViewModel
-class TheaterMapViewModel @Inject constructor(
- private val repository: TheaterRepository,
-) : ViewModel() {
-
- var uiModel by mutableStateOf>(emptyList())
- private set
-
- var selectedTheater by mutableStateOf(null)
- private set
-
- init {
- viewModelScope.launch {
- uiModel = loadUiModel()
- }
- }
-
- fun onRefresh() {
- viewModelScope.launch {
- if (uiModel.isEmpty()) {
- uiModel = loadUiModel()
- }
- }
- }
-
- fun onTheaterSelected(theater: TheaterMarkerUiModel) {
- selectedTheater = theater
- }
-
- fun onTheaterUnselected() {
- selectedTheater = null
- }
-
- private suspend fun loadUiModel(): List {
- return try {
- repository.getCodeList().toTheaterList()
- } catch (t: Throwable) {
- Logger.w(t)
- emptyList()
- }
- }
-
- private fun TheaterAreaGroupModel.toTheaterList(): List {
- return cgv.flatMap { group ->
- group.theaterList.map {
- CgvMarkerUiModel(
- areaCode = group.area.code,
- code = it.code,
- name = "CGV ${it.name}",
- lat = it.lat,
- lng = it.lng,
- )
- }
- } + lotte.flatMap { group ->
- group.theaterList.map {
- LotteCinemaMarkerUiModel(
- areaCode = group.area.code,
- code = it.code,
- name = "롯데시네마 ${it.name}",
- lat = it.lat,
- lng = it.lng,
- )
- }
- } + megabox.flatMap { group ->
- group.theaterList.map {
- MegaboxMarkerUiModel(
- areaCode = group.area.code,
- code = it.code,
- name = "메가박스 ${it.name}",
- lat = it.lat,
- lng = it.lng,
- )
- }
- }
- }
-}
diff --git a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/internal/LauncherIcons.kt b/feature/theatermap/src/main/java/soup/movie/feature/theatermap/internal/LauncherIcons.kt
deleted file mode 100644
index 20abb8d5b..000000000
--- a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/internal/LauncherIcons.kt
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright 2017 SOUP
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package soup.movie.feature.theatermap.internal
-
-import android.content.Context
-import android.content.pm.PackageManager
-import android.graphics.Bitmap
-import android.graphics.Canvas
-import android.graphics.Color
-import android.graphics.Paint
-import android.graphics.drawable.AdaptiveIconDrawable
-import android.graphics.drawable.Drawable
-import android.graphics.drawable.DrawableWrapper
-import android.os.Build
-import android.util.SparseArray
-import androidx.annotation.RequiresApi
-import soup.movie.log.Logger
-import kotlin.math.max
-
-/**
- * Utility class to handle icon treatments (e.g., shadow generation) for the Launcher icons.
- */
-class LauncherIcons(context: Context) {
-
- private val shadowCache = SparseArray()
- private val iconSize = context.resources.getDimensionPixelSize(android.R.dimen.app_icon_size)
-
- fun getAppIcon(context: Context, packageName: String): Drawable? {
- return try {
- val pm = context.packageManager
- val appInfo = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
- pm.getApplicationInfo(packageName, PackageManager.ApplicationInfoFlags.of(0))
- } else {
- pm.getApplicationInfo(packageName, 0)
- }
- getShadowedIcon(pm.getApplicationIcon(appInfo))
- } catch (e: PackageManager.NameNotFoundException) {
- Logger.w(e)
- null
- }
- }
-
- fun getShadowedIcon(drawable: Drawable): Drawable {
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
- return drawable
- }
- if (drawable !is AdaptiveIconDrawable) {
- return drawable
- }
- val shadow = getShadowBitmap(drawable)
- return ShadowDrawable(
- shadow,
- drawable,
- )
- }
-
- @RequiresApi(api = Build.VERSION_CODES.O)
- private fun getShadowBitmap(d: AdaptiveIconDrawable): Bitmap {
- val shadowSize = max(iconSize, d.intrinsicHeight)
- synchronized(shadowCache) {
- val shadow = shadowCache[shadowSize]
- if (shadow != null) {
- return shadow
- }
- }
-
- d.setBounds(0, 0, shadowSize, shadowSize)
-
- val blur = ICON_SIZE_BLUR_FACTOR * shadowSize
- val keyShadowDistance = ICON_SIZE_KEY_SHADOW_DELTA_FACTOR * shadowSize
- val bitmapSize = (shadowSize + 2 * blur + keyShadowDistance).toInt()
- val shadow = Bitmap.createBitmap(bitmapSize, bitmapSize, Bitmap.Config.ARGB_8888)
-
- val canvas = Canvas(shadow)
- canvas.translate(blur + keyShadowDistance / 2, blur)
-
- val paint = Paint(Paint.ANTI_ALIAS_FLAG)
- paint.color = Color.TRANSPARENT
-
- // Draw ambient shadow
- paint.setShadowLayer(blur, 0f, 0f, AMBIENT_SHADOW_ALPHA shl 24)
- canvas.drawPath(d.iconMask, paint)
-
- // Draw key shadow
- canvas.translate(0f, keyShadowDistance)
- paint.setShadowLayer(blur, 0f, 0f, KEY_SHADOW_ALPHA shl 24)
- canvas.drawPath(d.iconMask, paint)
-
- canvas.setBitmap(null)
- synchronized(shadowCache) {
- shadowCache.put(shadowSize, shadow)
- }
- return shadow
- }
-
- /**
- * A drawable which draws a shadow bitmap behind a drawable
- */
- class ShadowDrawable : DrawableWrapper {
-
- private val state: MyConstantState
-
- constructor(shadow: Bitmap, dr: Drawable) : super(dr) {
- this.state =
- MyConstantState(
- shadow,
- dr.constantState!!,
- )
- }
-
- constructor(state: MyConstantState) : super(state.childState.newDrawable()) {
- this.state = state
- }
-
- override fun getConstantState(): ConstantState? {
- return state
- }
-
- override fun draw(canvas: Canvas) {
- val bounds = bounds
- canvas.drawBitmap(state.shadow, null, bounds, state.paint)
- canvas.save()
- // Ratio of child drawable size to shadow bitmap size
- val factor = 1 / (1 + 2 * ICON_SIZE_BLUR_FACTOR + ICON_SIZE_KEY_SHADOW_DELTA_FACTOR)
-
- canvas.translate(
- bounds.width() * factor * (ICON_SIZE_BLUR_FACTOR + ICON_SIZE_KEY_SHADOW_DELTA_FACTOR / 2),
- bounds.height() * factor * ICON_SIZE_BLUR_FACTOR,
- )
- canvas.scale(factor, factor)
- super.draw(canvas)
- canvas.restore()
- }
-
- class MyConstantState internal constructor(
- val shadow: Bitmap,
- val childState: ConstantState,
- ) : ConstantState() {
-
- val paint = Paint(Paint.FILTER_BITMAP_FLAG)
-
- override fun newDrawable(): Drawable {
- return ShadowDrawable(
- this,
- )
- }
-
- override fun getChangingConfigurations(): Int {
- return childState.changingConfigurations
- }
- }
- }
-
- companion object {
- // Percent of actual icon size
- private const val ICON_SIZE_BLUR_FACTOR = 0.5f / 48
-
- // Percent of actual icon size
- private const val ICON_SIZE_KEY_SHADOW_DELTA_FACTOR = 1f / 48
-
- private const val KEY_SHADOW_ALPHA = 61
- private const val AMBIENT_SHADOW_ALPHA = 30
- }
-}
diff --git a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/internal/TheaterMapUiModel.kt b/feature/theatermap/src/main/java/soup/movie/feature/theatermap/internal/TheaterMapUiModel.kt
deleted file mode 100644
index e76b2918c..000000000
--- a/feature/theatermap/src/main/java/soup/movie/feature/theatermap/internal/TheaterMapUiModel.kt
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2021 SOUP
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package soup.movie.feature.theatermap.internal
-
-sealed class TheaterMarkerUiModel {
- abstract val areaCode: String
- abstract val code: String
- abstract val name: String
- abstract val lng: Double
- abstract val lat: Double
-}
-
-internal class CgvMarkerUiModel(
- override val areaCode: String,
- override val code: String,
- override val name: String,
- override val lng: Double,
- override val lat: Double,
-) : TheaterMarkerUiModel()
-
-internal class LotteCinemaMarkerUiModel(
- override val areaCode: String,
- override val code: String,
- override val name: String,
- override val lng: Double,
- override val lat: Double,
-) : TheaterMarkerUiModel()
-
-internal class MegaboxMarkerUiModel(
- override val areaCode: String,
- override val code: String,
- override val name: String,
- override val lng: Double,
- override val lat: Double,
-) : TheaterMarkerUiModel()
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 032d90dd4..d304f9ecb 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -37,8 +37,6 @@ firebase-perf = "1.4.2"
# Compose
compose-bom = "2024.09.03"
-accompanist = "0.36.0"
-navermap-compose = "1.5.7"
readmore = "1.5.6"
materialmotion = "1.1.3"
photo-compose = "1.0.1"
@@ -112,16 +110,12 @@ compose-materialIconsExtended = { module = "androidx.compose.material:material-i
compose-ui = { module = "androidx.compose.ui:ui" }
compose-animation-graphics = { module = "androidx.compose.animation:animation-graphics" }
-accompanist-drawablepainter = { module = "com.google.accompanist:accompanist-drawablepainter", version.ref = "accompanist" }
-
readmore-material = { module = "com.webtoonscorp.android:readmore-material", version.ref = "readmore" }
photo-compose = { module = "io.github.fornewid:photo-compose", version.ref = "photo-compose" }
materialmotion-compose-core = { module = "io.github.fornewid:material-motion-compose-core", version.ref = "materialmotion" }
-navermap-compose = { module = "io.github.fornewid:naver-map-compose", version.ref = "navermap-compose" }
-
# Test
test-junit = "junit:junit:4.13.2"
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 3e45764a2..3fa19b254 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -20,19 +20,6 @@ dependencyResolutionManagement {
includeGroup("com.google.testing.platform")
}
}
- maven {
- url = uri("https://devrepo.kakao.com/nexus/content/groups/public/")
- content {
- includeGroup("com.kakao.sdk")
- }
- }
- maven {
- url = uri("https://repository.map.naver.com/archive/maven")
- content {
- includeGroup("com.naver.maps")
- }
- }
-
mavenCentral()
}
}