Skip to content

Commit

Permalink
Apply Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
JolandaVerhoef authored and github-actions[bot] committed Nov 18, 2024
1 parent 54aad13 commit 5afffab
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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]

}
}
}
Expand Down Expand Up @@ -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]
Expand Down
20 changes: 18 additions & 2 deletions misc/src/main/java/com/example/snippets/DataRepository.kt
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
16 changes: 16 additions & 0 deletions misc/src/main/java/com/example/snippets/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 16 additions & 0 deletions misc/src/main/java/com/example/snippets/MyApplication.kt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 16 additions & 0 deletions misc/src/main/java/com/example/snippets/navigation/Destination.kt
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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

/*
Expand Down
18 changes: 17 additions & 1 deletion misc/src/main/java/com/example/snippets/ui/theme/Color.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,4 +24,4 @@ val Pink80 = Color(0xFFEFB8C8)

val Purple40 = Color(0xFF6650a4)
val PurpleGrey40 = Color(0xFF625b71)
val Pink40 = Color(0xFF7D5260)
val Pink40 = Color(0xFF7D5260)
18 changes: 17 additions & 1 deletion misc/src/main/java/com/example/snippets/ui/theme/Theme.kt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -54,4 +70,4 @@ fun SnippetsTheme(
typography = Typography,
content = content
)
}
}
18 changes: 17 additions & 1 deletion misc/src/main/java/com/example/snippets/ui/theme/Type.kt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,4 +47,4 @@ val Typography = Typography(
letterSpacing = 0.5.sp
)
*/
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ fun SnapScrollableScreen() {
}

@Composable
fun PositionScrollIndicator(){
fun PositionScrollIndicator() {
// [START android_wear_rotary_position_indicator]
val listState = rememberScalingLazyListState()
Scaffold(
Expand Down

0 comments on commit 5afffab

Please sign in to comment.