Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gallery/Grid view #534

Open
wants to merge 35 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9ab203c
Thumbail Generation study - inconsistent changes
JustFanta01 Apr 11, 2024
e6f673c
Merge branch 'cryptomator:develop' into feature/thumbnail-main
JustFanta01 Apr 11, 2024
9fa1f83
Added thumbnail File in CryptoFile and logic for storing and retrievi…
JustFanta01 Apr 13, 2024
f158359
Remove thumbnail from cache, add check if thumbnail exists only for i…
taglioIsCoding Apr 13, 2024
a5da6b1
Generate thumbnails only for images
taglioIsCoding Apr 14, 2024
4bbd29c
Removed unused imports
taglioIsCoding Apr 19, 2024
46fcb27
Add local LRU cache and first refactor
taglioIsCoding Apr 21, 2024
7c95cad
Removed unused imports + fix typo
JustFanta01 Apr 21, 2024
6f5d2da
changed names for retrieving cloud-related DiskLruCache
JustFanta01 Apr 28, 2024
91c1537
modified the cachekey for DiskLruCache
JustFanta01 Apr 28, 2024
54499a0
Added also in FormatPre7 the fetch of the thumbnail (not tested yet)
JustFanta01 Apr 28, 2024
bba7877
Add enum Thumbnail option
taglioIsCoding Apr 29, 2024
9e25e04
Merge branch 'feature/thumbnail-playground' of https://github.com/Jus…
JustFanta01 Apr 29, 2024
f6ded14
minor changes
JustFanta01 Apr 29, 2024
4fa8670
Change cachekey for thumbnails
JustFanta01 May 7, 2024
e67edf8
Use onEach and added the delete operation in the FormatPre7
JustFanta01 May 7, 2024
23f4f83
Added a separate thread to acquire the bitmap of the image and genera…
JustFanta01 Apr 28, 2024
fcdc306
Add thumbanil generator thread pool executor and subsample image stream
JustFanta01 May 1, 2024
8a2b3d6
Cleanup
taglioIsCoding May 8, 2024
ea217f9
Merge branch 'cryptomator:develop' into feature/thumbnail-playground
taglioIsCoding May 8, 2024
c835dfb
Add common interface for BrowseFilesFragment
JustFanta01 May 2, 2024
f394167
Add GalleryFragment (same interface as BrowseFileFragment) and his Ad…
JustFanta01 May 2, 2024
845c670
Select the correct Fragment based on UploadVault
JustFanta01 May 2, 2024
b461c13
Use custom format date in the FastScroll
JustFanta01 May 2, 2024
4a9854f
Add vault.id in the BrowseFilesIntent
JustFanta01 May 3, 2024
ac6aa7b
Check vault.id and folder ('auto-upload') for GalleryFragment usage
JustFanta01 May 4, 2024
56f3a0d
Add rectangle frame for image selection in GalleryFragment
JustFanta01 May 4, 2024
2135ecb
Re-insert file size comparator for FastScrollRecyclerView
JustFanta01 May 4, 2024
16438f5
Change date format used in FastScroll
JustFanta01 May 4, 2024
84d617e
Fix correct recycle of ViewHolder
JustFanta01 May 4, 2024
e3085b5
Add null check on vault.id in createFragmentFor
JustFanta01 May 5, 2024
fa224a4
Set ThumbnailGeneration option default as NEVER
JustFanta01 May 5, 2024
dbd526b
Thumbnail dim
taglioIsCoding May 8, 2024
915e05c
Merge branch 'develop' into feature/thumbnail-gallery-view
SailReal Oct 1, 2024
22f8611
Merge branch 'develop' into feature/thumbnail-gallery-view
JustFanta01 Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changed names for retrieving cloud-related DiskLruCache
JustFanta01 committed Apr 28, 2024
commit 6f5d2da30727791f05f8f0b3c4e2e08b64bed513
Original file line number Diff line number Diff line change
@@ -70,26 +70,21 @@ abstract class CryptoImplDecorator(
private val mimeTypes = MimeTypes(MimeTypeMap())

protected fun getLruCacheFor(type : CloudType): DiskLruCache? {
return getOrCreateLruCache(sharedPreferencesHandler.lruCacheSize(), dispatchCloud(type)!!) // unwrap should be safe!
return getOrCreateLruCache(getCacheTypeFromCloudType(type), sharedPreferencesHandler.lruCacheSize())
}
private fun getOrCreateLruCache(cacheSize: Int, key : LruFileCacheUtil.Cache): DiskLruCache? {
if(diskLruCache[key] == null) {
diskLruCache[key] = createLruCache(LruFileCacheUtil(context).resolve(key), cacheSize.toLong())
}
return diskLruCache[key]
}

private fun createLruCache(where: File, size: Long): DiskLruCache? {
return try {
DiskLruCache.create(where, size)
} catch (e: IOException) {
Timber.tag("CryptoImplDecorator").e(e, "Failed to setup LRU cache for $where.name")
null
private fun getOrCreateLruCache(key : LruFileCacheUtil.Cache, cacheSize: Int): DiskLruCache? {
return diskLruCache.computeIfAbsent(key) {
val where = LruFileCacheUtil(context).resolve(it)
try {
DiskLruCache.create(where, cacheSize.toLong())
} catch (e: IOException) {
Timber.tag("CryptoImplDecorator").e(e, "Failed to setup LRU cache for $where.name")
null
}
}
}


private fun dispatchCloud(type : CloudType) : LruFileCacheUtil.Cache? {
private fun getCacheTypeFromCloudType(type : CloudType) : LruFileCacheUtil.Cache {
return when (type) {
CloudType.DROPBOX -> LruFileCacheUtil.Cache.DROPBOX
CloudType.GOOGLE_DRIVE -> LruFileCacheUtil.Cache.GOOGLE_DRIVE
@@ -98,12 +93,7 @@ abstract class CryptoImplDecorator(
CloudType.WEBDAV -> LruFileCacheUtil.Cache.WEBDAV
CloudType.S3 -> LruFileCacheUtil.Cache.S3
CloudType.LOCAL -> LruFileCacheUtil.Cache.LOCAL
// CloudType.CRYPTO -> ...
else -> {
// it should be impossible to enter here, a cloud file could not be another type...
Timber.tag("CryptoImplDecorator").e("Unable to choose which cloud-cache")
null
}
else -> throw IllegalStateException()
}
}