Skip to content

Commit

Permalink
feat: 초대 공유 인텐트 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
CChuYong committed Jan 30, 2024
1 parent f1a3a8d commit d9fcf10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import android.content.Intent
import androidx.compose.runtime.Composable
import androidx.navigation.NavBackStackEntry
import androidx.navigation.NavHostController
import com.no5ing.bbibbi.R
import com.no5ing.bbibbi.presentation.feature.view.main.family.FamilyPage
import com.no5ing.bbibbi.presentation.feature.view_controller.NavigationDestination
import com.no5ing.bbibbi.presentation.feature.view_controller.main.ProfilePageController.goProfilePage
import com.no5ing.bbibbi.presentation.feature.view_controller.main.SettingHomePageController.goSettingHomePage
import com.no5ing.bbibbi.util.getLinkIdFromUrl
import com.no5ing.bbibbi.util.localResources

object FamilyListPageController : NavigationDestination(
route = mainFamilyPageRoute,
) {
@Composable
override fun Render(navController: NavHostController, backStackEntry: NavBackStackEntry) {
val resources = localResources()
FamilyPage(
onDispose = {
navController.popBackStack()
Expand All @@ -22,9 +26,11 @@ object FamilyListPageController : NavigationDestination(
navController.goProfilePage(it.memberId)
},
onTapShare = { url ->
val linkId = getLinkIdFromUrl(url)
val payload = resources.getString(R.string.share_link_payload, url, linkId)
val sendIntent = Intent(Intent.ACTION_SEND).apply {
putExtra(Intent.EXTRA_SUBJECT, "초대하기")
putExtra(Intent.EXTRA_TEXT, url)
putExtra(Intent.EXTRA_TEXT, payload)
type = "text/plain"
}
val shareIntent = Intent.createChooser(sendIntent, "Share URL")
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,5 @@
<string name="unsaved_post_dialog_message">저장되지 않은 게시물이 있어요.\n게시물 작성 화면으로 돌아갈까요?</string>
<string name="post_upload_sample_text">여덟자로입력해요</string>
<string name="build_number_info">빌드번호 %1$s</string>
<string name="share_link_payload">링크로 입장한 뒤 초대코드를 입력하세요.\n\n%1$s\n초대코드 : %2$s</string>
</resources>

0 comments on commit d9fcf10

Please sign in to comment.