fix scaling issues with images

This commit is contained in:
Philipp Crocoll 2015-10-03 06:53:45 +02:00
parent e982cde4d1
commit 243cab221c
2 changed files with 4 additions and 20 deletions

View File

@ -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

View File

@ -98,30 +98,14 @@ namespace keepass2android
return _blank;
}
bitmap = resize (bitmap);
draw = new BitmapDrawable(res, bitmap);
_customIconMap[icon] = draw;
}
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 ()
{