CoordinatorLayout scrolling not working properly after setting clearing light status bar

39
January 11, 2019, at 7:40 PM

I call toggleLightStatusBar() when I View.VISIBLE PaymentView. PaymentView is just a sibling view of my CoordinatorLayout that is initially in View.GONE. When I call clearLightStatusBar() and View.GONE PaymentView and go back to the menu screen, scrolling breaks as you can see in the gif.

Here is code for setting light status bar:

fun View.toggleLightStatusBar() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        val view = getActivity().window.decorView
        var flags = view.systemUiVisibility
        flags = flags or View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
        view.systemUiVisibility = flags
    }
}
fun View.clearLightStatusBar() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        val view = getActivity().window.decorView
        var flags = view.systemUiVisibility
        flags = flags xor View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
        view.systemUiVisibility = flags
    }
}
READ ALSO
Haven't perfect understanding with Firebase-Database and Firebase-authentication

Haven't perfect understanding with Firebase-Database and Firebase-authentication

In hear I'm supposed to register users from my web appBut after one user registration, the second user always removes current user details and come under the previous uid

52
Android APK not installing in device

Android APK not installing in device

I have created Same project as two WorkSpace in my systemex: AppSampleHindi and AppSampleEnglish,

34
Android: Testing an ExecutorService on the main thread

Android: Testing an ExecutorService on the main thread

I'm having a ViewModel with a code that is running inside the execute block (inside a Runnable)It all works fine, except that I can't successfully make the code run in the main thread when unit testing it (even debugging it, I can see the code inside...

14