From 71466768f767c4cd81733ef32300916d9a75a905 Mon Sep 17 00:00:00 2001 From: eho Date: Mon, 21 May 2018 22:14:32 +0200 Subject: [PATCH] ui:preview Replaced setLayerHeight and setLayerWidth calls with setLayerSize(). Saves a few lines of code. Always a good thing. --- .../ui/preview/PreviewImageFragment.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java b/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java index 03206c10b4..8b01401910 100644 --- a/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java +++ b/src/main/java/com/owncloud/android/ui/preview/PreviewImageFragment.java @@ -704,19 +704,17 @@ public class PreviewImageFragment extends FileFragment { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (result.ocFile.getMimetype().equalsIgnoreCase(MIME_TYPE_PNG)) { - layerDrawable.setLayerHeight(0, convertDpToPixel(bitmap.getHeight(), getActivity())); - layerDrawable.setLayerHeight(1, convertDpToPixel(bitmap.getHeight(), getActivity())); - layerDrawable.setLayerWidth(0, convertDpToPixel(bitmap.getWidth(), getActivity())); - layerDrawable.setLayerWidth(1, convertDpToPixel(bitmap.getWidth(), getActivity())); + layerDrawable.setLayerSize(0, convertDpToPixel(bitmap.getWidth(), + getActivity()), convertDpToPixel(bitmap.getHeight(), getActivity())); + layerDrawable.setLayerSize(1, convertDpToPixel(bitmap.getWidth(), + getActivity()), convertDpToPixel(bitmap.getHeight(), getActivity())); } else { - layerDrawable.setLayerHeight(0, convertDpToPixel(bitmapDrawable.getIntrinsicHeight(), - getActivity())); - layerDrawable.setLayerHeight(1, convertDpToPixel(bitmapDrawable.getIntrinsicHeight(), - getActivity())); - layerDrawable.setLayerWidth(0, convertDpToPixel(bitmapDrawable.getIntrinsicWidth(), - getActivity())); - layerDrawable.setLayerWidth(1, convertDpToPixel(bitmapDrawable.getIntrinsicWidth(), - getActivity())); + layerDrawable.setLayerSize(0, + convertDpToPixel(bitmapDrawable.getIntrinsicHeight(), getActivity()), + convertDpToPixel(bitmapDrawable.getIntrinsicWidth(), getActivity())); + layerDrawable.setLayerSize(1, + convertDpToPixel(bitmapDrawable.getIntrinsicHeight(), getActivity()), + convertDpToPixel(bitmapDrawable.getIntrinsicWidth(), getActivity())); } }