Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
JuTaK97 committed Sep 6, 2023
1 parent 60020ce commit 6394cb6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -751,12 +751,12 @@ fun QuestionCircleIcon(
@Composable
fun CloseCircleIcon(
modifier: Modifier = Modifier,
colorFilter: ColorFilter? = null
colorFilter: ColorFilter? = null,
) {
Image(
modifier = modifier,
painter = painterResource(id = R.drawable.ic_close_circle),
contentDescription = "",
colorFilter = colorFilter
colorFilter = colorFilter,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ class ApiOnError @Inject constructor(
ErrorCode.INVALID_NICKNAME -> Toast.makeText(
context,
context.getString(R.string.error_invalid_nickname),
Toast.LENGTH_SHORT
Toast.LENGTH_SHORT,
).show()
else -> Toast.makeText(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import com.squareup.moshi.JsonClass

@JsonClass(generateAdapter = true)
data class PatchUserInfoParams(
@Json(name = "nickname") val nickname: String
@Json(name = "nickname") val nickname: String,
)
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fun ChangeNicknamePage() {
Column(
modifier = Modifier
.fillMaxSize()
.background(SNUTTColors.Gray100)
.background(SNUTTColors.Gray100),
) {
TopBar(
title = {
Expand All @@ -78,7 +78,7 @@ fun ChangeNicknamePage() {
modifier = Modifier
.size(30.dp)
.clicks { onBackPressed() },
colorFilter = ColorFilter.tint(SNUTTColors.Black900)
colorFilter = ColorFilter.tint(SNUTTColors.Black900),
)
},
actions = {
Expand All @@ -88,22 +88,24 @@ fun ChangeNicknamePage() {
color = if (nicknameField.isEmpty() || nicknameField == initialNickname) SNUTTColors.Black500 else SNUTTColors.Black900,
modifier = Modifier
.clicks {
if (nicknameField.isNotEmpty() && nicknameField != initialNickname)
if (nicknameField.isNotEmpty() && nicknameField != initialNickname) {
handleChangeNickname()
}
}
},
)
}
},
)
Margin(10.dp)
SettingColumn(
title = stringResource(R.string.settings_change_nickname_title)
title = stringResource(R.string.settings_change_nickname_title),
) {
NicknameEditText(
value = nicknameField,
onValueChange = { nicknameField = it },
onDone = {
if (nicknameField.isNotEmpty() && nicknameField != initialNickname)
if (nicknameField.isNotEmpty() && nicknameField != initialNickname) {
handleChangeNickname()
}
},
hint = initialNickname,
)
Expand All @@ -112,7 +114,7 @@ fun ChangeNicknamePage() {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 30.dp)
.padding(horizontal = 30.dp),
) {
Text(
text = stringResource(R.string.settings_change_nickname_guide),
Expand All @@ -122,7 +124,7 @@ fun ChangeNicknamePage() {
)
Margin(30.dp)
Column(
verticalArrangement = Arrangement.spacedBy(2.sp.toDp())
verticalArrangement = Arrangement.spacedBy(2.sp.toDp()),
) {
Text(
text = stringResource(R.string.settings_change_nickname_requirement_title),
Expand All @@ -135,7 +137,7 @@ fun ChangeNicknamePage() {
text = it,
style = SNUTTTypography.body2.copy(
color = SNUTTColors.Black500,
)
),
)
}
}
Expand All @@ -158,7 +160,7 @@ fun NicknameEditText(
.height(45.dp)
.background(SNUTTColors.White900)
.padding(horizontal = 35.dp),
verticalAlignment = Alignment.CenterVertically
verticalAlignment = Alignment.CenterVertically,
) {
val keyboardController = LocalSoftwareKeyboardController.current
var isFocused by remember { mutableStateOf(false) }
Expand All @@ -184,15 +186,15 @@ fun NicknameEditText(
.clicks {
onValueChange("")
keyboardController?.hide()
}
},
)
}
Text(
text = "#NNNN",
style = SNUTTTypography.body1.copy(
color = SNUTTColors.Black300,
fontSize = 16.sp,
)
),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,24 @@ fun UserConfigPage() {
title = stringResource(R.string.settings_user_config_change_nickname),
onClick = {
navController.navigate(NavigationDestination.ChangeNickname)
}
},
) {
Text(
text = user?.nickname.toString(),
style = SNUTTTypography.body1.copy(
color = SNUTTColors.Black500
)
color = SNUTTColors.Black500,
),
)
}
SettingItem(
title = stringResource(R.string.settings_user_config_copy_nickname),
hasNextPage = false,
onClick = {
clipboardManager.setText(AnnotatedString(user?.nickname.toString()))
}
},
) {
DuplicateIcon(
modifier = Modifier.size(30.dp)
modifier = Modifier.size(30.dp),
)
}
}
Expand Down

0 comments on commit 6394cb6

Please sign in to comment.