Open panekzogen opened 5 years ago
Second issue which i found:
onMeasure
override is not correct without measuring children
For measure all components onMeasure
method should be overridden as follow
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
setMeasuredDimension(width, height);
int count = getChildCount();
for (int i = 0; i < count; i++) {
final View child = getChildAt(i);
measureChild(child, widthMeasureSpec, heightMeasureSpec);
}
}
Thank you for taking the time to post these fixes. It'll definitely help someone.
Hello.
I don't have a strong knowledge about view processing in android but maybe this helps someone because library seems unsupported. If someone want to create complex layout, in my case it was
ViewPager
inside adapter of swipe stack, note that the layout processing doing in wrong order: AtSwipeStack.addNewView()
which called ononLayout()
for children nodes performing following:But after several hours of reviewing android code and googling i found that right order is:
If someone has deep knowledge about it and know on what exactly it affects, please explain. Hope that it helps someone.