Closed kirillt closed 2 years ago
Or more performant way would be to listen for filesystem events on folders presented in resources grid and update internal collection only when something happens (don't confuse with #27).
Should be enough to use FileObserver
: https://developer.android.com/reference/android/os/FileObserver
Note that, if we have prefix selected (favorite), then we need subscribe not to root, but to the prefix
We should measure power consumption of file system monitoring. If it's high enough, just refreshing in necessary moments should be used instead of file system monitoring.
Fixed in #214
These two logs are caused by "disappeared" resources, i.e. resources which are removed externally from currently presented folder. We need to check out resource list every time before sorting or other adapter updates.
1:
2: