windowinsets

onApplyWindowInsets called with strange top inset

↘锁芯ラ 提交于 2020-01-16 10:09:30
问题 I have an Android app which has the following settings in its theme: <item name="android:navigationBarColor">@android:color/transparent</item> <item name="android:statusBarColor">@android:color/transparent</item> <item name="android:windowDrawsSystemBarBackgrounds">true</item> The top View in the hierarchy overrides onApplyWindowsInsets() . The implementation just logs the WindowInsets it was passed, then calls through to the superclass method, logs the result and returns it—nothing is

fitsSystemWindows on Fragment, Activity and DrawerLayout combination

守給你的承諾、 提交于 2019-12-18 18:24:11
问题 Problem The activity layout has a DrawerLayout with a FrameLayout as content to Fragment and a LinearLayout to be opened and closed by drawer. The fragment used on content has a FrameLayout with fitsSystemWindows flag and a Toolbar . If I insert the fragment at onCreate() all occurs as expected, the FrameLayout starts on position 0 and the Toolbar starts below the statusbar. But outside the onCreate() the same code fails, the fitsSystemWindows not works with FrameLayout . An important point,

fitsSystemWindows on Fragment, Activity and DrawerLayout combination

浪尽此生 提交于 2019-11-30 16:05:43
Problem The activity layout has a DrawerLayout with a FrameLayout as content to Fragment and a LinearLayout to be opened and closed by drawer. The fragment used on content has a FrameLayout with fitsSystemWindows flag and a Toolbar . If I insert the fragment at onCreate() all occurs as expected, the FrameLayout starts on position 0 and the Toolbar starts below the statusbar. But outside the onCreate() the same code fails, the fitsSystemWindows not works with FrameLayout . An important point, I need the Toolbar and fitsSystemWindows flag on Fragment and not on Activity . How to get the same

What are WindowInsets?

我怕爱的太早我们不能终老 提交于 2019-11-26 19:45:59
I am trying to learn about the Android OS and while I was reading the Google I/O 2014 app, I came across the WindowInsets . If anyone can explain what they are then it would be a great help. Thank you. You can learn all about WindowInsets here. WindowInsets provides you with the area on the window that is usable by the application. By itself it's of not much use. It's true purpose comes when you either override View.onApplyWindowInsets or implement View.OnApplyWindowInsetsListener . You can read about them here: View.onApplyWindowInsets and View.OnApplyWindowInsetsListener Listener for

What are WindowInsets?

此生再无相见时 提交于 2019-11-26 08:59:13
问题 I am trying to learn about the Android OS and while I was reading the Google I/O 2014 app, I came across the WindowInsets . If anyone can explain what they are then it would be a great help. Thank you. 回答1: You can learn all about WindowInsets here. WindowInsets provides you with the area on the window that is usable by the application. By itself it's of not much use. It's true purpose comes when you either override View.onApplyWindowInsets or implement View.OnApplyWindowInsetsListener . You