Skip to content

Commit

Permalink
refactor: make variable final by ide advice
Browse files Browse the repository at this point in the history
  • Loading branch information
Bambooin committed Aug 25, 2021
1 parent cf62532 commit b9c4f5e
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions app/src/main/java/com/osfans/trime/ime/keyboard/KeyboardView.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,25 @@ public interface OnKeyboardActionListener {
private StateListDrawable mKeyBackColor;
private int key_symbol_color, hilited_key_symbol_color;
private int mSymbolSize;
private Paint mPaintSymbol;
private final Paint mPaintSymbol;
private float mShadowRadius;
private int mShadowColor;
private float mBackgroundDimAmount;
private Drawable mBackground;

private TextView mPreviewText;
private PopupWindow mPreviewPopup;
private final TextView mPreviewText;
private final PopupWindow mPreviewPopup;
private int mPreviewOffset;
private int mPreviewHeight;
// Working variable
private final int[] mCoordinates = new int[2];

private PopupWindow mPopupKeyboard;
private final PopupWindow mPopupKeyboard;
private boolean mMiniKeyboardOnScreen;
private View mPopupParent;
private int mMiniKeyboardOffsetX;
private int mMiniKeyboardOffsetY;
private Map<Key, View> mMiniKeyboardCache;
private final Map<Key, View> mMiniKeyboardCache;
private Key[] mKeys;

/** Listener for {@link OnKeyboardActionListener}. */
Expand All @@ -169,8 +169,8 @@ public interface OnKeyboardActionListener {

private boolean mProximityCorrectOn;

private Paint mPaint;
private Rect mPadding;
private final Paint mPaint;
private final Rect mPadding;

private long mDownTime;
private long mLastMoveTime;
Expand All @@ -181,41 +181,41 @@ public interface OnKeyboardActionListener {
private int mDownKey = NOT_A_KEY;
private long mLastKeyTime;
private long mCurrentKeyTime;
private int[] mKeyIndices = new int[12];
private final int[] mKeyIndices = new int[12];
private GestureDetector mGestureDetector;
private int mRepeatKeyIndex = NOT_A_KEY;
private int mPopupLayout;
private final int mPopupLayout;
private boolean mAbortKey;
private Key mInvalidatedKey;
private Rect mClipRegion = new Rect(0, 0, 0, 0);
private final Rect mClipRegion = new Rect(0, 0, 0, 0);
private boolean mPossiblePoly;
private SwipeTracker mSwipeTracker = new SwipeTracker();
private int mSwipeThreshold;
private boolean mDisambiguateSwipe;
private final SwipeTracker mSwipeTracker = new SwipeTracker();
private final int mSwipeThreshold;
private final boolean mDisambiguateSwipe;

// Variables for dealing with multiple pointers
private int mOldPointerCount = 1;
private int[] mComboCodes = new int[10];
private final int[] mComboCodes = new int[10];
private int mComboCount = 0;
private boolean mComboMode = false;

private static int REPEAT_INTERVAL = 50; // ~20 keys per second
private static int REPEAT_START_DELAY = 400;
private static int LONGPRESS_TIMEOUT = ViewConfiguration.getLongPressTimeout();

private static int MAX_NEARBY_KEYS = 12;
private int[] mDistances = new int[MAX_NEARBY_KEYS];
private static final int MAX_NEARBY_KEYS = 12;
private final int[] mDistances = new int[MAX_NEARBY_KEYS];

// For multi-tap
private int mLastSentIndex;
private long mLastTapTime;
private static int MULTITAP_INTERVAL = 800; // milliseconds
private StringBuilder mPreviewLabel = new StringBuilder(1);
private final StringBuilder mPreviewLabel = new StringBuilder(1);

/** Whether the keyboard bitmap needs to be redrawn before it's blitted. * */
private boolean mDrawPending;
/** The dirty region in the keyboard bitmap */
private Rect mDirtyRect = new Rect();
private final Rect mDirtyRect = new Rect();
/** The keyboard bitmap for faster updates */
private Bitmap mBuffer;
/** Notes if the keyboard just changed, so that we could possibly reallocate the mBuffer. */
Expand Down

0 comments on commit b9c4f5e

Please sign in to comment.