mirror of
https://github.com/bitwarden/android.git
synced 2024-10-31 15:15:34 +03:00
Clean up imports (#1085)
This commit is contained in:
parent
cfc6dff1d7
commit
048171e04d
11 changed files with 14 additions and 8 deletions
|
@ -40,6 +40,7 @@ val SyncResponseJson.Policy.policyInformation: PolicyInformation?
|
|||
PolicyTypeJson.MAXIMUM_VAULT_TIMEOUT -> {
|
||||
Json.decodeFromStringOrNull<PolicyInformation.VaultTimeout>(it)
|
||||
}
|
||||
|
||||
PolicyTypeJson.SEND_OPTIONS -> {
|
||||
Json.decodeFromStringOrNull<PolicyInformation.SendOptions>(it)
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ class BitwardenAutofillService : AutofillService() {
|
|||
*/
|
||||
@Inject
|
||||
lateinit var processor: AutofillProcessor
|
||||
|
||||
/**
|
||||
* App information for the autofill feature.
|
||||
*/
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.x8bit.bitwarden.data.vault.datasource.network.service
|
||||
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.FolderJsonRequest
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateFolderResponseJson
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.SyncResponseJson
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateFolderResponseJson
|
||||
|
||||
/**
|
||||
* Provides an API for querying folder endpoints.
|
||||
|
|
|
@ -4,8 +4,8 @@ import com.x8bit.bitwarden.data.platform.datasource.network.model.toBitwardenErr
|
|||
import com.x8bit.bitwarden.data.platform.datasource.network.util.parseErrorBodyOrNull
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.api.FoldersApi
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.FolderJsonRequest
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateFolderResponseJson
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.SyncResponseJson
|
||||
import com.x8bit.bitwarden.data.vault.datasource.network.model.UpdateFolderResponseJson
|
||||
import kotlinx.serialization.json.Json
|
||||
|
||||
class FolderServiceImpl(
|
||||
|
|
|
@ -22,8 +22,8 @@ import com.x8bit.bitwarden.data.vault.repository.model.DeleteFolderResult
|
|||
import com.x8bit.bitwarden.data.vault.repository.model.DeleteSendResult
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.DomainsData
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.DownloadAttachmentResult
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.GenerateTotpResult
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.ExportVaultDataResult
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.GenerateTotpResult
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.RemovePasswordSendResult
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.RestoreCipherResult
|
||||
import com.x8bit.bitwarden.data.vault.repository.model.SendData
|
||||
|
|
|
@ -127,6 +127,7 @@ class MasterPasswordHintViewModel @Inject constructor(
|
|||
it.copy(dialog = MasterPasswordHintState.DialogState.PasswordHintSent)
|
||||
}
|
||||
}
|
||||
|
||||
is PasswordHintResult.Error -> {
|
||||
val errorMessage = action.result.message?.asText()
|
||||
?: R.string.generic_error_message.asText()
|
||||
|
|
|
@ -57,6 +57,7 @@ class PasswordHistoryViewModel @Inject constructor(
|
|||
.onEach(::sendAction)
|
||||
.launchIn(viewModelScope)
|
||||
}
|
||||
|
||||
is GeneratorPasswordHistoryMode.Item -> {
|
||||
vaultRepository
|
||||
.getVaultItemStateFlow(passwordHistoryMode.itemId)
|
||||
|
@ -103,11 +104,13 @@ class PasswordHistoryViewModel @Inject constructor(
|
|||
is DataState.Error -> {
|
||||
PasswordHistoryState.ViewState.Error(R.string.an_error_has_occurred.asText())
|
||||
}
|
||||
|
||||
is DataState.Loaded -> action.state.data?.passwordHistory.toViewState()
|
||||
is DataState.Loading -> PasswordHistoryState.ViewState.Loading
|
||||
is DataState.NoNetwork -> {
|
||||
PasswordHistoryState.ViewState.Error(R.string.an_error_has_occurred.asText())
|
||||
}
|
||||
|
||||
is DataState.Pending -> action.state.data?.passwordHistory.toViewState()
|
||||
}
|
||||
mutableStateFlow.update { it.copy(viewState = newState) }
|
||||
|
@ -163,6 +166,7 @@ data class PasswordHistoryState(
|
|||
*/
|
||||
val menuEnabled: Boolean
|
||||
get() = passwordHistoryMode is GeneratorPasswordHistoryMode.Default
|
||||
|
||||
/**
|
||||
* Represents the specific view states for the password history screen.
|
||||
*/
|
||||
|
|
|
@ -123,6 +123,7 @@ fun AttachmentItemContent(
|
|||
onAttachmentDownloadClick(attachmentItem)
|
||||
},
|
||||
onDismissClick = { shouldShowSizeWarningDialog = false },
|
||||
onDismissRequest = { shouldShowSizeWarningDialog = false },)
|
||||
onDismissRequest = { shouldShowSizeWarningDialog = false },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import com.x8bit.bitwarden.ui.vault.feature.vault.VaultState
|
|||
import com.x8bit.bitwarden.ui.vault.model.VaultCardBrand
|
||||
import com.x8bit.bitwarden.ui.vault.model.VaultLinkedFieldType
|
||||
import com.x8bit.bitwarden.ui.vault.model.findVaultCardBrandWithNameOrNull
|
||||
import java.lang.NumberFormatException
|
||||
import java.time.format.DateTimeFormatter
|
||||
import java.util.TimeZone
|
||||
|
||||
|
|
|
@ -28,13 +28,13 @@ import com.x8bit.bitwarden.ui.platform.components.model.IconRes
|
|||
import com.x8bit.bitwarden.ui.vault.feature.itemlisting.model.ListingItemOverflowAction
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.model.VaultFilterData
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.model.VaultFilterType
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.vaultFilterDataIfRequired
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.initials
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.toAccountSummaries
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.toActiveAccountSummary
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.toAppBarTitle
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.toVaultFilterData
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.toViewState
|
||||
import com.x8bit.bitwarden.ui.vault.feature.vault.util.vaultFilterDataIfRequired
|
||||
import com.x8bit.bitwarden.ui.vault.model.VaultCardBrand
|
||||
import com.x8bit.bitwarden.ui.vault.model.VaultItemListingType
|
||||
import com.x8bit.bitwarden.ui.vault.util.shortName
|
||||
|
|
|
@ -14,7 +14,6 @@ import androidx.compose.material3.IconButton
|
|||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
|
|
Loading…
Reference in a new issue