If I call
setOnApplyWindowInsetsListener()then should I have
My insets listeners didn’t get called.
If there is not
fitsSystemWindows="true" applied to the root layout, then the layout won’t dispatch any insets to its children, thus
ViewCompat.setOnApplyWindowInsetListener won’t be triggered.
ViewCompat.setOnApplyWindowInsetListenerin order to apply insets to some particular view. In the example there was an
ImageView and a
Toolbar . The requirement was to apply insets (i.e. status bar padding) to the
Toolbar, but not to
Should I call manually
You only need to apply
dispatchApplyWindowInsets() in your custom
ViewGroup . If you have a “materialish” layout, then you do not need it, because those layouts would dispatch insets to their children.