-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
This is a bit of an academic feature, but necessary for demonstrating a proper way of building more complex applications.
The loader:
- Only loads tiles and puts them into the content provider (the bitmaps to disk through bitmap cache)
- Provides an observable of error events
- Does not necessary give an observable of successes at all!
The store:
- Does not directly know about the loader, only connects to the content provider and detects loaded data through it
- Memory cache optional, though not needed
The bitmap cache:
- Remembers which bitmaps were already loaded and stores them in memory with a file path
- For performance the loader can insert the loaded bitmaps to the bitmap cache without interfering with the separation of responsibilities
The flow of loading a bitmap should be something like
- Get bitmap for tile x
- Is x in content provider?
- No: ask loader to load it (unless loader is already loading the specific tile)
- Yes: load bitmap from the bitmap cache
- Return the combined observable of bitmaps from the store and errors from loader. This either needs a wrapper class or we can use the RxJava Notification
Reactions are currently unavailable