diff options
author | David Morrissey <davemorrissey@gmail.com> | 2017-12-03 09:38:16 +0000 |
---|---|---|
committer | David Morrissey <davemorrissey@gmail.com> | 2017-12-03 09:38:16 +0000 |
commit | da5fff79ba23c6ff4409b204ff1f65cd252fdb98 (patch) | |
tree | 6d03e661dab747342d82716e1b527ffe0e90c84a | |
parent | 3b0a9d1a01ad1f8771c27d25613a4e10a2fb9c2a (diff) | |
download | subsampling-scale-image-view-da5fff79ba23c6ff4409b204ff1f65cd252fdb98.tar.gz |
Fixed some warnings
3 files changed, 16 insertions, 3 deletions
diff --git a/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageDecoder.java b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageDecoder.java index 292502c..57b27c1 100644 --- a/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageDecoder.java +++ b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageDecoder.java @@ -7,6 +7,7 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.net.Uri; +import android.support.annotation.Keep; import android.text.TextUtils; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; @@ -28,10 +29,13 @@ public class SkiaImageDecoder implements ImageDecoder { private final Bitmap.Config bitmapConfig; + @Keep + @SuppressWarnings("unused") public SkiaImageDecoder() { this(null); } + @SuppressWarnings("WeakerAccess") public SkiaImageDecoder(Bitmap.Config bitmapConfig) { Bitmap.Config globalBitmapConfig = SubsamplingScaleImageView.getPreferredBitmapConfig(); if (bitmapConfig != null) { @@ -86,7 +90,7 @@ public class SkiaImageDecoder implements ImageDecoder { bitmap = BitmapFactory.decodeStream(inputStream, null, options); } finally { if (inputStream != null) { - try { inputStream.close(); } catch (Exception e) { } + try { inputStream.close(); } catch (Exception e) { /* Ignore */ } } } } diff --git a/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.java b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.java index 423f807..2300345 100644 --- a/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.java +++ b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaImageRegionDecoder.java @@ -8,6 +8,7 @@ import android.content.res.Resources; import android.graphics.*; import android.net.Uri; import android.os.Build; +import android.support.annotation.Keep; import android.text.TextUtils; import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView; @@ -40,10 +41,13 @@ public class SkiaImageRegionDecoder implements ImageRegionDecoder { private final Bitmap.Config bitmapConfig; + @Keep + @SuppressWarnings("unused") public SkiaImageRegionDecoder() { this(null); } + @SuppressWarnings("WeakerAccess") public SkiaImageRegionDecoder(Bitmap.Config bitmapConfig) { Bitmap.Config globalBitmapConfig = SubsamplingScaleImageView.getPreferredBitmapConfig(); if (bitmapConfig != null) { @@ -95,7 +99,7 @@ public class SkiaImageRegionDecoder implements ImageRegionDecoder { decoder = BitmapRegionDecoder.newInstance(inputStream, false); } finally { if (inputStream != null) { - try { inputStream.close(); } catch (Exception e) { } + try { inputStream.close(); } catch (Exception e) { /* Ignore */ } } } } diff --git a/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaPooledImageRegionDecoder.java b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaPooledImageRegionDecoder.java index 9edb5cd..7074c8c 100644 --- a/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaPooledImageRegionDecoder.java +++ b/library/src/main/java/com/davemorrissey/labs/subscaleview/decoder/SkiaPooledImageRegionDecoder.java @@ -14,6 +14,7 @@ import android.graphics.Point; import android.graphics.Rect; import android.net.Uri; import android.os.Build; +import android.support.annotation.Keep; import android.text.TextUtils; import android.util.Log; @@ -74,10 +75,13 @@ public class SkiaPooledImageRegionDecoder implements ImageRegionDecoder { private Point imageDimensions = new Point(0, 0); private final AtomicBoolean lazyInited = new AtomicBoolean(false); + @Keep + @SuppressWarnings("unused") public SkiaPooledImageRegionDecoder() { this(null); } + @SuppressWarnings("WeakerAccess") public SkiaPooledImageRegionDecoder(Bitmap.Config bitmapConfig) { Bitmap.Config globalBitmapConfig = SubsamplingScaleImageView.getPreferredBitmapConfig(); if (bitmapConfig != null) { @@ -214,7 +218,7 @@ public class SkiaPooledImageRegionDecoder implements ImageRegionDecoder { } } finally { if (inputStream != null) { - try { inputStream.close(); } catch (Exception e) { } + try { inputStream.close(); } catch (Exception e) { /* Ignore */ } } } } @@ -308,6 +312,7 @@ public class SkiaPooledImageRegionDecoder implements ImageRegionDecoder { * @param fileLength the size of the image file in bytes. Creating another decoder will use approximately this much native memory. * @return true if another decoder can be created. */ + @SuppressWarnings("WeakerAccess") protected boolean allowAdditionalDecoder(int numberOfDecoders, long fileLength) { if (numberOfDecoders >= 4) { debug("No additional decoders allowed, reached hard limit (4)"); |