add logic for SplashScreenFragment
This commit is contained in:
parent
5cfb98ecfb
commit
a8ffa47f1a
@ -4,7 +4,7 @@
|
||||
<selectionStates>
|
||||
<SelectionState runConfigName="app">
|
||||
<option name="selectionMode" value="DROPDOWN" />
|
||||
<DropdownSelection timestamp="2024-10-25T13:51:03.991973200Z">
|
||||
<DropdownSelection timestamp="2024-10-25T14:57:29.908730700Z">
|
||||
<Target type="DEFAULT_BOOT">
|
||||
<handle>
|
||||
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\adm\.android\avd\Medium_Phone_API_35.avd" />
|
||||
|
@ -5,17 +5,25 @@ import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.commit
|
||||
import androidx.fragment.app.replace
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.example.autorization.R
|
||||
import com.example.autorization.ui.fragments.signup.SignUpScreen
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class SplashScreenFragment : Fragment(R.layout.fragment_splash_screen) {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
|
||||
return super.onCreateView(inflater, container, savedInstanceState)
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
lifecycleScope.launch {
|
||||
run {
|
||||
delay(3000)
|
||||
parentFragmentManager.commit {
|
||||
replace<SignUpScreen>(R.id.fragment_container_view)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -9,7 +9,7 @@
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_container_view"
|
||||
android:name="com.example.autorization.ui.fragments.signup.SignUpScreen"
|
||||
android:name="com.example.autorization.ui.fragments.SplashScreenFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>z
|
||||
android:layout_height="match_parent"/>
|
||||
</FrameLayout>
|
Loading…
Reference in New Issue
Block a user