Automattic / stories-android

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

Update current selected frame in onStart() to make sure touch listeners are set on AddedViews #662

Closed mzorz closed 3 years ago

mzorz commented 3 years ago

Fix #659

I've observed this issue appeared every time the story composer would be presented both with lock/unlock but also if you had a slide, then tapped on + to add another slide, but tapped back on the photo picker without making any selection.

I workarounded this by adding a call to update the current slide in onStart(), which works alright. I spent some time trying to understand how this would happen - I haven't been able to get exactly to why the listeners wouldn't get triggered, as apparently the touch events are being handled correctly by the background surface, and if you touch directly on top of the added views these events don't get through to the background image (indicating that these events are being captured but not handled correctly at the AddedView level somehow).

To test:

  1. run the demo app
  2. add a slide
  3. add an added view
  4. lock / unlock phone
  5. observe you can tap and drag the added view
peril-automattic[bot] commented 3 years ago

You can test the changes on this Pull Request by downloading the APK here.

aforcier commented 3 years ago

Working well! :shipit: