mirror of
https://github.com/moparisthebest/keepass2android
synced 2025-02-16 06:50:14 -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_width="40dp"
|
||||||
android:layout_height="40dp"
|
android:layout_height="40dp"
|
||||||
android:padding="8dp"
|
android:padding="8dp"
|
||||||
android:layout_margin="0dp"
|
android:layout_margin="2dp"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitCenter"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:src="@drawable/ic00" />
|
android:src="@drawable/ic00" />
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.design.widget.TextInputLayout
|
||||||
|
@ -98,30 +98,14 @@ namespace keepass2android
|
|||||||
return _blank;
|
return _blank;
|
||||||
}
|
}
|
||||||
|
|
||||||
bitmap = resize (bitmap);
|
|
||||||
|
|
||||||
draw = new BitmapDrawable(res, bitmap);
|
draw = new BitmapDrawable(res, bitmap);
|
||||||
_customIconMap[icon] = draw;
|
_customIconMap[icon] = draw;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 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 ()
|
public void Clear ()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user