Skip to content

Commit

Permalink
more formatting and action
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinSchildhorn committed Dec 4, 2023
1 parent 65dd54e commit 2559013
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 89 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/lint-action.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Lint Action
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
run-name: Running KtLint for linting
on: [pull_request]
jobs:
Lint-Action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: GitHub Action for ktlint
uses: yutailang0119/[email protected]




- name: Run KtFormat
run: ./gradlew ktFormat

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@ public open class OutlinedTextFieldMolecule(
override val unFocusedBorderColor: AtomikColor = focusedBorderColor,
override val radius: Int,
) : TextFieldMolecule(
textAtom,
backgroundColorAtom,
hintTextAtom,
errorTextAtom,
disabledColorAtom,
cursorColor,
errorColor,
),
textAtom,
backgroundColorAtom,
hintTextAtom,
errorTextAtom,
disabledColorAtom,
cursorColor,
errorColor,
),
BorderedAtom,
RoundedAtom {

@Composable
public fun colors(): TextFieldColors {
val textColor = textAtom.textColor.composeColor
Expand All @@ -57,26 +56,26 @@ public open class OutlinedTextFieldMolecule(
textColor = textColor,
backgroundColor = backgroundColor,
placeholderColor =
hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy(
ContentAlpha.medium,
),
hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy(
ContentAlpha.medium,
),
cursorColor = cursorColor?.composeColor ?: textColor,
focusedBorderColor = focusedBorderColor.composeColor,
unfocusedBorderColor = unFocusedBorderColor.composeColor,
disabledTextColor =
disabledColorAtom?.color?.composeColor
?: textColor.copy(ContentAlpha.disabled),
disabledColorAtom?.color?.composeColor
?: textColor.copy(ContentAlpha.disabled),
disabledBorderColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor,
disabledLabelColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor,
disabledLeadingIconColor =
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledPlaceholderColor =
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledTrailingIconColor =
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
errorCursorColor = errorColor?.composeColor ?: errorTextColor,
errorBorderColor = errorColor?.composeColor ?: errorTextColor,
errorLabelColor = errorColor?.composeColor ?: errorTextColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,27 @@ public open class TextFieldMolecule(
return TextFieldDefaults.textFieldColors(
textColor = textColor,
backgroundColor = backgroundColor,
placeholderColor = hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy(
ContentAlpha.medium,
),
placeholderColor =
hintTextAtom?.textColor?.composeColor ?: backgroundColor.copy(
ContentAlpha.medium,
),
cursorColor = cursorColor?.composeColor ?: textColor,
disabledTextColor = disabledColorAtom?.color?.composeColor
?: textColor.copy(ContentAlpha.disabled),
disabledIndicatorColor = disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledTextColor =
disabledColorAtom?.color?.composeColor
?: textColor.copy(ContentAlpha.disabled),
disabledIndicatorColor =
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledLabelColor = disabledColorAtom?.color?.composeColor ?: disabledBackgroundColor,
disabledLeadingIconColor = disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledPlaceholderColor = disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledTrailingIconColor = disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledLeadingIconColor =
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledPlaceholderColor =
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
disabledTrailingIconColor =
disabledColorAtom?.color?.composeColor
?: disabledBackgroundColor,
errorCursorColor = errorColor?.composeColor ?: errorTextColor,
errorIndicatorColor = errorColor?.composeColor ?: errorTextColor,
errorLabelColor = errorColor?.composeColor ?: errorTextColor,
Expand Down
4 changes: 4 additions & 0 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ android {
multiplatformResources {
multiplatformResourcesPackage = "com.kevinschildhorn.fotopresenter" // required
}

dependencies {
ktlintRuleset("com.twitter.compose.rules:ktlint:0.0.26")
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ object LoginScreenAtoms {
disabledColor = FotoColors.disabled,
radius = 15,
textAtom =
SimpleTextAtom(
textColor = FotoColors.primaryText,
typography = FotoTypography.button,
fontFamily = null,
),
SimpleTextAtom(
textColor = FotoColors.primaryText,
typography = FotoTypography.button,
fontFamily = null,
),
)
val textFieldMolecule =
OutlinedTextFieldMolecule(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ fun LoginScreen(
TitleView(
"Foto",
modifier =
Modifier.padding(
top = Padding.SMALL.dp,
start = Padding.STANDARD.dp,
bottom = Padding.LARGE.dp,
),
Modifier.padding(
top = Padding.SMALL.dp,
start = Padding.STANDARD.dp,
bottom = Padding.LARGE.dp,
),
)
LoginScreenForm(
uiState = uiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ fun ErrorView(
}
Box(
modifier =
configuredModifier.padding(
horizontal = atom.paddingHorizontal?.dp ?: 0.dp,
vertical = atom.paddingVertical?.dp ?: 0.dp,
),
configuredModifier.padding(
horizontal = atom.paddingHorizontal?.dp ?: 0.dp,
vertical = atom.paddingVertical?.dp ?: 0.dp,
),
) {
Text(
text = message,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ fun PrimaryButton(
modifier = modifier.height(44.dp),
enabled = buttonState.enabled,
colors =
ButtonDefaults.buttonColors(
backgroundColor = molecule.color.composeColor,
disabledBackgroundColor = molecule.disabledColor.composeColor,
),
ButtonDefaults.buttonColors(
backgroundColor = molecule.color.composeColor,
disabledBackgroundColor = molecule.disabledColor.composeColor,
),
) {
if (buttonState.loading) {
CircularProgressIndicator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class AutoConnectUseCaseTest : KoinTest {
modules(
testingModule(
settings =
MapSettings(
KEY_HOSTNAME to "192.168.1.1",
KEY_USERNAME to "admin",
KEY_PASSWORD to "password",
KEY_SHAREDFOLDER to "Public",
KEY_AUTOCONNECT to false,
),
MapSettings(
KEY_HOSTNAME to "192.168.1.1",
KEY_USERNAME to "admin",
KEY_PASSWORD to "password",
KEY_SHAREDFOLDER to "Public",
KEY_AUTOCONNECT to false,
),
),
)
}
Expand All @@ -52,13 +52,13 @@ class AutoConnectUseCaseTest : KoinTest {
modules(
testingModule(
settings =
MapSettings(
KEY_HOSTNAME to "google.com",
KEY_USERNAME to "admin",
KEY_PASSWORD to "password",
KEY_SHAREDFOLDER to "Public",
KEY_AUTOCONNECT to false,
),
MapSettings(
KEY_HOSTNAME to "google.com",
KEY_USERNAME to "admin",
KEY_PASSWORD to "password",
KEY_SHAREDFOLDER to "Public",
KEY_AUTOCONNECT to false,
),
),
)
}
Expand All @@ -83,13 +83,13 @@ class AutoConnectUseCaseTest : KoinTest {
modules(
testingModule(
settings =
MapSettings(
KEY_HOSTNAME to "throw",
KEY_USERNAME to "admin",
KEY_PASSWORD to "password",
KEY_SHAREDFOLDER to "Public",
KEY_AUTOCONNECT to false,
),
MapSettings(
KEY_HOSTNAME to "throw",
KEY_USERNAME to "admin",
KEY_PASSWORD to "password",
KEY_SHAREDFOLDER to "Public",
KEY_AUTOCONNECT to false,
),
),
)
}
Expand Down

0 comments on commit 2559013

Please sign in to comment.