cordova-plugin-splashscreen icon indicating copy to clipboard operation
cordova-plugin-splashscreen copied to clipboard

fix(android): center spinner position on Android 9

Open bozzaj opened this issue 6 years ago • 12 comments

Platforms affected

Android

Motivation and Context

Fixes #184

Description

Android 9 changed the position of the ProgressDialog. This restores the same behavior of previous Android versions where the ProgressBar (and Dialog) is centered on the screen.

Testing

cordova create app cordova platform add android cordova plugin add https://github.com/bozzaj/cordova-plugin-splashscreen cordova run android --device

Verified that the spinner was centered on the screen.

Checklist

  • [x] Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)

bozzaj avatar Oct 01 '19 21:10 bozzaj

Can you confirm my understanding?

So the spinner is positioned fine (centered on screen) on android 8 or below, and as of android 9, this has changed and this is what this PR addresses?

breautek avatar Jan 12 '20 14:01 breautek

That's correct. Existing behavior on Android 9 and above has the spinner showing at the bottom of the screen. This simply restores consistency with Android 8 and below, without any new functionality or change to past behavior.

bozzaj avatar Jan 12 '20 14:01 bozzaj

Installing older simulators. Might be awhile since I'm not at home, and my gf's internet sucks...

breautek avatar Jan 12 '20 17:01 breautek

I am unable to reproduce this with android 9 or 10 emulators.

Android 8.1, 9, and 10 all produce the loading spinner in the center of the screen for me. Is it possible this has already been addressed? Or maybe it's specific to a device?

breautek avatar Jan 12 '20 18:01 breautek

Ok, I startup up the x86 emulators and was not able to duplicate either with the a test app:

cordova create test-app
cd test-app
cordova plugin add cordova-plugin-splashscreen
cordova platform add android
cordova run android

The only addition I made to the test app was to insert the line:

navigator.splashscreen.show();

to the js/index.js file, just so the splash screen would stay up.

However, running the same app on a Samsung Galaxy Tab Active 2 (Android 9) and a Samsung Note 10+ (Android 10), I get the issue. I also tested a Galaxy Tab A (2018) with Android 9. I don't have any non-Samsung hardware with Android 9+ available to me today, but I'm pretty sure I can run the test with a couple of different non-Samsung devices tomorrow and provide screenshots if need be.

Screenshot_20200112-123123_HelloCordova Screenshot_20200112-121641_HelloCordova

bozzaj avatar Jan 12 '20 19:01 bozzaj

I've been able to test a OnePlus 7 Pro device with Android 10 and it functions like the emulators with no issues. Applying my fix, I tested on the emulators as well as all the above devices and it fixes the issue for the Samsung devices and does not change anything for the other devices.

bozzaj avatar Jan 12 '20 21:01 bozzaj

Okay, i have an actual Samsung device running android 9 that i will use to test. I just want to confirm the problem, then I'll confirm the fix.

I unfortunately can't do that right now, but I'll try to do it sometime this week.

breautek avatar Jan 12 '20 22:01 breautek

Can this please be reviewed and/or merged? I'm observing the same behavior and would love to see it fixed in the master branch.

iceman3000 avatar Feb 23 '20 08:02 iceman3000

Why is this not merged yet?

aurishhammadhafeez avatar Mar 28 '20 15:03 aurishhammadhafeez

Because we didn't have time yet to test this change and ensure it does not break older devices and works as intended.

timbru31 avatar Mar 28 '20 15:03 timbru31

Is there any ETA? Would love for this to be fixed.

daniel-w-swyftx avatar May 01 '20 01:05 daniel-w-swyftx

On my OnePlus devices with Android 11 the spinner is in the center as well. I think Samsung might have some vendor specific things on their Android.

Is this really a bug?

NiklasMerz avatar Apr 03 '22 17:04 NiklasMerz