Bug 1826944 - Onboarding now follows device orientation for tablets

fenix/114.1.0
rahulsainani 2 years ago committed by mergify[bot]
parent 872333dd83
commit 6c7fcda055

@ -45,8 +45,10 @@ class JunoOnboardingFragment : Fragment() {
@SuppressLint("SourceLockedOrientationActivity")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (isNotATablet()) {
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
}
}
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
override fun onCreateView(
@ -69,8 +71,10 @@ class JunoOnboardingFragment : Fragment() {
override fun onDestroy() {
super.onDestroy()
if (isNotATablet()) {
activity?.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
}
}
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
@Composable
@ -169,4 +173,7 @@ class JunoOnboardingFragment : Fragment() {
private fun shouldShowNotificationPage(context: Context) =
!NotificationManagerCompat.from(context.applicationContext).areNotificationsEnabledSafe() &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
private fun isNotATablet() =
!resources.getBoolean(R.bool.tablet)
}

Loading…
Cancel
Save