-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Make UI behavior for playback information display more consistent #8180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR.
Had a quick review:
- Please add some documentation/comments that explain (e.g. on complex if blocks) why stuff is happening
- Some code snippets look like they are copy-pasted. Consider using abstraction.
- Please don't use settings-logic inside a UI class (#Layering)
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/AnimatedProgressBar.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/AnimatedProgressBar.java
Outdated
Show resolved
Hide resolved
Thank @litetex for commenting! This really helps me on improvement. I add some response here.
Gonna do that.
yes, in class
I will find an appropriate place for it (maybe a helper class). |
The updates
|
SonarCloud Quality Gate failed. |
Just a remind that this pr has been shelved for some time, it may be better if someone would like to review this if the issues related to this pr should be solved and my solution being considered to be acceptable, or I may forget about my codes XD. Anyway I hope my pr not to bother you, so you can also just take this pr as a reference (if helpful) when solving related issues in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR! I agree with litetex, the code in the various stream item holders should be deduplicated. Maybe you could add a common method that takes as parameter the itemProgressView
, and the data needed to take decisions and update the UI.
Since this and other requested changes require knowledge about the codebase, if you need help or want me to do this, just ask ;-)
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/util/DependentPreferenceHelper.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/holder/LocalStatisticStreamItemHolder.java
Outdated
Show resolved
Hide resolved
@Trust04zh Hey, will you be incorporating the review at some point? |
@opusforlife2 yes, I will check the review and update the code in the recent two or three days. |
Kudos, SonarCloud Quality Gate passed! |
Thank you for the reviews @Stypox! I agree with them and updated the code accordingly. There is no functinoal change in the new commits. As some code changes are removed in new commits, the duplication in item holder classes reduces but still exists.
I'm not sure about how to make such code abstraction, since the three classes are not simply extended from the same superclass and the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long time passed... I hope you still remember something ;-)
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/info_list/holder/StreamMiniInfoItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/holder/LocalPlaylistStreamItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/holder/LocalStatisticStreamItemHolder.java
Outdated
Show resolved
Hide resolved
@Stypox Thanks for your reviewing and sorry that I just found the email reminding me for your reply, the code is updated. |
SonarCloud Quality Gate failed. |
app/src/main/java/org/schabi/newpipe/fragments/detail/VideoDetailFragment.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/info_list/holder/StreamMiniInfoItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/info_list/holder/StreamMiniInfoItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/holder/LocalPlaylistStreamItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/holder/LocalPlaylistStreamItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/holder/LocalStatisticStreamItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/local/holder/LocalStatisticStreamItemHolder.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/views/AnimatedProgressBar.java
Outdated
Show resolved
Hide resolved
@Stypox Thanks for your reviewing! The code mentioned are updated. |
@Trust04zh there are some unresolved points. You can use the "Resolve conversation" button to mark off things you have already done, in order not to forget anything. #8180 (comment) #8180 (comment) |
@Stypox Now they are marked as resolve. Sorry I took a few days to reply, I just took a vacation. |
Mmmh, you didn't push any new commit though, so I guess you misunderstood me: the things I did not mark as done myself were the ones that still needed to be done ;-) I unresolved the two mentioned comments again. It's just two small things. |
@Stypox updated now, thank you for the reminder, I did forget to deal with them 😟 |
…ations The following is the list of all commits squashed together: Regain function for option `Positions in lists` use option `Resume playback` to control display of progress info in VideoDetailFragment, remove this (extra) function from option `Positions in lists`. remove extra check for live streams, live streams updates just as non-live streams. fix TeamNewPipe#8176 by eliminating exit delay Regain function for option `Positions in lists` update code with developer's comments apply static import to methods in util class DependentPreferenceHelper Regain function for option `Positions in lists` use option `Resume playback` to control display of progress info in VideoDetailFragment, remove this (extra) function from option `Positions in lists`. remove extra check for live streams, live streams updates just as non-live streams. fix behavior for displaying progress bar when autoplay off but video resume on not to retrieve unnecessary states when position in lists disabled fix mistake in code simplify conditional logic update doc comment and remove unused method Fix not showing duration if position indicators disabled Positions in lists only depends on watch history
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some changes:
- rebased and squashed commits
- Now positions in lists only depends on watch history. Was there a specific reason for them to depend on "Resume playback"? One might want to see progress on items without resuming playback. 3ee3ddb
- Fix not showing duration if position indicators disabled. A condition was not in the correct place. a3699ca
Do these changes look good to you @Trust04zh?
SonarCloud Quality Gate failed. |
@Stypox yes, they are good to me.
In my understanding, displaying progress just tells playback information vaguely, and if users do not want to resume playback, it does not quite make sense. There was no clear discussion for this point in the previous issue, and the change is fine to me. |
Thanks again, @Trust04zh! |
@Trust04zh Could I bother you to update the PR description at the top with the latest changes? It's outdated, and difficult to understand exactly what the final state of things is. I think the videos are outdated as well now. |
I have updated the description of this pr based on the final changes, including:
I think that the description now clarifies things, and I'm willing to update if there are still unclear points for you. |
Thanks! Sorry, I don't understand point 4 at all. I was basically asking for changes that are visible to the user, not what code changes have been done. Point 2 is clear to me, from that perspective. Not sure what part of the videos is addressing point 4. |
Ah. Got it. Thanks! |
What is it?
Description of the changes in your PR
MakeThis change has been put on hold, see this comment.Resume playback
the dependency ofPositions in lists
.Positions in lists
.Resume playback
to control if playback information inVideoDetailFragment
should display (positionView
anddetailPositionView
, for UI), and remove this function forPositions in lists
.positionView
anddetailPositionView
should disappear. (this fixes Instant inconsistent display for playback information in VideoDetailFragment #8176)Before/After Screenshots/Screen Record
The first half of the two videos explain how the option
Positions in lists
should control the display of playback information in the list (change 2), and the second half explain how to eliminate the instant inconsistency in playback information display (change 4).before.mp4
after.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