Outline ;. Paint ;. Rect ;. RectF ;. Shader ;. BitmapDrawable ;. ColorDrawable ;. Drawable ;. Uri ;. Build ;. AttributeSet ;. MotionEvent ;. View ;. ViewOutlineProvider ;.
ImageView ;. ColorInt ;. ColorRes ;. While CircleImageView visually crops images into a circle, the touchable area of the view was actually still square, hence you could touch outside of the circle but inside that virtual square enclosing it and get a click callback. This has now been changed so that only the circle itself is touchable. So how does it work? A view decides if it wants to handle a touch event in onTouchEvent so all I had to do was override it and implement some logic to determine if a touch event actually happened within the bounds of the circle before calling the super implementation to do the actual handling.
This is the whole thing:. Toggle navigation. CircleImageView Release 3. Release 3. It uses a BitmapShader and does not : create a copy of the original bitmap use a clipPath which is neither hardware accelerated nor anti-aliased use setXfermode to clip the bitmap which means drawing twice to the canvas As this is just a custom ImageView and not a custom Drawable or a combination of both, it can be used with all kinds of drawables, i.
Releases 3.
0コメント