Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
327 stars 374 forks source link

Bug Fix when using Constraintlayout #367

Open ikerfah opened 6 years ago

ikerfah commented 6 years ago

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); } } }