Fix audio waveform RTL rendering.

Fixes #9823
master
Alan Evans 2020-07-07 11:39:32 -03:00 committed by Greyson Parrelli
parent 33c527f15e
commit 599e89b1f9
1 changed files with 4 additions and 0 deletions

View File

@ -120,6 +120,10 @@ public final class WaveFormSeekBarView extends AppCompatSeekBar {
canvas.save();
canvas.translate(getPaddingLeft(), getPaddingTop());
if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
canvas.scale(-1, 1, usableWidth / 2f, usableHeight / 2f);
}
for (int bar = 0; bar < data.length; bar++) {
float x = bar * (barWidth + barGap) + barWidth / 2f;
float y = data[bar] * maxHeight;