mirror of
https://github.com/nextcloud/android.git
synced 2024-12-21 00:12:05 +03:00
Fix review issues
This commit is contained in:
parent
90ce5fcea1
commit
33bac40563
1 changed files with 6 additions and 6 deletions
|
@ -545,10 +545,10 @@ public class PreviewImageFragment extends FileFragment {
|
||||||
Drawable bitmapDrawable = new BitmapDrawable(getResources(), bitmap);
|
Drawable bitmapDrawable = new BitmapDrawable(getResources(), bitmap);
|
||||||
layers[1] = bitmapDrawable;
|
layers[1] = bitmapDrawable;
|
||||||
LayerDrawable layerDrawable = new LayerDrawable(layers);
|
LayerDrawable layerDrawable = new LayerDrawable(layers);
|
||||||
layerDrawable.setLayerHeight(0, (int) convertDpToPixel(bitmap.getHeight(), getActivity()));
|
layerDrawable.setLayerHeight(0, convertDpToPixel(bitmap.getHeight(), getActivity()));
|
||||||
layerDrawable.setLayerHeight(1, (int) convertDpToPixel(bitmap.getHeight(), getActivity()));
|
layerDrawable.setLayerHeight(1, convertDpToPixel(bitmap.getHeight(), getActivity()));
|
||||||
layerDrawable.setLayerWidth(0, (int) convertDpToPixel(bitmap.getWidth(), getActivity()));
|
layerDrawable.setLayerWidth(0, convertDpToPixel(bitmap.getWidth(), getActivity()));
|
||||||
layerDrawable.setLayerWidth(1, (int) convertDpToPixel(bitmap.getWidth(), getActivity()));
|
layerDrawable.setLayerWidth(1, convertDpToPixel(bitmap.getWidth(), getActivity()));
|
||||||
imageView.setImageDrawable(layerDrawable);
|
imageView.setImageDrawable(layerDrawable);
|
||||||
} else {
|
} else {
|
||||||
imageView.setImageBitmap(bitmap);
|
imageView.setImageBitmap(bitmap);
|
||||||
|
@ -636,10 +636,10 @@ public class PreviewImageFragment extends FileFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static float convertDpToPixel(float dp, Context context) {
|
private static int convertDpToPixel(float dp, Context context) {
|
||||||
Resources resources = context.getResources();
|
Resources resources = context.getResources();
|
||||||
DisplayMetrics metrics = resources.getDisplayMetrics();
|
DisplayMetrics metrics = resources.getDisplayMetrics();
|
||||||
float px = dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT);
|
int px = (int) (dp * ((float) metrics.densityDpi / DisplayMetrics.DENSITY_DEFAULT));
|
||||||
return px;
|
return px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue