From b6f551063a2beebe342eb075a6b80dd1386c2c01 Mon Sep 17 00:00:00 2001 From: flash159483 Date: Mon, 19 Aug 2024 21:33:28 +0900 Subject: [PATCH] =?UTF-8?q?[FEAT]#111:=20Lint=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/kotlin/com/bff/wespot/model/ToastState.kt | 2 +- .../main/kotlin/com/bff/wespot/ui/CaptureBitmap.kt | 7 +++---- .../ui/src/main/kotlin/com/bff/wespot/ui/TopToast.kt | 4 ++-- .../main/kotlin/com/bff/wespot/util/ModifierUtil.kt | 8 ++++---- .../kotlin/com/bff/wespot/util/MultiClickCutter.kt | 12 ++++++------ .../com/bff/wespot/auth/screen/SchoolScreen.kt | 1 - .../wespot/message/screen/ReservedMessageScreen.kt | 2 +- .../wespot/message/screen/send/MessageEditScreen.kt | 3 +-- 8 files changed, 18 insertions(+), 21 deletions(-) diff --git a/core/ui/src/main/kotlin/com/bff/wespot/model/ToastState.kt b/core/ui/src/main/kotlin/com/bff/wespot/model/ToastState.kt index 571e1552..0abdd744 100644 --- a/core/ui/src/main/kotlin/com/bff/wespot/model/ToastState.kt +++ b/core/ui/src/main/kotlin/com/bff/wespot/model/ToastState.kt @@ -9,5 +9,5 @@ data class ToastState( val type: WSToastType, ) { constructor() : - this(false, com.bff.wespot.designsystem.R.string.cancel, WSToastType.Success) + this(false, com.bff.wespot.designsystem.R.string.cancel, WSToastType.Success) } diff --git a/core/ui/src/main/kotlin/com/bff/wespot/ui/CaptureBitmap.kt b/core/ui/src/main/kotlin/com/bff/wespot/ui/CaptureBitmap.kt index 568e67ab..4afef195 100644 --- a/core/ui/src/main/kotlin/com/bff/wespot/ui/CaptureBitmap.kt +++ b/core/ui/src/main/kotlin/com/bff/wespot/ui/CaptureBitmap.kt @@ -40,7 +40,7 @@ fun CaptureBitmap( Box( modifier = Modifier .wrapContentSize() - .background(WeSpotThemeManager.colors.backgroundColor) + .background(WeSpotThemeManager.colors.backgroundColor), ) { content.invoke() } @@ -66,7 +66,7 @@ fun saveBitmap(context: Context, bitmap: Bitmap, filename: String = DEFAULT_FILE val imageUri: Uri? = contentResolver.insert( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, - contentValues + contentValues, ) return imageUri.also { @@ -78,6 +78,5 @@ fun saveBitmap(context: Context, bitmap: Bitmap, filename: String = DEFAULT_FILE } } - @JvmField -val DEFAULT_FILENAME = "${System.currentTimeMillis()}.png" \ No newline at end of file +val DEFAULT_FILENAME = "${System.currentTimeMillis()}.png" diff --git a/core/ui/src/main/kotlin/com/bff/wespot/ui/TopToast.kt b/core/ui/src/main/kotlin/com/bff/wespot/ui/TopToast.kt index a24832c0..240b6133 100644 --- a/core/ui/src/main/kotlin/com/bff/wespot/ui/TopToast.kt +++ b/core/ui/src/main/kotlin/com/bff/wespot/ui/TopToast.kt @@ -21,7 +21,7 @@ fun TopToast( modifier = Modifier .fillMaxSize() .padding(top = 12.dp), - contentAlignment = Alignment.TopCenter + contentAlignment = Alignment.TopCenter, ) { WSToast( text = message, @@ -30,4 +30,4 @@ fun TopToast( closeToast = closeToast, ) } -} \ No newline at end of file +} diff --git a/core/ui/src/main/kotlin/com/bff/wespot/util/ModifierUtil.kt b/core/ui/src/main/kotlin/com/bff/wespot/util/ModifierUtil.kt index 5725c0b3..5f70ef3f 100644 --- a/core/ui/src/main/kotlin/com/bff/wespot/util/ModifierUtil.kt +++ b/core/ui/src/main/kotlin/com/bff/wespot/util/ModifierUtil.kt @@ -35,7 +35,7 @@ fun Modifier.clickableSingle( enabled: Boolean = true, onClickLabel: String? = null, role: Role? = null, - onClick: () -> Unit + onClick: () -> Unit, ) = composed( inspectorInfo = debugInspectorInfo { name = "clickable" @@ -43,7 +43,7 @@ fun Modifier.clickableSingle( properties["onClickLabel"] = onClickLabel properties["role"] = role properties["onClick"] = onClick - } + }, ) { multipleEventsCutter { manager -> Modifier.clickable( @@ -52,7 +52,7 @@ fun Modifier.clickableSingle( onClick = { manager.processEvent { onClick() } }, role = role, indication = LocalIndication.current, - interactionSource = remember { MutableInteractionSource() } + interactionSource = remember { MutableInteractionSource() }, ) } -} \ No newline at end of file +} diff --git a/core/ui/src/main/kotlin/com/bff/wespot/util/MultiClickCutter.kt b/core/ui/src/main/kotlin/com/bff/wespot/util/MultiClickCutter.kt index 9e80302b..7a93fad2 100644 --- a/core/ui/src/main/kotlin/com/bff/wespot/util/MultiClickCutter.kt +++ b/core/ui/src/main/kotlin/com/bff/wespot/util/MultiClickCutter.kt @@ -14,14 +14,14 @@ interface MultipleEventsCutterManager { @OptIn(FlowPreview::class) @Composable -fun multipleEventsCutter( - content: @Composable (MultipleEventsCutterManager) -> T -) : T { +fun multipleEventsCutter( + content: @Composable (MultipleEventsCutterManager) -> T, +): T { val debounceState = remember { MutableSharedFlow<() -> Unit>( replay = 0, extraBufferCapacity = 1, - onBufferOverflow = BufferOverflow.DROP_OLDEST + onBufferOverflow = BufferOverflow.DROP_OLDEST, ) } @@ -30,7 +30,7 @@ fun multipleEventsCutter( override fun processEvent(event: () -> Unit) { debounceState.tryEmit(event) } - } + }, ) LaunchedEffect(true) { @@ -42,4 +42,4 @@ fun multipleEventsCutter( } return result -} \ No newline at end of file +} diff --git a/feature/auth/src/main/kotlin/com/bff/wespot/auth/screen/SchoolScreen.kt b/feature/auth/src/main/kotlin/com/bff/wespot/auth/screen/SchoolScreen.kt index 1205c456..9ebf60f8 100644 --- a/feature/auth/src/main/kotlin/com/bff/wespot/auth/screen/SchoolScreen.kt +++ b/feature/auth/src/main/kotlin/com/bff/wespot/auth/screen/SchoolScreen.kt @@ -164,7 +164,6 @@ fun SchoolScreen( } } } - } } } diff --git a/feature/message/src/main/kotlin/com/bff/wespot/message/screen/ReservedMessageScreen.kt b/feature/message/src/main/kotlin/com/bff/wespot/message/screen/ReservedMessageScreen.kt index 21d24b12..397c27ff 100644 --- a/feature/message/src/main/kotlin/com/bff/wespot/message/screen/ReservedMessageScreen.kt +++ b/feature/message/src/main/kotlin/com/bff/wespot/message/screen/ReservedMessageScreen.kt @@ -110,7 +110,7 @@ fun ReservedMessageScreen( toastType = WSToastType.Success, showToast = showToast, ) { - showToast = false + showToast = false } LaunchedEffect(Unit) { diff --git a/feature/message/src/main/kotlin/com/bff/wespot/message/screen/send/MessageEditScreen.kt b/feature/message/src/main/kotlin/com/bff/wespot/message/screen/send/MessageEditScreen.kt index 990ed03c..001000cf 100644 --- a/feature/message/src/main/kotlin/com/bff/wespot/message/screen/send/MessageEditScreen.kt +++ b/feature/message/src/main/kotlin/com/bff/wespot/message/screen/send/MessageEditScreen.kt @@ -264,12 +264,11 @@ fun MessageEditScreen( TopToast( message = stringResource(R.string.toast_error_name_edit), toastType = WSToastType.Error, - showToast = toast + showToast = toast, ) { toast = false } - LaunchedEffect(Unit) { action(SendAction.OnMessageEditScreenEntered(navArgs.isReservedMessage, navArgs.messageId)) }