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

Improve playback parameter dialog's UI #7989

Merged
merged 18 commits into from
Apr 30, 2022

Conversation

litetex
Copy link
Member

@litetex litetex commented Mar 4, 2022

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)
Backstory

Description of the changes in your PR

  • Refactored the code
    • Removed a ton of duplicated stuff
    • Use viewbinding
    • Use Icepick instead of saving everything manually
  • Tuned UI
    • UI fit's now - without a scroller - onto a 5in smartphone (Pixel 3a) in fullscreen mode
    • Removed "Adjust pitch by musical semitones" checkbox and replaced it by a tab like component that can be expanded on demand
    • Semitones now work with "hook"-mode
    • Mark the currently selected steps/pitchmode inside the UI
  • Other
    • Used more containers in the UI so that we don't have to do everything inside the code

Before/After Screenshots/Screen Record

  • Before:
    grafik

  • After:
    grafik

NPPlaybackDialogDemo1.mp4

Fixes the following issue(s)

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.

Due diligence

@litetex litetex added feature request Issue is related to a feature in the app codequality Improvements to the codebase to improve the code quality labels Mar 4, 2022
@litetex litetex marked this pull request as ready for review March 4, 2022 21:29
@karyogamy
Copy link
Contributor

Nice work! By the way, would it be possible to collapse the 2 checkboxes into one line similar to Percent and Semitone?
If the text is too long to fit, maybe we can just call them Unhook and Skip Silence? Even with text and subtext it might save more space.

@litetex
Copy link
Member Author

litetex commented Mar 13, 2022

@karyogamy
I don't think that collapsing the checkboxes would be beneficial, because we don't need to save more space (already optimized for a standard 5" screen).
I might eventually do more UI optimizations in a future PR (e.g. representing the "Unhook" checkbox as a chain between speed and pitch) but the current one primarily aims at code improvements.

Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Used more containers in the UI so that we don't have to do everything inside the code

This is not good for performance afaik, but if we don't migrate to ConstraintLayout (which has view groups) there is no alternative (so nothing to do)

@litetex
Copy link
Member Author

litetex commented Mar 16, 2022

Thank you for the review!

Used more containers in the UI so that we don't have to do everything inside the code

This is not good for performance afaik, but if we don't migrate to ConstraintLayout (which has view groups) there is no alternative (so nothing to do)

  1. It aren't so many new "containers" (1-3)
  2. I think that ConstraintLayout is overrated in the first place - at least for this view:

So I quickly googled why Constraintlayout is better than Relativelayout and found these sources (from https://stackoverflow.com/questions/59628341/constraintlayout-vs-relativelayout-performance-2020):

TL;DR
I will not rewrite the complete layout now to ConstraintLayout because it's then 0.15ms faster. Especially regarding that the dialog/layout is rarely used in the first place.
We can create an issue that does this in the follow up, but for now I think that the current state should be enough.

@Stypox
Copy link
Member

Stypox commented Mar 16, 2022

I will not rewrite the complete layout now to ConstraintLayout because it's then 0.15ms faster. Especially regarding that the dialog/layout is rarely used in the first place.
We can create an issue that does this in the follow up, but for now I think that the current state should be enough.

Yes, I do agree it shouldn't be done here, and I do agree there is no big need to spend time on it. It's just something worth noting in my opinion, since ConstraintLayouts are better not only in performance but also they are also simpler to code, cause less errors and are more powerful.

@SameenAhnaf
Copy link
Collaborator

SameenAhnaf commented Apr 3, 2022

Do we really need to click twice just to save space? A checkbox could be placed here instead?
IMG_20220403_173456

@litetex
Copy link
Member Author

litetex commented Apr 9, 2022

@SameenAhnaf

  1. How often do you change between semitones and percent?Not that often or?
  2. If the "pitch" and "Semtiones" are displayed on a small screen and have long localizations they won't fit

@litetex litetex mentioned this pull request Apr 9, 2022
5 tasks
@Redirion
Copy link
Member

I resolved the conflict directly here on github and it resulted in that not really helpful commit message "Merge branch 'dev'". Can you clean that up please litetex? This should be ready to merge.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

litetex added 14 commits April 16, 2022 21:21
* Removed/Renamed methods
* Use ``IcePick``
* Better structuring
* Keep skipSilence when rotating the device (PlayQueueActivity only)
* De-Duplicated some fields
* Use a container for the pitch controls
* Name pitch related elements correctly
* Add support for semitones
* Fixed some minor bugs
* Improved some methods
Using an expandable Tab-like component instead of a combobox
From the PR review
@litetex litetex force-pushed the refactor-playback-parameter-dialog branch from 0c1b282 to a311519 Compare April 16, 2022 19:24
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

I tested and it works well. Thank you!

@Stypox Stypox merged commit 7646c68 into TeamNewPipe:dev Apr 30, 2022
@Stypox Stypox changed the title Rewrote PlaybackParameterDialog Improve playback parameter dialog's UI Apr 30, 2022
KosOrKosm added a commit to KosOrKosm/NewPipe that referenced this pull request Apr 30, 2022
@litetex litetex deleted the refactor-playback-parameter-dialog branch May 1, 2022 12:34
@Stypox Stypox mentioned this pull request Jun 24, 2022
3 tasks
@Fs00 Fs00 mentioned this pull request Jul 26, 2022
@goyalyashpal
Copy link
Contributor

goyalyashpal commented Jan 22, 2023

  • Mark the currently selected steps/pitchmode inside the UI

hey! is this reverted in v0.24.1 ?? I was unable to see the rectangular dashed border around currently selected playback speed selector/speed adjustment step size buttons in that version, while it's there in v0.23.3


Trail/please ignore

Failed gh pulls 🔍 :

@opusforlife2
Copy link
Collaborator

I can see it just fine. Maybe your OS colours are different?

@goyalyashpal
Copy link
Contributor

I can see it just fine. Maybe your OS colours are different?

i just rechecked, and yeah, it was present there.... though it was very faint due to low resolution and small screen size of the device i saw that on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality feature request Issue is related to a feature in the app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overhaul PlaybackParameterDialog
8 participants