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

Improvement: Rework playlist progressbar #1226

Merged

Conversation

wutschel
Copy link
Collaborator

@wutschel wutschel commented Jan 4, 2025

Description

Use UIView and their backgroundColor instead of UIImages. The progress bar itself is a child view of a masking UIView. The layout is corrected to have the whole progress view aligning with cell's bottom. The animation from 0-to-x% was updated to finish well within the update cycle time of 1 second and to only run, if the progress bar is updated first time for an already advanced playback. All now obsolete images are removed.

Screenshots (left = before, right = after):
Bildschirmfoto-2025-01-04-um-19-17-52

Summary for release notes

Improvement: Rework playlist progressbar

@wutschel wutschel force-pushed the refactor_playlist_progressbar branch 2 times, most recently from 236d4c7 to 1e7629d Compare January 7, 2025 09:28
Copy link
Collaborator

@kambala-decapitator kambala-decapitator left a comment

Choose a reason for hiding this comment

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

use UIProgressBar

@wutschel
Copy link
Collaborator Author

use UIProgressBar

Oh no. I wasn't even aware this exists ...

@wutschel
Copy link
Collaborator Author

use UIProgressBar

i played around with UIProgressView. I see the beauty of just setting progress and bar/track color, but I cannot make the layout as I want to. For example I am not able to change its height without setting transform, which has unwanted side effects.

Does not have any effect using UIProgressViewStyleBar style (width and origin can be changed though):

CGRect frame = playlistProgressbar.frame;
frame.size.height = 6;
playlistProgressbar.frame = frame;

@kambala-decapitator
Copy link
Collaborator

try setting progressImage to a 1pt wide image of desired height, although not sure it'd help

@wutschel
Copy link
Collaborator Author

try setting progressImage to a 1pt wide image of desired height, although not sure it'd help

Doesn't make any difference.

@kambala-decapitator
Copy link
Collaborator

try setting progressImage to a 1pt wide image of desired height, although not sure it'd help

Doesn't make any difference.

ok, then let's forget about UIProgressView

Copy link
Collaborator

@kambala-decapitator kambala-decapitator left a comment

Choose a reason for hiding this comment

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

now you should use your new progress bar component

@wutschel
Copy link
Collaborator Author

wutschel commented Jan 12, 2025

now you should use your new progress bar component

I guess I shot myself in the foot now. The class I introduced in #1220 is not a generic progress bar, but already tailored for PVR/broadcast (I even should rename the class to reflect this). Here, I need a generic one which only does the progress bar itself. This could then be used in the PVR/broadcast and the playlist progress view.

Separate PR to unify this later? Otherwise I would introduce the progress bar view class here, and then rebase/adapt the LiveTV PR to make use if it.

@kambala-decapitator
Copy link
Collaborator

performing refactoring right in #1220 would fine as well

@kambala-decapitator
Copy link
Collaborator

performing refactoring right in #1220 would fine as well

or even better: merge #1220, then refactor in this PR

@wutschel
Copy link
Collaborator Author

or even better: merge #1220, then refactor in this PR

Locally did this already based on whatever #1220 is currently looking like. Now adding the whole playlist progress view programmatically using a new class PlaylistProgressView.

Use newly introduced class ProgressBarView and replace xib-defined progress view with new PlaylistProgressView Correct the layout to have the whole progress view aligning with the cell's bottom.
@wutschel wutschel force-pushed the refactor_playlist_progressbar branch from 1e7629d to 5d982bc Compare January 16, 2025 12:03
@wutschel
Copy link
Collaborator Author

Here we go, updated this PR to make use of latest and greatest changes/concept discussed in #1220.

@kambala-decapitator kambala-decapitator merged commit 312879c into xbmc:master Jan 16, 2025
@wutschel wutschel deleted the refactor_playlist_progressbar branch January 16, 2025 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants