Gensoukyou1337
Gensoukyou1337

Reputation: 1527

Why is my navigation bar's background misaligned with the actual orientation?

Right now in the Android app I'm working on, I'm trying to figure out why, after rotating the device to landscape, my navbar's background still thinks the app is in portrait mode (and lays itself out at the bottom of my screen) when the navbar is already to the right of my screen.

Is it something to do with passing modified/wrong insets as the result of the OnApplyWindowInsetsListener put in the window.decorView?

Upvotes: 0

Views: 53

Answers (1)

Gensoukyou1337
Gensoukyou1337

Reputation: 1527

Note to self: NEVER set an OnApplyWindowInsetsListener to the window.decorView. It replaces the decorView's own insets listener, and said listener is the one laying out and animating the navigation bar and status bar backgrounds.

At maximum, use the Activity binding's root or the Fragment's view instead.

Upvotes: 0

Related Questions