recruit-lifestyle/FloatingView

How to make trash fixed icon smaller

VrtniPomidor opened this issue · 5 comments

Just as title, how can i reduce the size of trash_fixed_icon. it is too large on my screen. I am setting a bitmap to the floating icon.

Please reduce the pixel size of the image.
This is the easiest way.
Use Bitmap.createScaledBitmap

Bitmap scaledBitmap= Bitmap.createScaledBitmap(bmp, 100, 100, false);
iconView.setImageBitmap(scaledBitmap);

mFloatingViewManager = new FloatingViewManager(this, this);
mFloatingViewManager.setFixedTrashIconImage(R.drawable.ic_trash_fixed);
mFloatingViewManager.setActionTrashIconImage(R.drawable.ic_trash_action);

the action one is good, it bounds the iconView well. the fixed one is still too large, can you notice my mistake from snippet? or you need more code?

I think that the pixel size of ic_trash_action is too large.
Please try one of the following.

  • Edit ic_trash_action.png image to make it smaller
  • Use the FloatingViewManager.setActionTrashIconImage(Drawable) method (you should convert the scaled Bitmap to Drawable)

Yes the manual resize of the image resolved the issue, i thought they were sized based on the floating icon size, however is it possible you make it programatically possible (to resize trash icons)?

Thx for answer :)

The size of the "action icon" changes only when the Floating icon overlaps. The size of the "fix icon" does not change. It can not be changed programatically.
If you want to resize, please use only the "action icon". (Include X mark in image)