Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix when using Constraintlayout #367

Open
ikerfah opened this issue Mar 13, 2018 · 0 comments
Open

Bug Fix when using Constraintlayout #367

ikerfah opened this issue Mar 13, 2018 · 0 comments

Comments

@ikerfah
Copy link

ikerfah commented Mar 13, 2018

Hello , i've just face a problem on odoo framwork when i use Constraint layout inside OForm it's will stay INVISIBLE , i made a change in the code and now it's works perfectly , so i want to share this with you guys.
the change made on OForm class ( odoo/controls/OForm )
( sorry for my bad english )

old method :

private void findAllFields(ViewGroup view) {
int child = view.getChildCount();
for (int i = 0; i < child; i++) {
View v = view.getChildAt(i);
if (v instanceof LinearLayout || v instanceof RelativeLayout) {
if (v.getVisibility() == View.VISIBLE)
findAllFields((ViewGroup) v);
}
if (v instanceof OField) {
OField field = (OField) v;
if (field.getVisibility() == View.VISIBLE)
mFormFieldControls.put(field.getFieldName(), field);
}
}
}

the new one that work :

private void findAllFields(ViewGroup view) {
int child = view.getChildCount();
for (int i = 0; i < child; i++) {
View v = view.getChildAt(i);
if (v instanceof LinearLayout || v instanceof RelativeLayout || v instanceof ConstraintLayout) {
if (v.getVisibility() == View.VISIBLE)
findAllFields((ViewGroup) v);
}
if (v instanceof OField) {
OField field = (OField) v;
if (field.getVisibility() == View.VISIBLE)
mFormFieldControls.put(field.getFieldName(), field);
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant