diff --git a/core/designsystem/src/main/java/soup/movie/core/designsystem/theme/Colors.kt b/core/designsystem/src/main/java/soup/movie/core/designsystem/theme/Colors.kt index 508dbe84a..51a663dbf 100644 --- a/core/designsystem/src/main/java/soup/movie/core/designsystem/theme/Colors.kt +++ b/core/designsystem/src/main/java/soup/movie/core/designsystem/theme/Colors.kt @@ -29,8 +29,6 @@ data class MovieColors( val divider: Color, val star: Color, val dim: Color, - val naver: Color, - val onNaver: Color, val cgv: Color, val onCgv: Color, val lotte: Color, @@ -66,8 +64,6 @@ fun lightMovieColors( divider: Color = Color(0xFFF5F5F5), star: Color = Color(0xFFFFC107), dim: Color = Color(0xDDFFFFFF), - naver: Color = Color(0xFF1EC800), - onNaver: Color = material.surface, cgv: Color = Color.White, onCgv: Color = Color(0xFFE51F20), lotte: Color = Color(0xFFED1D24), @@ -85,8 +81,6 @@ fun lightMovieColors( divider = divider, star = star, dim = dim, - naver = naver, - onNaver = onNaver, cgv = cgv, onCgv = onCgv, lotte = lotte, @@ -106,8 +100,6 @@ fun darkMovieColors( divider: Color = Color(0xFF212121), star: Color = Color(0xFFFFC107), dim: Color = Color(0xAA000000), - naver: Color = Color(0xFF1EC800), - onNaver: Color = material.surface, cgv: Color = Color.White, onCgv: Color = Color(0xFFE51F20), lotte: Color = Color(0xFFED1D24), @@ -125,8 +117,6 @@ fun darkMovieColors( divider = divider, star = star, dim = dim, - naver = naver, - onNaver = onNaver, cgv = cgv, onCgv = onCgv, lotte = lotte, diff --git a/data/model/src/main/java/soup/movie/model/MovieDetailModel.kt b/data/model/src/main/java/soup/movie/model/MovieDetailModel.kt index 3f755aa64..531da8aaa 100644 --- a/data/model/src/main/java/soup/movie/model/MovieDetailModel.kt +++ b/data/model/src/main/java/soup/movie/model/MovieDetailModel.kt @@ -44,7 +44,6 @@ data class MovieDetailModel( val cgv: CgvInfoModel?, val lotte: LotteInfoModel?, val megabox: MegaboxInfoModel?, - val naver: NaverInfoModel?, val imdb: ImdbInfoModel?, val rt: RottenTomatoInfoModel?, val mc: MetascoreInfoModel?, diff --git a/data/model/src/main/java/soup/movie/model/NaverInfoModel.kt b/data/model/src/main/java/soup/movie/model/NaverInfoModel.kt deleted file mode 100644 index f1414c341..000000000 --- a/data/model/src/main/java/soup/movie/model/NaverInfoModel.kt +++ /dev/null @@ -1,21 +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.model - -data class NaverInfoModel( - val star: String, - val url: String?, -) diff --git a/data/network/api/src/main/java/soup/movie/data/network/response/MovieDetailResponse.kt b/data/network/api/src/main/java/soup/movie/data/network/response/MovieDetailResponse.kt index 0c23bf132..da18cb865 100644 --- a/data/network/api/src/main/java/soup/movie/data/network/response/MovieDetailResponse.kt +++ b/data/network/api/src/main/java/soup/movie/data/network/response/MovieDetailResponse.kt @@ -50,7 +50,6 @@ class MovieDetailResponse( val cgv: CgvInfoResponse? = null, val lotte: LotteInfoResponse? = null, val megabox: MegaboxInfoResponse? = null, - val naver: NaverInfoResponse? = null, val imdb: ImdbInfoResponse? = null, val rt: RottenTomatoInfoResponse? = null, val mc: MetascoreInfoResponse? = null, @@ -78,7 +77,6 @@ fun MovieDetailResponse.asModel(): MovieDetailModel { cgv = cgv?.asModel(), lotte = lotte?.asModel(), megabox = megabox?.asModel(), - naver = naver?.asModel(), imdb = imdb?.asModel(), rt = rt?.asModel(), mc = mc?.asModel(), diff --git a/data/network/api/src/main/java/soup/movie/data/network/response/NaverInfoResponse.kt b/data/network/api/src/main/java/soup/movie/data/network/response/NaverInfoResponse.kt deleted file mode 100644 index 740b82e4d..000000000 --- a/data/network/api/src/main/java/soup/movie/data/network/response/NaverInfoResponse.kt +++ /dev/null @@ -1,32 +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.data.network.response - -import kotlinx.serialization.Serializable -import soup.movie.model.NaverInfoModel - -@Serializable -class NaverInfoResponse( - val star: String, - val url: String? = null, -) - -fun NaverInfoResponse.asModel(): NaverInfoModel { - return NaverInfoModel( - star = star, - url = url, - ) -} diff --git a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/BoxOffice.kt b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/BoxOffice.kt new file mode 100644 index 000000000..7d7e88d88 --- /dev/null +++ b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/BoxOffice.kt @@ -0,0 +1,141 @@ +/* + * Copyright 2024 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.detail.impl + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.alpha +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import soup.movie.core.designsystem.theme.MovieTheme +import soup.movie.resources.R + +@OptIn(ExperimentalMaterialApi::class) +@Composable +fun BoxOffice( + uiModel: BoxOfficeItemUiModel, + onClick: () -> Unit, +) { + Card( + onClick = onClick, + modifier = Modifier.padding(start = 12.dp, end = 12.dp, bottom = 8.dp), + shape = RoundedCornerShape(16.dp), + backgroundColor = MovieTheme.colors.surface, + elevation = MovieTheme.elevations.card, + ) { + Row( + modifier = Modifier + .padding(top = 12.dp, bottom = 14.dp) + .fillMaxWidth(), + ) { + Column( + modifier = Modifier.weight(1f), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Text( + text = "박스오피스", + color = MovieTheme.colors.onSurface, + style = MovieTheme.typography.body2, + modifier = Modifier.alpha(0.7f), + ) + Text( + text = stringResource(R.string.rank, uiModel.rank), + color = MovieTheme.colors.onSurface, + style = MovieTheme.typography.subtitle1, + fontSize = 18.sp, + fontWeight = FontWeight.Bold, + modifier = Modifier.padding(top = 2.dp), + ) + Text( + text = stringResource(R.string.rank_date, uiModel.rankDate), + color = MovieTheme.colors.surface, + style = MovieTheme.typography.body2, + fontSize = 12.sp, + fontWeight = FontWeight.Bold, + modifier = Modifier + .padding(top = 6.dp) + .background( + color = MovieTheme.colors.onSurface, + shape = RoundedCornerShape(percent = 50), + ) + .padding(vertical = 1.dp, horizontal = 8.dp), + ) + } + Column( + modifier = Modifier.weight(1f), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + Text( + text = "누적 관객수", + color = MovieTheme.colors.onSurface, + style = MovieTheme.typography.body2, + modifier = Modifier.alpha(0.7f), + ) + Text( + text = stringResource(R.string.audience, uiModel.audience), + color = MovieTheme.colors.onSurface, + style = MovieTheme.typography.subtitle1, + fontSize = 18.sp, + fontWeight = FontWeight.Bold, + modifier = Modifier.padding(top = 2.dp), + ) + Text( + text = stringResource(R.string.screen_days, uiModel.screenDays), + color = MovieTheme.colors.surface, + style = MovieTheme.typography.body2, + fontSize = 12.sp, + fontWeight = FontWeight.Bold, + modifier = Modifier + .padding(top = 6.dp) + .background( + color = MovieTheme.colors.onSurface, + shape = RoundedCornerShape(percent = 50), + ) + .padding(vertical = 1.dp, horizontal = 8.dp), + ) + } + } + } +} + +@Preview +@Composable +private fun BoxOfficePreview() { + MovieTheme { + BoxOffice( + uiModel = BoxOfficeItemUiModel( + rank = 1, + rankDate = "2024.11.10.", + audience = 1000, + screenDays = 7, + ), + onClick = {}, + ) + } +} diff --git a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailList.kt b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailList.kt index b2737554b..1235b0f81 100644 --- a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailList.kt +++ b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailList.kt @@ -19,7 +19,6 @@ import androidx.compose.animation.animateContentSize import androidx.compose.animation.core.tween import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.Image -import androidx.compose.foundation.background import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -48,7 +47,6 @@ import androidx.compose.material.ChipDefaults import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.IconButton import androidx.compose.material.Text -import androidx.compose.material.TextButton import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -56,7 +54,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.alpha import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.RectangleShape @@ -68,7 +65,6 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import com.webtoonscorp.android.readmore.material.ReadMoreText import soup.movie.core.designsystem.icon.MovieIcons import soup.movie.core.designsystem.theme.MovieTheme @@ -123,12 +119,6 @@ internal fun DetailList( ) } } - is NaverItemUiModel -> { - Naver( - uiModel = item, - onClick = { onItemClick(item) }, - ) - } is ImdbItemUiModel -> { Imdb( uiModel = item, @@ -168,133 +158,6 @@ internal fun DetailList( } } -@OptIn(ExperimentalMaterialApi::class) -@Composable -private fun BoxOffice( - uiModel: BoxOfficeItemUiModel, - onClick: () -> Unit, -) { - Card( - onClick = onClick, - modifier = Modifier.padding(start = 12.dp, end = 12.dp, bottom = 8.dp), - shape = RoundedCornerShape(16.dp), - backgroundColor = MovieTheme.colors.surface, - elevation = MovieTheme.elevations.card, - ) { - Row( - modifier = Modifier.padding(top = 12.dp, bottom = 14.dp).fillMaxWidth(), - ) { - Column( - modifier = Modifier.weight(1f), - horizontalAlignment = Alignment.CenterHorizontally, - ) { - Text( - text = "박스오피스", - color = MovieTheme.colors.onSurface, - style = MovieTheme.typography.body2, - modifier = Modifier.alpha(0.7f), - ) - Text( - text = stringResource(R.string.rank, uiModel.rank), - color = MovieTheme.colors.onSurface, - style = MovieTheme.typography.subtitle1, - fontSize = 18.sp, - fontWeight = FontWeight.Bold, - modifier = Modifier.padding(top = 2.dp), - ) - Text( - text = stringResource(R.string.rank_date, uiModel.rankDate), - color = MovieTheme.colors.surface, - style = MovieTheme.typography.body2, - fontSize = 12.sp, - fontWeight = FontWeight.Bold, - modifier = Modifier - .padding(top = 6.dp) - .background( - color = MovieTheme.colors.onSurface, - shape = RoundedCornerShape(percent = 50), - ) - .padding(vertical = 1.dp, horizontal = 8.dp), - ) - } - Column( - modifier = Modifier.weight(1f), - horizontalAlignment = Alignment.CenterHorizontally, - ) { - Text( - text = "누적 관객수", - color = MovieTheme.colors.onSurface, - style = MovieTheme.typography.body2, - modifier = Modifier.alpha(0.7f), - ) - Text( - text = stringResource(R.string.audience, uiModel.audience), - color = MovieTheme.colors.onSurface, - style = MovieTheme.typography.subtitle1, - fontSize = 18.sp, - fontWeight = FontWeight.Bold, - modifier = Modifier.padding(top = 2.dp), - ) - Text( - text = stringResource(R.string.screen_days, uiModel.screenDays), - color = MovieTheme.colors.surface, - style = MovieTheme.typography.body2, - fontSize = 12.sp, - fontWeight = FontWeight.Bold, - modifier = Modifier - .padding(top = 6.dp) - .background( - color = MovieTheme.colors.onSurface, - shape = RoundedCornerShape(percent = 50), - ) - .padding(vertical = 1.dp, horizontal = 8.dp), - ) - } - Column( - modifier = Modifier.weight(1f), - horizontalAlignment = Alignment.CenterHorizontally, - ) { - Text( - text = "평점", - color = MovieTheme.colors.onSurface, - style = MovieTheme.typography.body2, - modifier = Modifier.alpha(0.7f), - ) - Row( - horizontalArrangement = Arrangement.Center, - verticalAlignment = Alignment.CenterVertically, - ) { - StarIcon(modifier = Modifier.requiredSize(16.dp)) - Text( - text = uiModel.rating, - color = MovieTheme.colors.onSurface, - style = MovieTheme.typography.subtitle1, - fontSize = 18.sp, - fontWeight = FontWeight.Bold, - maxLines = 1, - overflow = TextOverflow.Ellipsis, - modifier = Modifier.padding(top = 2.dp, start = 2.dp, end = 12.dp), - ) - } - Text( - text = "NAVER", - color = MovieTheme.colors.onNaver, - style = MovieTheme.typography.body2, - fontSize = 12.sp, - fontWeight = FontWeight.Bold, - modifier = Modifier - .padding(top = 6.dp) - .background( - color = MovieTheme.colors.naver, - shape = RoundedCornerShape(percent = 50), - ) - .padding(vertical = 1.dp, horizontal = 8.dp), - ) - } - } - } -} - @OptIn(ExperimentalMaterialApi::class) @Composable private fun Cgv( @@ -498,68 +361,6 @@ private fun Plot( } } -@OptIn(ExperimentalMaterialApi::class) -@Composable -private fun Naver( - uiModel: NaverItemUiModel, - onClick: () -> Unit, -) { - Card( - modifier = Modifier.padding(start = 12.dp, end = 12.dp, bottom = 8.dp), - shape = RoundedCornerShape(16.dp), - backgroundColor = MovieTheme.colors.surface, - elevation = MovieTheme.elevations.card, - ) { - Row( - modifier = Modifier.padding(vertical = 4.dp), - verticalAlignment = Alignment.CenterVertically, - ) { - Chip( - onClick = onClick, - modifier = Modifier.padding(horizontal = 12.dp), - colors = ChipDefaults.chipColors( - backgroundColor = MovieTheme.colors.naver, - contentColor = Color.White, - ), - ) { - Text( - text = "네이버", - style = MovieTheme.typography.body2, - fontWeight = FontWeight.Bold, - ) - } - Row( - modifier = Modifier.weight(1f), - horizontalArrangement = Arrangement.Center, - verticalAlignment = Alignment.CenterVertically, - ) { - StarIcon(modifier = Modifier.requiredSize(width = 24.dp, height = 36.dp)) - Text( - text = uiModel.rating, - color = MovieTheme.colors.onSurface, - style = MovieTheme.typography.body2, - fontWeight = FontWeight.Bold, - modifier = Modifier.padding(start = 4.dp), - ) - } - TextButton( - onClick = onClick, - modifier = Modifier.fillMaxHeight(), - ) { - Text( - text = "자세히보기", - color = MovieTheme.colors.secondary, - fontSize = 14.sp, - fontWeight = FontWeight.Bold, - modifier = Modifier - .padding(horizontal = 16.dp) - .align(Alignment.CenterVertically), - ) - } - } - } -} - @OptIn(ExperimentalMaterialApi::class) @Composable private fun Imdb( diff --git a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailScreen.kt b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailScreen.kt index c03fd9375..b73ce564b 100644 --- a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailScreen.kt +++ b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailScreen.kt @@ -57,12 +57,6 @@ internal fun DetailScreen( }, onItemClick = { item -> when (item) { - is BoxOfficeItemUiModel -> { - context.executeWeb(item.webLink) - } - is NaverItemUiModel -> { - context.executeWeb(item.webLink) - } is ImdbItemUiModel -> { context.executeWeb(item.webLink) } diff --git a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailUiModel.kt b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailUiModel.kt index 06f363470..567dcf72d 100644 --- a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailUiModel.kt +++ b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailUiModel.kt @@ -71,20 +71,12 @@ class MegaboxItemUiModel( val webLink: String?, ) -@Keep -class NaverItemUiModel( - val rating: String, - val webLink: String?, -) : ContentItemUiModel() - @Keep class BoxOfficeItemUiModel( val rank: Int, val rankDate: String, val audience: Int, val screenDays: Int, - val rating: String, - val webLink: String?, ) : ContentItemUiModel() @Keep @@ -130,7 +122,6 @@ class TrailerFooterItemUiModel( val ContentItemUiModel.id: String get() = when (this) { is TheatersItemUiModel -> "theaters" - is NaverItemUiModel -> "naver" is BoxOfficeItemUiModel -> "boxoffice" is ImdbItemUiModel -> "imdb" is PlotItemUiModel -> "plot" diff --git a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailViewModel.kt b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailViewModel.kt index ecc010f39..2ab0e6a90 100644 --- a/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailViewModel.kt +++ b/feature/detail/impl/src/main/java/soup/movie/feature/detail/impl/DetailViewModel.kt @@ -122,8 +122,6 @@ class DetailViewModel @Inject constructor( rankDate = yesterday().MM_DD(), audience = audiAcc, screenDays = screenDays(), - rating = naver?.star ?: NO_RATING, - webLink = naver?.url, ), ) } @@ -159,16 +157,6 @@ class DetailViewModel @Inject constructor( ), ), ) - if (boxOffice == null) { - naver?.run { - items.add( - NaverItemUiModel( - rating = star, - webLink = url, - ), - ) - } - } val plot = plot.orEmpty() if (plot.isNotBlank()) {