Skip to content

Commit

Permalink
Fix not showing duration if position indicators disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Feb 7, 2023
1 parent be4269e commit a3699ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,15 @@ public void updateFromItem(final LocalItem localItem,
.concatenateStrings(item.getStreamEntity().getUploader(),
ServiceHelper.getNameOfServiceById(item.getStreamEntity().getServiceId())));

if (DependentPreferenceHelper.getPositionsInListsEnabled(itemProgressView.getContext())
&& item.getStreamEntity().getDuration() > 0) {
if (item.getStreamEntity().getDuration() > 0) {
itemDurationView.setText(Localization
.getDurationString(item.getStreamEntity().getDuration()));
itemDurationView.setBackgroundColor(ContextCompat.getColor(itemBuilder.getContext(),
R.color.duration_background_color));
itemDurationView.setVisibility(View.VISIBLE);

if (item.getProgressMillis() > 0) {
if (DependentPreferenceHelper.getPositionsInListsEnabled(itemProgressView.getContext())
&& item.getProgressMillis() > 0) {
itemProgressView.setVisibility(View.VISIBLE);
itemProgressView.setMax((int) item.getStreamEntity().getDuration());
itemProgressView.setProgress((int) TimeUnit.MILLISECONDS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ public void updateFromItem(final LocalItem localItem,
itemVideoTitleView.setText(item.getStreamEntity().getTitle());
itemUploaderView.setText(item.getStreamEntity().getUploader());

if (DependentPreferenceHelper.getPositionsInListsEnabled(itemProgressView.getContext())
&& item.getStreamEntity().getDuration() > 0) {
if (item.getStreamEntity().getDuration() > 0) {
itemDurationView.
setText(Localization.getDurationString(item.getStreamEntity().getDuration()));
itemDurationView.setBackgroundColor(ContextCompat.getColor(itemBuilder.getContext(),
R.color.duration_background_color));
itemDurationView.setVisibility(View.VISIBLE);

if (item.getProgressMillis() > 0) {
if (DependentPreferenceHelper.getPositionsInListsEnabled(itemProgressView.getContext())
&& item.getProgressMillis() > 0) {
itemProgressView.setVisibility(View.VISIBLE);
itemProgressView.setMax((int) item.getStreamEntity().getDuration());
itemProgressView.setProgress((int) TimeUnit.MILLISECONDS
Expand Down

0 comments on commit a3699ca

Please sign in to comment.