droidcon NYC 2017 - Becoming a master window fitter🔧

Sdílet
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/

Komentáře • 32

  • @DarioColetto
    @DarioColetto Před měsícem

    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

  • @codinginflow
    @codinginflow Před 4 lety +27

    fitsSystemWindows must be the most confusing attribute in the Android framework

    • @codinginflow
      @codinginflow Před 4 lety

      @Eugene Lvovich! No directly but I explain it everywhere it is used in my tutorials

    • @austintaylor2607
      @austintaylor2607 Před 2 lety

      Instablaster

  • @IvanVasheka
    @IvanVasheka Před 5 lety +23

    Don't get me wrong, but I wonder if all this window-insets-feature could be more complex?

  • @DanieleSegato
    @DanieleSegato Před 5 lety +13

    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

  • @Actinesque
    @Actinesque Před 6 lety +16

    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.

    • @LiranBarsisa
      @LiranBarsisa Před 5 lety

      Which flags? Can you check on this, then:
      stackoverflow.com/q/53480773/878126
      ?

  • @martinbonnin4261
    @martinbonnin4261 Před 6 lety +2

    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 ;)

  • @n-o-i-d
    @n-o-i-d Před 2 lety

    absolutely excellent presentation

  • @amilcarandrade
    @amilcarandrade Před 5 lety

    Great talk!

  • @archiequinones6467
    @archiequinones6467 Před 6 lety +1

    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?

  • @vardhanveereshhosur9922

    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 ?

  • @gvozdiksanya
    @gvozdiksanya Před 6 lety +2

    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.

    • @ArtemDzhadzha
      @ArtemDzhadzha Před 5 lety

      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."

  • @niedarle
    @niedarle Před 11 měsíci

    this is also all deprecated now

  • @norlesh
    @norlesh Před 3 lety +1

    So now that everything inside of WindowInsets seems to be deprecated .. now WTF?

    • @Trecoolerok
      @Trecoolerok Před 3 lety

      they have added new methods to handle this. video is 3 years old.

  • @vlastos
    @vlastos Před 6 lety +6

    And why cant you just provide api to get the statusbar height if its static...

    • @vuluongtrieu2609
      @vuluongtrieu2609 Před 6 lety +3

      Typical android, make simple things too complicated

    • @DanieleSegato
      @DanieleSegato Před 5 lety +2

      The video LITERALLY just explained why they can't.

    • @DanieleSegato
      @DanieleSegato Před 5 lety +2

      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

  • @yeilmusic
    @yeilmusic Před 5 lety +1

    IOS WIN with static, UIApplication.shared.statusBarFrame.height

  • @cutiko
    @cutiko Před 4 lety

    21:27 windows insets

  • @vlastos
    @vlastos Před 6 lety

    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...

  • @LiranBarsisa
    @LiranBarsisa Před 5 lety

    26:12 The tip of using CoordinateLayout doesn't seem to work:
    stackoverflow.com/q/53480773/878126

  • @anonymous8324
    @anonymous8324 Před 4 lety +2

    что он там бормочет, тяжёлый английский акцент

  • @zekininadresi
    @zekininadresi Před 6 lety

    I'm very glad that fitSystem... thingy has been deprecated at last.

    • @DanieleSegato
      @DanieleSegato Před 5 lety +1

      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?

  • @chandruscm
    @chandruscm Před 6 lety +5

    Just provide the status bar height "?attr/statusBarSize" :/