use setAutoMirrored for image flipping on API 19 and higher
This commit is contained in:
parent
7906b9e632
commit
0ece2bcd0e
1 changed files with 4 additions and 0 deletions
|
@ -703,6 +703,10 @@ public class AndroidUtils {
|
|||
|
||||
public static Drawable getMirroredDrawable(@NonNull Context ctx,
|
||||
@NonNull Drawable drawable) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
drawable.setAutoMirrored(true);
|
||||
return drawable;
|
||||
}
|
||||
Bitmap bitmap = drawableToBitmap(drawable);
|
||||
return new BitmapDrawable(ctx.getResources(), flipBitmapHorizontally(bitmap));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue