Resolve lint warnings

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-04-18 23:52:08 +05:30
parent 5d884a8a74
commit 934c256edd
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
3 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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) {

View file

@ -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)
}
}