Automattic / stories-android

Loop concept app - WP Stories library
GNU General Public License v2.0
20 stars 6 forks source link

Update opaque bar height in OnApplyWindowInsetsListener #666

Closed mzorz closed 3 years ago

mzorz commented 3 years ago

Fix #664

The calculated opaque bar height was not being correctly applied after having changed so this PR fixes that by making sure the height is set on the opaque bar view right after calculating it in the OnApplyWindowInsetsListener.

Then, instead of setting the height at a later moment when the bar needs to be shown, we're only setting the visibility attribute to handle show/hide behavior, making it more precise.

To test: Using a Pixel 4a (device with a screen taller than 9:16)

  1. On WPAndroid: create a Story, add a slide, publish it
  2. open the post and edit the Story
  3. observe the opaque bar is correctly drawn
aforcier commented 3 years ago

:shipit: