-
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.
Merge pull request #196 from hellokitty-coding-club/feat/report
- Loading branch information
Showing
9 changed files
with
156 additions
and
34 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,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:id="@+id/edit_profile" | ||
<item android:id="@+id/edit" | ||
android:title="@string/edit"/> | ||
</menu> |
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
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
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,5 +1,6 @@ | ||
package com.lgtm.android.mission_detail | ||
|
||
import android.content.ActivityNotFoundException | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.os.Bundle | ||
|
@@ -202,8 +203,8 @@ class MissionDetailActivity : | |
|
||
override fun onMenuItemClick(item: MenuItem): Boolean { | ||
return when (item.itemId) { | ||
id.report, id.edit_profile -> { | ||
Toast.makeText(this, string.service_under_preparation, Toast.LENGTH_SHORT).show() | ||
id.report -> { | ||
onPressCsCenter() | ||
true | ||
} | ||
|
||
|
@@ -212,10 +213,29 @@ class MissionDetailActivity : | |
true | ||
} | ||
|
||
id.edit_text -> { | ||
Toast.makeText(this, string.service_under_preparation, Toast.LENGTH_SHORT).show() | ||
true | ||
} | ||
|
||
else -> false | ||
} | ||
} | ||
|
||
private fun onPressCsCenter() { | ||
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, missionDetailViewModel.getReportMessage()) | ||
} | ||
try { | ||
startActivity(intent) | ||
} catch (e: ActivityNotFoundException) { | ||
Toast.makeText(this, "메일을 보낼 수 없습니다", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
|
||
private fun showDeleteMissionDialog() { | ||
val title = getString(string.delete_mission_title) | ||
val description = getString(string.delete_mission_message) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.lgtm.android.profile | ||
|
||
import android.content.ActivityNotFoundException | ||
import android.content.Intent | ||
import android.net.Uri | ||
import android.os.Bundle | ||
|
@@ -137,11 +138,11 @@ class ProfileActivity : BaseActivity<ActivityProfileBinding>(R.layout.activity_p | |
override fun onMenuItemClick(item: MenuItem): Boolean { | ||
return when (item.itemId) { | ||
id.report -> { | ||
makeToastServiceUnderPreparation() | ||
onClickReport() | ||
true | ||
} | ||
|
||
id.edit_profile -> { | ||
id.edit -> { | ||
makeToastServiceUnderPreparation() | ||
true | ||
} | ||
|
@@ -150,6 +151,20 @@ class ProfileActivity : BaseActivity<ActivityProfileBinding>(R.layout.activity_p | |
} | ||
} | ||
|
||
private fun onClickReport() { | ||
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, profileViewModel.getReportMessage()) | ||
} | ||
try { | ||
startActivity(intent) | ||
} catch (e: ActivityNotFoundException) { | ||
Toast.makeText(this, "메일을 보낼 수 없습니다", Toast.LENGTH_SHORT).show() | ||
} | ||
} | ||
|
||
private fun makeToastServiceUnderPreparation() { | ||
Toast.makeText(this, com.lgtm.android.common_ui.R.string.service_under_preparation, Toast.LENGTH_SHORT).show() | ||
} | ||
|
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