Skip to content

Commit b12d692

Browse files
committed
Add spotless fixes
1 parent c6f551f commit b12d692

20 files changed

+142
-60
lines changed

Shrine/app/src/main/java/com/authentication/shrine/CredentialManagerUtils.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ import androidx.credentials.SignalUnknownCredentialRequest
3939
import androidx.credentials.exceptions.CreateCredentialException
4040
import androidx.credentials.exceptions.GetCredentialCancellationException
4141
import androidx.credentials.exceptions.publickeycredential.GetPublicKeyCredentialDomException
42-
import com.authentication.shrine.repository.SERVER_CLIENT_ID
43-
import com.google.android.libraries.identity.googleid.GetGoogleIdOption
4442
import androidx.datastore.core.DataStore
4543
import androidx.datastore.preferences.core.Preferences
4644
import com.authentication.shrine.repository.AuthRepository.Companion.RP_ID_KEY
4745
import com.authentication.shrine.repository.AuthRepository.Companion.USER_ID_KEY
4846
import com.authentication.shrine.repository.AuthRepository.Companion.read
47+
import com.authentication.shrine.repository.SERVER_CLIENT_ID
48+
import com.google.android.libraries.identity.googleid.GetGoogleIdOption
4949
import org.json.JSONObject
5050
import javax.inject.Inject
5151

@@ -117,7 +117,7 @@ class CredentialManagerUtils @Inject constructor(
117117
.setServerClientId(SERVER_CLIENT_ID)
118118
.setFilterByAuthorizedAccounts(false)
119119
.build(),
120-
)
120+
),
121121
)
122122
result = credentialManager.getCredential(context, credentialRequest)
123123
} catch (e: GetCredentialCancellationException) {

Shrine/app/src/main/java/com/authentication/shrine/api/AuthApiService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ interface AuthApiService {
165165
*/
166166
@POST("federation/options")
167167
suspend fun getFederationOptions(
168-
@Body urls: FederationOptionsRequest
168+
@Body urls: FederationOptionsRequest,
169169
): Response<GenericAuthResponse>
170170

171171
/**
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
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+
*/
116
package com.authentication.shrine.model
217

318
/**
419
* Represents the request body for getting federation options from the server.
520
* @param urls a list of urls to send for federated requests.
621
*/
722
data class FederationOptionsRequest(
8-
val urls: List<String> = listOf("https://accounts.google.com")
9-
)
23+
val urls: List<String> = listOf("https://accounts.google.com"),
24+
)
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
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+
*/
116
package com.authentication.shrine.model
217

318
/**
@@ -7,5 +22,5 @@ package com.authentication.shrine.model
722
*/
823
data class SignInWithGoogleRequest(
924
val token: String,
10-
val url: String = "https://accounts.google.com"
11-
)
25+
val url: String = "https://accounts.google.com",
26+
)

Shrine/app/src/main/java/com/authentication/shrine/repository/AuthRepository.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,15 +395,15 @@ class AuthRepository @Inject constructor(
395395
*/
396396
suspend fun signInWithFederatedTokenResponse(
397397
sessionId: String,
398-
credentialResponse: GetCredentialResponse
398+
credentialResponse: GetCredentialResponse,
399399
): Boolean {
400400
val credential = credentialResponse.credential
401401
try {
402402
if (credential is CustomCredential) {
403403
return verifyIdToken(
404404
sessionId,
405405
GoogleIdTokenCredential
406-
.createFrom(credential.data).idToken
406+
.createFrom(credential.data).idToken,
407407
)
408408
} else {
409409
Log.e(TAG, "Invalid federated token credential")
@@ -594,7 +594,7 @@ class AuthRepository @Inject constructor(
594594
suspend fun verifyIdToken(sessionId: String, token: String): Boolean {
595595
val apiResult = authApiService.verifyIdToken(
596596
cookie = sessionId.createCookieHeader(),
597-
requestParams = SignInWithGoogleRequest(token = token)
597+
requestParams = SignInWithGoogleRequest(token = token),
598598
)
599599

600600
if (apiResult.isSuccessful) {

Shrine/app/src/main/java/com/authentication/shrine/ui/AuthenticationScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.Arrangement
2121
import androidx.compose.foundation.layout.Column
2222
import androidx.compose.foundation.layout.Spacer
2323
import androidx.compose.foundation.layout.fillMaxSize
24-
import androidx.compose.foundation.layout.fillMaxWidth
2524
import androidx.compose.foundation.layout.height
2625
import androidx.compose.foundation.layout.padding
2726
import androidx.compose.material3.Scaffold
@@ -200,7 +199,8 @@ fun AuthenticationScreen(
200199
.height(dimensionResource(R.dimen.siwg_button_height))
201200
.clickable(
202201
enabled = !uiState.isLoading,
203-
onClick = onSignInWithSignInWithGoogleRequest)
202+
onClick = onSignInWithSignInWithGoogleRequest,
203+
),
204204
)
205205
}
206206

@@ -236,7 +236,7 @@ fun AuthenticationScreen(
236236
if (snackbarMessage != null) {
237237
LaunchedEffect(snackbarMessage) {
238238
snackbarHostState.showSnackbar(
239-
message = snackbarMessage
239+
message = snackbarMessage,
240240
)
241241
}
242242
}

Shrine/app/src/main/java/com/authentication/shrine/ui/PasskeyManagementScreen.kt

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import androidx.compose.runtime.Composable
4040
import androidx.compose.runtime.LaunchedEffect
4141
import androidx.compose.runtime.collectAsState
4242
import androidx.compose.runtime.getValue
43-
import androidx.compose.runtime.mutableStateOf
4443
import androidx.compose.runtime.remember
4544
import androidx.compose.runtime.setValue
4645
import androidx.compose.ui.Alignment
@@ -109,7 +108,7 @@ fun PasskeyManagementScreen(
109108

110109
val onSignalBtnClicked = {
111110
val credentialIdsList = passkeysList
112-
.filter { it.isSelected }
111+
.filter { !it.isSelected }
113112
.map { it.id }
114113
if (credentialIdsList.isNotEmpty()) {
115114
viewModel.signalAccepted(credentialIdsList)
@@ -188,8 +187,8 @@ fun PasskeyManagementScreen(
188187

189188
ShrineButton(
190189
onClick = onSignal,
191-
buttonText = "Signal Accepted",
192-
modifier = Modifier.fillMaxWidth()
190+
buttonText = "Delete selected credentials",
191+
modifier = Modifier.fillMaxWidth(),
193192
)
194193
} else {
195194
ShrineButton(
@@ -251,7 +250,7 @@ fun PasskeysListColumn(
251250
credentialProviderName = item.name,
252251
passkeyCreationDate = item.registeredAt.toReadableDate(),
253252
isChecked = item.isSelected,
254-
modifier = Modifier.clickable { onItemClick(index) }
253+
modifier = Modifier.clickable { onItemClick(index) },
255254
)
256255

257256
if (index < passkeysList.lastIndex) {
@@ -303,7 +302,7 @@ fun PasskeysDetailsRow(
303302
Checkbox(
304303
checked = isChecked,
305304
onCheckedChange = {},
306-
modifier = Modifier.clickable(enabled = false, onClick = { })
305+
modifier = Modifier.clickable(enabled = false, onClick = { }),
307306
)
308307

309308
Image(
@@ -367,7 +366,7 @@ fun PasskeyManagementScreenPreview() {
367366
),
368367
),
369368
aaguidData = mapOf(),
370-
{_ -> },
369+
{ _ -> },
371370
{},
372371
)
373372
}

Shrine/app/src/main/java/com/authentication/shrine/ui/UpdateProfileScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ fun UpdateProfileScreen(
6666
value = username,
6767
onValueChange = onUsernameChanged,
6868
hint = stringResource(R.string.username),
69-
modifier = Modifier.fillMaxWidth()
69+
modifier = Modifier.fillMaxWidth(),
7070
)
7171

7272
ShrineTextField(
7373
value = email,
7474
onValueChange = onEmailChanged,
7575
hint = stringResource(R.string.email_address),
76-
modifier = Modifier.fillMaxWidth()
76+
modifier = Modifier.fillMaxWidth(),
7777
)
7878

7979
ShrineButton(
@@ -92,7 +92,7 @@ fun TestPreview() {
9292
{},
9393
"",
9494
{},
95-
{_, _ -> },
95+
{ _, _ -> },
9696
)
9797
}
9898
}

Shrine/app/src/main/java/com/authentication/shrine/ui/common/ShrineTextField.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import androidx.compose.runtime.Composable
2525
import androidx.compose.ui.Modifier
2626
import androidx.compose.ui.res.dimensionResource
2727
import androidx.compose.ui.res.stringResource
28-
import androidx.compose.ui.text.input.TextFieldValue
2928
import androidx.compose.ui.tooling.preview.Preview
3029
import androidx.compose.ui.unit.dp
3130
import com.authentication.shrine.R

Shrine/app/src/main/java/com/authentication/shrine/ui/viewmodel/PasskeyManagementViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class PasskeyManagementViewModel @Inject constructor(
271271
} else {
272272
passkeyCredential
273273
}
274-
}
274+
},
275275
)
276276
}
277277
}

0 commit comments

Comments
 (0)