mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Move all Pair usage to kotlin.Pair
This commit is contained in:
@@ -9,7 +9,7 @@ import android.provider.MediaStore;
|
||||
import android.provider.MediaStore.Images;
|
||||
import android.provider.MediaStore.Video;
|
||||
import android.provider.OpenableColumns;
|
||||
import android.util.Pair;
|
||||
import kotlin.Pair;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -364,8 +364,8 @@ public class MediaRepository {
|
||||
|
||||
if (width == 0 || height == 0) {
|
||||
Pair<Integer, Integer> dimens = MediaUtil.getDimensions(context, media.getContentType(), media.getUri());
|
||||
width = dimens.first;
|
||||
height = dimens.second;
|
||||
width = dimens.getFirst();
|
||||
height = dimens.getSecond();
|
||||
}
|
||||
|
||||
return new Media(media.getUri(), media.getContentType(), media.getDate(), width, height, size, 0, media.isBorderless(), media.isVideoGif(), media.getBucketId(), media.getCaption(), null, null);
|
||||
@@ -390,8 +390,8 @@ public class MediaRepository {
|
||||
|
||||
if (width == 0 || height == 0) {
|
||||
Pair<Integer, Integer> dimens = MediaUtil.getDimensions(context, media.getContentType(), media.getUri());
|
||||
width = dimens.first;
|
||||
height = dimens.second;
|
||||
width = dimens.getFirst();
|
||||
height = dimens.getSecond();
|
||||
}
|
||||
|
||||
return new Media(media.getUri(), media.getContentType(), media.getDate(), width, height, size, 0, media.isBorderless(), media.isVideoGif(), media.getBucketId(), media.getCaption(), null, null);
|
||||
|
||||
@@ -13,7 +13,7 @@ import android.hardware.camera2.CameraCharacteristics;
|
||||
import android.hardware.camera2.CameraManager;
|
||||
import android.hardware.camera2.CameraMetadata;
|
||||
import android.os.Build;
|
||||
import android.util.Pair;
|
||||
import kotlin.Pair;
|
||||
import android.util.Size;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -69,9 +69,9 @@ public class CameraXUtil {
|
||||
try {
|
||||
Pair<Integer, Integer> dimens = BitmapUtil.getDimensions(new ByteArrayInputStream(data));
|
||||
|
||||
if (dimens.first != image.getWidth() && dimens.second != image.getHeight()) {
|
||||
if (dimens.getFirst() != image.getWidth() && dimens.getSecond() != image.getHeight()) {
|
||||
Log.w(TAG, String.format(Locale.ENGLISH, "Decoded image dimensions differed from stated dimensions! Stated: %d x %d, Decoded: %d x %d",
|
||||
image.getWidth(), image.getHeight(), dimens.first, dimens.second));
|
||||
image.getWidth(), image.getHeight(), dimens.getFirst(), dimens.getSecond()));
|
||||
Log.w(TAG, "Ignoring the stated rotation and rotating the crop rect 90 degrees (stated rotation is " + rotation + " degrees).");
|
||||
|
||||
rotation = 0;
|
||||
|
||||
Reference in New Issue
Block a user