-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
/*
CENTER CHILD BY DEFAULT
*/
@OverRide
public LayoutParams generateLayoutParams(AttributeSet attrs) {
LayoutParams params = new LayoutParams(getContext(), attrs);
params.gravity = Gravity.CENTER;
return params;
}
@Override
protected ViewGroup.LayoutParams generateLayoutParams(@NonNull ViewGroup.LayoutParams p) {
LayoutParams params = new LayoutParams(p);
params.gravity = Gravity.CENTER;
return params;
}
@Override
public LayoutParams generateDefaultLayoutParams() {
return new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.CENTER);
}
@Override
protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
return p instanceof LayoutParams;
}
it should be dynamic ( can change the gravity according to requirement ). change it if its possible
thanks in advance
Metadata
Metadata
Assignees
Labels
No labels