Messaging: Fix modifiers

We either have too few or too many

Change-Id: I09a9a38b859c68526fcbcdbc7862afe1d693f6c0
This commit is contained in:
Michael W
2024-12-26 14:55:12 +01:00
parent 37d6d70835
commit 21cb2b6289
78 changed files with 528 additions and 464 deletions
@@ -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.
@@ -67,7 +68,7 @@ public class AsyncImageView extends ImageView implements MediaResourceLoadListen
public final Binding<BindableMediaRequest<ImageResource>> mImageRequestBinding;
/** True if we want the image to fade in when it loads */
private boolean mFadeIn;
private final boolean mFadeIn;
/** True if we want the image to reveal (scale) when it loads. When set to true, this
* will take precedence over {@link #mFadeIn} */
@@ -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.
@@ -53,7 +54,7 @@ public class AttachmentPreview extends ScrollView implements OnAttachmentClickLi
private int mAnimatedHeight = -1;
private Animator mCloseGapAnimator;
private boolean mPendingFirstUpdate;
private Handler mHandler;
private final Handler mHandler;
private Runnable mHideRunnable;
private boolean mPendingHideCanceled;
@@ -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.
@@ -30,9 +31,9 @@ public class CompositeAdapter extends BaseAdapter {
private static final int INITIAL_CAPACITY = 2;
public static class Partition {
boolean mShowIfEmpty;
boolean mHasHeader;
BaseAdapter mAdapter;
final boolean mShowIfEmpty;
final boolean mHasHeader;
final BaseAdapter mAdapter;
public Partition(final boolean showIfEmpty, final boolean hasHeader,
final BaseAdapter adapter) {
@@ -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.
@@ -33,8 +34,8 @@ import com.android.messaging.util.Assert;
public class CustomHeaderViewPager extends LinearLayout {
public final static int DEFAULT_TAB_STRIP_SIZE = -1;
private final int mDefaultTabStripSize;
private ViewPager mViewPager;
private ViewPagerTabs mTabstrip;
private final ViewPager mViewPager;
private final ViewPagerTabs mTabstrip;
public CustomHeaderViewPager(final Context context, final AttributeSet attrs) {
super(context, attrs);
+2 -1
View File
@@ -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.
@@ -130,7 +131,7 @@ public class SnackBar {
private Action mAction;
private Placement mPlacement;
// The parent view is only used to get a window token and doesn't affect the layout
private View mParentView;
private final View mParentView;
public Builder(final SnackBarManager snackBarManager, final View parentView) {
Assert.notNull(snackBarManager);
@@ -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.
@@ -46,7 +47,7 @@ public interface SnackBarInteraction {
* {@link SnackBar} is always shown with {@link Gravity#BOTTOM} and that the provided View will
* always need to be translated up to make room for the SnackBar.
*/
public static class BasicSnackBarInteraction implements SnackBarInteraction {
class BasicSnackBarInteraction implements SnackBarInteraction {
private final View mView;
public BasicSnackBarInteraction(final View view) {
@@ -64,4 +65,4 @@ public interface SnackBarInteraction {
return mView.animate().translationY(0);
}
}
}
}
@@ -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.
@@ -27,7 +28,7 @@ import android.widget.LinearLayout;
import com.android.messaging.R;
public class ViewPagerTabStrip extends LinearLayout {
private int mSelectedUnderlineThickness;
private final int mSelectedUnderlineThickness;
private final Paint mSelectedUnderlinePaint;
private int mIndexForSelection;
@@ -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.
@@ -49,7 +50,7 @@ import com.android.messaging.R;
public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnPageChangeListener {
ViewPager mPager;
private ViewPagerTabStrip mTabStrip;
private final ViewPagerTabStrip mTabStrip;
/**
* Linearlayout that will contain the TextViews serving as tabs. This is the only child
@@ -60,7 +61,7 @@ public class ViewPagerTabs extends HorizontalScrollView implements ViewPager.OnP
final int mTextSize;
final boolean mTextAllCaps;
int mPrevSelected = -1;
int mSidePadding;
final int mSidePadding;
private static final int TAB_SIDE_PADDING_IN_DPS = 10;
@@ -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.
@@ -376,8 +377,8 @@ public class ApnSettingsActivity extends BugleActionBarActivity {
}
}
private class RestoreApnProcessHandler extends Handler {
private Handler mCachedRestoreApnUiHandler;
private static class RestoreApnProcessHandler extends Handler {
private final Handler mCachedRestoreApnUiHandler;
public RestoreApnProcessHandler(Looper looper, Handler restoreApnUiHandler) {
super(looper);
@@ -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.
@@ -56,7 +57,7 @@ public class AttachmentChooserFragment extends Fragment implements DraftMessageD
private AttachmentChooserFragmentHost mHost;
@VisibleForTesting
Binding<DraftMessageData> mBinding = BindingBase.createBinding(this);
final Binding<DraftMessageData> mBinding = BindingBase.createBinding(this);
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
@@ -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.
@@ -36,7 +37,7 @@ public abstract class ConversationInput {
}
protected boolean mShowing;
protected ConversationInputBase mConversationInputBase;
protected final ConversationInputBase mConversationInputBase;
public abstract boolean show(boolean animate);
public abstract boolean hide(boolean animate);
@@ -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.
@@ -77,15 +78,15 @@ public class ConversationListFragment extends Fragment implements ConversationLi
private boolean mForwardMessageMode;
public interface ConversationListFragmentHost {
public void onConversationClick(final ConversationListData listData,
void onConversationClick(final ConversationListData listData,
final ConversationListItemData conversationListItemData,
final boolean isLongClick,
final ConversationListItemView conversationView);
public void onCreateConversationClick();
public boolean isConversationSelected(final String conversationId);
public boolean isSwipeAnimatable();
public boolean isSelectionMode();
public boolean hasWindowFocus();
void onCreateConversationClick();
boolean isConversationSelected(final String conversationId);
boolean isSwipeAnimatable();
boolean isSelectionMode();
boolean hasWindowFocus();
}
private ConversationListFragmentHost mHost;
@@ -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.
@@ -47,8 +48,8 @@ public class ShareIntentFragment extends DialogFragment implements ConversationL
public static final String HIDE_NEW_CONVERSATION_BUTTON_KEY = "hide_conv_button_key";
public interface HostInterface {
public void onConversationClick(final ConversationListItemData conversationListItemData);
public void onCreateConversationClick();
void onConversationClick(final ConversationListItemData conversationListItemData);
void onCreateConversationClick();
}
private final Binding<ConversationListData> mListBinding = BindingBase.createBinding(this);
@@ -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.
@@ -99,8 +100,8 @@ class CameraManager implements FocusOverlayManager.Listener {
* Callback when taking image or video
*/
interface MediaCallback {
static final int MEDIA_CAMERA_CHANGED = 1;
static final int MEDIA_NO_DATA = 2;
int MEDIA_CAMERA_CHANGED = 1;
int MEDIA_NO_DATA = 2;
void onMediaReady(Uri uriToMedia, String contentType, int width, int height);
void onMediaFailed(Exception exception);
@@ -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.
@@ -55,6 +56,7 @@ public class GalleryGridItemView extends FrameLayout {
}
@VisibleForTesting
final
GalleryGridItemData mData;
private AsyncImageView mImageView;
private CheckBox mCheckBox;
@@ -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.
@@ -53,7 +54,7 @@ class GalleryMediaChooser extends MediaChooser implements
private View mMissingPermissionView;
/** Handles picking a media from the document picker. */
private DocumentImagePicker mDocumentImagePicker;
private final DocumentImagePicker mDocumentImagePicker;
GalleryMediaChooser(final MediaPicker mediaPicker) {
super(mediaPicker);
@@ -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.
@@ -36,7 +37,7 @@ import java.io.IOException;
* implementations of the shared methods are delegated to CameraPreview
*/
public class HardwareCameraPreview extends TextureView implements CameraPreview.CameraPreviewHost {
private CameraPreview mPreview;
private final CameraPreview mPreview;
public HardwareCameraPreview(final Context context, final AttributeSet attrs) {
super(context, attrs);
@@ -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.
@@ -17,8 +18,8 @@
package com.android.messaging.ui.mediapicker.camerafocus;
public interface FocusIndicator {
public void showStart();
public void showSuccess(boolean timeout);
public void showFail(boolean timeout);
public void clear();
}
void showStart();
void showSuccess(boolean timeout);
void showFail(boolean timeout);
void clear();
}
@@ -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.
@@ -76,7 +77,7 @@ public class FocusOverlayManager {
private boolean mMeteringAreaSupported;
private boolean mLockAeAwbNeeded;
private boolean mAeAwbLock;
private Matrix mMatrix;
private final Matrix mMatrix;
private PieRenderer mPieRenderer;
@@ -89,14 +90,14 @@ public class FocusOverlayManager {
private String mFocusMode;
private String mOverrideFocusMode;
private Parameters mParameters;
private Handler mHandler;
Listener mListener;
private final Handler mHandler;
private final Listener mListener;
public interface Listener {
public void autoFocus();
public void cancelAutoFocus();
public boolean capture();
public void setFocusParameters();
void autoFocus();
void cancelAutoFocus();
boolean capture();
void setFocusParameters();
}
private class MainHandler extends Handler {
@@ -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.
@@ -29,12 +30,12 @@ import java.util.List;
*/
public class PieItem {
public static interface OnClickListener {
public interface OnClickListener {
void onClick(PieItem item);
}
private Drawable mDrawable;
private int level;
private final int level;
private float mCenter;
private float start;
private float sweep;
@@ -199,4 +200,4 @@ public class PieItem {
setAlpha(mAlpha);
}
}
}
@@ -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.
@@ -46,14 +47,14 @@ public class PieRenderer extends OverlayRenderer
// These states are used to make sure the animation is run for at least some
// time.
private volatile int mState;
private ScaleAnimation mAnimation = new ScaleAnimation();
private final ScaleAnimation mAnimation = new ScaleAnimation();
private static final int STATE_IDLE = 0;
private static final int STATE_FOCUSING = 1;
private static final int STATE_FINISHING = 2;
private static final int STATE_PIE = 8;
private Runnable mDisappear = new Disappear();
private Animation.AnimationListener mEndAction = new EndAction();
private final Runnable mDisappear = new Disappear();
private final Animation.AnimationListener mEndAction = new EndAction();
private static final int SCALING_UP_TIME = 600;
private static final int SCALING_DOWN_TIME = 100;
private static final int DISAPPEAR_TIMEOUT = 200;
@@ -114,7 +115,7 @@ public class PieRenderer extends OverlayRenderer
private LinearAnimation mFadeIn;
private volatile boolean mFocusCancelled;
private Handler mHandler = new Handler() {
private final Handler mHandler = new Handler() {
public void handleMessage(Message msg) {
switch(msg.what) {
case MSG_OPEN:
@@ -133,9 +134,9 @@ public class PieRenderer extends OverlayRenderer
private PieListener mListener;
public static interface PieListener {
public void onPieOpened(int centerX, int centerY);
public void onPieClosed();
public interface PieListener {
void onPieOpened(int centerX, int centerY);
void onPieClosed();
}
public void setPieListener(PieListener pl) {
@@ -801,8 +802,8 @@ public class PieRenderer extends OverlayRenderer
private class LinearAnimation extends Animation {
private float mFrom;
private float mTo;
private final float mFrom;
private final float mTo;
private float mValue;
public LinearAnimation(float from, float to) {
@@ -822,4 +823,4 @@ public class PieRenderer extends OverlayRenderer
}
}
}
}
@@ -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.
@@ -30,20 +31,20 @@ public class RenderOverlay extends FrameLayout {
interface Renderer {
public boolean handlesTouch();
public boolean onTouchEvent(MotionEvent evt);
public void setOverlay(RenderOverlay overlay);
public void layout(int left, int top, int right, int bottom);
public void draw(Canvas canvas);
boolean handlesTouch();
boolean onTouchEvent(MotionEvent evt);
void setOverlay(RenderOverlay overlay);
void layout(int left, int top, int right, int bottom);
void draw(Canvas canvas);
}
private RenderView mRenderView;
private List<Renderer> mClients;
private final RenderView mRenderView;
private final List<Renderer> mClients;
// reverse list of touch clients
private List<Renderer> mTouchClients;
private int[] mPosition = new int[2];
private final List<Renderer> mTouchClients;
private final int[] mPosition = new int[2];
public RenderOverlay(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -175,4 +176,4 @@ public class RenderOverlay extends FrameLayout {
}
}
}
}