/sandbox-insets

Sample app that demonstrates weird (buggy?) behavior when combining MotionLayout, FragmentContainerView and Insetter.

Primary LanguageKotlin

MotionLayout with FragmentContainerView and Insetter

Sample app that demonstrates weird (buggy?) behavior when combining MotionLayout, FragmentContainerView and Insetter.

This app has 2 launcher icons: "Insets ConstraintLayout" and "Insets MotionLayout". The only difference between the 2 activities is that the former wraps the FragmentContainerView inside a ConstraintLayout, the latter inside a MotionLayout.

"Insets ConstraintLayout" works as expected

Menu with insets Light with insets Menu with insets

  1. Start "Insets ConstraintLayout"
  2. Notice that the toolbar on the menu screen has insets. It does not overlap with the status bar.
  3. Click on the "Light" button.
  4. Notice that the toolbar on the light screen has insets. It does not overlap with the status bar.
  5. Press back
  6. Notice that the toolbar on the menu screen has insets. It does not overlap with the status bar.

Conclusion: everything works as expected

"Insets MotionLayout" does not work as expected

Menu with insets Light without insets Menu without insets

  1. Start "Insets MotionLayout"
  2. Notice that the toolbar on the menu screen has insets. It does not overlap with the status bar.
  3. Click on the "Light" button.
  4. Notice that the toolbar on the light screen DOES NOT HAVE INSETS. It overlaps with the status bar.
  5. Press back
  6. Notice that the toolbar on the menu screen DOES NOT HAVE INSETS. It overlaps with the status bar.

Conclusion: only the first screen gets insets. Any other screen is missing insets.

Note: Whenever a screen did not get any insets, you can click in the EditText and it will 'fix' the insets. ¯\(ツ)