Skip to content

Commit

Permalink
Merge pull request #324 from Nexters/feature/317
Browse files Browse the repository at this point in the history
317 공연 공유 텍스트 변경
  • Loading branch information
HamBP authored Nov 2, 2024
2 parents 32cd9ab + d313c8a commit 286d4ad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringArrayResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.style.TextOverflow
Expand All @@ -70,6 +69,7 @@ import com.nexters.boolti.presentation.component.ShowInquiry
import com.nexters.boolti.presentation.component.SmallButton
import com.nexters.boolti.presentation.component.UserThumbnail
import com.nexters.boolti.presentation.extension.requireActivity
import com.nexters.boolti.presentation.extension.showDateTimeString
import com.nexters.boolti.presentation.screen.LocalSnackbarController
import com.nexters.boolti.presentation.screen.ticketing.ChooseTicketBottomSheet
import com.nexters.boolti.presentation.screen.ticketing.TicketBottomSheetType
Expand All @@ -85,7 +85,6 @@ import com.nexters.boolti.presentation.theme.point3
import com.nexters.boolti.presentation.util.UrlParser
import kotlinx.coroutines.launch
import timber.log.Timber
import java.time.format.DateTimeFormatter
import kotlin.math.ceil

@Composable
Expand Down Expand Up @@ -143,7 +142,7 @@ fun ShowDetailScreen(
modifier = modifier,
topBar = {
ShowDetailAppBar(
showId = uiState.showDetail.id,
showDetail = uiState.showDetail,
onBack = { viewModel.sendEvent(ShowDetailEvent.PopBackStack) },
onClickHome = onClickHome,
navigateToReport = navigateToReport,
Expand Down Expand Up @@ -252,7 +251,7 @@ fun ShowDetailScreen(

@Composable
private fun ShowDetailAppBar(
showId: String,
showDetail: ShowDetail,
onBack: () -> Unit,
onClickHome: () -> Unit,
navigateToReport: () -> Unit,
Expand All @@ -261,6 +260,18 @@ private fun ShowDetailAppBar(
var isContextMenuVisible by rememberSaveable {
mutableStateOf(false)
}
val dateString = "${showDetail.date.showDateTimeString} -"
val addressString =
"${showDetail.placeName} / ${showDetail.streetAddress}, ${showDetail.detailAddress}"
val previewUrl = "https://preview.boolti.in/show/${showDetail.id}"
val sharingText = stringResource(
R.string.show_share_format,
showDetail.name,
dateString,
addressString,
previewUrl
)

BtAppBar(
colors = BtAppBarDefaults.appBarColors(
containerColor = MaterialTheme.colorScheme.surface,
Expand All @@ -284,10 +295,7 @@ private fun ShowDetailAppBar(
onClick = {
val sendIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(
Intent.EXTRA_TEXT,
"https://preview.boolti.in/show/$showId"
)
putExtra(Intent.EXTRA_TEXT, sharingText)
type = "text/plain"
}
val shareIntent = Intent.createChooser(sendIntent, null)
Expand Down Expand Up @@ -409,16 +417,14 @@ private fun LazyListScope.ShowInfoTab(

item {
// 일시
val daysOfWeek = stringArrayResource(id = R.array.days_of_week)
val indexOfDay = showDetail.date.dayOfWeek.value - 1
val minute = stringResource(id = R.string.ticketing_minutes)
// ex. 2024.01.20 (토) / 18:00 (150분)
val formatter =
DateTimeFormatter.ofPattern("yyyy.MM.dd (${daysOfWeek[indexOfDay]}) / HH:mm (${showDetail.runningTime}${minute})")
val minute = stringResource(id = R.string.ticketing_minutes)
val dateTimeString =
showDetail.date.showDateTimeString + " (${showDetail.runningTime}${minute})"
Section(
modifier = paddingModifier.padding(top = 8.dp),
title = { SectionTitle(stringResource(id = R.string.ticketing_datetime)) },
content = { SectionContent(text = showDetail.date.format(formatter)) },
content = { SectionContent(text = dateTimeString) },
)
}

Expand Down
10 changes: 10 additions & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,16 @@
<string name="show_tab_cast">출연진</string>
<string name="empty_cast_title">COMING SOON</string>
<string name="empty_cast_desc">조금만 기다려주세요!</string>
<string name="show_share_format">
공연 정보를 공유드려요!\n
\n
- 공연명 : %s\n
- 일시 : %s\n
- 장소 : %s\n
\n
공연 상세 정보 ▼\n
%s
</string>

<!-- 입장 코드 -->
<string name="manager_code">입장 코드</string>
Expand Down

0 comments on commit 286d4ad

Please sign in to comment.