Jetpack Compose - Disposable Effect with Examples | Side Effect Handlers | CheezyCode Hindi

  Рет қаралды 6,496

Cheezy Code

Cheezy Code

Жыл бұрын

Learn Jetpack Compose in Android. In this video, learn about Disposable Side Effect in Jetpack Compose with examples. Covered all the required concepts to understand this concept well. This is a side effect handler that runs and also provides a way to clean up any resources. OnDispose method is defined place to execute clean up code when either composable leaves the composition or any key changes. It takes two parameters - one is key and other one is the effect block where side effect is executed. It is generally used to run non-suspended functions that might require clean up.
Learn the usage of DisposableEffect Handler in Jetpack Compose with Examples. It is always a best practice to dispose objects if they are not required to prevent memory leak. Learn by implementing a media player in composable along with one major example of implementing a feature where you want to check if keyboard is visible on the screen or not. This composable can be used to create custom UIs based on the keyboard visibility. Learn how to implement event handlers and how to add and remove these handlers using Disposable Effect in Compose. Learn how to define composables using best practices. Everything is explained in Hindi (हिन्दी)
Topics covered -
1. DisposableEffect in Jetpack Compose.
2. Simple Example of Disposable Effect with MutableState.
3. onDispose Functionality for cleaning up resources in side effects.
4. Keyboard Visibility in Jetpack Compose - Check if keyboard is visible or not.
Kotlin Flows Playlist -
• Kotlin Flows Tutorials
Jetpack Paging Tutorial -
• Android Paging 3 | Jet...
Complete Dependency Injection Playlist Link -
• Dagger 2 - Dependency ...
Complete Android Architecture Components Playlist -
• Android Architecture C...
Beginner series in Android Playlist (Hindi) -
• Android Tutorials Step...
Kotlin Beginners Tutorial Series -
• Kotlin Beginner Tutori...
For more info - visit the below link
www.cheezycode.com
We are social. Follow us at -
Facebook - / cheezycode
Twitter - / cheezycode
Instagram - / cheezycode

Пікірлер: 21
@muhammadusman5179
@muhammadusman5179 Жыл бұрын
Most recommended channel for learning android development. Very amazing content. Love you from Pakistan ❤
@CheezyCode
@CheezyCode Жыл бұрын
Thanks Usman ❤️ Love from India 🇮🇳
@ShijenN
@ShijenN 9 ай бұрын
Very practical example of viewtreeobserver. Thank you somuch !!!♥
@kingmarwat
@kingmarwat 10 ай бұрын
I always recommend this channel to my students. Great.
@shubhamshinde4042
@shubhamshinde4042 6 ай бұрын
Thank you so much. 💜
@rishikeshsingh9946
@rishikeshsingh9946 Жыл бұрын
Awesome ❤❤
@CheezyCode
@CheezyCode Жыл бұрын
Thank you bro
@akarshmittal9601
@akarshmittal9601 Жыл бұрын
I didn't understand how it is working disposable effect is just like launchedEffect and we are passing key1 = Unit as argument. So why it is being called again (evident from the fact that log is printed again)
@tushardeshmukh7740
@tushardeshmukh7740 Жыл бұрын
Sir I want video on callable and future object. I m unable to use okhttp3. Please
@Allrounder.00007
@Allrounder.00007 Жыл бұрын
Video on Jetpack compose navigation with viewmodel
@CheezyCode
@CheezyCode Жыл бұрын
Will be creating an app with all the things
@BHanif-zc2pr
@BHanif-zc2pr Жыл бұрын
Hellos sir will you please make a jetpack compose all in one video.
@CheezyCode
@CheezyCode Жыл бұрын
Will do it in the end
@ayushacharya5673
@ayushacharya5673 Жыл бұрын
My logs are being printed twice. Is that an issue?
@ChocoByte
@ChocoByte Жыл бұрын
Does DisposableEffect run on recomposition also?
@CheezyCode
@CheezyCode Жыл бұрын
No
@CheezyCode
@CheezyCode Жыл бұрын
Side effects jahan bhi run karege koshish yehi rehti h dobara trigger na ho...agar recomposition pe trigger hoga toh predicable behaviour nahi rahega
@ChocoByte
@ChocoByte Жыл бұрын
@@CheezyCode Bhaiya i still did'nt understood, if you are saying DisposableEffect does not get execute on recomposition then listener on line 45 at tiime 8:51 wont be attached in recomposition, because listener was removed before recomposition in OnDispose block
@CheezyCode
@CheezyCode Жыл бұрын
Recomposition pe remove nahi hoga...it will be removed when your composable is removed from the screen - either due to configuration change or screen has been changef
@ChocoByte
@ChocoByte Жыл бұрын
@@CheezyCode achaa....you are saying that OnDispose wont be call before recomposition, it will only be called when composable is removed from the screen - either due to configuration change or screen has been changed. Am i correct?
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 118 МЛН
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 18 МЛН
Идеально повторил? Хотите вторую часть?
00:13
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 9 МЛН
Flutter Exit App on Back press | WillPopScope Widget
2:42
CoderHasan
Рет қаралды 163
Just Bengaluru Things😌👌
0:17
Top Gear INDIA Supercars
Рет қаралды 31 МЛН
What the Heck Is a Surface In Jetpack Compose?!
1:00
Philipp Lackner
Рет қаралды 26 М.
Are You Doing THIS Modifier Mistake In Jetpack Compose?
0:59
Philipp Lackner
Рет қаралды 31 М.
Return a value from a Kotlin Coroutine Scope - Explained
6:32
Stevdza-San
Рет қаралды 18 М.