Skip to content

Commit

Permalink
[mod] 문의하기 메일 포맷 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjinc committed Dec 10, 2023
1 parent 11dcf3c commit f0d6b8f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
5 changes: 3 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ android {
applicationId "com.hyeeyoung.wishboard"
minSdkVersion 24
targetSdkVersion 33
versionCode 34
versionName "1.2.3"
versionCode 35
versionName "1.2.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand All @@ -40,6 +40,7 @@ android {
buildTypes {
debug {
buildConfigField "String", "BASE_URL", properties["DEV_BASE_URL"]
versionNameSuffix = "-dev"
}
release {
minifyEnabled true
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@
android:exported="true"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
android:host="wishboard.com"
android:path="/main"
android:scheme="https" />
</intent-filter>
</activity>

<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.hyeeyoung.wishboard.presentation.my.screens

import android.content.Intent
import android.os.Build
import android.os.Bundle
import android.view.View
import androidx.hilt.navigation.fragment.hiltNavGraphViewModels
Expand All @@ -23,6 +24,7 @@ import com.hyeeyoung.wishboard.util.UiState
import com.hyeeyoung.wishboard.util.extension.collectFlow
import com.hyeeyoung.wishboard.util.extension.navigateSafe
import com.hyeeyoung.wishboard.util.extension.safeValueOf
import com.hyeeyoung.wishboard.util.extension.sendMail
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.flow.combine

Expand Down Expand Up @@ -54,10 +56,16 @@ class MyFragment : NetworkFragment<FragmentMyBinding>(R.layout.fragment_my) {
findNavController().navigateSafe(R.id.action_my_to_password_change)
}
binding.contactUs.setOnClickListener {
val email = Intent(Intent.ACTION_SEND)
email.type = "plain/text"
email.putExtra(Intent.EXTRA_EMAIL, arrayOf("[email protected]"))
startActivity(email)
requireContext().sendMail(
getString(R.string.my_contact_us_email_title),
String.format(
getString(R.string.my_contact_us_email_content),
Build.BRAND,
Build.MODEL,
BuildConfig.VERSION_NAME,
Build.VERSION.SDK_INT,
),
)
}
binding.howToUse.setOnClickListener {
moveWebViewActivity(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
package com.hyeeyoung.wishboard.util.extension

import android.content.Context
import android.content.Intent
import android.widget.Toast
import com.hyeeyoung.wishboard.R

fun Context.showToast(message: String, isShort: Boolean = true) {
val duration = if (isShort) Toast.LENGTH_SHORT else Toast.LENGTH_LONG
Toast.makeText(this, message, duration).show()
}

fun Context.sendMail(title: String, content: String) {
Intent(Intent.ACTION_SEND).apply {
type = "plain/text"
putExtra(Intent.EXTRA_EMAIL, arrayOf(getString(R.string.wishboard_email)))
putExtra(Intent.EXTRA_SUBJECT, title)
putExtra(Intent.EXTRA_TEXT, content)
}.also { startActivity(it) }
}
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<resources>
<string name="app_name">WishBoard</string>
<string name="logo_text">Wish Board</string>
<string name="wishboard_email">[email protected]</string>

<!-- Global -->
<string name="confirm">확인</string>
Expand Down Expand Up @@ -209,6 +210,8 @@
<string name="my_new_password_re_write">새 비밀번호 재입력</string>
<string name="my_new_password_re_write_hint">새 비밀번호를 다시 입력해 주세요.</string>
<string name="my_password_mismatch_detail">비밀번호가 일치하지 않아요!</string>
<string name="my_contact_us_email_title">위시보드에게 문의하기</string>
<string name="my_contact_us_email_content">안녕하세요. 위시보드 입니다. 🔫\n문의 내용을 하단에 작성해 주세요.\n답변은 전송주신 메일로 회신드리겠습니다. 💌\n감사합니다. 😉\n-------------\n\n\n\n\n\n-------------\nDevice: %s %s\nApp version: %s\nOS Version: %d</string>

<!-- How To Use -->
<string name="how_to_use_yes_button_text">네! 알겠어요</string>
Expand Down

0 comments on commit f0d6b8f

Please sign in to comment.