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

Fix slideshow #12

Closed
wants to merge 5 commits into from
Closed

Fix slideshow #12

wants to merge 5 commits into from

Conversation

gmasil
Copy link
Contributor

@gmasil gmasil commented Dec 14, 2023

This PR was originally created here: SimpleMobileTools/Simple-Gallery#3043

Currently the slideshow is not working, see SimpleMobileTools/Simple-Gallery#3020.

When the slideshow is starting the ViewPagerActivity is activated and will call initContinue() where checkSystemUI() is called. This will stop the slideshow immediately if the activity is not in fullscreen mode.

I removed the call to stopSlideshow().

Edit: Resolves #35

@naveensingh
Copy link
Member

@gmasil as per the SMT reports, it looks like this bug only appears on Android 14?

@Aga-C
Copy link
Member

Aga-C commented Dec 30, 2023

@naveensingh I can confirm this bug (checked on emulator) on Android 14. On Android 13 everything works fine.

@naveensingh
Copy link
Member

@gmasil with this solution, the slideshow can no longer be stopped by taping on the currently visible image.

The slideshow is being stopped because the mIsFullScreen variable is false when it should be true. The first call to hideSystemUi() doesn't seem to work properly on Android 14. That's the root cause. The API we are using was deprecated some time ago. I'll investigate this later.

@gmasil
Copy link
Contributor Author

gmasil commented Dec 30, 2023

@gmasil with this solution, the slideshow can no longer be stopped by taping on the currently visible image.

The slideshow is being stopped because the mIsFullScreen variable is false when it should be true. The first call to hideSystemUi() doesn't seem to work properly on Android 14. That's the root cause. The API we are using was deprecated some time ago. I'll investigate this later.

Oh I didn't know that you could stop the slideshow by tapping. I'll try to investigate further, thanks!

@Goodwy
Copy link

Goodwy commented Jan 18, 2024

The isInMultiWindowMode condition does not work. It works if you replace the code

mIsFullScreen = if (isNougatPlus() && isInMultiWindowMode) {
                visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE != 0
            } else if (visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE == 0) {
                false
            } else {
                visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
            }

by

mIsFullScreen = if (isUpsideDownCakePlus()) {
                visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE != 0
            } else if (isNougatPlus() && isInMultiWindowMode) {
                visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE != 0
            } else if (visibility and View.SYSTEM_UI_FLAG_LOW_PROFILE == 0) {
                false
            } else {
                visibility and View.SYSTEM_UI_FLAG_FULLSCREEN != 0
            }

@gmasil
Copy link
Contributor Author

gmasil commented Jan 18, 2024

@Goodwy thanks a lot, this seems to be working.
Updated PR, Testers are welcome again :)

@naveensingh
Copy link
Member

These PRs are being closed automatically by GitHub or some glitch. I'm not closing them.

@naveensingh naveensingh reopened this Jan 28, 2024
@naveensingh
Copy link
Member

@gmasil

I detached all the forked Fossify repositories and as a result, PRs originating from SMT forks are being closed automatically. Please consider the following solution:

  • Fork the new repository from Fossify.
  • Add your SMT fork as a remote and merge your changes.
  • Raise a new PR using the newly forked Fossify repository.

Sorry for the inconvenience.

@gmasil
Copy link
Contributor Author

gmasil commented Jan 28, 2024

Now that @Goodwy provided the solution he/she might as well have the honor.
I used this since Jan 18 and I haven't noticed any problems so far, so green light from my side.

@gmasil gmasil deleted the 3020-fix-slideshow branch January 28, 2024 23:09
naveensingh added a commit that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The slideshow doesn't work
4 participants