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

Reload upon activity resume #284

Open
6 of 7 tasks
KopiasCsaba opened this issue Aug 15, 2024 · 6 comments
Open
6 of 7 tasks

Reload upon activity resume #284

KopiasCsaba opened this issue Aug 15, 2024 · 6 comments
Labels
bug Something is not working

Comments

@KopiasCsaba
Copy link

Checklist

  • 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 feature request.
  • I have read and understood the contribution guidelines.
  • I optionally donated to support the Fossify mission.

Feature description

Upon starting the app or reactivating it (if it was running just switched away and came back), it'd be nice to have an automatic reload of images in that directory. Due to performance reasons I understand if it gets a setting buried somewhere and default off as well.

Why do you want this feature?

So on graphene OS on pixel phones, thankfully we can use the awesome(ly working) factory camera app the google camera app without the google ecosystem. But, it is hardcoded to open google's photo gallery, so if it's not installed it will not open the gallery from the app just whine.

What we (including my wife) do now is manually switching to Fossify gallery. But there is an extra step to update the pictures (pull down), and that could be eliminated with this.

I also wonder to rename the package somehow to get it working straight from the camera app, but that's off topic.

Additional information

I'm very thankful for this project, thank you guys.

@KopiasCsaba KopiasCsaba added feature request Issue is about a new feature in the app needs triage Issue is not yet ready for PR authors to take up labels Aug 15, 2024
@Aga-C
Copy link
Member

Aga-C commented Aug 16, 2024

It should already work like this, see the video below (on my two non-rooted devices it works the same):

qemu-system-x86_64_nrhWGHWvfD.mp4

Are you doing it the same way? If so, maybe it's a problem with loading working too slow. Have you tried to wait a bit more? We have known performance issues related to the image list.

@Aga-C Aga-C added the waiting for author If the author does not respond, the issue will be closed. Otherwise, the label will be removed. label Aug 16, 2024
@KopiasCsaba
Copy link
Author

KopiasCsaba commented Aug 16, 2024

Dear @Aga-C ,

Thank you for your swift and kind reply, i looked around a bit more to see whats going on, and it is a funny racecondition between the camera app and fossify gallery.

I have made a screenrecording but im on the go, anyhow i switched between the two apps slowly to be visible on the recording. And voila, indeed on activity resume it reloads.

But!

If i make a photo and immediately switch to the gallery app, it refreshes BEFORE the picture is saved back in the camera app. And then it will never show up.

So, steps to reproduce:

  • Open f.g., select camera dir
  • Open the camera
  • Snap a photo and switch back to f.g. as fast as you can.

(With gesture nav its very easy to switch fast, probably you can't reproduce it with the three button nav)

If you can't reproduce or curious, at night i'll upload a video where you can see it happening.

So i wonder what would be a nice solution. The absolute nerd option would be two settings parameter:

  • Extra reload after resume
  • Extra reload delay
    But it might be confusing for many:)

So maybe an "extra reloads after resume" option that would reload 4 time after resume with one second delay could be something inbetween?

So it would reload asap as the activity is resumed, then 4 more times after a second delay each might be good for most use cases.

Let me know what do you think!

@github-actions github-actions bot removed the waiting for author If the author does not respond, the issue will be closed. Otherwise, the label will be removed. label Aug 16, 2024
@Aga-C Aga-C added bug Something is not working niche Only relevant to a very small amount of people and removed feature request Issue is about a new feature in the app needs triage Issue is not yet ready for PR authors to take up labels Aug 16, 2024
@KopiasCsaba
Copy link
Author

Here is a video to show it: https://www.youtube.com/watch?v=w_KBMJ048GI

I also wonder that a loading indicator would be nice to be seen when reloading is in progress when it's just because of the activity resume.

@Aga-C Aga-C removed the niche Only relevant to a very small amount of people label Aug 16, 2024
@Aga-C
Copy link
Member

Aga-C commented Aug 16, 2024

I could only reproduce it by switching quickly between the apps, at the pace you've shown in the video it was working fine. What device model do you have?

@naveensingh
Copy link
Member

New items should show up regardless because we have a content observer listening for changes:

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)
}
}
}
}

Evidently, it doesn't seem to be working correctly.

@KopiasCsaba
Copy link
Author

I could only reproduce it by switching quickly between the apps, at the pace you've shown in the video it was working fine. What device model do you have?

Yeah, it probably depends on the device and the camera app. I'm using Pixel 7A with the Google Camera. It appears to think around quite a bit before saving the image to the storage apparently.

But it's good news that there is a pub/sub going on although it might be broken at the moment, but then no need to do extra refreshes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

No branches or pull requests

3 participants