Fluid Gestures — Transcript
Full transcript
- 0:04hey cool awesome so this is a talk on
- 0:10flu gestures I mean I don't know if you
- 0:12guys know what I'm talking about yet so
- 0:14but i'm eric and i'm a senior android
- 0:17engineer at tumblr we're based out of
- 0:19New York so well right here but it's a
- 0:22skill is an awesome place alright so we
- 0:26have animations in android here's one of
- 0:29the cool ones we got the material design
- 0:31award back in joint Con 2015 for like
- 0:36animations and one similar this uh and
- 0:40and we have gestures right sort of some
- 0:45of a cool why I find in google maps is a
- 0:50it's like tilt gesture you mean you know
- 0:52I mean I don't see why anyone use this
- 0:54right like and it's cool you can see it
- 0:57buildings in 3d maybe I'll give you in
- 0:58New York or something like that you can
- 1:00go and try and get a sense of where you
- 1:03are every walk through New York
- 1:05virtually maybe maybe that's the cool
- 1:07new VR thing that everyone's excited for
- 1:10but it's so it's definitely a cool
- 1:13feature a cool hidden feature I that you
- 1:16that you have in google maps so so the
- 1:19point of fluid gesture is sort of
- 1:21similar to what Oh will was talking
- 1:23about with rebound is you take gestures
- 1:26you take these motions and you combine
- 1:28them with animations and I call them
- 1:31fluid gestures um there's a much older
- 1:33term called direct manipulation that
- 1:35takes that concept and and and says if
- 1:37the user can move a view or some sort of
- 1:41thing on the screen at the same time as
- 1:44as their as their finger is moving then
- 1:46they have a direct motion of like a
- 1:49feedback Mike they're tucked position
- 1:52it's directly corresponding to their
- 1:54view position and a good example is this
- 1:56is scrolling like no one had to teach
- 1:58you how to skull on your phone there's
- 2:01no there's no you did not open up your
- 2:02phone and said this is how you scroll
- 2:04this is how you slide to unlock on that
- 2:06on iOS right like that that was a
- 2:09gesture that was like something like
- 2:11like oh this makes sense like the what
- 2:13I'm doing on the screen corresponds to
- 2:15what is happening and then that's the
- 2:18sort of you I that feel
- 2:18natural right and like it's close to me
- 2:21like a good examples like when you pick
- 2:23up a cup right you you don't know how
- 2:27heavy your cup is you just let go and
- 2:29you feel it out and if it seems to have
- 2:31you got you you you increase your grip
- 2:33for example so is that notion of
- 2:36feedback it'sit's it's as a zoo is the
- 2:39view changes then you can go and adjust
- 2:42what you're doing so what were what is
- 2:47the flu gesture it teaches users with
- 2:49animations right you didn't have to have
- 2:51a tutorial to to figure out what to do
- 2:55and a big benefit that I really like is
- 2:58you can a lot of these gestures at least
- 3:01the ones I think are good are the ones
- 3:02where you can cancel halfway where you
- 3:03can say hey I didn't actually want to go
- 3:05back hey I didn't actually want to open
- 3:07that screen and power users that it
- 3:09doesn't get in the way right you go and
- 3:10you just fling a little bit faster and
- 3:12it closed a little bit faster sometimes
- 3:15you have a tab animation or a long
- 3:16pressed or something like that and
- 3:17that's like now you're the whole you
- 3:19have to hold another like two seconds
- 3:21and then the thing that you want will
- 3:22actually happen so I'm well I'm just
- 3:25going to go through a bunch of examples
- 3:27another one is like view pagers so
- 3:30there's like a really common onboarding
- 3:31experience that you see a lot of
- 3:33designers use nowadays we can start like
- 3:35page between these different screens so
- 3:39there's a really terrible a photo of me
- 3:40but snapchat has this hidden viewpager I
- 3:44like this is something that you have to
- 3:46kind of discover on your own that you
- 3:47can go and paige through these different
- 3:50filters right but they have an even more
- 3:53advanced version you can go and hold
- 3:54your finger you see my finger and the
- 3:56bottom left there holding down one of my
- 3:58fingers and then i use my other finger
- 4:00and I comply to filters at the same time
- 4:04so like snapchat I think has a lot of
- 4:06these hidden gestures and they even have
- 4:09to like have a little tutorial just to
- 4:13for you to find them at me I don't know
- 4:14maybe they're too gesture heavy because
- 4:18they don't have any UI elements just
- 4:19sort of indicate that you can do it so
- 4:23another example here is the sort of like
- 4:24double view pager situation right you
- 4:27can go up you can go down you can go
- 4:29left you can all right
- 4:31sorry I'm gonna go back here and I go
- 4:34left like there's like multiple
- 4:37dimensions and you don't know you don't
- 4:38even have like your nav bar at the
- 4:40bottom I mean it's cool I don't know if
- 4:43it's like one thing that like users
- 4:45intuitively figure out and I guess they
- 4:47added that tutorial so probably not so
- 4:51that might be like one that goes a
- 4:52little too far and here's another hidden
- 4:54one that I really like you can go and
- 4:57flip between different tabs in google
- 5:00chrome write without actually going
- 5:02through that menu where you can see all
- 5:05your tabs and and there's something like
- 5:08maybe they should have taught users to
- 5:09do something maybe they should have
- 5:10added some sort of indicator that you
- 5:12can do this or maybe it's just a power
- 5:13user feature you know some of these
- 5:15things you would have to admit there's
- 5:17another way to do it unlike the snapchat
- 5:19example so another example is jogging so
- 5:26here's a really simple slider this one's
- 5:29a little little fancier than your normal
- 5:31one that comes with Android but it's
- 5:35kind of cool I mean it's you know what
- 5:37you're doing you're scrubbing through
- 5:38this uh this song or this mixtape but I
- 5:43mean it's also tremendously useful like
- 5:45if you wanted to reorder something in a
- 5:48list like I don't know how I there might
- 5:51be some complicated checkbox situation
- 5:53for rearranging items but this is
- 5:55supernatural right this is something
- 5:57that's like you go and you click on the
- 5:59item you drag it and then you place it
- 6:02where you want it to be you have this
- 6:03like hover State situation she sort of
- 6:05shadow if shadow is the right word and
- 6:11something here's a more complicated
- 6:12tumblr feature where you can go and and
- 6:14take a set of photos and rearrange them
- 6:17and I think this is something it's a
- 6:19little more restricted than what you can
- 6:21do with our instagrams are things called
- 6:25layout and and it's sort of natural in
- 6:30some sense but you also get a sense of
- 6:31what the rules are you can only have
- 6:33three photos in a row each photo must be
- 6:37in a row or something like that it's
- 6:39something that the animations help you
- 6:42figure out what you can and can't do
- 6:44right because of the
- 6:45the photos don't move then like maybe
- 6:47you can't do that cool a example is a
- 6:53transitions so here in this case this is
- 6:58one that I don't know how I discovered I
- 7:00discovered it accidentally and when I
- 7:01was like using the dropbox app you can
- 7:05kind of do the same sort of thing that
- 7:07you can do in newer iOS versions we can
- 7:09go and swipe to go back and it's not
- 7:15really obvious because you can see I'm
- 7:16going back I'm going back forward here
- 7:18and then and then what's happening there
- 7:21was like how did I know that I could do
- 7:24that there was no animation that said oh
- 7:25you know you can also swipe to go back
- 7:28but it's something is also also really
- 7:30useful I mean they added it to iOS
- 7:32because I'm on big phones it's something
- 7:35that you just can't reach that button
- 7:36but I guess they figure it is cool here
- 7:38even though there's a back button on the
- 7:40bottom left sometimes maybe power users
- 7:42want to go back faster I don't know and
- 7:46this is all the same sort of transition
- 7:49I don't know why they added the 3d part
- 7:52but maybe it made it more obvious to to
- 7:55users that you're you're in this like
- 7:58layered view where you can view the
- 8:03multiple tabs in Google Chrome so here's
- 8:08a really crazy one I don't know how long
- 8:10it took them to do this basically like
- 8:14you can you can drag on this on this a
- 8:18view and it will transition back to the
- 8:21previous screen so i went from that grid
- 8:23of snapchat discover partners to to this
- 8:30snapchat story and and you can drag and
- 8:34it does it's like cool animations
- 8:35playing the video while it's like doing
- 8:37this reveal transition I'm just a lot
- 8:39going on there but it makes sense that
- 8:40it means something you'd never really
- 8:42need to use there's nothing telling you
- 8:44that you can do this but if you hit the
- 8:46back button it does the reverse this
- 8:47animation so maybe it kind of makes
- 8:49sense and here's another one that I
- 8:52found in google photos I don't like
- 8:54that's pretty crazy you can pinch to go
- 8:58back to the pre
- 8:59the screen and and and I think I've seen
- 9:03this in other in some maybe maybe some
- 9:05iOS apps I remember the tumblr iOS app
- 9:08had it uh for a while and it's something
- 9:12it's like it's cool to do it feels good
- 9:14and and it makes sense i mean it's like
- 9:17if you weren't sure how to go back and
- 9:19like maybe you can just do that at it
- 9:21what I mean is this it make it make sure
- 9:23your interface feel more more realistic
- 9:25as it feels like you you actually have
- 9:26something in front of you that you can
- 9:29sort of like interact with in a more
- 9:31like you don't feel as restricted as
- 9:33when you're just tapping buttons and a
- 9:38big one that they just added to the
- 9:39design support library and also they
- 9:42added to the I think the the design
- 9:45material design guidelines is the bottom
- 9:48sheet what you see in a lot like a lot
- 9:50of types of apps have this like a lot of
- 9:51them like audio playing apps have some
- 9:55like this we can constantly access the
- 9:56the currently the phone that you're
- 9:58currently playing right cool and just
- 10:02like a little more advanced like you can
- 10:04go and and and drag this bottom sheet up
- 10:08and there's an additional parallax thing
- 10:10going on here but it makes sense what's
- 10:13going on you can see you can understand
- 10:14all the transitions but it's like you
- 10:17can also just happen that thing and I'll
- 10:18come up right so you just wanted to peek
- 10:21at the photo you want to peek at the
- 10:23information without actually opening up
- 10:25the entire screen I mean you can you can
- 10:27also drag and and I just found out
- 10:30recently that like Google keep has like
- 10:34the ability to just draw things in it
- 10:36and here's the other this like double
- 10:40stacked like sort of a bottom sheet
- 10:43thing where it pops up the the size
- 10:45indicator first and then if you want
- 10:46some more options you can go in and
- 10:47check out the colors that they have any
- 10:51I just have so many examples and here's
- 10:56one for a calendar you can once you open
- 10:57up that calendar view you can drag the
- 11:00where you can see my fingers is on is on
- 11:03Wednesday and I'm and I'm dragging that
- 11:06week view back up and make it and I'm
- 11:09making it bigger so then hiding the full
- 11:12month you so there's some other insane
- 11:17ones i'm just i'm sure there's even more
- 11:19than the ones i've found and this is one
- 11:22I just made hopefully it works okay cool
- 11:25yeah so in in in fourth grade once you
- 11:27check in you got this dialogue they have
- 11:29something they have a lot of animation
- 11:30since app you can drag it you can do
- 11:32this like we're dragging thing I don't
- 11:34know why they didn't that and then you
- 11:38could do it again on all the dialogues
- 11:40and there's like that that coin
- 11:41animation too but I think one that's
- 11:46very very useful unlike the foursquare
- 11:49one is the the YouTube
- 11:53picture-in-picture sort of video player
- 11:55right where you can go and watch a video
- 12:01while you're just browsing the rest of
- 12:02the of YouTube and and and you can go
- 12:06and make make it bigger again I didn't I
- 12:08don't have that in this in this video
- 12:10but you can you can also drag it back up
- 12:11and decide hey I do want to watch this
- 12:13video or you can just like swipe it away
- 12:17so it's like a lot of interactions that
- 12:19are possible but it's it's obvious how
- 12:21to how to interact with that in some
- 12:24sense and also you can cancel it which
- 12:25nice like you can say oh I actually
- 12:27don't want this picture picture thing I
- 12:30want I want to see the full video so
- 12:34like I was saying like what's a good
- 12:36gesture as it should be simple um you
- 12:39can you can have things that have like
- 12:40your car like three fingers four fingers
- 12:43I mean I think uh iOS and OS 10 are they
- 12:49known for these these like four finger
- 12:52gestures I mean those things don't
- 12:53really work on a phone they might work
- 12:55on an iPad but really if you're using
- 12:58your phone in your hand like requiring
- 13:00the usually I have like more than one
- 13:01finger out that at the same time is a
- 13:03little bit difficult and I think a big
- 13:05part of it from you is like it should be
- 13:06reversible it should be something where
- 13:08uh it's obvious like hey I actually
- 13:11maybe don't want to do this I'm just
- 13:13peeking like going going back to the
- 13:14previous screen like sometimes I forgot
- 13:16well which folder in my in oh I can go
- 13:19and and swipe peak check hmm yeah I
- 13:24think I know what folder I'm in now
- 13:25just go back to the screen that I was on
- 13:27and and then they should be consistent
- 13:29nishat it should be obvious like hey if
- 13:31I do this action it will do this thing
- 13:33if you go and try to overload so like
- 13:36operator overloading your you're just
- 13:41going to confuse your users there's not
- 13:42going to know like Oh what it does this
- 13:44action do and part of it is being like
- 13:46is related to being reversible if the
- 13:48action is reversible then hey they can
- 13:50check it out without actually like
- 13:52canceling what they're doing I'm sure
- 13:55there are a lot of examples i mislike
- 13:56you no swiping away your email in inbox
- 14:00or gmail it's probably another
- 14:02well-known one so I think you all want
- 14:05to know how to how to make these I mean
- 14:07a lot of these are already in the
- 14:08framework like scrolling you could you
- 14:10have the scrollview you have the
- 14:11recyclerview you have the list view yeah
- 14:13the sliders as support library has a lot
- 14:18of these additional material design sort
- 14:22of components I like the view pager I
- 14:25mean there's also in the framework I
- 14:26guess and and and bottom sheets I wish
- 14:30they just added like I know two weeks
- 14:32ago isn't like that and I think the big
- 14:37thing I'm trying to I'm going to focus
- 14:38on in this talk is is how to use rebound
- 14:41like as well as saying yesterday and and
- 14:45there's two I think there's other than
- 14:47using rebound just by itself there's
- 14:50Jagger which I'll show you in a second
- 14:51and backward which library that I want
- 14:54to talk about because I worked on it all
- 14:57right so Jagger so a brief aside it does
- 15:01it does allow sort of like that the
- 15:02swipe to go back animation was sort of
- 15:07gesture where you can go and go back to
- 15:09the previous activity which is pretty
- 15:11useful to its nice little library that
- 15:14lets you do is animation about trying to
- 15:16figure out oh do I screenshot the
- 15:17previous activity like how do I like
- 15:19magic effect but my entire activity is
- 15:21moving it just handles that for you very
- 15:25nice it's also something that like iOS
- 15:26and now has like I've seen before in and
- 15:28then and in iOS is just built in they
- 15:32don't go and build this this feature so
- 15:36we're going to get into a little more
- 15:39comp kid and stuff so basically like
- 15:43when you try to build this this these
- 15:45gestures what's happening is that your
- 15:48user is touching the screen you have a
- 15:51non-touch designer or maybe a gesture
- 15:53detector or whatever that emits like a
- 15:56motion event it gives you an emotion
- 15:58event and something happens it goes to a
- 16:01spring your spring animates so I'm
- 16:04assuming you know about rebound where
- 16:06you you you set the end value of a
- 16:09spring and it goes and in it animates
- 16:11and then you get a spring listen to a
- 16:12call back every single time the spring
- 16:14moves and you take that call back and
- 16:17you're given you're given a value for
- 16:19like a position in the spring and now I
- 16:24think most of the time what you end up
- 16:26doing is that you just map it to a few
- 16:28in a property like a property of a view
- 16:32because if you want to scale of you you
- 16:36want to translate a view like these are
- 16:38just view properties I mean you can do
- 16:42other things that are not UI related but
- 16:44I'm you're going to talk about fluid
- 16:47gestures so the other thing that's kind
- 16:50of complicated about rebound that I i
- 16:52found a little bit hard to get my head
- 16:57around was you your view has owns you're
- 17:01on touch the scenario right you have to
- 17:03set the untouched Estonia so no it knows
- 17:05about it the on Chester so it goes and
- 17:07and sets the n value or modifies this
- 17:10the spring the spring uh owns or is
- 17:15related to like a spring listener so it
- 17:17will go and notify the spring listen to
- 17:19every single time it animates and then
- 17:21the spring listener you go and and
- 17:24modify the view and and this is
- 17:26something like you have to set up this
- 17:28entire architecture when you when you
- 17:31are using rebound and I found that it
- 17:35seemed to me like you would have issues
- 17:37of like references and and maybe memory
- 17:41leaks because you know maybe you forget
- 17:43to unassign the spring of the scenario
- 17:49from the
- 17:50spring or you forgot to like basically
- 17:56detach these these callbacks from each
- 17:58other and another thing that I was
- 18:04talking about I said you had to do
- 18:06something to go from motion event to the
- 18:08n value of a spring like what what do
- 18:10you do and then you have to do the same
- 18:12thing in reverse you have to go and take
- 18:14that value from the spring and yet the
- 18:15map it to to a view position right like
- 18:20there's only so many things you're going
- 18:22to do here but it's not obviously what
- 18:25what what should I like what value
- 18:28should I set like a motion event you
- 18:30have an x and y and and and maybe that
- 18:32corresponds to pixels and your your
- 18:37spring value should that be in pixel
- 18:39should that be in like DP and then your
- 18:42view property probably also set in
- 18:44pixels or DP or some like that or maybe
- 18:47if you're doing skill like what units
- 18:50are scaling I don't know and they've won
- 18:54there's one useful utility method a map
- 18:57value from range range which I'll talk
- 19:00you talk about and basically that will
- 19:03help you do this sort of napping so this
- 19:06is like the traditional rebound example
- 19:10where you go you press on the image and
- 19:14it shrinks so I think we'll was talking
- 19:18about this yesterday so so what's your
- 19:22that being here you get an action down
- 19:23motion event you you go from a previous
- 19:27value of zero so it's like the lower
- 19:28lower left and you go to the upper right
- 19:30you go to a value of one instantaneously
- 19:32right and then you take that and you map
- 19:36that value to the spring so in this case
- 19:38is super simple you're mapping from 0 to
- 19:421 and then you're going to change your
- 19:44the end value of your spring from 0 to 1
- 19:47we don't really need an equation here we
- 19:50don't really need Mat value from a
- 19:52strange so that part is simple but
- 19:55remember that was there scaling you're
- 19:57not going from a scale of 0 just 22 a
- 20:00scale of of one and
- 20:02code i think i'm using the same exact
- 20:05code that he should rest a because just
- 20:08directly from the examples so action
- 20:10down you set the in value one you cancel
- 20:13you lift up your finger set it in value
- 20:15of zero so you can majan the other side
- 20:16of this square wave type thing this is a
- 20:20the the leading edge be going down from
- 20:231 to 0 when you lift your finger up so
- 20:29how do you take that swing value and and
- 20:32convert that to a scale well in in in
- 20:37his example he takes the current value
- 20:42applies this function 1 minus 0.5 times
- 20:45the current value and he sets that on
- 20:48the the the view and it's actually I
- 20:52mean simpler as like a map value from
- 20:55Asia Ranger going from 0 0 to 1 that
- 20:58range and and you're taking that range
- 21:02you're mapping arranged from 120 like
- 21:07half so you take it you shrink about
- 21:08half and then you're also flipping it so
- 21:13makes sense I didn't go and prove this
- 21:15I'm sure you can go and write a proof
- 21:17that that this math works out or you can
- 21:21look at the code and and and here's the
- 21:23the same code where you go and you use
- 21:26that equation to set the scale based on
- 21:29the current spring value right and he's
- 21:33doing it for scale extant scale why so
- 21:35you can imagine you can it have you can
- 21:37be changing multiple view properties at
- 21:39the same time so it's that same
- 21:43animation again when you press down and
- 21:45it gets smaller cool so I think I think
- 21:51we've all seen the facebook chat heads
- 21:53and think I have it here at their yeah
- 21:56and you can drag it around I was
- 21:59thinking like how do I make this
- 22:01animation with rebound how do I make
- 22:02this gesture happen with rebound because
- 22:05what do I use as my as my range of my
- 22:09spring like do I take the screen
- 22:11coordinates and say oh 1 is equal to
- 22:15the edge of the spring or do I like what
- 22:18happens with like why and and the more I
- 22:21thought about it is like this is
- 22:23something I really shouldn't be thinking
- 22:24about this is something that should be a
- 22:26lot simpler so actually and another
- 22:31thing is that i saw that google play
- 22:35games added this the ability to record
- 22:37yourself while you're playing a game the
- 22:39similar sort of animation but they don't
- 22:41have that sort of like physicality where
- 22:43where you have that bounciness that
- 22:45happens it just it just follows your
- 22:47finger directly and when you drop your
- 22:49your head I guess my head on the on the
- 22:53X it just like goes away it doesn't like
- 22:54spring into place I don't know like what
- 22:57range I need to be for that X activate
- 22:59oh there you go get the the red thing so
- 23:04this is similar idea that in a backboard
- 23:09where we try to go and and move a view
- 23:12so how do we do this in two dimensions
- 23:16well you know that you take in it you're
- 23:18going to take motion event get X do
- 23:22something to it and map it to view a
- 23:25translation X right so you're taking a
- 23:28property in emotion event and mapping it
- 23:31to a property on a view and the thing I
- 23:34realized is like you you're never going
- 23:36to map X to Y right what were you
- 23:41accomplish by doing that uh and and I
- 23:44think most of time you you're going to
- 23:46you're going to want the same thing if
- 23:48you're doing this this relationship
- 23:49between from from X in pixels to 2x and
- 23:53pixels you're going to want the same
- 23:55consistently ship in both axes and on
- 23:58the tablet versus a phone write
- 24:02something on a tablet you wouldn't want
- 24:04your springs to be a little more springy
- 24:06because it's a bigger screen it's the
- 24:08users doesn't feel like they're on a
- 24:10bigger screen they're not switching
- 24:12necessarily from device device and
- 24:13testing of your animations the same but
- 24:17how do we write this this function ik
- 24:22and then you have to do you do reverse
- 24:23like you you want your pixels going in
- 24:26and your pixels coming out and you want
- 24:28a direct
- 24:29relationship between the users motion
- 24:32and the views motion so this is what
- 24:37backward tries to solve there's a logo i
- 24:41spend way too much time making so
- 24:44basically I I saw that and there weren't
- 24:50any names that to those concepts of like
- 24:52mapping from from a touch listener to a
- 24:56spring and then as spring to a view so I
- 24:59I mean these are terrible names but
- 25:01going from a motion event to the spring
- 25:05I called an imitator so in that sense
- 25:08from the perspective of spring the the
- 25:10spring is imitating the motion of the
- 25:12the emotion event and the performer
- 25:16takes the spring value the current value
- 25:19of the spring and maps that to a view
- 25:22property right so here's a here's a
- 25:27simple example it takes a motion
- 25:31property X so in this case we've defined
- 25:35that relationship say like hey i know
- 25:37i'm not i'm going to look at the motion
- 25:40event x value and i know that's going to
- 25:43correlate to the view property
- 25:47translation X so when you get a touch
- 25:53event we will imitate that and and and
- 25:56perturb the spring and a performer goes
- 26:01and does that on the other side and well
- 26:05in this case the it's a different spring
- 26:07but you're taking a the motion at spring
- 26:12and mapping that to translation X right
- 26:15there's only so many view properties and
- 26:17Google's already developed this this
- 26:20framework where you can refer to view
- 26:21properties using these uh generics right
- 26:25that the property generics who so this
- 26:33is so basically backward is a sort of
- 26:35thin very Swiss cheesy layer on top of
- 26:40rebound basically you can go
- 26:43you can use a spring listener just like
- 26:46using before you can use a touch
- 26:47listener like you're using before but in
- 26:50this case I gave them names in this case
- 26:52I gave them some functionality and and
- 26:54if you want to do more complicated
- 26:56behavior then you you can go and and
- 27:01modify that or put in your own
- 27:02components and and this is other thing
- 27:05called an actor which tries to tie these
- 27:08two concepts together well you know
- 27:09about both sides of the animation then
- 27:11it can just hook up the components you
- 27:13know that you have this gesture
- 27:15happening and you know that you want to
- 27:17take the users in play and you want to
- 27:18map it directly to view I mean you can
- 27:20do more sort of like complicated
- 27:22interactions where a view moves another
- 27:24view in and be bound but we're focusing
- 27:30here on making things like chat heads
- 27:32what I you're you're moving the same
- 27:35view that you are touching so scaling a
- 27:42view on press that same animation you
- 27:44saw earlier the same gesture uh is how
- 27:49you do it in in in backboard you go you
- 27:52create a thing so you create a spring
- 27:54you have spring system and you take a a
- 27:59performer but I will out of a subclass
- 28:03of a performer that makes it'll be
- 28:04easier to to use and it adds that same
- 28:10map value to value method that we that
- 28:16we you had to call manually before and
- 28:17here we're specifying hey we're going to
- 28:19map 0212 to that same 0 0 to 12 half and
- 28:24we're going to do it in scale X and
- 28:26scale y and then we're going to have a
- 28:28toggle imitator so you can go in
- 28:31subclass and add that behavior and we
- 28:33use that behavior for your spring
- 28:36listeners and I toggle imitator just
- 28:40says on down I'm going to go to one and
- 28:43when you lift up your finger you're
- 28:45going to go to you're going to mutate
- 28:47the the spring to to be a value of zero
- 28:52so the same sort of interaction so this
- 28:55is the same thing in in backward so the
- 28:59rebound animation in backwards so a
- 29:03little bit a digression how did you do
- 29:07that X motion in in backboard what part
- 29:14of it was you there's only so many
- 29:17interactions are possible right you have
- 29:19motion events which have like
- 29:21translation and you have duration I'm
- 29:23you can do things with scale gesture
- 29:26maybe that'd be nice to add in the
- 29:27future and you have animations which are
- 29:30translations they all rotation and maybe
- 29:32like frame animations and I mean there's
- 29:34other things you can do to views but
- 29:36then that sounds very custom to me right
- 29:41so yeah so emotion property x like I was
- 29:46saying it Maps the get x2 translation X
- 29:520 and actors hook hook up those
- 29:57interactions they hook up those
- 29:59callbacks together and if you don't
- 30:01specify an imitator you don't specify a
- 30:03performer if you can specify have enough
- 30:05information for it to just sort of guess
- 30:06at what you're trying to do and if you
- 30:10want to customize that behavior you can
- 30:11go and specify your own components so
- 30:16that same that the tread animation is a
- 30:20lot easier in blackboard and I think
- 30:23both of the time you're going to do the
- 30:24same thing you can you can add so you do
- 30:28you call add translate motion emotion
- 30:31part of your ex and says oh okay you
- 30:34want it move motion in the X direction
- 30:36and you gave me a view you gave me a
- 30:39spring system so i can create a spring
- 30:40and you also know that Oh motion puppy X
- 30:46also says translation X is is the
- 30:48desired view property to animate so I'm
- 30:52going to connect the motion in the X
- 30:57direction with the view motion in the X
- 31:00direction and two dimensions you're
- 31:01going to create another spring so that's
- 31:03why you have to pass the spring system
- 31:04in for like in
- 31:06pendant motion in two directions right
- 31:09so you have X on your blog and maybe in
- 31:11one day one with VR we could go and do
- 31:13it in three dimensions so it's that same
- 31:17motion animation movement animation so
- 31:21you want to add custom behavior you can
- 31:25go in and subclass the motion imitator
- 31:27and say in this case on release if the
- 31:31current value in the X Direction is more
- 31:34than the width of the root view snap to
- 31:39the right to the right side and if it's
- 31:42more than an injection it's the less
- 31:44than that value that the middle value in
- 31:47X direction then stop to the left and
- 31:51you're going to be moving the
- 31:54translation X property on the view and
- 31:57it will make a lot more sense when you
- 31:58see as I mission you're on the left side
- 32:00snap to the left if you're on the right
- 32:02sides snap to the right this is
- 32:05something we consider doing in tumbler
- 32:07with the floating action button maybe if
- 32:09you're a left-handed user you'd want to
- 32:10go and let the user move the floating
- 32:15action button to the left side because
- 32:16they're there they're left handed so I
- 32:21going back to chat heads they have it
- 32:24also has like spring chain going on
- 32:27there's like multiple heads and I know
- 32:30this scares any of you you might be
- 32:32reminded of like control systems with
- 32:34some like crazy like mechanics class or
- 32:37something where you have these Springs
- 32:38coupled together and you're like a lot
- 32:40of crazy differential equations going on
- 32:42but luckily we do not have to worry
- 32:44about that the the solution is
- 32:48integrated for us by rebound so what
- 32:55will is showing yesterday this sort of
- 32:56animation where you can move any of
- 32:59these views from side to side and the
- 33:00rest of them will move so i think the
- 33:05spring chain animation in rebound right
- 33:07now is like very specific to to moving
- 33:09in one direction i'm not sure actually
- 33:13actually haven't tried making you work
- 33:14in two directions but it might be
- 33:16possible
- 33:18so the solution in backboard is that the
- 33:23the imitator concepts were more
- 33:25generalized and just like you can
- 33:26imitate the motion of like a motion
- 33:28event you can go and imitate the motion
- 33:31of another spring right so this spring
- 33:35imitator is also a swing listeners so
- 33:36you can add it to a leader spring in
- 33:39this case and in the followers spring
- 33:41can can get its value set based on the
- 33:44value of the leader spring so in this
- 33:48case like when the leader spring moves
- 33:50the follower spring will move after with
- 33:53a delay so here's a nice diagram I made
- 33:58where you have this the touchless enter
- 34:01it goes the spring mutator is also swing
- 34:03listen air so that value of the first
- 34:05spring when it changes it goes and
- 34:07changes the value the second spring and
- 34:09that caused the value of the performer
- 34:11attached to the end to also change its
- 34:14value and and move the view and also you
- 34:17probably want to attach another spring
- 34:18listener to the first spring and that
- 34:20would change the value of the view
- 34:24attached to the first spring right so
- 34:26you can get that chat animation chat
- 34:28head animation ah I mean if you just
- 34:31have two swings in a row that you could
- 34:32just like add them together I think to
- 34:35create one spring I don't rember physics
- 34:36or something like that and and this is
- 34:40the same sort of hidden animation in
- 34:42tumblr I mean there's no practical
- 34:44purpose to this but you can drag the
- 34:47floating action button around and and
- 34:50see the compose icons underneath so sort
- 34:55of like a whimsical College feature or a
- 35:00bit of a flourish so that's a basic
- 35:04introduction to to backboard and and I'm
- 35:07fluid gestures I'm Eric and yeah that's
- 35:10how you can contact me ang to check out
- 35:12the library alright thanks
- 35:20are there any questions i would see with
- 35:31activities you should probably use
- 35:32something like dragger it's just
- 35:34something that it's is purposely built
- 35:37for that it's a little bit it's
- 35:39problematic though because you may have
- 35:41to you uses a translucent activity and
- 35:43and actually iOS this is really clever
- 35:46trick where if you start to swipe back
- 35:48its screenshots the current screen and
- 35:50then it starts up the previous screen in
- 35:53the background so that that the previous
- 35:56screen is the one that's actually active
- 35:57and the current screen is the one is
- 35:59just a screenshot and that saves on my
- 36:01memory you don't have like two screens
- 36:02running at the same time so it's unique
- 36:09cool all right thanks for coming
About this transcript
This page contains the full transcript of Fluid Gestures by Touchlab, generated from the public captions YouTube serves with the video. The transcript has 6,038 words across 792 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.