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

@@ -3,7 +3,7 @@ package org.thoughtcrime.securesms.mms;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.util.Pair;
import kotlin.Pair;
import androidx.annotation.IntRange;
import androidx.annotation.NonNull;
@@ -107,8 +107,8 @@ public abstract class MediaConstraints {
try {
InputStream is = PartAuthority.getAttachmentStream(context, uri);
Pair<Integer, Integer> dimensions = BitmapUtil.getDimensions(is);
return dimensions.first > 0 && dimensions.first <= getImageMaxWidth(context) &&
dimensions.second > 0 && dimensions.second <= getImageMaxHeight(context);
return dimensions.getFirst() > 0 && dimensions.getFirst() <= getImageMaxWidth(context) &&
dimensions.getSecond() > 0 && dimensions.getSecond() <= getImageMaxHeight(context);
} catch (BitmapDecodingException e) {
throw new IOException(e);
}

View File

@@ -5,7 +5,7 @@ import android.database.Cursor;
import android.net.Uri;
import android.provider.OpenableColumns;
import android.text.TextUtils;
import android.util.Pair;
import kotlin.Pair;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -77,8 +77,8 @@ public final class SlideFactory {
if (width == 0 || height == 0) {
Pair<Integer, Integer> dimens = MediaUtil.getDimensions(context, mimeType, uri);
width = dimens.first;
height = dimens.second;
width = dimens.getFirst();
height = dimens.getSecond();
}
if (mediaType == null) {
@@ -125,8 +125,8 @@ public final class SlideFactory {
if (width == 0 || height == 0) {
Pair<Integer, Integer> dimens = MediaUtil.getDimensions(context, mimeType, uri);
width = dimens.first;
height = dimens.second;
width = dimens.getFirst();
height = dimens.getSecond();
}
if (mediaType == null) {