Skip to content

Commit

Permalink
feat : [공연 상세] 전화/문자로 문의하기 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
HamBP committed May 20, 2024
1 parent d7bf01e commit d80c5c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions presentation/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.CALL_PHONE" />

</manifest>
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.nexters.boolti.presentation.screen.showdetail

import android.content.Intent
import android.net.Uri
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
Expand All @@ -20,6 +22,7 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.nexters.boolti.presentation.R
Expand All @@ -34,6 +37,7 @@ fun InquiryBottomSheet(
contact: String,
) {
val textId = if (isTelephone) R.string.show_call_to_ask else R.string.show_text_to_ask
val context = LocalContext.current

ModalBottomSheet(
containerColor = MaterialTheme.colorScheme.surfaceTint,
Expand All @@ -53,7 +57,12 @@ fun InquiryBottomSheet(
Modifier
.height(58.dp)
.fillMaxWidth()
.clickable { }
.clickable {
val uriKey = if (isTelephone) "tel" else "smsto"
val action = if (isTelephone) Intent.ACTION_DIAL else Intent.ACTION_SENDTO
val intent = Intent(action).setData(Uri.parse("$uriKey:$contact"))
context.startActivity(intent)
}
.padding(horizontal = 24.dp, vertical = 18.dp)) {
Text(
text = stringResource(id = textId),
Expand Down

0 comments on commit d80c5c8

Please sign in to comment.