Skip to content

Commit

Permalink
#5 [FEAT] 공유 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
gaeulzzang committed Dec 30, 2024
1 parent 7403f17 commit 490bfe0
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.sopt.presentation.groupDetail

import android.content.Intent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand Down Expand Up @@ -36,11 +37,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.core.content.ContextCompat
import androidx.hilt.navigation.compose.hiltViewModel
import com.sopt.core.designsystem.component.button.NoostakFloatingActionButton
import com.sopt.core.designsystem.component.topappbar.NoostakTopAppBar
Expand Down Expand Up @@ -101,6 +104,8 @@ fun GroupDetailScreen(
onGroupMemberClick: (Long) -> Unit
) {
val pagerState = rememberPagerState { tabs.size }
val context = LocalContext.current

Scaffold(
modifier = Modifier
.statusBarsPadding()
Expand Down Expand Up @@ -154,6 +159,16 @@ fun GroupDetailScreen(
.size(24.dp)
.noRippleClickable {
// 공유 기능
val sendIntent = Intent().apply {
action = Intent.ACTION_SEND
putExtra(
Intent.EXTRA_TEXT,
"공유하고자 하는 그룹 아이디: $groupId"
)
type = "text/plain"
}
val shareIntent = Intent.createChooser(sendIntent, null)
ContextCompat.startActivity(context, shareIntent, null)
},
imageVector = ImageVector.vectorResource(id = R.drawable.ic_share),
contentDescription = null,
Expand Down

0 comments on commit 490bfe0

Please sign in to comment.