[Android] Onboarding: fix the permission state when coming back from the no permission fragment
Nicolas Pomepuy
git at videolan.org
Fri Jun 17 11:48:27 UTC 2022
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Fri Jun 17 07:14:20 2022 +0200| [086e089563fdd6bdf2e3f9d0dbe92ffdcbff2e14] | committer: Duncan McNamara
Onboarding: fix the permission state when coming back from the no permission fragment
> https://code.videolan.org/videolan/vlc-android/commit/086e089563fdd6bdf2e3f9d0dbe92ffdcbff2e14
---
.../vlc/gui/onboarding/OnboardingPermissionFragment.kt | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingPermissionFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingPermissionFragment.kt
index 7a1b36f6f..224776240 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingPermissionFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/onboarding/OnboardingPermissionFragment.kt
@@ -74,6 +74,16 @@ class OnboardingPermissionFragment : OnboardingFragment(), View.OnClickListener
currentlySelected.setColorFilter(ContextCompat.getColor(requireActivity(), R.color.orange500))
}
+ override fun onResume() {
+ super.onResume()
+ when(viewModel.permissionType) {
+ PermissionType.NONE -> permNone
+ PermissionType.ALL -> permAll
+ PermissionType.MEDIA -> permMedia
+ }.performClick()
+
+ }
+
override fun onClick(view: View) {
view.background = ContextCompat.getDrawable(requireActivity(), R.drawable.theme_selection_rounded)
view.animate().scaleX(1F).scaleY(1F)
More information about the Android
mailing list