ui:preview Replaced setLayerHeight and setLayerWidth calls with setLayerSize().

Saves a few lines of code. Always a good thing.
This commit is contained in:
eho 2018-05-21 22:14:32 +02:00
parent 36328e242e
commit 71466768f7

View file

@ -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()));
}
}