mirror of
https://github.com/moparisthebest/keepass2android
synced 2024-11-25 02:32:26 -05:00
fix scaling issues with images
This commit is contained in:
parent
e982cde4d1
commit
243cab221c
@ -17,8 +17,8 @@
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:padding="8dp"
|
||||
android:layout_margin="0dp"
|
||||
android:scaleType="fitXY"
|
||||
android:layout_margin="2dp"
|
||||
android:scaleType="fitCenter"
|
||||
android:layout_alignParentRight="true"
|
||||
android:src="@drawable/ic00" />
|
||||
<android.support.design.widget.TextInputLayout
|
||||
|
@ -98,8 +98,6 @@ namespace keepass2android
|
||||
return _blank;
|
||||
}
|
||||
|
||||
bitmap = resize (bitmap);
|
||||
|
||||
draw = new BitmapDrawable(res, bitmap);
|
||||
_customIconMap[icon] = draw;
|
||||
}
|
||||
@ -107,21 +105,7 @@ namespace keepass2android
|
||||
return draw;
|
||||
}
|
||||
|
||||
/** Resize the custom icon to match the built in icons
|
||||
* @param bitmap
|
||||
* @return
|
||||
*/
|
||||
private Bitmap resize (Bitmap bitmap)
|
||||
{
|
||||
int width = bitmap.Width;
|
||||
int height = bitmap.Height;
|
||||
|
||||
if (width == _blankWidth && height == _blankHeight) {
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
return Bitmap.CreateScaledBitmap (bitmap, _blankWidth, _blankHeight, true);
|
||||
}
|
||||
|
||||
public void Clear ()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user