Return to Video

Add the Other Team in XML

  • 0:01 - 0:02
    Okay.
    You're doing a great job.
  • 0:02 - 0:05
    And your app is looking pretty good.
  • 0:05 - 0:07
    Unfortunately, right now,
    it only really works for
  • 0:07 - 0:09
    a pretty one sided basketball game.
  • 0:10 - 0:14
    What we really want is for it to be
    able to keep score for two teams.
  • 0:14 - 0:17
    Let's start with the xml, and
    then we can worry about the Java.
  • 0:18 - 0:19
    Okay.
    So you're going to be adding another
  • 0:19 - 0:21
    column for team b.
  • 0:21 - 0:23
    And remember we're just
    focusing on the XML right now.
  • 0:24 - 0:27
    If we remember the design for
    this first side.
  • 0:27 - 0:30
    It's a stack of views all within
    a vertical linear lay out.
  • 0:30 - 0:34
    Now the side for
    team B looks pretty darn similar.
  • 0:34 - 0:37
    Try as we might though,
    you can't have two root views.
  • 0:37 - 0:40
    So you're going to need to use
    nested lay outs in this case.
  • 0:40 - 0:43
    You should be thinking of each
    of these linear lay outs,
  • 0:43 - 0:45
    kind of like a view in itself.
  • 0:46 - 0:51
    So if we think of this all as just one
    view, and this all as just one view.
  • 0:51 - 0:56
    And if each of these two views need
    to take up equal amount of space, so
  • 0:56 - 0:58
    basically half of the screen.
  • 0:58 - 1:00
    What parent view group
    would we need to use?
  • 1:01 - 1:03
    Put your answer to that here.
  • 1:03 - 1:05
    Now, once you've got this right,
  • 1:05 - 1:08
    hopefully that will give you enough
    information to start coding this out.
  • 1:08 - 1:11
    Give it a try, you can always watch
    the solution video if you get really,
  • 1:11 - 1:12
    really stuck.
  • 1:13 - 1:16
    Now, once you've coded it up,
    it should look like this.
  • 1:16 - 1:21
    So, Team A, well that side
    should still function okay.
  • 1:21 - 1:27
    Team B though, might have well,
    a bit strange behavior.
  • 1:27 - 1:30
    That's because we haven't really
    coded up the Java for that side.
  • 1:30 - 1:33
    So don't worry about it,
    just try to get it to look like this.
Title:
Add the Other Team in XML
Description:

more » « less
Video Language:
English
Team:
Udacity
Project:
UD837 - Android for Beginners
Duration:
01:34

English subtitles

Revisions Compare revisions