From ccbb81e9f514dd40000de6b7f965083b2916dfe6 Mon Sep 17 00:00:00 2001 From: Matthias Urhahn Date: Sun, 28 Jan 2018 12:23:40 +0100 Subject: [PATCH] Ask for permission if necessary when browsing local sources. (#1216) --- .../eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt index 4606ce585..ceed07a35 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/catalogue/CatalogueController.kt @@ -1,5 +1,6 @@ package eu.kanade.tachiyomi.ui.catalogue +import android.Manifest.permission.WRITE_EXTERNAL_STORAGE import android.support.v7.widget.LinearLayoutManager import android.support.v7.widget.SearchView import android.view.* @@ -15,6 +16,7 @@ import eu.kanade.tachiyomi.data.preference.PreferencesHelper import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.online.LoginSource import eu.kanade.tachiyomi.ui.base.controller.NucleusController +import eu.kanade.tachiyomi.ui.base.controller.requestPermissionsSafe import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction import eu.kanade.tachiyomi.ui.catalogue.browse.BrowseCatalogueController import eu.kanade.tachiyomi.ui.catalogue.global_search.CatalogueSearchController @@ -99,6 +101,8 @@ class CatalogueController : NucleusController(), recycler.layoutManager = LinearLayoutManager(view.context) recycler.adapter = adapter recycler.addItemDecoration(SourceDividerItemDecoration(view.context)) + + requestPermissionsSafe(arrayOf(WRITE_EXTERNAL_STORAGE), 301) } override fun onDestroyView(view: View) {