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

Fix the mini player icon on first load #208

Merged
merged 2 commits into from
Aug 5, 2022
Merged

Conversation

geekygecko
Copy link
Member

This change fixes the issue that when you open the app the mini player shows a pause icon when there isn't a podcast playing. It happens when the system changes between light and dark theme.

The core of the issue was that I was trying to set the Lottie drawable frame to the play icon in the custom view component init method. At this point the view hasn't been inflated yet so the drawable is null and can't have the frame set. To fix this I move setting the frame into the onLayout method and the drawable is not null.

As part of this PR I also fixed some other things:

  • Cached the string resources in the custom view as when a podcast is playing this method is called every second with the playback state.
  • Upgraded to Lottie 5.2.0. The main change was the XML attribute lottie_scale has been removed.
  • Fixed Talkback on the mini player, it wasn't being used and it wasn't localised.

Fixes #148

device-2022-08-05-110346.mp4

@geekygecko geekygecko requested a review from a team as a code owner August 5, 2022 01:34
Copy link
Contributor

@ashiagr ashiagr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found everything good in my testing. Code changes look good as well.
Thanks you for the fix!

@ashiagr ashiagr merged commit a29f90a into main Aug 5, 2022
@ashiagr ashiagr deleted the update/play_button_update branch August 5, 2022 11:54
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.

System theme changes to dark / light theme shows the wrong mini player play button icon
2 participants