-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
package com.lgtm.android.mission_suggestion.ui.detail | ||
|
||
import android.content.ActivityNotFoundException | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.os.Bundle | ||
import android.widget.Toast | ||
import androidx.activity.viewModels | ||
import androidx.compose.runtime.Composable | ||
import com.lgtm.android.common_ui.base.BaseComposeActivity | ||
|
@@ -21,7 +25,8 @@ class SuggestionDetailActivity: BaseComposeActivity(){ | |
override fun Content() { | ||
LGTMTheme { | ||
SuggestionDetailScreen( | ||
onBackButtonClick = ::setBackButtonClick | ||
onBackButtonClick = ::setBackButtonClick, | ||
onReportSuggestionClick = ::setReportSuggestionClick | ||
) | ||
} | ||
} | ||
|
@@ -38,6 +43,20 @@ class SuggestionDetailActivity: BaseComposeActivity(){ | |
finish() | ||
} | ||
|
||
private fun setReportSuggestionClick() { | ||
val intent = Intent(Intent.ACTION_SENDTO).apply { | ||
data = Uri.parse("mailto:") | ||
putExtra(Intent.EXTRA_EMAIL, arrayOf("[email protected]")) | ||
putExtra(Intent.EXTRA_SUBJECT, "[LGTM] 미션 제안 불편사항 신고") | ||
putExtra(Intent.EXTRA_TEXT, suggestionDetailViewModel.getReportMessage()) | ||
} | ||
try { | ||
startActivity(intent) | ||
} catch (e: ActivityNotFoundException) { | ||
Toast.makeText(this, "메일을 보낼 수 없습니다", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
|
||
companion object { | ||
const val SUGGESTION_ID = "suggestion_id" | ||
private const val defaultValue = -1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters