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

Visual artifacts upon first keypress #75

Open
juleskers opened this issue Sep 26, 2023 · 3 comments
Open

Visual artifacts upon first keypress #75

juleskers opened this issue Sep 26, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@juleskers
Copy link
Collaborator

In #73, @nicolasbrailo mentioned jumping keys upon first keypress.

One suggestion for a test: can we add one to test the stability of the sizes? I noticed the size of the keys in the app change after the first keypress on the latest version of the app, and I'm not sure why or when we introduced that

While I haven't seen size changes myself, I have seen black areas that only get filled out after the first touch.

It seems we have some kind of cached screen surface (probably from Android itself?) that only gets repainted on first trigger.

Since I am not quite sure where to start fixing this, I'm opening this ticket to track the investigation.

@juleskers
Copy link
Collaborator Author

juleskers commented Sep 26, 2023

So far, i Have personally observed:

  • upon app-resume black bar at right/bottom, exactly matching the android bottom bar (home, back, recent apps), not sure how to reproduce this one..
  • after completely closing the app (swiping to the side in "recent apps" view, first opening of the app will show a black screen with the android locking warning, like so:
    • Screenshot_20230926-191909_PianOli
    • closing the android warning will show a completely black screen
    • touching anywhere will play a note and draw the normal piano.

My phone is running /e/-OS, a LineageOS derivate, since Android flavours probably differ in their rendering and resume behaviour.

@nicolasbrailo, do your "jumping" keys happen in the "closed from recent apps" scenario?

@juleskers
Copy link
Collaborator Author

juleskers commented Dec 17, 2023

Just a realisation, while I was refactoring PianoCanvas..

Should we (re)draw on surfaceChanged?
Currently, we just ignore it, which may lead the OS to do "smart" things with outdated, wrongly scaled cached previews..
(or black screens if it doesn't have those)..

Current implementation:

@Override
public void surfaceChanged(@NonNull SurfaceHolder surfaceHolder, int i, int i1, int i2) {
}

@juleskers juleskers added the bug Something isn't working label Dec 18, 2023
@nicolasbrailo
Copy link
Owner

@juleskers good find. I think it only makes sense to redraw when the OS is telling us the screen changed!

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

No branches or pull requests

2 participants