DON'T Update Your UI Like THIS In Compose

  Рет қаралды 25,044

Philipp Lackner

Philipp Lackner

Жыл бұрын

Follow for more Android & Kotlin tips 🙌

Пікірлер: 28
@MrSN99
@MrSN99 Жыл бұрын
All my homies are collecting state in the activity itself
@martinseal1987
@martinseal1987 Жыл бұрын
Kotlin and android Dev is getting out of hand everything you do comes with 10 gotchas
@CommanderSteps
@CommanderSteps Жыл бұрын
Deine Shorts sind super!
@PhilippLackner
@PhilippLackner Жыл бұрын
Danke!
@justloveandpeace4010
@justloveandpeace4010 Жыл бұрын
Awesome bro
@abdullqadirbarznji1149
@abdullqadirbarznji1149 Жыл бұрын
Thanks man
@josema2702
@josema2702 Жыл бұрын
eres un fenomeno primo
@freshtechtips
@freshtechtips Жыл бұрын
A complete new dependencies just to do simple core things?? Like new dependency just for extention functions for suspend instead of callback I know it because of kotlin support and java the main one, but why not make single dependency for kotlin for all that things instead of kotlin support dependency for every core feature like coroutines I think android team should think in better way
@PhilippLackner
@PhilippLackner Жыл бұрын
Because kotlin != android
@mohegyux4072
@mohegyux4072 Жыл бұрын
I thought any state is discarded once the composable is disposed of !
@PhilippLackner
@PhilippLackner Жыл бұрын
The state is, but the underlying flow will still run because collectAsState will not cancel it when the app goes in the background
@alihamad7958
@alihamad7958 15 күн бұрын
I dont understand why jetpack Compose developers dont just use mutableStateOf in ViewModel so we dont need to use collect at UI
@malikkissoum730
@malikkissoum730 Жыл бұрын
ok I have a question. When ur app then goes to the foreground after being in the background, this thing gets notified and update the state, how can I prevent this ? Say I have a snackbar that I have already shown, and i don't wan to show it anymore when the app goes to the foreground
@dennispetcu8383
@dennispetcu8383 Жыл бұрын
Dismiss the snackbar in onPause
@_0_o_924
@_0_o_924 Жыл бұрын
Shared flow?
@khiariyoussef3226
@khiariyoussef3226 Жыл бұрын
@Philipp there is a question that came up in my mind when I was dealing with saving UI state, should we use rememberSaveable or ViewModel's saved state handle? 🤔
@WellingtonFerreiraTon
@WellingtonFerreiraTon Жыл бұрын
If you don't mind me trying to help, I guess rememberSaveable is better to use when we want a ui state that is intrinsically connected to composable (for example, an expandable text, to keep if it's expanded or not even after configuration changes); and UI logic that relates to business logic we can keep on view model (for example, when we populate a list of users to a composable from request or database). I hope it helps. (If i wrote anything wrong please let me know, english is not my native language)
@khiariyoussef3226
@khiariyoussef3226 Жыл бұрын
@@WellingtonFerreiraTon Thanks for the reply, but i don't agree on the second statement about using savedstatehandle for saving lists, it is not recommended (according to the docs), we could use a local database for that.
@WellingtonFerreiraTon
@WellingtonFerreiraTon Жыл бұрын
@@khiariyoussef3226 sorry I was speaking about state management on the second statement, not about saved state handle. My bad! I think the most frequent use case for saved state handle is to get arguments defined through navigation. Google reccomends to use view model mostly for UI logic that depends on business logic. If possible the best approach is to have a state class to handle most complex use cases that don't rely on business logic. I hope I got this right. Thanks for your input :)
@WellingtonFerreiraTon
@WellingtonFerreiraTon Жыл бұрын
Just a little addendum, view model is also reccomended for screen logic.
@amanverma6515
@amanverma6515 3 ай бұрын
Why this is not default?
@phamquangtrung8425
@phamquangtrung8425 Жыл бұрын
How to automatically allow access(grant permission)usb serial on android?
@frenchp5435
@frenchp5435 Жыл бұрын
no hacking! _bad_ hackerman Vietnam
@Mreto17
@Mreto17 3 ай бұрын
Ekspresine biasa wae
@my_love_sanatan
@my_love_sanatan Жыл бұрын
Day by day Android developement is losing its popularity by this complex things
@CommanderSteps
@CommanderSteps Жыл бұрын
It actually just got easier with this library.
@serpenheir
@serpenheir Жыл бұрын
Complex things and concepts allow to create versatile software and API. If someone quits from Android development due to "complex" things like this, they've never been an accomplished engineer at first.
@my_love_sanatan
@my_love_sanatan Жыл бұрын
People are shifting to react nowadays just because of complexities Android day by day
3 Clean Code Hacks I Bet You Didn't Know (Kotlin & Android)
12:30
Philipp Lackner
Рет қаралды 26 М.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Finger Heart - Fancy Refill (Inside Out Animation)
00:30
FASH
Рет қаралды 29 МЛН
Идеально повторил? Хотите вторую часть?
00:13
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 9 МЛН
Каха заблудился в горах
00:57
К-Media
Рет қаралды 10 МЛН
Jetpack Compose. Основы. State [Ru, Kotlin\Android]
33:21
Mobile Developer
Рет қаралды 26 М.
The Ultimate Package Structure Guide for Android Developers
12:10
Philipp Lackner
Рет қаралды 38 М.
Full Guide to Jetpack Compose Effect Handlers
24:56
Philipp Lackner
Рет қаралды 90 М.
The perfect imperfection of Google's Material You
15:47
David Imel
Рет қаралды 425 М.
Fundamentals of Compose Layouts and Modifiers - MAD Skills
11:56
Android Developers
Рет қаралды 89 М.
State - Android Jetpack Compose - Part 6
12:45
Philipp Lackner
Рет қаралды 82 М.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45