Skip to content

Commit e4dee91

Browse files
committed
Analysis: Resolve composable naming lint warnings
Warning Message: "Composable functions with a return type should start with a lowercase letter" Explanation: "@composable functions without a return type should use similar naming to classes, starting with an uppercase letter and ending with a noun. @composable functions with a return type should be treated as normal Kotlin functions, starting with a lowercase letter." ------------------------------------------------------------------------ Renaming all composable functions with a return type to lowercase letter fix these warnings.
1 parent c0c964a commit e4dee91

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

WordPress/src/main/java/org/wordpress/android/ui/prefs/accountsettings/components/AccountClosureUi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import org.wordpress.android.ui.prefs.accountsettings.AccountSettingsViewModel.C
1313
fun AccountClosureUi(viewModel: AccountSettingsViewModel) {
1414
val uiState = viewModel.accountClosureUiState.collectAsState()
1515

16-
CloseAccountButton(onClick = { viewModel.openAccountClosureDialog() })
16+
closeAccountButton(onClick = { viewModel.openAccountClosureDialog() })
1717

1818
(uiState.value as? Opened)?.let {
1919
AccountClosureDialog(

WordPress/src/main/java/org/wordpress/android/ui/prefs/accountsettings/components/CloseAccountButton.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import org.wordpress.android.R
1717
import org.wordpress.android.ui.compose.theme.AppTheme
1818

1919
@Composable
20-
fun CloseAccountButton(onClick: () -> Unit = {}) = Button(
20+
fun closeAccountButton(onClick: () -> Unit = {}) = Button(
2121
elevation = ButtonDefaults.elevation(
2222
defaultElevation = 0.dp,
2323
pressedElevation = 0.dp,
@@ -44,7 +44,7 @@ fun CloseAccountButton(onClick: () -> Unit = {}) = Button(
4444
@Composable
4545
fun PreviewCloseAccountButton() {
4646
AppTheme {
47-
CloseAccountButton()
47+
closeAccountButton()
4848
}
4949
}
5050

WordPress/src/main/java/org/wordpress/android/ui/prefs/accountsettings/components/DialogErrorUi.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fun DialogErrorUi(
5252
)
5353
Text(stringResource(messageId))
5454
Spacer(Modifier.size(padding))
55-
FlatOutlinedButton(
55+
flatOutlinedButton(
5656
text = stringResource(R.string.dismiss),
5757
onClick = onDismissRequest,
5858
modifier = Modifier.fillMaxWidth(),
@@ -62,7 +62,7 @@ fun DialogErrorUi(
6262
),
6363
)
6464
Spacer(Modifier.size(padding))
65-
FlatButton(
65+
flatButton(
6666
text = stringResource(R.string.contact_support),
6767
onClick = onHelpRequested,
6868
modifier = Modifier.fillMaxWidth(),

WordPress/src/main/java/org/wordpress/android/ui/prefs/accountsettings/components/DialogSuccessUi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fun DialogSuccessUi(
3030
text = stringResource(R.string.account_closure_dialog_success_message),
3131
fontWeight = FontWeight.Bold,
3232
)
33-
FlatOutlinedButton(
33+
flatOutlinedButton(
3434
text = stringResource(R.string.ok),
3535
onClick = onDismissRequest,
3636
modifier = Modifier.fillMaxWidth(),

WordPress/src/main/java/org/wordpress/android/ui/prefs/accountsettings/components/DialogUi.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fun DialogUi(
6464
.fillMaxWidth(),
6565
horizontalArrangement = Arrangement.SpaceAround,
6666
) {
67-
FlatOutlinedButton(
67+
flatOutlinedButton(
6868
text = stringResource(R.string.cancel),
6969
onClick = onCancel,
7070
modifier = Modifier.weight(1f),
@@ -76,7 +76,7 @@ fun DialogUi(
7676
enabled = !isPending,
7777
)
7878
Spacer(Modifier.size(padding))
79-
FlatOutlinedButton(
79+
flatOutlinedButton(
8080
text = stringResource(R.string.confirm),
8181
modifier = Modifier.weight(1f),
8282
enabled = username.isNotEmpty() && username == currentUsername,

WordPress/src/main/java/org/wordpress/android/ui/prefs/accountsettings/components/FlatButtons.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import androidx.compose.ui.unit.dp
1313
import org.wordpress.android.ui.compose.theme.AppColor
1414

1515
@Composable
16-
fun FlatButton(
16+
fun flatButton(
1717
text: String,
1818
onClick: () -> Unit,
1919
modifier: Modifier = Modifier,
@@ -35,7 +35,7 @@ fun FlatButton(
3535
}
3636

3737
@Composable
38-
fun FlatOutlinedButton(
38+
fun flatOutlinedButton(
3939
text: String,
4040
onClick: () -> Unit,
4141
modifier: Modifier = Modifier,

0 commit comments

Comments
 (0)