droidcon NYC 2017 - Becoming a master window fitter🔧
Vložit
- čas přidán 29. 07. 2024
- Chris Banes, Google
Window insets have long been a source of confusion to developers, and that’s because they are indeed very confusing! The system dispatches Insets for many reasons, such as drawing behind navigation bars, full-screen immersive modes or handling round displays. This session will deep-dive on the situations where you need to consider Window Insets, and how you can handle them without resorting to copying random code from StackOverflow. You will learn the answers to questions such as: ‘How do I handle these in my custom view?’, ‘How do I draw behind the status bar?’ and ‘What was the developer of AppBarLayout thinking?!’
goo.gl/yuQF48
droidcon NYC - droidcon.nyc
*********************************************
droidcon NYC has become an event where the American and International Android development and design community come together to share what’s new and what they’ve been working on. Our goal is to serve the community and move the Android platform forward.
Organized by droidcon - www.droidcon.com/
*********************************************
droidcon is the largest global network of developer conferences which bring together the industry's foremost experts dedicated to advancing the Android platform. droidcon engages a global network of over 25,000 developers attending our events in 26 countries.
Content by touchlab - touchlab.co
*********************************************
droidcon NYC content organized by Kevin Galligan, President of touchlab
Android and iOS Mobile App Development / Doppl Open Source Code Sharing Platform / Mobile Innovation Advisory / UIUX Design. Our goal is to keep growing our company by serving the community. Stop by our next meetup: www.meetup.com/nyandroiddevel...
Big thanks to our video sponsors:
American Express - jobs.americanexpress.com/tech
mParticle - www.mparticle.com/
2024 and you saved me from 3 days of randomly putting flags and methods around while testing on 10 different devices with different android versions and oem configurations... Now at least I am understanding exactly what these stuff are doing
fitsSystemWindows must be the most confusing attribute in the Android framework
@Eugene Lvovich! No directly but I explain it everywhere it is used in my tutorials
Instablaster
Don't get me wrong, but I wonder if all this window-insets-feature could be more complex?
Not sure if Chris Banes or anyone from Google is still following this comment section... If you are: can we have similar talk explaining the internals of what exactly AppBarLayout and CollapsingLayout do and how.
Lot of the complexity in building UIs right now is around those widgets, if you are in the "supported" situation it's all easy, if you go out of it just a little you'll find yourself in some big issue.
Thanks
I spent the whole day trying to understand why that onApplyWindowInsetsListener wasn't called on my root view… only to learn from this video that I had to request those two window flags.
This inset thing is so far the most infuriating part of Android UI for me.
Thanks for the video though.
Which flags? Can you check on this, then:
stackoverflow.com/q/53480773/878126
?
The talk is very cool ! I have been struggling with insets for some time now ! The inset apis are much less cool to say the least ;)
absolutely excellent presentation
Great talk!
What happens when the view who consumed the inset was set to visibility gone? For example I am using a vertical LinearLayout (just an example) with a toolbar and another view then the toolbar consumed the inset and after some interaction the toolbar was set to gone. Wouldnt that cause problems?
onApplyWindowInsets does not get called for Appcompat Theme. I changed the AppCompat theme to Material Theme, its getting called. Any issue with AppCompat theme with windowInset ?
Looking at DrawerLayout code... fitSystemWindows actually does exactly the opposite from what's described on 15:47. Adds insets so it is NOT behind the status bar (API 24).
I'm more confused than ever.
Precisely what I'm seeing too. And the documentation says the same - "If true, adjusts the padding of this view to leave space for the system windows."
this is also all deprecated now
So now that everything inside of WindowInsets seems to be deprecated .. now WTF?
they have added new methods to handle this. video is 3 years old.
And why cant you just provide api to get the statusbar height if its static...
Typical android, make simple things too complicated
The video LITERALLY just explained why they can't.
what is upsetting is they changed the meaning of fitsSystemWindows
so, depending on which layout you use it change meaning on that layout and its children...
that looks like a trap for you to fall in..... :(
And even if I now understand better how it all works I still need to think hard before actually figuring out how to handle it
IOS WIN with static, UIApplication.shared.statusBarFrame.height
21:27 windows insets
Im confused, so I should not use the fitSystemWindows? How else do I make it not layout behind system bars from xml only? Hope they dont want me to set that listener then move layout from java...
In 26:10
Doesn't seem to work on some cases:
stackoverflow.com/q/53480773/878126
26:12 The tip of using CoordinateLayout doesn't seem to work:
stackoverflow.com/q/53480773/878126
что он там бормочет, тяжёлый английский акцент
I'm very glad that fitSystem... thingy has been deprecated at last.
As of now there's no deprecation on it: developer.android.com/reference/android/view/View.html#attr_android:fitsSystemWindows
what are you referring to?
Just provide the status bar height "?attr/statusBarSize" :/