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> <selectionStates>
<SelectionState runConfigName="app"> <SelectionState runConfigName="app">
<option name="selectionMode" value="DROPDOWN" /> <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"> <Target type="DEFAULT_BOOT">
<handle> <handle>
<DeviceId pluginId="LocalEmulator" identifier="path=C:\Users\adm\.android\avd\Medium_Phone_API_35.avd" /> <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.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup 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.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) { class SplashScreenFragment : Fragment(R.layout.fragment_splash_screen) {
override fun onCreateView( override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
inflater: LayoutInflater, super.onViewCreated(view, savedInstanceState)
container: ViewGroup?, lifecycleScope.launch {
savedInstanceState: Bundle? run {
): View? { delay(3000)
parentFragmentManager.commit {
return super.onCreateView(inflater, container, savedInstanceState) replace<SignUpScreen>(R.id.fragment_container_view)
}
}
}
} }
} }

View File

@ -9,7 +9,7 @@
<androidx.fragment.app.FragmentContainerView <androidx.fragment.app.FragmentContainerView
android:id="@+id/fragment_container_view" 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_width="match_parent"
android:layout_height="match_parent"/>z android:layout_height="match_parent"/>
</FrameLayout> </FrameLayout>