From 5afffab0773354571a010da0cce626ad00b3e8e1 Mon Sep 17 00:00:00 2001 From: JolandaVerhoef Date: Mon, 18 Nov 2024 12:29:00 +0000 Subject: [PATCH] Apply Spotless --- .../snippets/BroadcastReceiverSnippets.kt | 21 ++++++++++++++++--- .../com/example/snippets/DataRepository.kt | 20 ++++++++++++++++-- .../java/com/example/snippets/MainActivity.kt | 16 ++++++++++++++ .../com/example/snippets/MyApplication.kt | 16 ++++++++++++++ .../snippets/navigation/Destination.kt | 16 ++++++++++++++ .../snippets/navigation/LandingScreen.kt | 16 ++++++++++++++ .../com/example/snippets/ui/theme/Color.kt | 18 +++++++++++++++- .../com/example/snippets/ui/theme/Theme.kt | 18 +++++++++++++++- .../com/example/snippets/ui/theme/Type.kt | 18 +++++++++++++++- .../example/wear/snippets/rotary/Rotary.kt | 2 +- 10 files changed, 152 insertions(+), 9 deletions(-) diff --git a/misc/src/main/java/com/example/snippets/BroadcastReceiverSnippets.kt b/misc/src/main/java/com/example/snippets/BroadcastReceiverSnippets.kt index 9c4c5f9c..c77ace34 100644 --- a/misc/src/main/java/com/example/snippets/BroadcastReceiverSnippets.kt +++ b/misc/src/main/java/com/example/snippets/BroadcastReceiverSnippets.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets import android.content.BroadcastReceiver @@ -106,7 +122,7 @@ class BroadcastReceiverViewModel @Inject constructor( } fun sendBroadcast(newData: String, usePermission: Boolean = false) { - if(!usePermission) { + if (!usePermission) { // [START android_broadcast_receiver_8_send] val intent = Intent("com.example.snippets.ACTION_UPDATE_DATA").apply { putExtra("com.example.snippets.DATA", newData) @@ -122,7 +138,6 @@ class BroadcastReceiverViewModel @Inject constructor( // [START android_broadcast_receiver_9_send_with_permission] context.sendBroadcast(intent, android.Manifest.permission.ACCESS_COARSE_LOCATION) // [END android_broadcast_receiver_9_send_with_permission] - } } } @@ -231,7 +246,7 @@ fun MyApp() {} // [START android_broadcast_receiver_14_stateless] @Composable fun MyStatefulScreen() { - val myBroadcastReceiver = remember { MyBroadcastReceiver()} + val myBroadcastReceiver = remember { MyBroadcastReceiver() } val context = LocalContext.current LifecycleStartEffect(true) { // [START_EXCLUDE] diff --git a/misc/src/main/java/com/example/snippets/DataRepository.kt b/misc/src/main/java/com/example/snippets/DataRepository.kt index 492c1e80..7e626e5a 100644 --- a/misc/src/main/java/com/example/snippets/DataRepository.kt +++ b/misc/src/main/java/com/example/snippets/DataRepository.kt @@ -1,9 +1,25 @@ +/* + * 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.snippets -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.StateFlow import javax.inject.Inject import javax.inject.Singleton +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.StateFlow @Singleton class DataRepository @Inject constructor() { diff --git a/misc/src/main/java/com/example/snippets/MainActivity.kt b/misc/src/main/java/com/example/snippets/MainActivity.kt index f2c660fa..a687939e 100644 --- a/misc/src/main/java/com/example/snippets/MainActivity.kt +++ b/misc/src/main/java/com/example/snippets/MainActivity.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets import android.os.Bundle diff --git a/misc/src/main/java/com/example/snippets/MyApplication.kt b/misc/src/main/java/com/example/snippets/MyApplication.kt index 4b72a7e9..4e4a187c 100644 --- a/misc/src/main/java/com/example/snippets/MyApplication.kt +++ b/misc/src/main/java/com/example/snippets/MyApplication.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets import android.app.Application diff --git a/misc/src/main/java/com/example/snippets/navigation/Destination.kt b/misc/src/main/java/com/example/snippets/navigation/Destination.kt index 433c6437..59f424a7 100644 --- a/misc/src/main/java/com/example/snippets/navigation/Destination.kt +++ b/misc/src/main/java/com/example/snippets/navigation/Destination.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets.navigation enum class Destination(val route: String, val title: String) { diff --git a/misc/src/main/java/com/example/snippets/navigation/LandingScreen.kt b/misc/src/main/java/com/example/snippets/navigation/LandingScreen.kt index 3dda3eef..f096906d 100644 --- a/misc/src/main/java/com/example/snippets/navigation/LandingScreen.kt +++ b/misc/src/main/java/com/example/snippets/navigation/LandingScreen.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets.navigation /* diff --git a/misc/src/main/java/com/example/snippets/ui/theme/Color.kt b/misc/src/main/java/com/example/snippets/ui/theme/Color.kt index 955071f5..662ef48f 100644 --- a/misc/src/main/java/com/example/snippets/ui/theme/Color.kt +++ b/misc/src/main/java/com/example/snippets/ui/theme/Color.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets.ui.theme import androidx.compose.ui.graphics.Color @@ -8,4 +24,4 @@ val Pink80 = Color(0xFFEFB8C8) val Purple40 = Color(0xFF6650a4) val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) \ No newline at end of file +val Pink40 = Color(0xFF7D5260) diff --git a/misc/src/main/java/com/example/snippets/ui/theme/Theme.kt b/misc/src/main/java/com/example/snippets/ui/theme/Theme.kt index 08cd9e69..4dcf62e8 100644 --- a/misc/src/main/java/com/example/snippets/ui/theme/Theme.kt +++ b/misc/src/main/java/com/example/snippets/ui/theme/Theme.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets.ui.theme import android.os.Build @@ -54,4 +70,4 @@ fun SnippetsTheme( typography = Typography, content = content ) -} \ No newline at end of file +} diff --git a/misc/src/main/java/com/example/snippets/ui/theme/Type.kt b/misc/src/main/java/com/example/snippets/ui/theme/Type.kt index 7986d37e..f383a07b 100644 --- a/misc/src/main/java/com/example/snippets/ui/theme/Type.kt +++ b/misc/src/main/java/com/example/snippets/ui/theme/Type.kt @@ -1,3 +1,19 @@ +/* + * 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.snippets.ui.theme import androidx.compose.material3.Typography @@ -31,4 +47,4 @@ val Typography = Typography( letterSpacing = 0.5.sp ) */ -) \ No newline at end of file +) diff --git a/wear/src/main/java/com/example/wear/snippets/rotary/Rotary.kt b/wear/src/main/java/com/example/wear/snippets/rotary/Rotary.kt index a6115816..97bace50 100644 --- a/wear/src/main/java/com/example/wear/snippets/rotary/Rotary.kt +++ b/wear/src/main/java/com/example/wear/snippets/rotary/Rotary.kt @@ -243,7 +243,7 @@ fun SnapScrollableScreen() { } @Composable -fun PositionScrollIndicator(){ +fun PositionScrollIndicator() { // [START android_wear_rotary_position_indicator] val listState = rememberScalingLazyListState() Scaffold(