Skip to content

Commit

Permalink
[ProgressIndicator] Applied a workaround in Circular counter-clockwise.
Browse files Browse the repository at this point in the history
Resolves #4125

PiperOrigin-RevId: 621606567
  • Loading branch information
pekingme authored and paulfthomas committed Apr 3, 2024
1 parent 544c75f commit e8452fb
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import android.graphics.PathMeasure;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.util.Pair;
import androidx.annotation.ColorInt;
import androidx.annotation.FloatRange;
Expand Down Expand Up @@ -118,6 +120,11 @@ void adjustCanvas(
canvas.scale(scaleX, scaleY);
if (spec.indicatorDirection != CircularProgressIndicator.INDICATOR_DIRECTION_CLOCKWISE) {
canvas.scale(1, -1);
if (VERSION.SDK_INT == VERSION_CODES.Q) {
// There's some issue to rotate and flip the canvas on API 29. The workaround is to rotate
// the canvas an extra 0.1 degree.
canvas.rotate(0.1f);
}
}

// Clip all drawing to the designated area, so it doesn't draw outside of its bounds (which can
Expand Down

0 comments on commit e8452fb

Please sign in to comment.