Merge pull request #4997 from ByteHamster/buffering-indicator-strength

Make buffering indicator a bit less visible
This commit is contained in:
ByteHamster 2021-03-07 10:42:19 +01:00 committed by GitHub
commit 1ab732b8da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -17,7 +17,6 @@ public class ChapterSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
private float[] dividerPos; private float[] dividerPos;
private final Paint paintBackground = new Paint(); private final Paint paintBackground = new Paint();
private final Paint paintProgressPrimary = new Paint(); private final Paint paintProgressPrimary = new Paint();
private final Paint paintProgressSecondary = new Paint();
public ChapterSeekBar(Context context) { public ChapterSeekBar(Context context) {
super(context); super(context);
@ -43,8 +42,6 @@ public class ChapterSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
paintBackground.setAlpha(128); paintBackground.setAlpha(128);
paintProgressPrimary.setColor(ThemeUtils.getColorFromAttr(getContext(), paintProgressPrimary.setColor(ThemeUtils.getColorFromAttr(getContext(),
de.danoeh.antennapod.core.R.attr.colorPrimary)); de.danoeh.antennapod.core.R.attr.colorPrimary));
paintProgressSecondary.setColor(ThemeUtils.getColorFromAttr(getContext(),
de.danoeh.antennapod.core.R.attr.seek_background));
} }
/** /**
@ -82,7 +79,7 @@ public class ChapterSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
final int saveCount = canvas.save(); final int saveCount = canvas.save();
canvas.translate(getPaddingLeft(), getPaddingTop()); canvas.translate(getPaddingLeft(), getPaddingTop());
canvas.drawRect(0, top, width, bottom, paintBackground); canvas.drawRect(0, top, width, bottom, paintBackground);
canvas.drawRect(0, top, progressSecondary, bottom, paintProgressSecondary); canvas.drawRect(0, top, progressSecondary, bottom, paintBackground);
canvas.drawRect(0, top, progressPrimary, bottom, paintProgressPrimary); canvas.drawRect(0, top, progressPrimary, bottom, paintProgressPrimary);
canvas.restoreToCount(saveCount); canvas.restoreToCount(saveCount);
} }
@ -112,7 +109,7 @@ public class ChapterSeekBar extends androidx.appcompat.widget.AppCompatSeekBar {
canvas.drawRect(leftCurr, topExpanded, progressPrimary, bottomExpanded, paintProgressPrimary); canvas.drawRect(leftCurr, topExpanded, progressPrimary, bottomExpanded, paintProgressPrimary);
} else { } else {
if (progressSecondary > leftCurr) { if (progressSecondary > leftCurr) {
canvas.drawRect(leftCurr, top, progressSecondary, bottom, paintProgressSecondary); canvas.drawRect(leftCurr, top, progressSecondary, bottom, paintBackground);
} }
canvas.drawRect(leftCurr, top, progressPrimary, bottom, paintProgressPrimary); canvas.drawRect(leftCurr, top, progressPrimary, bottom, paintProgressPrimary);
} }