Comments (8)
from sunflower.
Hi @sagar-viradiya - yes, please open a new issue and we can discuss the livedata changes there.
from sunflower.
Thanks for the detailed write-up! Would you be interested in opening a pull request to update the two list ViewModels?
from sunflower.
Thanks! Note there's a pending fix in #30 that may conflict with your changes.
from sunflower.
I think better solution is to use new fragment life cycle while observing live data.
Read this
https://medium.com/@BladeCoder/architecture-components-pitfalls-part-1-9300dd969808
check note at the end of post
We need to update support lib as new view life cycle is there in 28.0.0
See https://youtu.be/pErTyQpA390?t=5m41s to better understand the issue
from sunflower.
from sunflower.
Yeah sorry my bad. Thing is every time you switch fragment from GardenPlantListing to PlantListing and vice versa onCreateView will get call and method in view model also. Which will end up in querying database multiple times. Your PR will fix this issue.
However there is one issue of multiple observation on livedata. So each time you switch fragment new live data observer is being registered. This will lead to multiple callbacks for livedata observer and because of this multiple notifyDataSetChanged() in adapter.
I have figured out this issue. @tiembo Should I create new issue for this ?
from sunflower.
Closing issue; fixed via #33
from sunflower.
Related Issues (20)
- [Update]: Fix Deprecation on PlantDetailsFragment
- [Bug]: Button Visibility Issue on PlantDetails Screen HOT 1
- [Bug]: Transparent background color on dark theme HOT 1
- [Bug]: The filter icon duplicate HOT 1
- Remove commented code HOT 2
- [Bug]: Incorrect packaging.yaml HOT 3
- [Bug]: Toolbar is not collapsing well on Dark Mode HOT 2
- [Bug]: Release build is not showing any data
- [Bug]: Plus icon not visible on plant details screen at m3 in Dark Mode HOT 2
- window.open('https://play.google.com/store/apps/details?id=<PLAY_PACKAGE_NAME>', '_blank'); HOT 2
- Sunflower
- [Update]: Migrate [Hilt & Room] from KAPT to KSP HOT 2
- [Update]: Clean up Version Catalogs and upgrade dependencies flavours HOT 1
- Update Project Target SDK and Compiled SDK to Api 34
- [Bug]: After pull the latest update, the app getting crashed while selecting the plant list tab and onClick Add plant button. HOT 5
- You can update to chipmunk if you want now that youre on it
- [Bug]: Associated image visibility and scroll acts weird.
- [Bug]: NoClassDefFoundError when instrumented test.
- [Bug]: Performance issue
- Update to Kotlin v2.0 & Compose compiler
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sunflower.