Sha256: 4673d2c78051c48621218d8298491af4505e795369ce61b71bfdd2e18dc506b6
Contents?: true
Size: 861 Bytes
Versions: 1
Compression:
Stored size: 861 Bytes
Contents
package <%= package_name %>.features.web import <%= package_name %>.base.NavDestination import <%= package_name %>.util.SIGN_IN_URL import dev.hotwire.turbo.fragments.TurboWebFragment import dev.hotwire.turbo.nav.TurboNavGraphDestination import dev.hotwire.turbo.visit.TurboVisitAction.REPLACE import dev.hotwire.turbo.visit.TurboVisitOptions @TurboNavGraphDestination(uri = "turbo://fragment/web") open class WebFragment : TurboWebFragment(), NavDestination { override fun onVisitErrorReceived(location: String, errorCode: Int) { when (errorCode) { 401 -> navigate(SIGN_IN_URL, TurboVisitOptions(action = REPLACE)) else -> super.onVisitErrorReceived(location, errorCode) } } override fun createErrorView(statusCode: Int): View { return layoutInflater.inflate(R.layout.error_web, null) } }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
turbo-native-initializer-0.0.5 | lib/turbo_native_initializer/templates/android_stack/app/src/main/java/dev/hotwire/turbo/turbonativeproject/features/web/WebFragment.kt.tt |