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

Fixed Android banner rendering issue. #158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jtuchsen
Copy link

By default the Cordova Webview scales to take up the entire width and
height of the Android screen. A change was made to set its height to
flex to take up the entire remaining free vertical space, instead of
taking all of it. This change was made because the AdView, when at the
bottom of the screen, was "bumping" up the WebView to take it's space.
This bumping only happened after layout in the WebView, which caused
fullscreen WebView content to visually jump up. Oddly this happened
after every reflow inside of the WebView, so on every page change you
had the content "bump" up.

For some reason this change only fixes Android versions > 4.1. I
cannot figure out why it isn't helping on version <= 4.1. The half
solution for now is better than none at all though.

  By default the Cordova Webview scales to take up the entire width and
height of the Android screen. A change was made to set its height to
flex to take up the entire remaining free vertical space, instead of
taking all of it. This change was made because the AdView, when at the
bottom of the screen, was "bumping" up the WebView to take it's space.
This bumping only happened after layout in the WebView, which caused
fullscreen WebView content to visually jump up. Oddly this happened
after every reflow inside of the WebView, so on every page change you
had the content "bump" up.

  For some reason this change only fixes Android versions > 4.1. I
cannot figure out why it isn't helping on version <= 4.1. The half
solution for now is better than none at all though.
  The previous commit was causing a crash because a change to the UI
thread wasn't run inside Androids special runOnUiThread method. This
error got passed me because I had tested an earlier version where I
changed the main UI late when showing a banner ad, instead of on
initializing the plugin, and for some reason the version that doesn't
force the setLayout call to run on the UI thread works in my app. :)
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.

1 participant