diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2022-11-18 14:24:07 +0530 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2022-11-18 14:24:07 +0530 |
commit | a981b6b9f75797ab3d269d01bd571fc0143f2218 (patch) | |
tree | 3606305081d8d0591c715ec1b34505cd258d948b | |
parent | 11f192532fe7111fdf9be4afe7ff659e1faa514d (diff) |
chore: inject VM with Lifecycle-ViewModel-Compose integration
-rw-r--r-- | app/build.gradle.kts | 1 | ||||
-rw-r--r-- | app/src/main/java/app/passwordstore/ui/pgp/PGPKeyListActivity.kt | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 92ed3b0d..60f3f2f2 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -72,6 +72,7 @@ dependencies { implementation(libs.androidx.documentfile) implementation(libs.androidx.fragment.ktx) implementation(libs.bundles.androidxLifecycle) + implementation(libs.androidx.lifecycle.viewmodel.compose) implementation(libs.androidx.material) implementation(libs.androidx.preference) implementation(libs.androidx.recyclerview) diff --git a/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyListActivity.kt b/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyListActivity.kt index 90a6d21f..6916e28b 100644 --- a/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyListActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/pgp/PGPKeyListActivity.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.lifecycle.viewmodel.compose.viewModel import app.passwordstore.R import app.passwordstore.ui.APSAppBar import app.passwordstore.ui.compose.theme.APSTheme @@ -70,8 +71,8 @@ class PGPKeyListActivity : ComponentActivity() { @Composable fun PGPKeyList( - viewModel: PGPKeyListViewModel, modifier: Modifier = Modifier, + viewModel: PGPKeyListViewModel = viewModel(), ) { KeyList( identifiers = viewModel.keys, |