Move all Pair usage to kotlin.Pair

This commit is contained in:
Greyson Parrelli
2025-11-10 12:03:18 -05:00
parent 66f136903f
commit 2147ad29fa
20 changed files with 72 additions and 72 deletions

View File

@@ -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);

View File

@@ -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;