On some devices such as Samsung S8, navigation bar can be hide or show, that's a question in some condition. Samsung S8's navigation bar can be hide or show by click left bottom button
I didn't find straight way to determine even if in the Android sources code.
And I google some issues, such as A good solution to check for navigation bar , but it doesn't help.
Any help is very appreciated.
First, credit the original author: https://www.jianshu.com/p/ddfbabd614b6
For the Samsung phones (i.e, S8, S9, etc) you can detect if the navigation bar is showing via listening to a Samsung event.
Then just listen to this event, and do your thing: