[LeakCanary] SplashFragment: Early return if onboarding isn't completed
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -39,8 +39,7 @@ import com.aurora.store.viewmodel.auth.AuthViewModel
|
|||||||
class SplashFragment : BaseFragment(R.layout.fragment_splash) {
|
class SplashFragment : BaseFragment(R.layout.fragment_splash) {
|
||||||
|
|
||||||
private var _binding: FragmentSplashBinding? = null
|
private var _binding: FragmentSplashBinding? = null
|
||||||
private val binding: FragmentSplashBinding
|
private val binding get() = _binding!!
|
||||||
get() = _binding!!
|
|
||||||
|
|
||||||
private val viewModel: AuthViewModel by activityViewModels()
|
private val viewModel: AuthViewModel by activityViewModels()
|
||||||
|
|
||||||
@@ -48,6 +47,13 @@ class SplashFragment : BaseFragment(R.layout.fragment_splash) {
|
|||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
_binding = FragmentSplashBinding.bind(view)
|
_binding = FragmentSplashBinding.bind(view)
|
||||||
|
|
||||||
|
if (!Preferences.getBoolean(requireContext(), PREFERENCE_INTRO)) {
|
||||||
|
findNavController().navigate(
|
||||||
|
SplashFragmentDirections.actionSplashFragmentToOnboardingFragment()
|
||||||
|
)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
binding.imgIcon.load(R.mipmap.ic_launcher) {
|
binding.imgIcon.load(R.mipmap.ic_launcher) {
|
||||||
transformations(RoundedCornersTransformation(32F))
|
transformations(RoundedCornersTransformation(32F))
|
||||||
}
|
}
|
||||||
@@ -72,12 +78,6 @@ class SplashFragment : BaseFragment(R.layout.fragment_splash) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Preferences.getBoolean(requireContext(), PREFERENCE_INTRO)) {
|
|
||||||
findNavController().navigate(
|
|
||||||
SplashFragmentDirections.actionSplashFragmentToOnboardingFragment()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
attachActions()
|
attachActions()
|
||||||
|
|
||||||
//Initial status
|
//Initial status
|
||||||
|
|||||||
Reference in New Issue
Block a user