|
@@ -7,6 +7,7 @@ import android.view.LayoutInflater
|
|
|
import android.view.View
|
|
import android.view.View
|
|
|
import android.view.ViewGroup
|
|
import android.view.ViewGroup
|
|
|
import androidx.fragment.app.viewModels
|
|
import androidx.fragment.app.viewModels
|
|
|
|
|
+import androidx.lifecycle.Observer
|
|
|
import androidx.lifecycle.ViewModelProvider
|
|
import androidx.lifecycle.ViewModelProvider
|
|
|
import com.mrozon.feature_splash.R
|
|
import com.mrozon.feature_splash.R
|
|
|
import com.mrozon.feature_splash.databinding.FragmentSplashBinding
|
|
import com.mrozon.feature_splash.databinding.FragmentSplashBinding
|
|
@@ -24,35 +25,21 @@ class SplashFragment : BaseFragment<FragmentSplashBinding>() {
|
|
|
|
|
|
|
|
private val viewModel by viewModels<SplashFragmentViewModel> { viewModelFactory }
|
|
private val viewModel by viewModels<SplashFragmentViewModel> { viewModelFactory }
|
|
|
|
|
|
|
|
- private fun setFullscreen() {
|
|
|
|
|
- val flags =
|
|
|
|
|
- View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
|
|
|
|
|
- View.SYSTEM_UI_FLAG_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
|
|
|
|
- requireActivity().window.decorView.systemUiVisibility = flags
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- private fun hideSystemUI() {
|
|
|
|
|
- // Enables regular immersive mode.
|
|
|
|
|
- // For "lean back" mode, remove SYSTEM_UI_FLAG_IMMERSIVE.
|
|
|
|
|
- // Or for "sticky immersive," replace it with SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
|
|
|
|
- requireActivity().window.decorView.systemUiVisibility = (View.SYSTEM_UI_FLAG_IMMERSIVE
|
|
|
|
|
- // Set the content to appear under the system bars so that the
|
|
|
|
|
- // content doesn't resize when the system bars hide and show.
|
|
|
|
|
- or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|
|
|
|
|
- or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
|
|
|
|
- or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
|
|
|
|
- // Hide the nav bar and status bar
|
|
|
|
|
- or View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
|
|
|
|
- or View.SYSTEM_UI_FLAG_FULLSCREEN)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
override fun onAttach(context: Context) {
|
|
override fun onAttach(context: Context) {
|
|
|
super.onAttach(context)
|
|
super.onAttach(context)
|
|
|
SplashFragmentComponent.injectFragment(this)
|
|
SplashFragmentComponent.injectFragment(this)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
override fun subscribeUi() {
|
|
override fun subscribeUi() {
|
|
|
-
|
|
|
|
|
|
|
+ viewModel.currentUser.observe(viewLifecycleOwner, Observer { it ->
|
|
|
|
|
+ if(it==null){
|
|
|
|
|
+ //auth user
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ //show profiles
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|