mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
ui:preview Replaced setLayerHeight and setLayerWidth calls with setLayerSize().
Saves a few lines of code. Always a good thing.
This commit is contained in:
parent
36328e242e
commit
71466768f7
1 changed files with 10 additions and 12 deletions
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue