Skip to content

Commit

Permalink
Spotless (#51)
Browse files Browse the repository at this point in the history
* Spotless

* πŸ€– Updates baselines for Dependency Guard

* Sky

* πŸ€– Updates screenshots

* Roses

* Cleanup

* πŸ€– Updates screenshots

* progress wrong layout

* Spotless

---------

Co-authored-by: JackEblan <[email protected]>
  • Loading branch information
JackEblan and JackEblan authored Sep 8, 2024
1 parent 022ec08 commit e8e46cf
Show file tree
Hide file tree
Showing 39 changed files with 175 additions and 81 deletions.
84 changes: 42 additions & 42 deletions app/dependencies/releaseRuntimeClasspath.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,45 @@ androidx.autofill:autofill:1.0.0
androidx.collection:collection-jvm:1.4.0
androidx.collection:collection-ktx:1.4.0
androidx.collection:collection:1.4.0
androidx.compose.animation:animation-android:1.7.0-beta06
androidx.compose.animation:animation-core-android:1.7.0-beta06
androidx.compose.animation:animation-core:1.7.0-beta06
androidx.compose.animation:animation:1.7.0-beta06
androidx.compose.foundation:foundation-android:1.7.0-beta06
androidx.compose.foundation:foundation-layout-android:1.7.0-beta06
androidx.compose.foundation:foundation-layout:1.7.0-beta06
androidx.compose.foundation:foundation:1.7.0-beta06
androidx.compose.material3.adaptive:adaptive-android:1.0.0-beta04
androidx.compose.material3.adaptive:adaptive:1.0.0-beta04
androidx.compose.material3:material3-adaptive-navigation-suite-android:1.3.0-beta05
androidx.compose.material3:material3-adaptive-navigation-suite:1.3.0-beta05
androidx.compose.material3:material3-android:1.3.0-beta05
androidx.compose.material3:material3:1.3.0-beta05
androidx.compose.material:material-icons-core-android:1.6.8
androidx.compose.material:material-icons-core:1.6.8
androidx.compose.material:material-icons-extended-android:1.6.8
androidx.compose.material:material-icons-extended:1.6.8
androidx.compose.material:material-ripple-android:1.7.0-beta02
androidx.compose.material:material-ripple:1.7.0-beta02
androidx.compose.runtime:runtime-android:1.7.0-beta06
androidx.compose.runtime:runtime-saveable-android:1.7.0-beta06
androidx.compose.runtime:runtime-saveable:1.7.0-beta06
androidx.compose.runtime:runtime:1.7.0-beta06
androidx.compose.ui:ui-android:1.7.0-beta06
androidx.compose.ui:ui-geometry-android:1.7.0-beta06
androidx.compose.ui:ui-geometry:1.7.0-beta06
androidx.compose.ui:ui-graphics-android:1.7.0-beta06
androidx.compose.ui:ui-graphics:1.7.0-beta06
androidx.compose.ui:ui-text-android:1.7.0-beta06
androidx.compose.ui:ui-text:1.7.0-beta06
androidx.compose.ui:ui-tooling-preview-android:1.7.0-beta06
androidx.compose.ui:ui-tooling-preview:1.7.0-beta06
androidx.compose.ui:ui-unit-android:1.7.0-beta06
androidx.compose.ui:ui-unit:1.7.0-beta06
androidx.compose.ui:ui-util-android:1.7.0-beta06
androidx.compose.ui:ui-util:1.7.0-beta06
androidx.compose.ui:ui:1.7.0-beta06
androidx.compose:compose-bom:2024.06.00
androidx.compose.animation:animation-android:1.7.0
androidx.compose.animation:animation-core-android:1.7.0
androidx.compose.animation:animation-core:1.7.0
androidx.compose.animation:animation:1.7.0
androidx.compose.foundation:foundation-android:1.7.0
androidx.compose.foundation:foundation-layout-android:1.7.0
androidx.compose.foundation:foundation-layout:1.7.0
androidx.compose.foundation:foundation:1.7.0
androidx.compose.material3.adaptive:adaptive-android:1.0.0
androidx.compose.material3.adaptive:adaptive:1.0.0
androidx.compose.material3:material3-adaptive-navigation-suite-android:1.3.0
androidx.compose.material3:material3-adaptive-navigation-suite:1.3.0
androidx.compose.material3:material3-android:1.3.0
androidx.compose.material3:material3:1.3.0
androidx.compose.material:material-icons-core-android:1.7.0
androidx.compose.material:material-icons-core:1.7.0
androidx.compose.material:material-icons-extended-android:1.7.0
androidx.compose.material:material-icons-extended:1.7.0
androidx.compose.material:material-ripple-android:1.7.0
androidx.compose.material:material-ripple:1.7.0
androidx.compose.runtime:runtime-android:1.7.0
androidx.compose.runtime:runtime-saveable-android:1.7.0
androidx.compose.runtime:runtime-saveable:1.7.0
androidx.compose.runtime:runtime:1.7.0
androidx.compose.ui:ui-android:1.7.0
androidx.compose.ui:ui-geometry-android:1.7.0
androidx.compose.ui:ui-geometry:1.7.0
androidx.compose.ui:ui-graphics-android:1.7.0
androidx.compose.ui:ui-graphics:1.7.0
androidx.compose.ui:ui-text-android:1.7.0
androidx.compose.ui:ui-text:1.7.0
androidx.compose.ui:ui-tooling-preview-android:1.7.0
androidx.compose.ui:ui-tooling-preview:1.7.0
androidx.compose.ui:ui-unit-android:1.7.0
androidx.compose.ui:ui-unit:1.7.0
androidx.compose.ui:ui-util-android:1.7.0
androidx.compose.ui:ui-util:1.7.0
androidx.compose.ui:ui:1.7.0
androidx.compose:compose-bom:2024.09.00
androidx.concurrent:concurrent-futures:1.1.0
androidx.core:core-ktx:1.13.1
androidx.core:core-splashscreen:1.0.1
Expand Down Expand Up @@ -106,9 +106,9 @@ androidx.vectordrawable:vectordrawable:1.1.0
androidx.versionedparcelable:versionedparcelable:1.1.1
androidx.viewpager:viewpager:1.0.0
androidx.window.extensions.core:core:1.0.0
androidx.window:window-core-android:1.3.0-rc01
androidx.window:window-core:1.3.0-rc01
androidx.window:window:1.3.0-rc01
androidx.window:window-core-android:1.3.0
androidx.window:window-core:1.3.0
androidx.window:window:1.3.0
com.google.accompanist:accompanist-drawablepainter:0.32.0
com.google.android.gms:play-services-base:18.0.1
com.google.android.gms:play-services-basement:18.3.0
Expand Down
3 changes: 0 additions & 3 deletions core/design-system/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ dependencies {
api(libs.androidx.compose.foundation)
api(libs.androidx.compose.foundation.layout)
api(libs.androidx.compose.material3)
api(libs.androidx.compose.material3.adaptive)
api(libs.androidx.compose.material.iconsExtended)
api(libs.androidx.compose.runtime)
api(libs.androidx.compose.ui.util)
Expand All @@ -50,6 +49,4 @@ dependencies {
testImplementation(libs.robolectric)
testImplementation(libs.roborazzi)
testImplementation(projects.core.screenshotTesting)

androidTestImplementation(libs.androidx.compose.ui.test)
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.eblan.socialworkreviewer.core.designsystem.component

import androidx.compose.material3.LinearProgressIndicator
Expand All @@ -22,4 +39,4 @@ fun SwrLinearProgressIndicator(
trackColor = trackColor,
strokeCap = strokeCap,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.eblan.socialworkreviewer.core.designsystem.component

import androidx.compose.foundation.layout.RowScope
Expand All @@ -10,7 +27,6 @@ import androidx.compose.material3.TopAppBarScrollBehavior
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier


@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SwrLargeTopAppBar(
Expand All @@ -31,4 +47,4 @@ fun SwrLargeTopAppBar(
colors = colors,
scrollBehavior = scrollBehavior,
)
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.eblan.socialworkreviewer.core.designsystem

import androidx.activity.ComponentActivity
Expand Down Expand Up @@ -30,4 +47,4 @@ class ProgressIndicatorScreenshotTests {
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import com.eblan.socialworkreviewer.core.designsystem.theme.LightPurpleColorSche
import com.eblan.socialworkreviewer.core.designsystem.theme.SwrTheme
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import kotlin.test.assertEquals

/**
Expand All @@ -41,6 +43,7 @@ import kotlin.test.assertEquals
*
* It verifies that the various composition locals β€” [MaterialTheme] and design system.
*/
@RunWith(RobolectricTestRunner::class)
class ThemeTest {

@get:Rule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
/*
*
* Copyright 2023 Einstein Blanco
*
* Licensed under the GNU General Public License v3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/gpl-3.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package com.eblan.socialworkreviewer.core.designsystem

import androidx.activity.ComponentActivity
Expand All @@ -8,10 +25,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.platform.LocalInspectionMode
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.FontScale
import androidx.compose.ui.test.junit4.createAndroidComposeRule
import androidx.compose.ui.test.onRoot
import com.eblan.socialworkreviewer.core.designsystem.component.SwrLargeTopAppBar
import com.eblan.socialworkreviewer.core.designsystem.theme.LocalGradientColors
import com.eblan.socialworkreviewer.core.designsystem.theme.SwrTheme
import com.eblan.socialworkreviewer.core.screenshottesting.util.DefaultRoborazziOptions
import com.eblan.socialworkreviewer.core.screenshottesting.util.captureMultiTheme
import com.github.takahirom.roborazzi.captureRoboImage
Expand All @@ -23,9 +43,6 @@ import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
import org.robolectric.annotation.GraphicsMode
import org.robolectric.annotation.LooperMode
import androidx.compose.ui.test.DeviceConfigurationOverride
import androidx.compose.ui.test.FontScale
import com.eblan.socialworkreviewer.core.designsystem.theme.SwrTheme

@OptIn(ExperimentalMaterial3Api::class)
@RunWith(RobolectricTestRunner::class)
Expand Down Expand Up @@ -60,7 +77,7 @@ class TopAppBarScreenshotTests {
}
}
composeTestRule.onRoot().captureRoboImage(
"src/test/screenshots/TopAppBar/TopAppBar_fontScale2.png",
"src/test/screenshots/LargeTopAppBar/LargeTopAppBar_fontScale2.png",
roborazziOptions = DefaultRoborazziOptions,
)
}
Expand All @@ -80,4 +97,4 @@ class TopAppBarScreenshotTests {
},
)
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ internal fun CorrectChoicesScreen(
modifier = modifier.testTag("correctChoices:largeTopAppBar"),
scrollBehavior = scrollBehavior,
)

},
) { paddingValues ->
Column(
Expand Down Expand Up @@ -222,13 +221,17 @@ private fun CorrectChoicesSelection(
val wrongChoice =
isCurrentQuestion && choice !in correctChoices && choice in selectedChoices

val choiceBrush = if (correctChoice) {
Brush.linearGradient(
colors = greenGradientColors,
)
val choiceBorderGradientColors = if (correctChoice) {
greenGradientColors
} else if (wrongChoice) {
redGradientColors
} else {
emptyList()
}

val choiceBrush = if (choiceBorderGradientColors.isNotEmpty()) {
Brush.linearGradient(
colors = redGradientColors,
colors = choiceBorderGradientColors,
)
} else {
CardDefaults.outlinedCardBorder().brush
Expand All @@ -237,7 +240,10 @@ private fun CorrectChoicesSelection(
OutlinedCard(
onClick = {},
modifier = Modifier.fillMaxWidth(),
border = BorderStroke(width = 2.dp, brush = choiceBrush),
border = BorderStroke(
width = 2.dp,
brush = choiceBrush,
),
) {
Box(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.testTag
Expand Down Expand Up @@ -318,7 +319,6 @@ private fun Questions(
modifier = modifier.testTag("question:largeTopAppBar"),
scrollBehavior = scrollBehavior,
)

},
snackbarHost = {
SnackbarHost(hostState = snackbarHostState)
Expand Down Expand Up @@ -356,6 +356,11 @@ private fun Questions(
progress = {
animatedProgress
},
modifier = modifier
.fillMaxWidth()
.height(30.dp)
.padding(10.dp),
strokeCap = StrokeCap.Round,
)

HorizontalPager(
Expand Down Expand Up @@ -507,9 +512,15 @@ private fun QuestionChoicesSelection(
choices.forEach { choice ->
val selectedChoice = isCurrentQuestion && choice in selectedChoices

val selectedChoiceBrush = if (selectedChoice) {
val choiceBorderGradientColors = if (selectedChoice) {
greenGradientColors
} else {
emptyList()
}

val choiceBrush = if (choiceBorderGradientColors.isNotEmpty()) {
Brush.linearGradient(
colors = greenGradientColors,
colors = choiceBorderGradientColors,
)
} else {
CardDefaults.outlinedCardBorder().brush
Expand Down Expand Up @@ -542,7 +553,10 @@ private fun QuestionChoicesSelection(
scaleY = choiceAnimation.value
}
},
border = BorderStroke(width = 2.dp, brush = selectedChoiceBrush),
border = BorderStroke(
width = 2.dp,
brush = choiceBrush,
),
) {
Box(
modifier = Modifier
Expand Down
Loading

0 comments on commit e8e46cf

Please sign in to comment.