Messaging: Replace explicit types

Change-Id: I2165b3dec73973a2a82d8b3c7c364b5f011e597d
This commit is contained in:
Michael W
2024-12-26 15:54:37 +01:00
parent 9538179c75
commit 0069df879a
124 changed files with 278 additions and 277 deletions
@@ -408,7 +408,7 @@ class CameraManager implements FocusOverlayManager.Listener {
}
mPendingOpenCameraIndex = mCameraIndex;
mOpenCameraTask = new AsyncTask<Integer, Void, Camera>() {
mOpenCameraTask = new AsyncTask<>() {
private Exception mException;
@Override
@@ -974,7 +974,7 @@ class CameraManager implements FocusOverlayManager.Listener {
screenHeight *= scaleFactor;
final float aspectRatio = screenWidth / (float) screenHeight;
final List<Camera.Size> sizes = new ArrayList<Camera.Size>(
final List<Camera.Size> sizes = new ArrayList<>(
mCamera.getParameters().getSupportedPictureSizes());
final int maxPixels = maxWidth * maxHeight;
@@ -989,7 +989,7 @@ class CameraManager implements FocusOverlayManager.Listener {
* aspect ratio and size as the picture if possible
*/
private Camera.Size chooseBestPreviewSize(final Camera.Size pictureSize) {
final List<Camera.Size> sizes = new ArrayList<Camera.Size>(
final List<Camera.Size> sizes = new ArrayList<>(
mCamera.getParameters().getSupportedPreviewSizes());
final float aspectRatio = pictureSize.width / (float) pictureSize.height;
final int capturePixels = pictureSize.width * pictureSize.height;
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 The Android Open Source Project
* Copyright (C) 2024 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -71,7 +72,7 @@ public class GalleryGridView extends MediaPickerGridView implements
public GalleryGridView(final Context context, final AttributeSet attrs) {
super(context, attrs);
mSelectedImages = new ArrayMap<Uri, MessagePartData>();
mSelectedImages = new ArrayMap<>();
}
public void setHostInterface(final GalleryGridViewListener hostInterface) {
@@ -301,15 +302,16 @@ public class GalleryGridView extends MediaPickerGridView implements
}
public static final Parcelable.Creator<SavedState> CREATOR =
new Parcelable.Creator<SavedState>() {
@Override
public SavedState createFromParcel(final Parcel in) {
return new SavedState(in);
}
@Override
public SavedState[] newArray(final int size) {
return new SavedState[size];
}
};
new Parcelable.Creator<>() {
@Override
public SavedState createFromParcel(final Parcel in) {
return new SavedState(in);
}
@Override
public SavedState[] newArray(final int size) {
return new SavedState[size];
}
};
}
}
@@ -173,7 +173,7 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
public MediaPicker(final Context context) {
mBinding.bind(DataModel.get().createMediaPickerData(context));
mEnabledChoosers = new ArrayList<MediaChooser>();
mEnabledChoosers = new ArrayList<>();
mChoosers = new MediaChooser[] {
new CameraMediaChooser(this),
new GalleryMediaChooser(this),
@@ -432,7 +432,7 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
}
final MediaChooser[] enabledChoosers = new MediaChooser[mEnabledChoosers.size()];
mEnabledChoosers.toArray(enabledChoosers);
mPagerAdapter = new FixedViewPagerAdapter<MediaChooser>(enabledChoosers);
mPagerAdapter = new FixedViewPagerAdapter<>(enabledChoosers);
if (mViewPager != null) {
mViewPager.setAdapter(mPagerAdapter);
}
@@ -574,7 +574,7 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
}
void dispatchItemsSelected(final MessagePartData item, final boolean dismissMediaPicker) {
final List<MessagePartData> items = new ArrayList<MessagePartData>(1);
final List<MessagePartData> items = new ArrayList<>(1);
items.add(item);
dispatchItemsSelected(items, dismissMediaPicker);
}
@@ -306,7 +306,7 @@ public class FocusOverlayManager {
private void initializeFocusAreas(int focusWidth, int focusHeight,
int x, int y, int previewWidth, int previewHeight) {
if (mFocusArea == null) {
mFocusArea = new ArrayList<Object>();
mFocusArea = new ArrayList<>();
mFocusArea.add(new Area(new Rect(), 1));
}
@@ -318,7 +318,7 @@ public class FocusOverlayManager {
private void initializeMeteringAreas(int focusWidth, int focusHeight,
int x, int y, int previewWidth, int previewHeight) {
if (mMeteringArea == null) {
mMeteringArea = new ArrayList<Object>();
mMeteringArea = new ArrayList<>();
mMeteringArea.add(new Area(new Rect(), 1));
}
@@ -74,7 +74,7 @@ public class PieItem {
public void addItem(PieItem item) {
if (mItems == null) {
mItems = new ArrayList<PieItem>();
mItems = new ArrayList<>();
}
mItems.add(item);
}
@@ -149,7 +149,7 @@ public class PieRenderer extends OverlayRenderer
private void init(Context ctx) {
setVisible(false);
mItems = new ArrayList<PieItem>();
mItems = new ArrayList<>();
Resources res = ctx.getResources();
mRadius = (int) res.getDimensionPixelSize(R.dimen.pie_radius_start);
mCircleSize = mRadius - res.getDimensionPixelSize(R.dimen.focus_radius_offset);
@@ -53,8 +53,8 @@ public class RenderOverlay extends FrameLayout {
mRenderView = new RenderView(context);
addView(mRenderView, new LayoutParams(LayoutParams.MATCH_PARENT,
LayoutParams.MATCH_PARENT));
mClients = new ArrayList<Renderer>(10);
mTouchClients = new ArrayList<Renderer>(10);
mClients = new ArrayList<>(10);
mTouchClients = new ArrayList<>(10);
setWillNotDraw(false);
addRenderer(new PieRenderer(context));