Library

Video Player is loading.
 
Current Time 0:00
Duration 5:25
Loaded: 0.00%
 

x1.00


Back

Games & Quizzes

Training Mode - Typing
Fill the gaps to the Lyric - Best method
Training Mode - Picking
Pick the correct word to fill in the gap
Fill In The Blank
Find the missing words in a sentence Requires 5 vocabulary annotations
Vocabulary Match
Match the words to the definitions Requires 10 vocabulary annotations

You may need to watch a part of the video to unlock quizzes

Don't forget to Sign In to save your points

Challenge Accomplished

PERFECT HITS +NaN
HITS +NaN
LONGEST STREAK +NaN
TOTAL +
- //

We couldn't find definitions for the word you were looking for.
Or maybe the current language is not supported

  • 00:05

    CHET HAASE: Hi, I'm Chet Haase from the
    CHET HAASE: Hi, I'm Chet Haase from the

  • 00:07

    Android team at Google.
    Android team at Google.

  • 00:08

    I work on graphics and animation stuff here.
    I work on graphics and animation stuff here.

  • 00:10

    And today I wanted to talk about some animation stuff.
    And today I wanted to talk about some animation stuff.

  • 00:13

    Surprise, surprise.
    Surprise, surprise.

  • 00:14

    Specifically I wanted to talk about View Animations, which
    Specifically I wanted to talk about View Animations, which

  • 00:16

    is the set of the animation APIs that are available prior
    is the set of the animation APIs that are available prior

  • 00:19

    to the 3.0 release.
    to the 3.0 release.

  • 00:21

    So there's some more modern APIs that we'll talk about in
    So there's some more modern APIs that we'll talk about in

  • 00:25

    future episodes, but for now we'll talk about the APIs that
    future episodes, but for now we'll talk about the APIs that

  • 00:28

    you might want to use if you're running on devices that
    you might want to use if you're running on devices that

  • 00:30

    are running platforms prior to the 3.0 release.
    are running platforms prior to the 3.0 release.

  • 00:33

    So View Animations were created specifically for
    So View Animations were created specifically for

  • 00:36

    animating individual properties of views.
    animating individual properties of views.

  • 00:38

    It's not a general purpose animation engine, but a way to
    It's not a general purpose animation engine, but a way to

  • 00:40

    achieve specific visual effects
    achieve specific visual effects

  • 00:42

    for your user interface.
    for your user interface.

  • 00:44

    So let's take a look at a demo, which I called View
    So let's take a look at a demo, which I called View

  • 00:47

    Animations.
    Animations.

  • 00:48

    We have a few buttons on the screen that are named after
    We have a few buttons on the screen that are named after

  • 00:51

    the animations that are going to be run when
    the animations that are going to be run when

  • 00:53

    you click on them.
    you click on them.

  • 00:53

    So we have an alpha animation, a translate animation that
    So we have an alpha animation, a translate animation that

  • 00:56

    moves the button around, rotate animation, a scale
    moves the button around, rotate animation, a scale

  • 00:59

    animation, and then a set animation is basically a way
    animation, and then a set animation is basically a way

  • 01:02

    to choreograph several animations on the same object.
    to choreograph several animations on the same object.

  • 01:05

    So we run all of those types of animations on that one
    So we run all of those types of animations on that one

  • 01:08

    button to give a really horrible effect, which I
    button to give a really horrible effect, which I

  • 01:12

    expect to not see in any of your applications.
    expect to not see in any of your applications.

  • 01:15

    Now all of these animations that we're running here were
    Now all of these animations that we're running here were

  • 01:17

    created and run in code, but you can also load them from
    created and run in code, but you can also load them from

  • 01:20

    animation resources, which we'll see in
    animation resources, which we'll see in

  • 01:21

    the code in a minute.
    the code in a minute.

  • 01:22

    So we can get exactly the same types of effect loading from
    So we can get exactly the same types of effect loading from

  • 01:25

    XML resources instead.
    XML resources instead.

  • 01:27

    So now let's take a look at the code.
    So now let's take a look at the code.

  • 01:30

    So we have this class called View Animations.
    So we have this class called View Animations.

  • 01:32

    It's an activity.
    It's an activity.

  • 01:33

    We have a check box that controls whether we load from
    We have a check box that controls whether we load from

  • 01:35

    resources or create these on the fly in code.
    resources or create these on the fly in code.

  • 01:37

    We have the buttons that are created here.
    We have the buttons that are created here.

  • 01:40

    We have alpha, translate, rotate, scale, set, and then
    We have alpha, translate, rotate, scale, set, and then

  • 01:42

    we listen for clicks on those buttons and run the animations
    we listen for clicks on those buttons and run the animations

  • 01:45

    appropriately.
    appropriately.

  • 01:46

    This is the interesting part about how the animations are
    This is the interesting part about how the animations are

  • 01:49

    actually created, so this is how you create some of these
    actually created, so this is how you create some of these

  • 01:51

    animations in code.
    animations in code.

  • 01:53

    So here's an alpha animation.
    So here's an alpha animation.

  • 01:54

    We say we want an alpha animation, it's going to go
    We say we want an alpha animation, it's going to go

  • 01:56

    from 1 to 0.
    from 1 to 0.

  • 01:57

    That's basically saying from fully opaque to fully
    That's basically saying from fully opaque to fully

  • 01:59

    transparent.
    transparent.

  • 02:00

    And we're going to set the duration.
    And we're going to set the duration.

  • 02:02

    Note that view animations don't have a default duration,
    Note that view animations don't have a default duration,

  • 02:04

    so you need to set a duration to have any animation at all,
    so you need to set a duration to have any animation at all,

  • 02:09

    otherwise they'll just happen atomically and immediately,
    otherwise they'll just happen atomically and immediately,

  • 02:12

    which is probably not the kind of animation effect you're
    which is probably not the kind of animation effect you're

  • 02:14

    looking for.
    looking for.

  • 02:15

    We have a translate animation that's going to be moving in
    We have a translate animation that's going to be moving in

  • 02:18

    both x and y, and you have the ability to move in absolute
    both x and y, and you have the ability to move in absolute

  • 02:21

    coordinates or relative to self or relative to parents.
    coordinates or relative to self or relative to parents.

  • 02:25

    You can basically say, I want to move for half of my
    You can basically say, I want to move for half of my

  • 02:27

    parent's width, for example.
    parent's width, for example.

  • 02:29

    Again, we set the duration and that animation
    Again, we set the duration and that animation

  • 02:31

    is on rotate animation.
    is on rotate animation.

  • 02:33

    Again we have the concept of being relative to self,
    Again we have the concept of being relative to self,

  • 02:35

    relative to parent, and we have a pivot point that we're
    relative to parent, and we have a pivot point that we're

  • 02:37

    rotating around.
    rotating around.

  • 02:39

    Here we're pivoting around the center point of the button
    Here we're pivoting around the center point of the button

  • 02:43

    itself, so it's just going to rotate around its center.
    itself, so it's just going to rotate around its center.

  • 02:45

    Set the duration and we're done.
    Set the duration and we're done.

  • 02:46

    Scale animation, we're going to scale in both x and y, from
    Scale animation, we're going to scale in both x and y, from

  • 02:50

    1 to 2, which is saying from my normal 100%
    1 to 2, which is saying from my normal 100%

  • 02:52

    size to 200% size.
    size to 200% size.

  • 02:56

    And the set animation is a way of combining all of these
    And the set animation is a way of combining all of these

  • 02:59

    animations to run all on the same button to give that
    animations to run all on the same button to give that

  • 03:02

    really horrible effect that we saw.
    really horrible effect that we saw.

  • 03:04

    We set up each of these animations, which is just a
    We set up each of these animations, which is just a

  • 03:07

    method that I created to say either use the animations that
    method that I created to say either use the animations that

  • 03:10

    are created above or create them from resources, which
    are created above or create them from resources, which

  • 03:14

    we'll see in a minute.
    we'll see in a minute.

  • 03:15

    And then we listen in on the button.
    And then we listen in on the button.

  • 03:17

    When the button has clicked, then we run the animation
    When the button has clicked, then we run the animation

  • 03:19

    appropriately.
    appropriately.

  • 03:20

    So that's the code side of this.
    So that's the code side of this.

  • 03:22

    The resource side we can take a look at, and it should be
    The resource side we can take a look at, and it should be

  • 03:26

    fairly straightforward.
    fairly straightforward.

  • 03:27

    If you understand how to create these in code, you'll
    If you understand how to create these in code, you'll

  • 03:29

    understand what the attribute names are in the XML resource.
    understand what the attribute names are in the XML resource.

  • 03:32

    So here's the alpha animation.
    So here's the alpha animation.

  • 03:34

    We say from an alpha of 1 to an alpha of 0 duration we're
    We say from an alpha of 1 to an alpha of 0 duration we're

  • 03:37

    going to make this a little bit faster in XML resources.
    going to make this a little bit faster in XML resources.

  • 03:40

    Rotate, we've got two degrees 360, so it's basically going
    Rotate, we've got two degrees 360, so it's basically going

  • 03:44

    to spin an entire cycle and it's going to pivot around
    to spin an entire cycle and it's going to pivot around

  • 03:47

    half of its own width.
    half of its own width.

  • 03:49

    So it's got a center point right it in its center for the
    So it's got a center point right it in its center for the

  • 03:52

    rotation scale animation here.
    rotation scale animation here.

  • 03:55

    From x and y of 1, so that's from its normal 100% size to
    From x and y of 1, so that's from its normal 100% size to

  • 03:59

    an x and y scale of 2, so going to
    an x and y scale of 2, so going to

  • 04:01

    200% duration of 1,000.
    200% duration of 1,000.

  • 04:05

    And here's the set.
    And here's the set.

  • 04:06

    So this is how we choreograph animations and do several
    So this is how we choreograph animations and do several

  • 04:09

    things either in parallel or in sequence.
    things either in parallel or in sequence.

  • 04:11

    We're actually doing all of these all together, so they're
    We're actually doing all of these all together, so they're

  • 04:14

    going to happen all at the same time to give to the most
    going to happen all at the same time to give to the most

  • 04:17

    egregious effect possible.
    egregious effect possible.

  • 04:19

    But you can stagger these in time as well by
    But you can stagger these in time as well by

  • 04:21

    using a start offset.
    using a start offset.

  • 04:23

    Here we have an alpha animation that's going to kick
    Here we have an alpha animation that's going to kick

  • 04:25

    off at the same time as the rotate animation, same time as
    off at the same time as the rotate animation, same time as

  • 04:28

    the scale animation, and at the same time as
    the scale animation, and at the same time as

  • 04:30

    the translate animation.
    the translate animation.

  • 04:32

    So to load these we can go back and look at the code and
    So to load these we can go back and look at the code and

  • 04:37

    instead of just running the animation that we created in
    instead of just running the animation that we created in

  • 04:39

    code above we do a animation utils load animation, and load
    code above we do a animation utils load animation, and load

  • 04:44

    it from the resource ID that we specified.
    it from the resource ID that we specified.

  • 04:46

    So the takeaway from this today is, it's fairly easy to
    So the takeaway from this today is, it's fairly easy to

  • 04:50

    create these things and to run these animations and get some
    create these things and to run these animations and get some

  • 04:52

    simple effects, basically moving things around on the
    simple effects, basically moving things around on the

  • 04:55

    screen and fading them in and out, which can be a very
    screen and fading them in and out, which can be a very

  • 04:57

    powerful tool to help your users understand what's going
    powerful tool to help your users understand what's going

  • 05:00

    on in your UI.
    on in your UI.

  • 05:01

    Fade the things in that are coming into view, fade them
    Fade the things in that are coming into view, fade them

  • 05:03

    out if they're going away, move things into position, and
    out if they're going away, move things into position, and

  • 05:07

    basically give a more immersive and intuitive
    basically give a more immersive and intuitive

  • 05:10

    experience to your users.
    experience to your users.

  • 05:12

    In future episodes we'll see alternate ways of doing this
    In future episodes we'll see alternate ways of doing this

  • 05:15

    kind of stuff as well as other, more powerful,
    kind of stuff as well as other, more powerful,

  • 05:17

    animations.
    animations.

  • 05:18

    Thanks for tuning in.
    Thanks for tuning in.

All noun
hi
/hī/

word

What you say when you meet someone

DevBytes: View Animations

44,781 views

Video Language:

  • English

Caption Language:

  • English (en)

Accent:

  • English

Speech Time:

96%
  • 5:13 / 5:25

Speech Rate:

  • 203 wpm - Fast

Category:

  • Science & Technology

Intro:

CHET HAASE: Hi, I'm Chet Haase from the. Android team at Google.. I work on graphics and animation stuff here.. And today I wanted to talk about some animation stuff.
Surprise, surprise.. Specifically I wanted to talk about View Animations, which
is the set of the animation APIs that are available prior
to the 3.0 release.. So there's some more modern APIs that we'll talk about in
future episodes, but for now we'll talk about the APIs that
you might want to use if you're running on devices that
are running platforms prior to the 3.0 release.. So View Animations were created specifically for. animating individual properties of views.. It's not a general purpose animation engine, but a way to
achieve specific visual effects. for your user interface.. So let's take a look at a demo, which I called View
Animations.. We have a few buttons on the screen that are named after

Video Vocabulary

/ˌanəˈmāSH(ə)n/

noun

liveliness.

/spəˈsifək(ə)lē/

adverb

As regards a particular thing; closely related to.

/ˈjen(ə)rəl/

adjective noun

Widespread, normal or usual. commander of army.

verb

bring to life.

/krēˈāt/

verb

bring into existence.

/əˈCHēv/

verb

successfully bring about or reach desired objective or result.

/spəˈsifik/

adjective noun

clearly defined or identified. medicine or remedy effective in treating particular disease.

/ˈplatfôrm/

noun other

raised surface for standing on. Areas from which you board a train at a station.

/ˈpərpəs/

noun verb

reason why something is done etc.. have as intention or objective.

/əˈvāləb(ə)l/

adjective

able to be used or obtained.

/ˈbāsik(ə)lē/

adverb

in most essential respects.

/transˈlāt/

verb

To change something into a different state.

/dəˈvīs/

noun other

piece of mechanical or electronic equipment. Objects, machines, or equipment for a specific use.

/ˈpräpərdē/

noun other

possessions collectively. Buildings or pieces of land owned by someone.

/ˈrəniNG/

adjective noun verb

flowing naturally or supplied to building through pipes and taps. action or movement of runner. To manage or operate a business.