Skip to content

Commit

Permalink
ktlint
Browse files Browse the repository at this point in the history
  • Loading branch information
rozPierog committed Apr 26, 2024
1 parent 522e100 commit cca9e6a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 33 deletions.
1 change: 0 additions & 1 deletion app/src/main/java/com/omelan/cofi/components/RecipeItem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,4 @@ fun PreviewRecipeItem() {
)
}
}

}
8 changes: 5 additions & 3 deletions app/src/main/java/com/omelan/cofi/components/Timer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ fun Track(
val widthDifference = referenceWidthForSmallOffset - strokeWidth.value

val proportionalOffsetChange = widthDifference *
((referenceOffsetForLargeWidth - referenceOffsetForSmallWidth) /
(referenceWidthForLargeOffset - referenceWidthForSmallOffset))
(
(referenceOffsetForLargeWidth - referenceOffsetForSmallWidth) /
(referenceWidthForLargeOffset - referenceWidthForSmallOffset)
)

return@derivedStateOf referenceOffsetForSmallWidth + proportionalOffsetChange
}
Expand Down Expand Up @@ -251,7 +253,7 @@ fun TimerPreview() {
currentStep = Step(
id = 1,
name = "ExperimentalAnimatedInsets ExperimentalAnimatedInsets " +
"ExperimentalAnimatedInsets ExperimentalAnimatedInsets",
"ExperimentalAnimatedInsets ExperimentalAnimatedInsets",
time = 5 * 1000,
type = StepType.OTHER,
orderInRecipe = 0,
Expand Down
8 changes: 5 additions & 3 deletions app/src/main/java/com/omelan/cofi/pages/RecipeEdit.kt
Original file line number Diff line number Diff line change
Expand Up @@ -226,14 +226,16 @@ fun RecipeEdit(
) {
derivedStateOf {
windowSizeClass.widthSizeClass == WindowWidthSizeClass.Compact ||
(configuration.screenHeightDp > configuration.screenWidthDp)
(configuration.screenHeightDp > configuration.screenWidthDp)
}
}

val canSafelyExit = !(steps !== stepsToEdit ||
val canSafelyExit = !(
steps !== stepsToEdit ||
name.text != recipeToEdit.name ||
description.text != recipeToEdit.description ||
pickedIcon != recipeToEdit.recipeIcon)
pickedIcon != recipeToEdit.recipeIcon
)

val safeGoBack: () -> Unit = {
if (!canSafelyExit) {
Expand Down
6 changes: 5 additions & 1 deletion app/src/main/java/com/omelan/cofi/pages/details/UpNext.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ fun UpNext(
weightMultiplier: Float = 1f,
timeMultiplier: Float = 1f,
) {
Surface(modifier = modifier.animateContentSize(), shape = shapes.medium, tonalElevation = 2.dp) {
Surface(
modifier = modifier.animateContentSize(),
shape = shapes.medium,
tonalElevation = 2.dp,
) {
Column(
Modifier
.fillMaxWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@ fun DependencyPreview() {
dependency = Dependency(
project = "Nice package",
description = "Contains Guava\\u0027s " +
"com.google.common.util.concurrent.ListenableFuture" +
" class,\\n without any of its other classes -- but is also available in " +
"a second\\n \\\"version\\\" that omits the class to avoid conflicts with " +
"the copy in Guava\\n itself. The idea is:\\n\\n - If users want only " +
"ListenableFuture, they depend on listenablefuture-1.0.\\n\\n " +
"- If users want all of Guava, they depend on guava, which, as of Guava\\n " +
" 27.0, depends on\\n " +
" listenablefuture-9999.0-empty-to-avoid-conflict-with-guava. " +
"The 9999.0-...\\n version number is enough for some build systems" +
" (notably, Gradle) to select\\n that empty artifact over the " +
"\\\"real\\\" listenablefuture-1.0 -- avoiding a\\n " +
"conflict with the copy of ListenableFuture in guava itself. If users are\\n " +
" using an older version of Guava or a build system other than Gradle," +
" they\\n may see class conflicts. If so, they can solve them by manually" +
" excluding\\n the listenablefuture artifact or manually forcing their " +
"build systems to\\n use 9999.0-....\",\n",
"com.google.common.util.concurrent.ListenableFuture" +
" class,\\n without any of its other classes -- but is also available in " +
"a second\\n \\\"version\\\" that omits the class to avoid conflicts with " +
"the copy in Guava\\n itself. The idea is:\\n\\n - If users want only " +
"ListenableFuture, they depend on listenablefuture-1.0.\\n\\n " +
"- If users want all of Guava, they depend on guava, which, as of Guava\\n " +
" 27.0, depends on\\n " +
" listenablefuture-9999.0-empty-to-avoid-conflict-with-guava. " +
"The 9999.0-...\\n version number is enough for some build systems" +
" (notably, Gradle) to select\\n that empty artifact over the " +
"\\\"real\\\" listenablefuture-1.0 -- avoiding a\\n " +
"conflict with the copy of ListenableFuture in guava itself. If users are\\n " +
" using an older version of Guava or a build system other than Gradle," +
" they\\n may see class conflicts. If so, they can solve them by manually" +
" excluding\\n the listenablefuture artifact or manually forcing their " +
"build systems to\\n use 9999.0-....\",\n",
version = "3.2.1",
developers = listOf("Leon Omelan"),
url = "jsonObject.getString( url )",
Expand Down
18 changes: 9 additions & 9 deletions app/src/main/java/com/omelan/cofi/utils/NavigationUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ fun AnimatedContentTransitionScope<NavBackStackEntry>.slideIn(
towards: AnimatedContentTransitionScope.SlideDirection,
) =
fadeIn(tween(tweenDuration, easing = LinearOutSlowInEasing)) +
slideIntoContainer(
towards,
animationSpec = tween(tweenDuration, easing = FastOutSlowInEasing),
initialOffset = { fullWidth -> -(offsetCalculation(fullWidth)) },
)
slideIntoContainer(
towards,
animationSpec = tween(tweenDuration, easing = FastOutSlowInEasing),
initialOffset = { fullWidth -> -(offsetCalculation(fullWidth)) },
)

fun AnimatedContentTransitionScope<NavBackStackEntry>.slideOut(
towards: AnimatedContentTransitionScope.SlideDirection,
) = slideOutOfContainer(
towards,
animationSpec = tween(tweenDuration, easing = FastOutSlowInEasing),
targetOffset = { fullWidth -> offsetCalculation(fullWidth) },
) + fadeOut(tween(tweenDuration, easing = LinearOutSlowInEasing))
towards,
animationSpec = tween(tweenDuration, easing = FastOutSlowInEasing),
targetOffset = { fullWidth -> offsetCalculation(fullWidth) },
) + fadeOut(tween(tweenDuration, easing = LinearOutSlowInEasing))

0 comments on commit cca9e6a

Please sign in to comment.