Repository which can help to grasp android windows insets idea and Edge-To-Edge concept + we can detect keyboard without assumption that "keyboard should be more than X part of screen"
PDF Doc with explanation https://github.com/vovaksenov99/AndroidInsetUsageSample/blob/master/InsetsPDF.pdf