From 4f28f0636eb27706a2fd59d99c98a7b1a919bf30 Mon Sep 17 00:00:00 2001 From: trambui09 Date: Thu, 7 Nov 2024 22:56:18 +0000 Subject: [PATCH] Apply Spotless --- .../predictiveback/PredictiveBackSnippets.kt | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/compose/snippets/src/main/java/com/example/compose/snippets/predictiveback/PredictiveBackSnippets.kt b/compose/snippets/src/main/java/com/example/compose/snippets/predictiveback/PredictiveBackSnippets.kt index 96392f88..ff1fc6cf 100644 --- a/compose/snippets/src/main/java/com/example/compose/snippets/predictiveback/PredictiveBackSnippets.kt +++ b/compose/snippets/src/main/java/com/example/compose/snippets/predictiveback/PredictiveBackSnippets.kt @@ -1,31 +1,46 @@ +/* + * Copyright 2024 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.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.example.compose.snippets.predictiveback -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.navigation.compose.NavHost -import androidx.navigation.compose.rememberNavController -import androidx.navigation.NavHostController -import androidx.compose.animation.scaleOut -import androidx.compose.ui.graphics.TransformOrigin -import androidx.compose.animation.EnterTransition import android.os.SystemClock import androidx.activity.compose.PredictiveBackHandler -import androidx.compose.ui.unit.dp +import androidx.compose.animation.EnterTransition import androidx.compose.animation.core.Animatable -import androidx.navigation.compose.composable +import androidx.compose.animation.scaleOut import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.Surface +import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.graphics.TransformOrigin import androidx.compose.ui.input.pointer.util.VelocityTracker import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.unit.dp +import androidx.navigation.NavHostController +import androidx.navigation.compose.NavHost +import androidx.navigation.compose.composable +import androidx.navigation.compose.rememberNavController import kotlin.coroutines.cancellation.CancellationException - @Composable private fun PredictiveBackOverrideExit( modifier: Modifier, @@ -39,7 +54,7 @@ private fun PredictiveBackOverrideExit( popExitTransition = { scaleOut( targetScale = 0.9f, - transformOrigin = TransformOrigin(pivotFractionX = 0.5f, pivotFractionY = 0.5f) + transformOrigin = TransformOrigin(pivotFractionX = 0.5f, pivotFractionY = 0.5f) ) }, popEnterTransition = { @@ -66,16 +81,16 @@ private fun PredictiveBackOverrideExit( @Composable private fun HomeScreen( - modifier: Modifier = Modifier, navController: NavHostController + modifier: Modifier = Modifier, + navController: NavHostController ) { - } @Composable private fun SettingsScreen( - modifier: Modifier = Modifier, navController: NavHostController + modifier: Modifier = Modifier, + navController: NavHostController ) { - } @Composable @@ -130,7 +145,6 @@ private fun PredictiveBackHandlerManualProgress() { velocityTracker.resetTracking() } // [END android_compose_predictivebackhandler] - } } @@ -139,4 +153,4 @@ private enum class DrawerState { Closed } -private val DrawerWidth = 300.dp \ No newline at end of file +private val DrawerWidth = 300.dp