Skip to content

Commit

Permalink
Final fields
Browse files Browse the repository at this point in the history
  • Loading branch information
davemorrissey committed Dec 12, 2017
1 parent 4856a41 commit 51605f6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
@SuppressWarnings("WeakerAccess")
public class ImageViewState implements Serializable {

private float scale;
private final float scale;

private float centerX;
private final float centerX;

private float centerY;
private final float centerY;

private int orientation;
private final int orientation;

public ImageViewState(float scale, PointF center, int orientation) {
this.scale = scale;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public class SubsamplingScaleImageView extends View {
private int minimumScaleType = SCALE_TYPE_CENTER_INSIDE;

// overrides for the dimensions of the generated tiles
public static int TILE_SIZE_AUTO = Integer.MAX_VALUE;
public static final int TILE_SIZE_AUTO = Integer.MAX_VALUE;
private int maxTileWidth = TILE_SIZE_AUTO;
private int maxTileHeight = TILE_SIZE_AUTO;

Expand Down Expand Up @@ -260,7 +260,7 @@ public class SubsamplingScaleImageView extends View {
private OnLongClickListener onLongClickListener;

// Long click handler
private Handler handler;
private final Handler handler;
private static final int MESSAGE_LONG_CLICK = 1;

// Paint objects created once and reused for efficiency
Expand All @@ -273,11 +273,11 @@ public class SubsamplingScaleImageView extends View {
private ScaleAndTranslate satTemp;
private Matrix matrix;
private RectF sRect;
private float[] srcArray = new float[8];
private float[] dstArray = new float[8];
private final float[] srcArray = new float[8];
private final float[] dstArray = new float[8];

//The logical density of the display
private float density;
private final float density;

// A global preference for bitmap format, available to decoder classes that respect it
private static Bitmap.Config preferredBitmapConfig;
Expand Down Expand Up @@ -1913,7 +1913,7 @@ private ScaleAndTranslate(float scale, PointF vTranslate) {
this.vTranslate = vTranslate;
}
private float scale;
private PointF vTranslate;
private final PointF vTranslate;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
@SuppressWarnings("WeakerAccess")
public class CompatDecoderFactory<T> implements DecoderFactory<T> {

private Class<? extends T> clazz;
private Bitmap.Config bitmapConfig;
private final Class<? extends T> clazz;
private final Bitmap.Config bitmapConfig;

/**
* Construct a factory for the given class. This must have a default constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class SkiaPooledImageRegionDecoder implements ImageRegionDecoder {
private Uri uri;

private long fileLength = Long.MAX_VALUE;
private Point imageDimensions = new Point(0, 0);
private final Point imageDimensions = new Point(0, 0);
private final AtomicBoolean lazyInited = new AtomicBoolean(false);

@Keep
Expand Down Expand Up @@ -339,7 +339,7 @@ protected boolean allowAdditionalDecoder(int numberOfDecoders, long fileLength)
*/
private static class DecoderPool {
private final Semaphore available = new Semaphore(0, true);
private Map<BitmapRegionDecoder, Boolean> decoders = new ConcurrentHashMap<>();
private final Map<BitmapRegionDecoder, Boolean> decoders = new ConcurrentHashMap<>();

/**
* Returns false if there is at least one decoder in the pool.
Expand Down

0 comments on commit 51605f6

Please sign in to comment.