Тёмный

Coil - Image Loading Library with Jetpack Compose 

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

🏆 My Online Courses
⭐Discount Coupon: LAUNCH-STEVDZA-SAN
stevdza-san.com
🐱‍👤 Wanna become a member? Join!
/ @stevdzasan
📸 Instagram
/ stevdza_san
In this video I'm going to show you how to load image from URL into your Android application using Coil image loading library and also use some of it's great functionalities like setting a placeholder image, applying transformations, showing Crossfade effect and so on. I already made a video about Coil image loading library, but this time we are doing it with Jetpack Compose! Watch the whole video to learn more about it! :)
Dependency:
implementation("io.coil-kt:coil-compose:1.3.1")
⌚Timestamps
0:00 - Introduction
1:13 - Load Image from URL
3:00 - Painter State
4:33 - Placeholder
4:57 - Crossfade
5:12 - Error
5:47 - Transformations
8:24 - Conclusion

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

 

23 июл 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 66   
@homayoonahmadi77
@homayoonahmadi77 2 года назад
The 2.1.0 version of coil-compose library has a AsyncImage function that is very easy to use!
@StevdzaSan
@StevdzaSan 2 года назад
Yes, you can check my new video: ru-vid.comyu29LxHc5Jo?feature=share
@farshad462
@farshad462 Год назад
@@StevdzaSan please consider make a video like this ,about using coil 2.0.0
@shanzaeorangzaib8234
@shanzaeorangzaib8234 Год назад
@@StevdzaSan I started to learn jetpack compose first so it's ok for me as a beginner that i continue to learn jetpack compose and then get knowledge of xml or it's necessary that i should learn xml first
@StevdzaSan
@StevdzaSan Год назад
@@shanzaeorangzaib8234 You don't need the knowledge of an XML if you're learning Jetpack Compose. :)
@shanzaeorangzaib8234
@shanzaeorangzaib8234 Год назад
@@StevdzaSan thanks for your reply and guidance
@yendys74
@yendys74 3 года назад
Finallly Someone i Trust is doing a JetPack Compose
@bro_chenzox
@bro_chenzox 2 года назад
Wow! Stunning issue! Thank you for your time and endeavors!
@StevdzaSan
@StevdzaSan 2 года назад
Glad to help!
@vapecat
@vapecat 3 года назад
Just right when I need it, thank you
@raffyrey9604
@raffyrey9604 5 месяцев назад
This playlist is so cool thankyou so much
@wilkq1110
@wilkq1110 Год назад
bro, always when I look for something I find answers here, Thank you
@decepticonWave
@decepticonWave Год назад
Amazing Video. Thanks for the video. Keep up the good work
@flavouredflight8628
@flavouredflight8628 3 года назад
Tq Very Much Bro🤗, Was Looking At This Particular Docs Moment Ago And This Video's Notification Came♥️
@StevdzaSan
@StevdzaSan 3 года назад
Righ on time 👌
@xenatronics393
@xenatronics393 2 года назад
very helpfull, thanks again!
@cloudBread007
@cloudBread007 3 года назад
This is really useful, thank you.
@StevdzaSan
@StevdzaSan 3 года назад
You're welcome 😊
@rahathossainhimel7177
@rahathossainhimel7177 3 года назад
Thank You ❤️
@hadjsaidaoumer3058
@hadjsaidaoumer3058 5 месяцев назад
Thank yooooooooooou the best one 👌👌👌👌👌👌👌👌👌👌
@putinstop5940
@putinstop5940 2 года назад
*Perfecto il amico, чын айтсам, кыйын экенсин жигар*
@digitalluxury2033
@digitalluxury2033 2 года назад
Professional ... thanks a loooot
@CFundDOnoob
@CFundDOnoob 2 года назад
Thanks for the nice explanation! Is it possible to load local images via URI too? The documentation doesn't give much information about that 😬
@ahmadab9666
@ahmadab9666 Год назад
thanks alot
@RFbcc
@RFbcc 3 года назад
Thanks, great video !! How do we load a local image on the background thread ?
@milon27
@milon27 3 года назад
Thank you
@rawhasan1180
@rawhasan1180 3 года назад
Great tutorial, thanks! Want to more compose tutorials.
@StevdzaSan
@StevdzaSan 3 года назад
Yeah, from now on I'll create video tutorials mostly by using Jetpack Compose 👊✋
@rawhasan1180
@rawhasan1180 3 года назад
@@StevdzaSan That would be great!
@somdatatechnology233
@somdatatechnology233 3 года назад
Thanks you are amazing, could you tell me full jetpack compose documentation?
@copybotai
@copybotai 2 года назад
this is very useful, please if you can explain how share image and download it in storage
@baadrqaaba9529
@baadrqaaba9529 2 года назад
Am trying to load multiple images inside a lazyrow composable , the painter state is always giving me an empty state, i dont know what am missing
@galaxiegalaxie5003
@galaxiegalaxie5003 2 года назад
How do you refresh manually when error or failed to load, due to slow network etc?
@orlandonovasrodriguez825
@orlandonovasrodriguez825 3 года назад
Good video
@kavinprabu6829
@kavinprabu6829 2 года назад
Hi can I specify the cache to be store the image only for 600 minutes?is it possible? I am searching for three days, I couldn't find any possibility?Thanks in advance
@Arash72af
@Arash72af 3 года назад
is it possible to export drawable or bitmap from painter? for example, i would like to extract colors with the palette, as long as the target has been handled internally and must be null, I cannot get drawable from CoilImage anymore, do you have any solution for that?
@Arash72af
@Arash72af 2 года назад
this is the work around: fun calcDominantColor(drawable: Drawable, onFinish: (Color) -> Unit) { val bmp = (drawable as BitmapDrawable).bitmap.copy(Bitmap.Config.ARGB_8888, true) Palette.from(bmp).generate{ palette -> palette?.dominantSwatch?.rgb?.let { colorValue -> onFinish(Color(colorValue)) } } } fun fetchColors(url: String, context: Context, onCalculated: (Color) -> Unit) { viewModelScope.launch { // Requesting the image using coil's ImageRequest val req = ImageRequest.Builder(context) .data(url) .allowHardware(false) .build() val result = Coil.execute(req) if (result is SuccessResult) { // Save the drawable as a state in order to use it on the composable // Converting it to bitmap and using it to calculate the palette calcDominantColor(result.drawable) { color -> onCalculated(color) } } } } and simply call the fetchColor fuction from ViewModel and pass url.
@brawlstar3731
@brawlstar3731 3 года назад
Great One feedback please increase text size of editor 🙏
@dxndivyansh
@dxndivyansh 3 года назад
How can I use a composable like shimmer card for the placeholder? For the earlier accompanist library I implemented it using loading state attribute of the coilImagePainter object...Any idea how to do in coil-compose??
@StevdzaSan
@StevdzaSan 3 года назад
You can also access painter states with this new dependency.
@GakisStylianos
@GakisStylianos 2 года назад
Check out Landscapist library that wraps Coil and add stuff like that on top
@hugosalazar6911
@hugosalazar6911 3 года назад
How to use coil with Firebase Storage please
@devildevil873
@devildevil873 2 года назад
Sir I have one doubt I can't explain it by writing I have to send the screen recording so how can I contact u so that u can help me 😭😭🙏🙏🙏🙏plz help me sir bcz.. it's my project and I got stuck in this problem
@bboydarknesz
@bboydarknesz 3 года назад
wow is it load asynchronously? cause we dont want to wait it load all images
@StevdzaSan
@StevdzaSan 3 года назад
Yep
@samstoyroom
@samstoyroom 3 года назад
Better than Glide? I know Glide supports GIF, what about Coil?
@StevdzaSan
@StevdzaSan 3 года назад
coil-kt.github.io/coil/gifs/
@StevdzaSan
@StevdzaSan 2 года назад
@@bro_chenzox Here's the solution :) github.com/skydoves/Landscapist
@aminelhag
@aminelhag 2 года назад
Thank to You Stevdza-san ( ノ ゚ー゚)ノ Keep Going
@bboydarknesz
@bboydarknesz 3 года назад
so we dont need picasso and others library like this again?????
@deviantstudio
@deviantstudio 2 года назад
coil is a library
@seanaquillaemmanuel6257
@seanaquillaemmanuel6257 3 года назад
I want to learn android kotlin, there are many java android tutorial. Should i learn java android too?
@StevdzaSan
@StevdzaSan 3 года назад
To learn Kotlin you don't need to know Java, don't worry about that and start working with Kotlin immediately. 👍🚀
@seanaquillaemmanuel6257
@seanaquillaemmanuel6257 3 года назад
@@StevdzaSan thank you 😁
@Nick-cx4rs
@Nick-cx4rs Год назад
Idk why they deleted blurtransformation on new version of coil suck
@muhammed4d
@muhammed4d 6 месяцев назад
I think this structure is a bit outdated. Can you please make an updated video?
@javad0470
@javad0470 3 года назад
please make tutorial about recyclerView and viewModel in jetpack compose , thank alot