Commit Graph

57 Commits

Author SHA1 Message Date
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
LuK1337 7e1a9b2d9d Glimpse: Add "Trash" album
Change-Id: Id9e089434abe51ae74e9b5e895882535a7bf8e98
2023-08-06 18:34:11 +02:00
LuK1337 5c225960f8 Glimpse: Simplify bucket id check in onCreateLoader()
Change-Id: I5b88c0580413902db502fb4330b35b7d2b120bdf
2023-08-06 09:57:42 +02:00
LuK1337 71b46b0dad Glimpse: Implement "Favorites" album
Change-Id: Ia8fc129f6dfab06ce96fea39d0e3b526e300391c
2023-08-06 09:31:42 +02:00
Sebastiano Barezzi f6b8998442
Glimpse: Cache cursor indexes
Change-Id: I5f7f4bbf5fc5ae987e01fb2bbac43bb9951210a4
2023-08-06 01:22:08 +02:00
Sebastiano Barezzi 4bbb71c891
Glimpse: Media: Add a MediaStore parser function helper
Change-Id: I3e9438b4bc7f92975037fc7182684a9987ff776e
2023-08-06 01:10:22 +02:00
Sebastiano Barezzi da0b39e3bf
Glimpse: Move video loading to MediaViewerFragment
* Fixes black player on fast scrolling
* While at it simplify UI visibility and player view checks in the
  adapter

Change-Id: I841d9852a93230a89b23ac4069c75b621d173c8a
2023-08-06 00:58:27 +02:00
Sebastiano Barezzi 455f341ed0
Glimpse: MediaViewerFragment: Bail out of the fragment before doing anything else
Change-Id: I4424c8d3346d215754df561e5d6761e17a342ef8
2023-08-06 00:39:55 +02:00
Luca Stefani ad1c6996f5
Glimpse: ThumbnailLayoutManager: Ignore OOB in onLayoutChildren
When the underlying data is changed when the we're trying to
layout the children on the RecyclerView we can hit that.

TODO: Add proper syncronization and/or switch to ViewModels
Change-Id: I174e6c7c3cca2980ced19a424fc2e12372791d88
2023-08-06 00:39:26 +02:00
Sebastiano Barezzi 10a5c8ff04 Glimpse: Get rid of CommonNavigationArguments
Change-Id: I0936fc9c1411930081299ff36583b09b71f188e0
2023-08-06 00:34:21 +02:00
LuK1337 d74cd06a79 Glimpse: Handle empty album name gracefully
Change-Id: I31d70f3e1c1943015110e7167ea540b149b90144
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi dfa041bc01 Glimpse: Reinstance ThumbnailLayoutManager on configuration change
Change-Id: I0a4d99fce11d1b88e0f89f885f1857ccb0a25adb
2023-08-06 00:34:21 +02:00
LuK1337 b81db3b9db Glimpse: Set android:configChanges for MainActivity
We don't want to restart activity on config changes.

Test: Play video and rotate the device, notice that it no longer rewinds
      the playback to 0s.
Change-Id: I854edd26eec0a8bef29a706619088d132dc5f4e3
2023-08-06 00:34:21 +02:00
LuK1337 c73a85fd29 Glimpse: Simplify favorite button drawable handling
Change-Id: I1cabdd7c0596f3046ebbb0d28547a232c6192c4f
2023-08-06 00:34:21 +02:00
LuK1337 824b8856c9 Glimpse: Hook up favorite button
Change-Id: Ib578f87581b58c9f27f815747d1529a6c9255703
2023-08-06 00:34:21 +02:00
LuK1337 3f6a1d81dd Glimpse: Load isFavorite data
Change-Id: Ibc74da8e570b3267bb6a03a431d93bc70f10f6c8
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi 894d14e23b Glimpse: Downgrade coil to 2.2.2
Change-Id: Iff86a7c5b4a715eae5f5de55df948fb483f63a25
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi 27345358c3 Glimpse: Use AOSP's version of NavigationX
Change-Id: Ica426c80f73afee0ca309c8a6f9a0d2521788e96
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi ad07a6fd30 Glimpse: New span count and padding
* Also improve UI for tablets

Change-Id: I2e49b373bfa9732044c9e77f72cd35a70505fe86
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi 18c4e560c9 Glimpse: Rework ThumbnailLayoutManager
* Hardcode the span count in the class
* Enforce the usage of ThumbnailAdapter, can't work with anything else
* Move ViewTypes enum class out of the companion object

Change-Id: I777409de63b03bd836aa82fe6a4476d9e3b19ccb
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi cb5536d392 Glimpse: Move thumbnails recycler view in a layout XML
Change-Id: Ib739d18775e70ee417996626da11df24b61f8b6b
2023-08-06 00:34:21 +02:00
Luca Stefani 92d5bb0c24 Glimpse: Show video preview while scrolling
Change-Id: I5b1ad0b6121409a5edb0d42aaf9f4a663a4eb85d
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi d5fd770872 Glimpse: Add SDK check for ImageDecoderDecoder
Change-Id: Idb8cc4742124c7b6f1ee193175bc64148eee741b
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi 853f08fd98 Glimpse: Close media viewer if no medias are present
Change-Id: Id6279a6c1b2bc41a27593839b5f3c268c57f95a2
2023-08-06 00:34:21 +02:00
Sebastiano Barezzi 8f2ccc7e76 Glimpse: ThumbnailAdapter: Reset headers positions on cursor change
Change-Id: Ia3301bcfe542a996b05b2220240cdd08c4e1b57d
2023-08-06 00:34:21 +02:00
LuK1337 29d4d381e7 Glimpse: Hook up delete button
Change-Id: I5ae05cbbb62d3ef2bf139bdd8345459a3ea7e218
2023-08-06 00:34:21 +02:00
Luca Stefani c36e32ab34 Glimpse: Use relative date strings in Reels
Change-Id: I84eaa2cea0b91aa3da26298e8b78a951551477b8
2023-08-06 00:34:21 +02:00
Luca Stefani 6cfb7064b3 Glimpse: Use a shared player across all media views
This is required to properly stop the player on detach

Change-Id: Ia18f55c6dfd796f044d0e7aed179f9f21a141eda
2023-08-06 00:34:21 +02:00
Luca Stefani 6984c7d35f Glimpse: Preserve last seen media position
Otherwise resuming the fragment will go back to
the original media.

Change-Id: I9433f353782afb0ae006de4d2906842299f34e82
2023-08-06 00:34:21 +02:00
Luca Stefani 321615afe5 Glimpse: Update workflows versions
They use node12 that is deprecated.

Change-Id: I88864db207ffbc353ee4fc05477c98e962c3e158
2023-08-06 00:34:21 +02:00
Luca Stefani 343e1ca766 Glimpse: Initial media sharing support
Change-Id: Ic83a8203b6f69bcf8468014d17e059194493a273
2023-08-06 00:34:21 +02:00
Luca Stefani 2ef61e0c48 Glimpse: Request ACCESS_MEDIA_LOCATION in Q+
It's required to read the media location.

Change-Id: I6d5b28338c86b23a537696b10a0b5bed87cb669b
2023-08-06 00:34:21 +02:00
Luca Stefani 18a61b6507 Glimpse: Ensure we split properly per day
1 day difference between 2 dates means 24 hours.

Also switch to Java 8 Date Time API to handle timezone properly
since dateAdded is epoch without any offset.

Change-Id: I056a8a0d71247ea2045d6d092332a7ff4fb51466
2023-08-06 00:34:20 +02:00
Luca Stefani 6a7c4bec4f Glimpse: Implement scrolling
Change-Id: I4b87e75e45106ca31ce6c8624aca0790dea8e953
2023-08-05 17:54:57 +02:00
Sebastiano Barezzi 2110823b23 Glimpse: Show video icon on video thumbnails
Change-Id: Ia0fc1622ba8c19c9a77b4398495f4eac46c8ed73
2023-08-05 17:54:57 +02:00
Sebastiano Barezzi 25a80b9a65 Glimpse: MediaViewerFragment: Load images with coil
* Fixes stuttering while opening
* It also handles EXIF rotation

Change-Id: I82f1a83e608d7ea7c91e5f4c91fd336a33e67b9e
2023-08-05 17:54:57 +02:00
Luca Stefani ee33e7775f Glimpse: Use buildString to create selections
Change-Id: I8b67b7ae6bf17a35b82b5fcdd53b294fa469ba6a
2023-08-05 17:54:57 +02:00
Luca Stefani 8720344ae4 Glimpse: Use stable IDs in our adapters
Our album IDs and photo IDs are unique and stable.

Change-Id: Ic37051ea71b3f773fc3dc241d1b513d636b8688c
2023-08-05 17:54:57 +02:00