I'm relatively new to android development. Started...
# compose
t
I'm relatively new to android development. Started learning in december'20 with xml/view based layouts through udacity. Soon switched to compose as declarative UI seemed easier to me having done web development in react. I have practiced everything (animations, i/o, custom layouts, theming) in isolated manner through preview composables. Now I am trying to create a full fledged app with firebase. I have some queries and it would really help if you can clear even some of those. 1. For showing images, I am using accompanist. I wanted to know is there a codelab like those for jetpack compose to learn accompanist? 2. How do i cache images? Like if I fetch some image by url once and close the app. Then next time can i show old image without fetching it again. Does accompanist do that? 3. During Layouts codelab for compose there was a lazy column scroll handling to scroll to top/bottom by button. When i used to scroll to top then only 4/5 items were visible rest disappeared. But as soon as i touched the window again everything came back up. Was it a compose compiler problem or just debug app/my mobile problem? 4. Is there a preferred way to map firestore model to local model? I was thinking to create extension functions. Any tutorial for mvvm/repository pattern with compose will be helpful. Everywhere i see these but the basics are still a bit hazy. Any answers will be informative for me. Thanks all.
🧵 2
a
1. No AFAIK. Have you read the guide? 2. This is controlled by the underlying library which handles image loading. I think both coil and glide do this by default. Coil uses OkHttp's cache. 3. Might be this bug. 4. Nothing compose-specific. There should be many tutorials on how to use Firestore in Android.
☝️ 1
👍 1
t
Thanks for the reply. I guess I should read coil documentation too for clarity.
c
Accompanist Coil is a thin layer on top of Coil, so 99% of the Coil docs apply to Accompanist too. The only things which doesn’t are the things which talk about
ImageView
, etc. The same logic apply to the Glide library
👍 2