Full Screen Preview is overlapping system’s bottom navigation (Android

Published

I have a bottom navigation in activity and three fragments. One fragment needs a full screen preview. For this I am using

private fun setFullScreenPreview() {
    activity?.let { context ->
        val activity = (context as MainActivity)
        val window = activity.window
        window.setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
            WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
    }
}

As I do not want full screen in other fragments I am doing this in onStop()

 private fun disableFullScreenPreview() {
    activity?.let { context ->
        val window = (context as MainActivity).window
        window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
    }
}

It works fine when system has full screen navigation Like This but if system has bottom navigation then it is overlaps system’s default navigation like This

Source: Android Questions

Published
Categorized as android, android-activity, android-fragments, bottomnavigationview

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq