In your ConstrainLayout the parent view you are using fitsSystemWindow="True" change it to false or just delete it so it's false by default...
Also in your main activity u don't need to call it choose to call it from xml or programmatically and if u don't want this white Space just delete it from both