Return to Video

https:/.../2020-02-04_ap_witchel_x.x_fc2_listview_recyclerview_demo.mp4

  • 0:01 - 0:09
    ♪ (Jazz music) ♪
  • 0:11 - 0:15
    I want to show you a demo
    for the second flipped classroom
  • 0:15 - 0:18
    where we're going to be doing
    ListViews and RecyclerViews.
  • 0:18 - 0:24
    Very exciting stuff because
    these are -- RecyclerView really is
  • 0:24 - 0:28
    one of the basic android data structures
    that we're going to be working with,
  • 0:28 - 0:31
    and you'll be working with your projects.
    Super important.
  • 0:31 - 0:39
    So for this example, I sort of
    went to the internet
  • 0:39 - 0:41
    and I found some colors.
  • 0:42 - 0:46
    This is a very extensive list of colors.
    (laughs)
  • 0:47 - 0:51
    And it starts out with
    always in the same order
  • 0:51 - 0:58
    with a lot of these dark blues
    and greens, and color names
  • 0:58 - 1:02
    like Endeavor, which I don't know
    if anyone really uses that
  • 1:02 - 1:06
    as a color name.
    Tropical Rain Forest, Blue Ribbon.
  • 1:06 - 1:09
    Science Blue? I don't know.
  • 1:09 - 1:13
    So you'll notice -- Let's see. So --
    Endeavour is above Camerone,
  • 1:13 - 1:17
    and now Endeavour is down here.
    So you'll notice that if I click
  • 1:17 - 1:20
    on any of these --
    And this is a ListView --
  • 1:20 - 1:24
    If I click on any of these,
    they seemingly sort of disappear.
  • 1:24 - 1:28
    There's a lot of really dark,
    a lot of dark colors in the beginning.
  • 1:28 - 1:38
    Anyway, if we go up to the top, we can
    see what happens to all these. Oh. Hello?
  • 1:38 - 1:41
    Oh my god, do I need to restart
    this thing?
  • 1:41 - 1:42
    Oh, there we go.
  • 1:42 - 1:45
    Oh, look. Well, we can actually recognize
    some of these.
  • 1:46 - 1:49
    If you notice, when you click,
    it goes to the top.
  • 1:49 - 1:52
    It sets the functionality
    you have to implement.
  • 1:52 - 1:55
    If you click -- Oh, this is --
    This blue is just called Blue.
  • 1:56 - 2:00
    So Blue is now on top,
    Dark Blue on top,
  • 2:00 - 2:03
    Navy Blue on top.
    This is so dark,
  • 2:03 - 2:05
    I don't know maybe it's Black,
    maybe it's something
  • 2:05 - 2:07
    that's close to Black,
    but we can't even read it
  • 2:07 - 2:11
    because in all of these cases,
    the text is Black.
  • 2:12 - 2:17
    Okay, so that's the ListView
    in a ListView functionality.
  • 2:17 - 2:19
    This flipped classroom
    has some ListView stuff.
  • 2:19 - 2:23
    It also has some RecyclerView
    stuff, and they're both
  • 2:23 - 2:27
    independent activities,
    so this is one of the last cases
  • 2:27 - 2:31
    that we're going to have before
    we hit fragments,
  • 2:31 - 2:34
    which are a little bit more
    convenient way of managing
  • 2:34 - 2:38
    different screens, but for now,
    we've got this --
  • 2:38 - 2:42
    I think it's called the Swap Icon,
    so I don't exactly know
  • 2:42 - 2:44
    who it's really intended for,
  • 2:44 - 2:48
    but I use it to swap between these
    two views.
  • 2:49 - 2:52
    And this view is much less
    monotone.
  • 2:53 - 2:56
    This is a RecyclerView,
    and part of what's going on here
  • 2:56 - 2:59
    is it's got this fancy grid layout,
    so that's sort of nice,
  • 2:59 - 3:04
    and then all of the color names
    are in these boxes,
  • 3:04 - 3:06
    which is this CardView.
  • 3:06 - 3:14
    So CardView is a built-in display class,
    which has some nice borders
  • 3:14 - 3:20
    and rounded edges, and can give you
    a little bit of a drop shadow if you want.
  • 3:20 - 3:24
    So, CardViews are pretty common
    in RecylerViews.
  • 3:25 - 3:31
    And here, instead of when you click the --
    So, something else happens
  • 3:31 - 3:37
    when you click the color name.
    Let's click Blue Violet here
  • 3:37 - 3:39
    and that became Pickled Bean.
  • 3:40 - 3:46
    And Havelock Blue. And then it
    became Portica, which is only
  • 3:46 - 3:49
    one line and you see everything
    sort of shifted around.
  • 3:49 - 3:52
    What's nice about that is
    you don't have to do any of that work.
  • 3:52 - 3:55
    That's all the RecyclerView layout.
  • 3:55 - 3:59
    The layout of the -- It's not the adapter,
    it's the layout manager.
  • 4:00 - 4:06
    So anyway, along with all of these names,
    we have these numbers,
  • 4:06 - 4:12
    which is the luminance, I believe.
    Luminance being a sort of
  • 4:13 - 4:17
    measure of how bright or dark a color is.
  • 4:17 - 4:20
    And one thing that we do is when
    the luminance is below 0.3,
  • 4:20 - 4:24
    we write a color name in white,
    and when it's above,
  • 4:24 - 4:29
    we write it in black because
    that is a high enough contrast
  • 4:29 - 4:32
    that we can now read all of
    the color names. So that's sort of useful.
  • 4:32 - 4:35
    So, I just think this is pretty.
  • 4:35 - 4:36
    (laughs)
  • 4:36 - 4:41
    And -- Oh, yeah. What's happening
    when I click is it's a random --
  • 4:41 - 4:47
    I believe it's a random swap --
    and I believe every time this boots up,
  • 4:47 - 4:49
    there's a random order.
  • 4:50 - 4:52
    Not 100% sure though.
  • 4:52 - 4:56
    But anyway, this is your
    flip classroom.
  • 4:56 - 5:01
    You'll be swapping colors
    and learning the joys
  • 5:01 - 5:07
    of the difference between Cannon Pink
    and Vin Rouge in no time.
  • 5:08 - 5:09
    Thanks.
Title:
https:/.../2020-02-04_ap_witchel_x.x_fc2_listview_recyclerview_demo.mp4
Video Language:
English
Duration:
05:28

English subtitles

Incomplete

Revisions