Commit Graph

144 Commits

Author SHA1 Message Date
Sebastiano Barezzi bbd9488226
Glimpse: Move app bar to each main fragment's fragment
* Search fragment doesn't use it, it needs a search bar instead
* This way we lose bottom navigation hide on scroll, but we gain working
  app bar color scrim on scrolling

Change-Id: Ie96711010ade1976890f095fdd15740cf15e6c75
2023-08-20 14:33:56 +02:00
Sebastiano Barezzi dbdf861d07
Glimpse: Use a FrameLayout for ReelsFragment
Change-Id: I593e0b03c715e95d04dbc5f302a3ea812b046d67
2023-08-20 04:30:08 +02:00
Sebastiano Barezzi 6a9c18eae7
Glimpse: ext: Remove -Ext from file names
Change-Id: I2f1911a667576f8353c3db93c1837f6d657d7387
2023-08-20 03:47:20 +02:00
Sebastiano Barezzi 985a897ddb
Glimpse: AlbumsFlow: Avoid double data loading for bucket ID
Change-Id: Ib33211dbf5222005f00c67d838de3e4888e13ade
2023-08-20 03:46:34 +02:00
Sebastiano Barezzi ef3a4ab28d
Glimpse: MediaFlow: Reorder variables
Change-Id: I532ebefd750f6d21f942425c218116e8b137fcb0
2023-08-20 03:46:01 +02:00
Sebastiano Barezzi 70683038e4
Glimpse: MediaFlow: Fix typo
Change-Id: I81678b02aa158b3397bb85cb4fdb53c72de94d64
2023-08-20 03:42:49 +02:00
Sebastiano Barezzi 42961be502
Glimpse: Media info bottom sheet dialog
Change-Id: Iadcb08b09cfc07139fc69ce69e605eb4f604c760
2023-08-20 03:23:56 +02:00
Sebastiano Barezzi b2d54069e4
Glimpse: Add display name to Media
Change-Id: Icf723d459cc9899788e8852d04272b58f87d8445
2023-08-20 01:55:09 +02:00
Luca Stefani 1baef233ff
Glimpse: Flow content provides flows on IO dispatcher
Change-Id: Idfa0bc09dda0eb71835c1b8d3c9572b5a757bb43
2023-08-20 01:06:20 +02:00
Luca Stefani 3107835489
Glimpse: Only send ContentObserver callbacks when Job is active
Change-Id: I83dfe71285e2ee1b38087ae3537a8fadc6d32ca3
2023-08-20 01:06:20 +02:00
Sebastiano Barezzi d61b281506
Glimpse: Update androidx.media3
Change-Id: I8b35cb04809a4000f7d15d266c2316bc2c721862
2023-08-19 18:30:00 +02:00
Luca Stefani c757a1d723
Glimpse: Use thumbnail cached image as full image preview
Change-Id: I87891cd8a2a687893e129cde28d5c5b3f43024dd
2023-08-19 17:10:20 +02:00
Luca Stefani dd81817e66
Glimpse: Increase memory cache size
It's now 5% bigger

Change-Id: Ic1b1d87f0e2adff64fc354ff6207e96243657c5a
2023-08-19 17:09:02 +02:00
Luca Stefani a528b7302b
Glimpse: Specify the memory key for images loaded via Coil
If the Uri matches but sizes don't Coil will re-fetch the image
from disk, that's not optimal.

Change-Id: I2336b851f2b11819845f4bd5815d1ec60b7fccd4
2023-08-19 17:08:19 +02:00
Luca Stefani c45a4cb57b
Glimpse: Include the thumbnail media in album
Change-Id: I5041f0c947d6645447e3c0480ca364fb3552cdf2
2023-08-19 17:06:58 +02:00
Luca Stefani 2178130037
Glimpse: Actually lazy load ExoPlayer
Change-Id: Ic5235fd8b855c4e91a8bdfa60ebe4c398870660a
2023-08-19 16:24:35 +02:00
Luca Stefani 23ae63d0f3
Glimpse: Collect on resume
ContentObservers are tied to the lifecycle of the application
and must be started/stopped onResume to ensure proper callbacks

Change-Id: I63c1a6ebc3e734a84aa729f36296d570801e6c70
2023-08-19 15:58:59 +02:00
Luca Stefani f5b020e292
Glimpse: Conflate any flow from URIs
If we get a lot of new files we want to drop any "old" event

Change-Id: I913672d4b651ca0473edc530e0f57996fd4b6830
2023-08-19 15:58:59 +02:00
Luca Stefani 2790d4977d
Glimpse: Switch AlbumThumbnailAdapter to `var data`
A bit nicer instead of nullable list

Change-Id: If56620b5883c0e3b53a7fa0d62311c2e0999ca66
2023-08-19 15:58:59 +02:00
Luca Stefani d4b1bfd6b2
Glimpse: Don't use CursorLoader
Instead manually invoke the query and listen for updates
on the external media Uri to trigger updates.

Change-Id: I0d86484dfa453cce9910d2bcadee6191de5aed28
2023-08-19 15:58:59 +02:00
Luca Stefani af3e76b1c3 Glimpse: Implement data loading using the Repository/ViewModel pattern
Change-Id: Ia152000673b36e7f690ac5f2665ef1a0204bb339
2023-08-15 20:26:24 +02:00
Luca Stefani 72e7b9b16f Glimpse: Only specify the necessary projections to AlbumsProjection
Change-Id: I6289cc0f35bce8a28fb6cf8de3da725b11a819ab
2023-08-15 18:41:05 +02:00
Luca Stefani f3869838c4 Glimpse: Add bucket ID to Media
Change-Id: I0f94f8444ac11a65a68e7913f29c3208a03c315c
2023-08-15 18:41:00 +02:00
Luca Stefani 5dfb70cebe Glimpse: MEDIA_STORE_REELS_LOADER_ID -> MEDIA_STORE_MEDIA_LOADER_ID
Change-Id: I4c626456b29f841aaa7b4b9cc5df03b6a1bd80c4
2023-08-15 18:40:57 +02:00
Luca Stefani 4a36f5dd5c Glimpse: GlimpseCursorLoader: Enforce non-null queryArgs
Change-Id: I35fa64c8bd03eddc98ed15e728cd8e43d06447c7
2023-08-15 18:40:52 +02:00
Luca Stefani 50b56e82b8 Glimpse: Set extra mime types in shareIntent()
Change-Id: I5b86fbc788dc5fb1da073a500868ac2e3683ad65
2023-08-09 17:48:15 +02:00
Luca Stefani 020ea47a06
Glimpse: Preload 2 pages on either side of current page
Better user experience while scrolling

Change-Id: Ic707c2f37a4cef1954be604e990e3bcab7778f4c
2023-08-09 15:17:08 +02:00
Luca Stefani de55efce60
Glimpse: Specify size of the image to load
It allows Coil to avoid caching the whole image for reel viewing

Change-Id: I0994848364aea8592325570b8dcfd6fe9efd713b
2023-08-09 15:17:08 +02:00
LuK1337 2bfdb7abb3
Glimpse: Improve Album::equals() implementation
Let's just compare all fields instead of just the id.

Test: Go to albums, take a screenshot and notice that "{} items"
      increased by one.
Change-Id: I770bb31ccd02964672280c0dffe393d1d2f005fd
2023-08-09 15:17:08 +02:00
Sebastiano Barezzi b9f7c5d16c
Glimpse: Implement trashed undo button
Change-Id: Ibb39ba3d4525655757e97453ff4f937eeafcd498
2023-08-09 15:17:08 +02:00
Sebastiano Barezzi 6b81f8e0f8
Glimpse: Update favorite button on contract result
Change-Id: I4746412b910da62cc2c10af6d93b02cbc5cba82b
2023-08-09 15:17:08 +02:00
Sebastiano Barezzi d68ca22081
Glimpse: Anchor Snackbars to bottom sheet
* Let's not cover action buttons

Change-Id: Idd78c88c1bc61de05b3cd25cb262d4e66dea01b9
2023-08-09 15:17:08 +02:00
Sebastiano Barezzi f8da706637
Glimpse: Add delete dialogs
* Now that we might have permission to do stuff without the user's
  approval, this is needed

Change-Id: I807d6cd8a11ea24bdd20b737747dfafbfa582624
2023-08-09 15:17:08 +02:00
Sebastiano Barezzi 128c7de377
Glimpse: Add MANAGE_MEDIA permission
Change-Id: I6de0dcff96884d3bbf8e75d32e10a3dc04778a67
2023-08-09 15:17:08 +02:00
LuK1337 e62b2090ca Glimpse: Fix status bar color on light theme
Change-Id: I549025a6c1a4087124c2c85e81a6b3922db40dec
2023-08-08 16:27:00 +02:00
LuK1337 a99d51f75c Glimpse: Move no permissions message to resources
Also sync it with Aperture.

Change-Id: Id0e2cf1e1183079f93f733c5c2710781872bf905
2023-08-08 15:44:55 +02:00
Sebastiano Barezzi 395b012086
Glimpse: Reorder permissions
Change-Id: I16aef1154b244a06e0610899d17f3ec566dc0683
2023-08-08 03:25:41 +02:00
Sebastiano Barezzi 7c701c0125
Glimpse: Don't include trashed medias in albums
Change-Id: Ie447b3770471c53e44d04cfde12e41f295d94b0e
2023-08-08 03:24:44 +02:00
Luca Stefani 79a420286d Glimpse: Share common projections
Change-Id: I362799adb1200c46bcbbaed31fb9d537ef21e565
2023-08-07 23:36:58 +02:00
Luca Stefani 1cb30ec8bb Glimpse: Try to set proper mime type when sharing media
We also have to grant read URI permission in case
the receiving end doesn't have the read media permission.

Change-Id: I28b77b680bdff123a0c737eb41ddcdbe34dba1cb
2023-08-07 23:36:58 +02:00
Luca Stefani 568bd417f2 Glimpse: Hook up adjust button
Change-Id: Id72ec262b0a237b7f07b16f465912eb19cf705e8
2023-08-07 23:36:58 +02:00
Luca Stefani b57d776fc2 Glimpse: Fetch Media mime type
Change-Id: I76dd6b4536e8784fdab4b4a9fd9627a9161e90dd
2023-08-07 23:36:58 +02:00
Luca Stefani dc0aa894df Revert "Glimpse: ThumbnailLayoutManager: Ignore OOB in onLayoutChildren"
Not needed anymore, we don't insert items onLayout.

This reverts commit ad1c6996f5.

Change-Id: Icc482e8f97229c05490786282e00e33da4ad441f
2023-08-07 23:23:17 +02:00
Luca Stefani 336a869299 Glimpse: Always take into account we'll have 1 header in ThumbnailAdapter
Otherwise the recycler view won't call us enough times since we
know we'll always need at least one header.
Once an header item has been added we start using that has the
count of the items.

Change-Id: Ibee23f8bc14cacca125647335725e566475985c7
2023-08-07 23:23:17 +02:00
Luca Stefani 75d8906c4a Glimpse: Don't inline sortOrder in CursorLoader init
Change-Id: I92e6bafe56dd2cfe0d12d072fc36f03757205abb
2023-08-07 01:43:25 +02:00
Luca Stefani 270f8099be Glimpse: Abstract away the query builder
Change-Id: I0e58cb4179c0e7852275d74f501d40b27a68dae1
2023-08-07 01:43:25 +02:00
Sebastiano Barezzi db7fdd00de
Glimpse: Add missed SDK check
Change-Id: I3202c71f6047e987fbcdd67041df676b9ab153e9
2023-08-07 01:31:34 +02:00
Sebastiano Barezzi d491334a6d Glimpse: MediaViewerFragment: Reload current page content when cursor changes
Change-Id: I0af966fc9060baf3aabda9d04516d0749e20ebf5
2023-08-06 18:34:11 +02:00
Sebastiano Barezzi e048906a31 Glimpse: Add trash action
Change-Id: Iaf4d5a13cbe0e56d7b6be62fe3dfa9be839aa461
2023-08-06 18:34:11 +02:00
Sebastiano Barezzi 1537848b01 Glimpse: Add isTrashed to Media
Change-Id: I5f196e69275bc15b29d25840529a87c3484097f9
2023-08-06 18:34:11 +02:00