Skip to content

Commit

Permalink
[MP-4703] popup -> alert 수정 및 커스텀 컨텐츠 슬롯 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Jokas2 committed Jun 7, 2024
1 parent acb67c3 commit 1faf39b
Show file tree
Hide file tree
Showing 8 changed files with 1,000 additions and 145 deletions.
695 changes: 695 additions & 0 deletions designsystem/src/main/java/net/deali/designsystem/component/Alert.kt

Large diffs are not rendered by default.

132 changes: 116 additions & 16 deletions designsystem/src/main/java/net/deali/designsystem/component/Popup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ import net.deali.designsystem.theme.DealiShape
* [DialogProperties]에서 닫기가 비활성화 된 경우 호출하지 않습니다.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "Alert로 변경해 주세요.",
replaceWith = ReplaceWith("Alert(\n" +
"title = title,\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
"onRightButtonClick = onRightButtonClick,\n" +
"onDismissRequest = onDismissRequest,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun Popup(
title: String,
Expand All @@ -61,9 +75,9 @@ fun Popup(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("Popup(\n" +
replaceWith = ReplaceWith("Alert(\n" +
"title = title,\n" +
"content = content,\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
Expand Down Expand Up @@ -110,6 +124,20 @@ fun Popup(
* [DialogProperties]에서 닫기가 비활성화 된 경우 호출하지 않습니다.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "Alert로 변경해 주세요.",
replaceWith = ReplaceWith("Alert(\n" +
"title = title,\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
"onRightButtonClick = onRightButtonClick,\n" +
"onDismissRequest = onDismissRequest,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun Popup(
title: String,
Expand Down Expand Up @@ -168,9 +196,9 @@ fun Popup(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("Popup(\n" +
replaceWith = ReplaceWith("Alert(\n" +
"title = title,\n" +
"content = content,\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
Expand Down Expand Up @@ -216,6 +244,19 @@ fun Popup(
* [DialogProperties]에서 닫기가 비활성화 된 경우 호출하지 않습니다.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "Alert로 변경해 주세요.",
replaceWith = ReplaceWith("Alert(\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
"onRightButtonClick = onRightButtonClick,\n" +
"onDismissRequest = onDismissRequest,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun Popup(
content: String,
Expand All @@ -239,8 +280,8 @@ fun Popup(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("Popup(\n" +
"content = content,\n" +
replaceWith = ReplaceWith("Alert(\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
Expand Down Expand Up @@ -284,6 +325,19 @@ fun Popup(
* [DialogProperties]에서 닫기가 비활성화 된 경우 호출하지 않습니다.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "Alert로 변경해 주세요.",
replaceWith = ReplaceWith("Alert(\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
"onRightButtonClick = onRightButtonClick,\n" +
"onDismissRequest = onDismissRequest,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun Popup(
content: AnnotatedString,
Expand Down Expand Up @@ -328,8 +382,8 @@ fun Popup(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("Popup(\n" +
"content = content,\n" +
replaceWith = ReplaceWith("Alert(\n" +
"contentText = content,\n" +
"leftButtonText = leftButtonText,\n" +
"rightButtonText = rightButtonText,\n" +
"onLeftButtonClick = onLeftButtonClick,\n" +
Expand Down Expand Up @@ -371,6 +425,18 @@ fun Popup(
* @param onDismissRequest 버튼 외의 방법으로 팝업을 닫으려 할 때의 이벤트 콜백.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "AlertSingleButton으로 변경해 주세요.",
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"title = title,\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismissRequest,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun PopupSingleButton(
title: String,
Expand All @@ -392,9 +458,9 @@ fun PopupSingleButton(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("PopupSingleButton(\n" +
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"title = title,\n" +
"content = content,\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismiss,\n" +
Expand Down Expand Up @@ -433,6 +499,18 @@ fun PopupSingleButton(
* [DialogProperties]에서 닫기가 비활성화 된 경우 호출하지 않습니다.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "AlertSingleButton으로 변경해 주세요.",
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"title = title,\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismiss,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun PopupSingleButton(
title: String,
Expand Down Expand Up @@ -478,9 +556,9 @@ fun PopupSingleButton(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("PopupSingleButton(\n" +
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"title = title,\n" +
"content = content,\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismiss,\n" +
Expand Down Expand Up @@ -518,6 +596,17 @@ fun PopupSingleButton(
* [DialogProperties]에서 닫기가 비활성화 된 경우 호출하지 않습니다.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "AlertSingleButton으로 변경해 주세요.",
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismissRequest,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun PopupSingleButton(
content: String,
Expand All @@ -537,8 +626,8 @@ fun PopupSingleButton(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("PopupSingleButton(\n" +
"content = content,\n" +
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismiss,\n" +
Expand Down Expand Up @@ -574,6 +663,17 @@ fun PopupSingleButton(
* [DialogProperties]에서 닫기가 비활성화 된 경우 호출하지 않습니다.
* @param properties 팝업 다이얼로그의 동작을 정의하는 속성 객체.
*/
@Deprecated(
message = "AlertSingleButton으로 변경해 주세요.",
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismiss,\n" +
"properties = properties\n" +
")"
),
)
@Composable
fun PopupSingleButton(
content: AnnotatedString,
Expand Down Expand Up @@ -605,8 +705,8 @@ fun PopupSingleButton(

@Deprecated(
message = "onDismiss 콜백을 onDismissRequest로 변경해 주세요.",
replaceWith = ReplaceWith("PopupSingleButton(\n" +
"content = content,\n" +
replaceWith = ReplaceWith("AlertSingleButton(\n" +
"contentText = content,\n" +
"buttonText = buttonText,\n" +
"onButtonClick = onButtonClick,\n" +
"onDismissRequest = onDismiss,\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sealed class Screen(
object TextInputWithButton : Screen("textInputWithButton")
object TextAreaButton : Screen("textAreaButton")
object SearchInputWithTag : Screen("searchInputWithTag")
object Popup : Screen("popup")
object Alert : Screen("alert")
object Slider : Screen("slider")

/** Undefined */
Expand Down
8 changes: 4 additions & 4 deletions sample/src/main/java/net/deali/designsystem/sample/ui/Nav.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import androidx.navigation.NavGraphBuilder
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import net.deali.designsystem.sample.data.model.Screen
import net.deali.designsystem.sample.data.datastore.DataStoreUtil
import net.deali.designsystem.sample.data.model.Screen
import net.deali.designsystem.sample.ui.main.MainScreen
import net.deali.designsystem.sample.ui.screen.AlertScreen
import net.deali.designsystem.sample.ui.screen.BottomSheetScreen
import net.deali.designsystem.sample.ui.screen.ButtonsScreen
import net.deali.designsystem.sample.ui.screen.CheckBoxScreen
Expand All @@ -27,7 +28,6 @@ import net.deali.designsystem.sample.ui.screen.DropdownScreen
import net.deali.designsystem.sample.ui.screen.IconsScreen
import net.deali.designsystem.sample.ui.screen.IndentationsScreen
import net.deali.designsystem.sample.ui.screen.IndicatorScreen
import net.deali.designsystem.sample.ui.screen.PopupScreen
import net.deali.designsystem.sample.ui.screen.RadioButtonScreen
import net.deali.designsystem.sample.ui.screen.RatingScreen
import net.deali.designsystem.sample.ui.screen.SearchInputScreen
Expand Down Expand Up @@ -253,8 +253,8 @@ private fun NavGraphBuilder.moleculesGraph(
composable(Screen.SearchInputWithTag.route) {
SearchInputWithTagScreen(onBackPress = navController::popBackStack)
}
composable(Screen.Popup.route) {
PopupScreen(onBackPress = navController::popBackStack)
composable(Screen.Alert.route) {
AlertScreen(onBackPress = navController::popBackStack)
}
composable(Screen.Slider.route) {
SliderScreen(onBackPress = navController::popBackStack)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class MainActivity : ComponentActivity() {
Screen.TextInputWithButton,
Screen.TextAreaButton,
Screen.SearchInputWithTag,
Screen.Popup,
Screen.Alert,
Screen.Slider,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private fun MainScreenPreview() {
Screen.TextInputWithButton,
Screen.TextAreaButton,
Screen.SearchInputWithTag,
Screen.Popup,
Screen.Alert,
Screen.Slider,
),
others = listOf(
Expand Down
Loading

0 comments on commit 1faf39b

Please sign in to comment.