Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ”€ :: (#208) Toast ์ƒ์„ฑ ํ•จ์ˆ˜ ๋งŒ๋“ค๊ธฐ #209

Merged
merged 2 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/ui/src/main/java/com/msg/ui/makeToast.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.msg.ui

import android.content.Context
import android.widget.Toast

fun makeToast(context: Context, message: String, duration: Int = Toast.LENGTH_SHORT) {
Toast.makeText(context, message, duration).show()
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.msg.certification

import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -23,6 +22,7 @@ import com.msg.design_system.component.button.BitgoeulButton
import com.msg.design_system.component.topbar.DetailSettingTopBar
import com.msg.design_system.theme.color.BitgoeulColor
import com.msg.ui.DevicePreviews
import com.msg.ui.makeToast
import com.msg.ui.util.toKoreanFormat
import java.time.LocalDate

Expand Down Expand Up @@ -99,9 +99,9 @@ internal fun AddCertificationScreen(
text = "์ž๊ฒฉ์ฆ ๋“ฑ๋ก",
onClicked = {
if (name.value.isBlank()) {
Toast.makeText(context, "์ž๊ฒฉ์ฆ ์ด๋ฆ„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”", Toast.LENGTH_SHORT).show()
makeToast(context, "์ž๊ฒฉ์ฆ ์ด๋ฆ„์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”")
} else if (date.value == null) {
Toast.makeText(context, "์ทจ๋“์ผ์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”", Toast.LENGTH_SHORT).show()
makeToast(context, "์ทจ๋“์ผ์„ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”")
} else {
onAddClicked(name.value, date.value!!)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.bitgoeul.email

import android.util.Log
import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -29,6 +28,7 @@ import com.msg.design_system.component.icon.GoBackIcon
import com.msg.design_system.component.topbar.GoBackTopBar
import com.msg.design_system.theme.BitgoeulAndroidTheme
import com.msg.model.remote.response.email.GetEmailAuthenticateStatusResponse
import com.msg.ui.makeToast
import kotlinx.coroutines.launch

@Composable
Expand All @@ -51,10 +51,10 @@ internal fun EmailSendInformRoute(
onSuccess = { response ->
if (response.isAuthentication) {
onMoveNewPasswordClicked()
Toast.makeText(context, "์ด๋ฉ”์ผ ์ธ์ฆ์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.", Toast.LENGTH_SHORT).show()
makeToast(context, "์ด๋ฉ”์ผ ์ธ์ฆ์— ์„ฑ๊ณตํ–ˆ์Šต๋‹ˆ๋‹ค.")
}
if (!response.isAuthentication) {
Toast.makeText(context, "์ด๋ฉ”์ผ ์ธ์ฆ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.", Toast.LENGTH_SHORT).show()
makeToast(context, "์ด๋ฉ”์ผ ์ธ์ฆ์— ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค.")
}
}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.bitgoeul.email

import android.widget.Toast
import androidx.activity.ComponentActivity
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
Expand All @@ -27,6 +26,7 @@ import com.msg.design_system.component.icon.GoBackIcon
import com.msg.design_system.component.textfield.DefaultTextField
import com.msg.design_system.component.topbar.GoBackTopBar
import com.msg.design_system.theme.BitgoeulAndroidTheme
import com.msg.ui.makeToast

@Composable
internal fun InputNewPasswordRoute(
Expand Down Expand Up @@ -134,7 +134,7 @@ internal fun InputNewPasswordScreen(
if (passwordPattern.matches(firstInputPassword.value)) {
onNextClicked(secondInputPassword.value)
} else {
Toast.makeText(context, "๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” 8~24์ž ์˜๋ฌธ, ์ˆซ์ž, ํŠน์ˆ˜๋ฌธ์ž 1๊ฐœ ์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.", Toast.LENGTH_SHORT).show()
makeToast(context, "๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” 8~24์ž ์˜๋ฌธ, ์ˆซ์ž, ํŠน์ˆ˜๋ฌธ์ž 1๊ฐœ ์ด์ƒ์ด์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.")
}
}
)
Expand Down
6 changes: 3 additions & 3 deletions feature/login/src/main/java/com/bitgoeul/login/LoginScreen.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.bitgoeul.login

import android.content.pm.ActivityInfo
import android.widget.Toast
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
Expand Down Expand Up @@ -35,6 +34,7 @@ import com.msg.design_system.theme.BitgoeulAndroidTheme
import com.msg.design_system.util.LockScreenOrientation
import com.msg.design_system.util.checkEmailRegex
import com.msg.design_system.util.checkPasswordRegex
import com.msg.ui.makeToast
import kotlinx.coroutines.launch

@Composable
Expand All @@ -56,11 +56,11 @@ internal fun LoginRoute(
getLoginData(
viewModel = viewModel,
onSuccess = {
Toast.makeText(context, "๋กœ๊ทธ์ธ์— ์„ฑ๊ณตํ•˜์˜€์Šต๋‹ˆ๋‹ค.", Toast.LENGTH_SHORT).show()
makeToast(context, "๋กœ๊ทธ์ธ์— ์„ฑ๊ณตํ•˜์˜€์Šต๋‹ˆ๋‹ค.")
onLoginClicked()
},
onFailure = {
Toast.makeText(context, "๋กœ๊ทธ์ธ์— ์‹คํŒจํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด์ฃผ์„ธ์š”", Toast.LENGTH_SHORT).show()
makeToast(context, "๋กœ๊ทธ์ธ์— ์‹คํŒจํ•˜์˜€์Šต๋‹ˆ๋‹ค. ๋‹ค์‹œ ์‹œ๋„ํ•ด์ฃผ์„ธ์š”")
}
)
}
Expand Down
Loading