ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

33 Previews and extra data for resources #122

Closed kirillt closed 3 years ago

kirillt commented 3 years ago

ResourceMetaExtra substructure of ResourceMeta introduced. This field is used to store dynamically-determined data which depends on kind of ResourceMeta (like video, documents, images etc.)

Previews are implemented using global singleton object and their generation is triggered during indexing. This has to be changed in future (see #115). We store generated previews in cache folder so far (this will be changed upon implementation of persisted/replicated cache). For images we don't generate previews, but just use themselves. For any kind of resource, besides preview, thumbnail is also generated which is preview scaled down to 72x108 and stored in separate folder. Existence of preview/thumbnail for given resource is done prepending constant path to its id.

What needs to be finished prior to merge into main:

Also would be good: * Previews for videos (#33) is what gave name to this PR, but we could finish it later actually * Make sortings in resources grid use ResourceMeta fields size and modified instead of querying file system * Verify coroutines for loading thumbnails (see usage of ThumbnailTarget)

mdrlzy commented 3 years ago

Glide sometimes loading wrong image on RecyclerView. Related issue: https://github.com/bumptech/glide/issues/2847

|