Disable search fab and add a skeleton of search screen.
This commit is contained in:
parent
54e09e5f1d
commit
70aa2a7972
15 changed files with 296 additions and 49 deletions
|
|
@ -23,12 +23,7 @@ class AuthenticationRepository @Inject constructor(
|
|||
val credential: GoogleAccountCredential
|
||||
get() {
|
||||
val credential = GoogleAccountCredential
|
||||
.usingOAuth2(
|
||||
context, listOf(
|
||||
SheetsScopes.SPREADSHEETS,
|
||||
SheetsScopes.SPREADSHEETS_READONLY,
|
||||
)
|
||||
)
|
||||
.usingOAuth2(context, capabilities)
|
||||
.setBackOff(ExponentialBackOff())
|
||||
|
||||
credential.selectedAccount = signInCredential.value?.let {
|
||||
|
|
@ -43,4 +38,11 @@ class AuthenticationRepository @Inject constructor(
|
|||
) {
|
||||
signInCredential.value = credential
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val capabilities = listOf(
|
||||
// SheetsScopes.SPREADSHEETS,
|
||||
SheetsScopes.SPREADSHEETS_READONLY,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -95,16 +95,16 @@ class LexiconRepository @Inject constructor(
|
|||
Lexicon(
|
||||
id = index,
|
||||
name = name,
|
||||
diminutive = diminutive,
|
||||
diminutive = diminutive?.takeIf { it.isNotBlank() },
|
||||
gender = when (gender) {
|
||||
"Male" -> Lexicon.Gender.MALE
|
||||
"Femelle" -> Lexicon.Gender.FEMALE
|
||||
else -> Lexicon.Gender.UNDETERMINED
|
||||
},
|
||||
race = race,
|
||||
race = race?.takeIf { it.isNotBlank() },
|
||||
portrait = portrait?.split("\n")?.mapNotNull { it.toUriOrNull() } ?: emptyList(),
|
||||
description = description,
|
||||
history = history,
|
||||
description = description?.takeIf { it.isNotBlank() },
|
||||
history = history?.takeIf { it.isNotBlank() },
|
||||
)
|
||||
} else {
|
||||
null
|
||||
|
|
@ -119,7 +119,7 @@ class LexiconRepository @Inject constructor(
|
|||
}
|
||||
|
||||
private fun String?.toUriOrNull(): Uri? = try {
|
||||
this?.toUri()
|
||||
this?.takeIf { it.isNotBlank() }?.toUri()
|
||||
} catch (_: Exception) {
|
||||
null
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue