Тёмный

No more String-based Routes! New Compose Navigation Release 

Stevdza-San
Подписаться 85 тыс.
Просмотров 8 тыс.
50% 1

🏆 My Online Courses
stevdza-san.com
📝 Writing on Medium
/ stevdza-san
☕ Let's get a coffee. You're paying! :)
ko-fi.com/stevdza_san
💻 Github
github.com/stevdza-san
📸 Instagram
/ stevdza_san

Опубликовано:

 

8 май 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 44   
@StevdzaSan
@StevdzaSan 2 месяца назад
For a custom data type we should override one more function in the NavType to avoid that run-time exception: serializeAsValue() and just return Json.encodeToString(value) ✅
@galaxiegalaxie5003
@galaxiegalaxie5003 2 месяца назад
Wow ita great to see such features. Anyways i wish they could make similar implementation like voyager in jepack naviagation which is so easy to do.🥰
@StevdzaSan
@StevdzaSan 2 месяца назад
@galaxiegalaxie5003 Oh yeah Voyager has a really nice API indeed 😊
@skarloti
@skarloti 2 месяца назад
You always find amazingly good content. Thanks for the effort you put into teaching us something new. My day is perfect when it starts with your videos. Thank you.
@moaliyou
@moaliyou 2 месяца назад
I'll wait to see the stable one, this is really amazing
@raja_uma1r
@raja_uma1r 2 месяца назад
I always use a navigation viewModel to hold the data( also complex objects) and then read it from the destination screen. Use enum classes to define routes to overcome typing errors. This approach with compose navigation works well in every scenario.
@manofsteel6173
@manofsteel6173 2 месяца назад
Bro I'm new to compose.can u provide any links to learn navigation
@heshamabdo6024
@heshamabdo6024 2 месяца назад
your video is amazing. Thank you so much for sharing this new technology with us.
@abdushakoor0099
@abdushakoor0099 2 месяца назад
can't wait to test it out. it's been a long time especially because we already have type-safe in xml navigation
@MaggicBones
@MaggicBones 2 месяца назад
me too !
@user-gl8yw6yu2i
@user-gl8yw6yu2i 2 месяца назад
finally!!!! it was a giant pain in the ass for me! it's time for refactoring!!
@henrik908
@henrik908 2 месяца назад
Thanks you for the video my friend.
@codeforandroid
@codeforandroid 2 месяца назад
Nice update ✌
@Klusio19
@Klusio19 2 месяца назад
Currently I'm taking Your course on Udemy ToDo App with Compose, and these string-based routes were strange to me. What a perfect time for this video to come out 😅
@StevdzaSan
@StevdzaSan 2 месяца назад
I'll also update the course with this new approach, I'm waiting for a beta release just in case. :)
@jam-burger
@jam-burger 2 месяца назад
Can you make a video about explaining all the effects (like LaunchEffect and all)
@Yang-Youtube
@Yang-Youtube 2 месяца назад
The new safe args navigation doesn't seem to work with deeplink.😢
@tusharsrivastava107
@tusharsrivastava107 2 месяца назад
They are adding @Serializable and @Parcelable both to a class ? i was under impression parcelable can improve app performance over serilization.
@Tbijo54
@Tbijo54 2 месяца назад
Can we still get runtime args from SavedStateHandle in viewmodels?
@sebastianseno9285
@sebastianseno9285 2 месяца назад
it's also work with Parcelize ?
@skarloti
@skarloti 2 месяца назад
1:38 Is it possible to replace its sealed class Screen with a sealed interface Screen?
@StevdzaSan
@StevdzaSan 2 месяца назад
Haven't used sealed interface that much at all.
@TomBerghuis
@TomBerghuis 2 месяца назад
Can you access the argument in the viewmodel?
@StevdzaSan
@StevdzaSan 2 месяца назад
Yes, you can use SavedStateHandle and call the same toRoute() function within the ViewModel.
@imammihir
@imammihir 2 месяца назад
Wow 🎉
@abobus_f1
@abobus_f1 2 месяца назад
Can you say what the better this navigation or voyager
@StevdzaSan
@StevdzaSan 2 месяца назад
Ah, you're asking hard questions 😄
@abobus_f1
@abobus_f1 2 месяца назад
@@StevdzaSan😄
@vengateshm2122
@vengateshm2122 2 месяца назад
I tried and faced the similar crash.
@ahmetfarukcuha7793
@ahmetfarukcuha7793 2 месяца назад
eventually :)
@pyaesonehan19
@pyaesonehan19 Месяц назад
@4ytonly
@4ytonly 2 месяца назад
I suggest you change the title of your video to include words navigation so its easier to find later!
@StevdzaSan
@StevdzaSan 2 месяца назад
Thanks for the tip!
@Nick-cx4rs
@Nick-cx4rs 2 месяца назад
Bro still basic ui components are (Experimental) and has bugs for 3 year still they dont care it ? And why they still making shitshow apis intead of fix experimentals and stable it. Imagine getting type safe arguments after 3 years.I really dont understand them
@StevdzaSan
@StevdzaSan 2 месяца назад
Bugs are gonna be always present. I've never had any issue with their basic components. On what exactly are you referring to?
@Nick-cx4rs
@Nick-cx4rs 2 месяца назад
​@@StevdzaSan e.g. disable swipe on bottomsheet. Put scrollable layout in it .bottomSheet closing on swipe. m3
@srkrishnan1989
@srkrishnan1989 Месяц назад
Try flutter and make difference video
@KingFuYouTube
@KingFuYouTube 2 месяца назад
first
@sudheeshmohan4357
@sudheeshmohan4357 28 дней назад
Isnt it more convenient to convert custom object to Jsonstring and pass as string param then parse the 'Json to object instead of creating navtype boilerplate code? Pass Gson().toJson(yourModelClassObject) in string param, then for getting it use generic function: inline fun String?.parseJsonString(): T? { return try { this?.let { val type = object : TypeToken() {}.type Gson().fromJson(it, type) } } catch (e: JsonSyntaxException) { Log.i("Error", "Failed to parse JSON string: ${e.message}") null } } val screenA = it.toRoute() val data = screenA .jsonstring.parseJsonString()
@javiergonzalez399
@javiergonzalez399 10 дней назад
val coverNavType = GenericNavType(Cover::class, Cover.serializer()) class GenericNavType( private val clazz: KClass, private val serializer: KSerializer ) : NavType(isNullableAllowed = false) { override fun put(bundle: Bundle, key: String, value: T) { bundle.putParcelable(key, value) } override fun get(bundle: Bundle, key: String): T? { return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { bundle.getParcelable(key, clazz.java) } else { @Suppress("DEPRECATION") bundle.getParcelable(key) } } override fun parseValue(value: String): T { return Json.decodeFromString(serializer, value) } override fun serializeAsValue(value: T): String { return Json.encodeToString(serializer, value) } }
Далее
БАССЕЙНЫ ПО ЦВЕТАМ ЧЕЛЛЕНДЖ !
38:20
APIs Explained (in 4 Minutes)
3:57
Просмотров 732 тыс.
What Are APIs? - Simply Explained
6:49
Просмотров 874 тыс.
Bottom Nav Bar #03 | Material 3 | Jetpack Compose
12:21
5 Design Patterns That Are ACTUALLY Used By Developers
9:27
He Beat A Super Grandmaster In 9 Moves!!
6:13
Просмотров 36 тыс.
This is Why Programming Is Hard For you
10:48
Просмотров 711 тыс.
Ionic 3 Mobile Weather App Build
1:15:02
Просмотров 259 тыс.