Skip to content

BUG: Doesn't swipe left when new photos are available #652

Closed as duplicate

Description

@soshial

Checklist

  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.

Affected app version

1.4.2

Affected Android/Custom ROM version

Android 16

Affected device model

Pixel 9 Pro

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug

  1. Open the latest photo (when trying to swipe left -> it doesn't swipe because no newer photo exist — CORRECT)
  2. Minimize gallery and make a new photo with a camera app
  3. Return to Gallery app and try to swipe again

Expected behavior

On step 3 swiping left must work (because newer photo appeared)

Actual behavior

It cannot swipe left

Screenshots/Screen recordings

document_5343637557647277367.mp4

Additional information

No response

Activity

  1. added
    bugSomething is not working
    needs triageIssue is not yet ready for PR authors to take up
    on Sep 13, 2025
  2. naveensingh commented on Sep 13, 2025

    @naveensingh
    Member

    It'll be handled in #284

  3. added
    duplicateThis issue or pull request already exists
    and removed
    bugSomething is not working
    needs triageIssue is not yet ready for PR authors to take up
    on Sep 13, 2025
  4. soshial commented on Sep 13, 2025

    @soshial
    Author

    Thanks you, @naveensingh! Will this also work in PhotoVideoActivity? I don't see any ContentObserver there.

  5. naveensingh commented on Sep 13, 2025

    @naveensingh
    Member

    Will this also work in PhotoVideoActivity? I don't see any ContentObserver there.

    Both PhotoVideoActivity and ViewPagerActivity inherit the SimpleActivity (which contains the observer). Just need to register the observer at the right time and reload the media when changes occur.

  6. soshial commented on Sep 14, 2025

    @soshial
    Author

    Thanks, but I couldn't find registerFileUpdateListener() being called in PhotoVideoActivity or SimpleActivity.

    Also, I think this a badly engineered approach having it in SimpleActivity, because the same code will be executed multiple times:

        private val observer = object : ContentObserver(null) {
            override fun onChange(selfChange: Boolean, uri: Uri?) {
                super.onChange(selfChange, uri)
                if (uri != null) {
                    val path = getRealPathFromURI(uri)
                    if (path != null) {
                        updateDirectoryPath(path.getParentPath())
                        addPathToDB(path)
                    }
                }
            }
        }

    It should be launched/subscribed only once in a single place, and other activities should simply subscribe to changes.

  7. naveensingh commented on Sep 14, 2025

    @naveensingh
    Member

    I couldn't find registerFileUpdateListener() being called in PhotoVideoActivity or SimpleActivity.

    Currently, only MainActivity and MediaActivity register the observer (by calling registerFileUpdateListener()).

    Also, note that when you are able to swipe, you are in the ViewPagerActivity, not PhotoVideoActivity.

    badly engineered approach

    Agreed. All Fossify apps don't follow the recommended architecture. There are many ancient God activities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions