Return to Video

So Much Real Estate Part 3 (quiz)

  • 0:02 - 0:06
    All right, use Cardview for
    detail view shadows on all platforms.
  • 0:06 - 0:08
    So first of all grab the starting code,
  • 0:08 - 0:13
    then add the Cardview library dependency
    under project structure dependencies.
  • 0:13 - 0:16
    For tablet portrait
    replace the weather detail
  • 0:16 - 0:21
    container frame layout with a Cardview,
    but use margins rather than padding, so
  • 0:21 - 0:23
    the Cardview edges get properly
    moved in from the layout border.
  • 0:24 - 0:30
    For tablet landscape, replace the detail
    fragment frame layout with a Cardview.
  • 0:30 - 0:33
    To do this without creating additional
    hierarchy that prevents the shadow from
  • 0:33 - 0:37
    rendering correctly, create a space view
  • 0:37 - 0:40
    in the RelativeLayout to
    align the Cardview with.
  • 0:40 - 0:41
    Again, a little bit tricky there.
  • 0:41 - 0:47
    One more note: this will create an empty
    Cardview when nothing is selected,
  • 0:47 - 0:51
    because by default,
    our detail fragment hides itself.
  • 0:51 - 0:54
    So instead of that in
    our detail fragment,
  • 0:54 - 0:56
    check to see if the parent
    view is a Cardview.
  • 0:56 - 1:00
    And instead of hiding ourselves,
    hide that parent view instead.
  • 1:00 - 1:01
    So that's what that
    this line means here,
  • 1:01 - 1:04
    when it says hide the card view
    parent in the detail fragment.
Title:
So Much Real Estate Part 3 (quiz)
Description:

more » « less
Video Language:
English
Team:
Udacity
Project:
UD855 - Android Fundamentals 2
Duration:
01:05

English subtitles

Revisions Compare revisions