chore: cleanup IDE warnings

This commit is contained in:
Harsh Shandilya 2023-06-27 17:28:54 +05:30
parent 6263e374d8
commit ee6895b2e8
No known key found for this signature in database
6 changed files with 1 additions and 15 deletions

View file

@ -6,9 +6,7 @@
package app.passwordstore.data.password
import app.passwordstore.data.passfile.Totp
import kotlin.time.ExperimentalTime
@OptIn(ExperimentalTime::class)
class FieldItem(val key: String, val value: String, val action: ActionType) {
enum class ActionType {
COPY,

View file

@ -4,7 +4,6 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
@ -30,7 +29,6 @@ import app.passwordstore.ui.compose.PasswordField
import app.passwordstore.ui.compose.theme.APSThemePreview
import app.passwordstore.util.time.UserClock
import app.passwordstore.util.totp.UriTotpFinder
import kotlin.time.ExperimentalTime
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
@ -45,7 +43,6 @@ import kotlinx.coroutines.runBlocking
* When [readOnly] is `false`, the [TextField]s are rendered editable but currently do not pass up
* their "updated" state to anything. This will be changed in later commits.
*/
@OptIn(ExperimentalTime::class, ExperimentalMaterial3Api::class)
@Composable
fun PasswordEntryScreen(
entryName: String,
@ -84,7 +81,7 @@ fun PasswordEntryScreen(
TextField(
value = totp.value,
onValueChange = {},
readOnly = readOnly,
readOnly = true,
label = { Text("OTP (expires in ${totp.remainingTime.inWholeSeconds}s)") },
trailingIcon = { CopyButton({ totp.value }) },
modifier = Modifier.padding(bottom = 8.dp),
@ -107,7 +104,6 @@ fun PasswordEntryScreen(
}
@Composable
@OptIn(ExperimentalMaterial3Api::class)
private fun ExtraContent(
entry: PasswordEntry,
readOnly: Boolean,

View file

@ -8,7 +8,6 @@ import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
import androidx.activity.viewModels
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.FloatingActionButton
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@ -25,7 +24,6 @@ import app.passwordstore.util.viewmodel.PGPKeyListViewModel
import dagger.hilt.android.AndroidEntryPoint
@AndroidEntryPoint
@OptIn(ExperimentalMaterial3Api::class)
class PGPKeyListActivity : ComponentActivity() {
private val viewModel: PGPKeyListViewModel by viewModels()

View file

@ -17,14 +17,12 @@ import kotlin.collections.set
import kotlin.coroutines.coroutineContext
import kotlin.time.Duration.Companion.milliseconds
import kotlin.time.Duration.Companion.seconds
import kotlin.time.ExperimentalTime
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.isActive
/** Represents a single entry in the password store. */
@OptIn(ExperimentalTime::class)
public class PasswordEntry
@AssistedInject
constructor(

View file

@ -1,8 +1,6 @@
package app.passwordstore.data.passfile
import kotlin.time.Duration
import kotlin.time.ExperimentalTime
/** Holder for a TOTP secret and the duration for which it is valid. */
@OptIn(ExperimentalTime::class)
public data class Totp(public val value: String, public val remainingTime: Duration)

View file

@ -1,6 +1,5 @@
package app.passwordstore.ui.compose
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Text
@ -15,7 +14,6 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.input.PasswordVisualTransformation
import androidx.compose.ui.text.input.VisualTransformation
@OptIn(ExperimentalMaterial3Api::class)
@Composable
public fun PasswordField(
value: String,