sschueller / peertube-android

Thorium, a PeerTube Android Client
https://github.com/Chocobozzz/PeerTube
GNU Affero General Public License v3.0
341 stars 53 forks source link

Added preview of the current playback speed and video quality in the VideoOptionsFragment #204

Closed Poslovitch closed 4 years ago

Poslovitch commented 4 years ago

This PR introduces a "preview" of the current video playback speed and quality, as follows: image (the previews are underlined in red)

I'm publishing this PR as a draft, because I need your technical help and opinions about two things:

  1. Playback speed is currently displaying the speed float. I am planning to make use of the strings (e.g. 1.25x instead of 1.25, Normal instead of 1.0). However, I'm afraid the code will be clumsy. Any tips for this?
  2. See the comments I made down below.
sschueller commented 4 years ago

For the speed I am not sure what the most elegant solution would be. You could try using two array to do the translation float to string resource: https://stackoverflow.com/a/21614742/1152320 . or maybe cast the float to a string and tag it to the end of the key of a string resource;: https://stackoverflow.com/questions/43722367/android-dynamic-key-names-r-string

Poslovitch commented 4 years ago

Alright thanks, I'll go with the latter.

maybe cast the float to a string and tag it to the end of the key of a string resource;: https://stackoverflow.com/questions/43722367/android-dynamic-key-names-r-string

Poslovitch commented 4 years ago

Done! image

sschueller commented 4 years ago

Thanks

sschueller commented 4 years ago

There are a few bugs: https://github.com/sschueller/peertube-android/issues/207