mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Move all Pair usage to kotlin.Pair
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user