I have an activity that hosts a fragment, and several others.
This activity already has fitsSystemWindows=false
so that it will extend it's boundaries towards the very bottom of the screen, I am hiding the Navigation Bar btw.
The problem is, it has a fragment that has a RichEditor view inside it which means users should be able to put multiple lines of text inside that fragment. SO I made that fragment fitsSystemWindows=true
so that when users start clicking on the RichEditor and types, the adjustResize
flag, which I have set in the styles, will fire up and allow the user to scroll the page.
It resizes and allows the user to scroll yes.
The only problem is, when the fragment resizes, it gets additional padding on the top and bottom and since I have a custom toolbar on the main activity, it is very awkwardly visibly being added on screen. The funny thing is, the top padding is exactly the same as the height of the device's status bar and the bottom padding is exactly the same as the height of the Navigation Bar.
I tried making the clipToPadding
attribute in the fragment's layout into true and false but it does not stop the fragment from getting the additional paddings. I also searched around but I can't get anything useful to get around this as most of the questions I encounter are about how to ALLOW the resize to happen and not anything about how to remove or stop the padding.
Is there even any way to know when the fragment has been resized or the resize has been triggered? If ever I can use that listener to remove the additional paddings as needed.
Any thoughts on this?
EDIT I already tried putting fitsystemwindows=true in the main activity, but it gets some padding on the bottom for the navigation bar. And I need the activity to fill the whole screen as the navigation bar is hidden