Return to Video

Tablet Selectors

  • 0:00 - 0:03
    As we're defining a button,
    we can have a number of images for
  • 0:03 - 0:06
    that button depending on its state.
  • 0:06 - 0:09
    Now possible states are the normal
    look for the button,
  • 0:09 - 0:13
    what it looks like when it's pressed,
    what it looks like when it has focus and
  • 0:13 - 0:16
    also what it looks like
    when it's disabled.
  • 0:17 - 0:21
    To achieve this easily in Android,
    to create these multiple states of
  • 0:21 - 0:25
    graphic for your button,
    you create what is called a selector.
  • 0:25 - 0:30
    Now selector is simply an XML file
    that you put in res/drawable.
  • 0:30 - 0:32
    You can call it whatever you like,
    but for
  • 0:32 - 0:38
    this sample I called
    my button_custom.XML.
  • 0:38 - 0:42
    Now in this file that you then
    specify the drawable that you use for
  • 0:42 - 0:44
    each state.
  • 0:44 - 0:48
    I've started the file for you here,
    how would you finish this to allow for
  • 0:48 - 0:51
    the disabled and
    normal state of the button.
  • 0:51 - 0:56
    If you look closely, you can see I have
    to draw both google_signin_pressed for
  • 0:56 - 1:01
    state_pressed, and
    google_singin_focus for state_focused.
  • 1:01 - 1:04
    So think about how you would finish
    this file for the disabled and
  • 1:04 - 1:06
    normal states of the button.
  • 1:06 - 1:07
    You'll see that in the next video.
Cím:
Tablet Selectors
Leírás:

03-04 Tablet Selectors

more » « less
Video Language:
English
Team:
Udacity
Projekt:
ud876-5 - Google Play Services - Identity
Duration:
01:09
Udacity Robot edited Angol subtitles for Tablet Selectors
Udacity Robot edited Angol subtitles for Tablet Selectors
Cogi-Admin edited Angol subtitles for Tablet Selectors

English subtitles

Felülvizsgálatok Compare revisions