Open Abhi347 opened 8 years ago
I guess it caused by the method of onMeasure in this PorterImageView. Make square=false,and try again.
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if(square) {
int width = getMeasuredWidth();
int height = getMeasuredHeight();
int dimen = Math.min(width, height);
setMeasuredDimension(dimen, dimen);
}
}
I'm having the same problem here.
public ShaderImageView(Context context, AttributeSet attrs) {
super(context, attrs);
setup(context, attrs, 0);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
setLayerType(LAYER_TYPE_SOFTWARE, null);
}
}
I have the same issue on Android version 16
I have tested ShapeImageView on 3 Android devices. One is Sony Xperia P running on Android 4.1, Another is Samsung Galaxy Note on 4.1.2 and the last one is LG Nexus 4 on 5.0
The ShapeDrawable doesn't work in the first 2 devices running on 4.1, while both these devices are working with RoundedImageView (Although the images appear in a square shape, not a rounded one). I want to have a Hexagonal shape, thus need ShapeDrawable. I have already tried HexagonImageView too. Note that the view is showing images in Lollipop version.
Here's my sample code -
Am I missing something here?