Skip to content

Commit ac96ad1

Browse files
wardlaurengithub-actions[bot]
authored andcommitted
Apply Spotless
1 parent 12d0e82 commit ac96ad1

File tree

1 file changed

+23
-8
lines changed
  • compose/snippets/src/main/java/com/example/compose/snippets/components

1 file changed

+23
-8
lines changed

compose/snippets/src/main/java/com/example/compose/snippets/components/IconButton.kt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2025 The Android Open Source Project
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package com.example.compose.snippets.components
218

319
import android.graphics.drawable.Icon
@@ -14,20 +30,19 @@ import androidx.compose.material3.IconButton
1430
import androidx.compose.material3.Text
1531
import androidx.compose.runtime.Composable
1632
import androidx.compose.runtime.LaunchedEffect
33+
import androidx.compose.runtime.getValue
34+
import androidx.compose.runtime.mutableIntStateOf
35+
import androidx.compose.runtime.mutableStateOf
1736
import androidx.compose.runtime.remember
1837
import androidx.compose.runtime.rememberUpdatedState
1938
import androidx.compose.runtime.saveable.rememberSaveable
39+
import androidx.compose.runtime.setValue
2040
import androidx.compose.ui.Alignment
2141
import androidx.compose.ui.Modifier
22-
import androidx.compose.ui.graphics.vector.ImageVector
42+
import androidx.compose.ui.res.painterResource
2343
import androidx.compose.ui.tooling.preview.Preview
24-
import kotlinx.coroutines.delay
25-
import androidx.compose.runtime.getValue
26-
import androidx.compose.runtime.setValue
27-
import androidx.compose.runtime.mutableStateOf
28-
import androidx.compose.runtime.mutableIntStateOf
2944
import com.example.compose.snippets.R
30-
import androidx.compose.ui.res.painterResource
45+
import kotlinx.coroutines.delay
3146

3247
@Preview
3348
@Composable
@@ -70,7 +85,7 @@ fun MomentaryIconButton(
7085
interactionSource = interactionSource
7186
) {
7287
Icon(
73-
painter = if (isPressed) painterResource(id = selectedImage) else painterResource(id = unselectedImage) ,
88+
painter = if (isPressed) painterResource(id = selectedImage) else painterResource(id = unselectedImage),
7489
contentDescription = contentDescription,
7590
)
7691
}

0 commit comments

Comments
 (0)