This is the gist which explains how to use Android predictive back gesture and iOS swipe to go back when using Voyager in Compose multiplatform.
If you are just using Android, you can merge the commonMain stuff and the androidMain stuff.
// commonMain | |
@Composable | |
fun App() { | |
MyApplicationTheme { | |
Navigator( | |
screen = InitialScreen(), | |
disposeBehavior = NavigatorDisposeBehavior(), | |
onBackPressed = { true }, | |
) { |
This is the gist which explains how to use Android predictive back gesture and iOS swipe to go back when using Voyager in Compose multiplatform.
If you are just using Android, you can merge the commonMain stuff and the androidMain stuff.
import android.view.LayoutInflater | |
import android.view.View | |
import android.view.ViewGroup | |
import androidx.appcompat.app.AppCompatActivity | |
import androidx.fragment.app.DialogFragment | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.DefaultLifecycleObserver | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.viewbinding.ViewBinding |
// https://github.com/Zhuinden/fragmentviewbindingdelegate-kt | |
import android.view.View | |
import androidx.fragment.app.Fragment | |
import androidx.lifecycle.DefaultLifecycleObserver | |
import androidx.lifecycle.Lifecycle | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.Observer | |
import androidx.viewbinding.ViewBinding | |
import kotlin.properties.ReadOnlyProperty |