package Ġcom . m ro us avy . camera . utils Ċ Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ Ċ // ĠReact Ġdoes Ġnot Ġtrigger Ġon Layout Ġevents Ġfor Ġdynamically Ġadded Ġviews Ġ(` addView `). Ċ // ĠThis Ġfixes Ġthat . Ċ // Ġhttps :// github . com / facebook / react - native / issues / 1 7 9 6 8 # issuecomment - 6 3 3 3 0 8 6 1 5 Ċ fun ĠViewGroup . install Hierarchy F itter () Ġ{ ĊĠ Ġset On Hierarchy ChangeListener ( object Ġ: ĠViewGroup . On Hierarchy ChangeListener Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġon Child View Removed ( parent : ĠView ?, Ġchild : ĠView ?) Ġ= ĠUnit ĊĠĠĠ Ġoverride Ġfun Ġon Child View Added ( parent : ĠView ?, Ġchild : ĠView ?) Ġ{ ĊĠĠĠĠĠ Ġparent ?. measure ( ĊĠĠĠĠĠĠĠ ĠView . Measure Spec . make Measure Spec ( meas ured Width , ĠView . Measure Spec . EX ACT LY ), ĊĠĠĠĠĠĠĠ ĠView . Measure Spec . make Measure Spec ( meas ured Height , ĠView . Measure Spec . EX ACT LY ) ĊĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġparent ?. layout ( 0 , Ġ 0 , Ġparent . meas ured Width , Ġparent . meas ured Height ) ĊĠĠĠ Ġ} ĊĠ Ġ}) Ċ } Ċ