PermissionsFragment: allow to go forward without granting permissions

This commit is contained in:
Oliver Scott
2021-09-02 22:58:26 -04:00
parent 2def492c1e
commit 9a94e81bc0
2 changed files with 0 additions and 21 deletions

View File

@@ -142,12 +142,6 @@ class OnboardingActivity : BaseActivity() {
save(PREFERENCE_INTRO, true)
open(SplashActivity::class.java, true)
}
for (fragment in supportFragmentManager.fragments) {
if (fragment is PermissionsFragment) {
B.btnForward.isEnabled = fragment.canGoForward()
break
}
}
} else {
B.btnForward.text = getString(R.string.action_next)
B.btnForward.setOnClickListener {

View File

@@ -97,15 +97,6 @@ class PermissionsFragment : BaseFragment() {
) == PackageManager.PERMISSION_GRANTED
val storageManager = if (isRAndAbove()) Environment.isExternalStorageManager() else true
val canInstallPackages = if (isOAndAbove()) requireContext().packageManager.canRequestPackageInstalls() else true
canGoForward = writeExternalStorage && storageManager && canInstallPackages
if (canGoForwardInitial == null) {
canGoForwardInitial = canGoForward
}
if (canGoForward && canGoForwardInitial == false) {
if (activity is OnboardingActivity) {
(activity!! as OnboardingActivity).refreshButtonState()
}
}
setFilterDuplicates(true)
installerList.forEach {
add(
@@ -177,10 +168,4 @@ class PermissionsFragment : BaseFragment() {
}
}
private var canGoForward = false
private var canGoForwardInitial: Boolean? = null
fun canGoForward(): Boolean {
return canGoForward
}
}