add logic for SplashScreenFragment

This commit is contained in:
adm 2024-10-25 18:05:10 +03:00
parent 5cfb98ecfb
commit a8ffa47f1a
3 changed files with 19 additions and 11 deletions

View File

@ -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" />

View File

@ -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)
}
}
}
}
}

View File

@ -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>