diff options
Diffstat (limited to 'app/src/main/java')
3 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt index fd7bdf83..c9b9824f 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordFragment.kt @@ -120,7 +120,7 @@ class PasswordFragment : Fragment() { val path = requireNotNull(requireArguments().getString(PasswordStore.REQUEST_ARG_PATH)) model.navigateTo(File(path), pushPreviousLocation = false) - model.searchResult.observe(this) { result -> + model.searchResult.observe(viewLifecycleOwner) { result -> // Only run animations when the new list is filtered, i.e., the user submitted a search, // and not on folder navigations since the latter leads to too many removal animations. (recyclerView.itemAnimator as OnOffItemAnimator).isEnabled = result.isFiltered diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt index 90b2e631..ce5300c1 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt @@ -170,6 +170,7 @@ class PasswordStore : AppCompatActivity() { } override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults) // If request is cancelled, the result arrays are empty. if (requestCode == REQUEST_EXTERNAL_STORAGE) { if (grantResults.isNotEmpty() && grantResults[0] == PackageManager.PERMISSION_GRANTED) { diff --git a/app/src/main/java/com/zeapo/pwdstore/SelectFolderFragment.kt b/app/src/main/java/com/zeapo/pwdstore/SelectFolderFragment.kt index a7489893..b9e2e6be 100644 --- a/app/src/main/java/com/zeapo/pwdstore/SelectFolderFragment.kt +++ b/app/src/main/java/com/zeapo/pwdstore/SelectFolderFragment.kt @@ -57,7 +57,7 @@ class SelectFolderFragment : Fragment() { val path = requireNotNull(requireArguments().getString(PasswordStore.REQUEST_ARG_PATH)) model.navigateTo(File(path), listMode = ListMode.DirectoriesOnly, pushPreviousLocation = false) - model.searchResult.observe(this) { result -> + model.searchResult.observe(viewLifecycleOwner) { result -> recyclerAdapter.submitList(result.passwordItems) } } |