YouTube2Text

Fluid Gestures — Transcript

by Touchlab · 6,038 words · 792 segments · language en · Watch on YouTube

Full transcript

  1. 0:04hey cool awesome so this is a talk on
  2. 0:10flu gestures I mean I don't know if you
  3. 0:12guys know what I'm talking about yet so
  4. 0:14but i'm eric and i'm a senior android
  5. 0:17engineer at tumblr we're based out of
  6. 0:19New York so well right here but it's a
  7. 0:22skill is an awesome place alright so we
  8. 0:26have animations in android here's one of
  9. 0:29the cool ones we got the material design
  10. 0:31award back in joint Con 2015 for like
  11. 0:36animations and one similar this uh and
  12. 0:40and we have gestures right sort of some
  13. 0:45of a cool why I find in google maps is a
  14. 0:50it's like tilt gesture you mean you know
  15. 0:52I mean I don't see why anyone use this
  16. 0:54right like and it's cool you can see it
  17. 0:57buildings in 3d maybe I'll give you in
  18. 0:58New York or something like that you can
  19. 1:00go and try and get a sense of where you
  20. 1:03are every walk through New York
  21. 1:05virtually maybe maybe that's the cool
  22. 1:07new VR thing that everyone's excited for
  23. 1:10but it's so it's definitely a cool
  24. 1:13feature a cool hidden feature I that you
  25. 1:16that you have in google maps so so the
  26. 1:19point of fluid gesture is sort of
  27. 1:21similar to what Oh will was talking
  28. 1:23about with rebound is you take gestures
  29. 1:26you take these motions and you combine
  30. 1:28them with animations and I call them
  31. 1:31fluid gestures um there's a much older
  32. 1:33term called direct manipulation that
  33. 1:35takes that concept and and and says if
  34. 1:37the user can move a view or some sort of
  35. 1:41thing on the screen at the same time as
  36. 1:44as their as their finger is moving then
  37. 1:46they have a direct motion of like a
  38. 1:49feedback Mike they're tucked position
  39. 1:52it's directly corresponding to their
  40. 1:54view position and a good example is this
  41. 1:56is scrolling like no one had to teach
  42. 1:58you how to skull on your phone there's
  43. 2:01no there's no you did not open up your
  44. 2:02phone and said this is how you scroll
  45. 2:04this is how you slide to unlock on that
  46. 2:06on iOS right like that that was a
  47. 2:09gesture that was like something like
  48. 2:11like oh this makes sense like the what
  49. 2:13I'm doing on the screen corresponds to
  50. 2:15what is happening and then that's the
  51. 2:18sort of you I that feel
  52. 2:18natural right and like it's close to me
  53. 2:21like a good examples like when you pick
  54. 2:23up a cup right you you don't know how
  55. 2:27heavy your cup is you just let go and
  56. 2:29you feel it out and if it seems to have
  57. 2:31you got you you you increase your grip
  58. 2:33for example so is that notion of
  59. 2:36feedback it'sit's it's as a zoo is the
  60. 2:39view changes then you can go and adjust
  61. 2:42what you're doing so what were what is
  62. 2:47the flu gesture it teaches users with
  63. 2:49animations right you didn't have to have
  64. 2:51a tutorial to to figure out what to do
  65. 2:55and a big benefit that I really like is
  66. 2:58you can a lot of these gestures at least
  67. 3:01the ones I think are good are the ones
  68. 3:02where you can cancel halfway where you
  69. 3:03can say hey I didn't actually want to go
  70. 3:05back hey I didn't actually want to open
  71. 3:07that screen and power users that it
  72. 3:09doesn't get in the way right you go and
  73. 3:10you just fling a little bit faster and
  74. 3:12it closed a little bit faster sometimes
  75. 3:15you have a tab animation or a long
  76. 3:16pressed or something like that and
  77. 3:17that's like now you're the whole you
  78. 3:19have to hold another like two seconds
  79. 3:21and then the thing that you want will
  80. 3:22actually happen so I'm well I'm just
  81. 3:25going to go through a bunch of examples
  82. 3:27another one is like view pagers so
  83. 3:30there's like a really common onboarding
  84. 3:31experience that you see a lot of
  85. 3:33designers use nowadays we can start like
  86. 3:35page between these different screens so
  87. 3:39there's a really terrible a photo of me
  88. 3:40but snapchat has this hidden viewpager I
  89. 3:44like this is something that you have to
  90. 3:46kind of discover on your own that you
  91. 3:47can go and paige through these different
  92. 3:50filters right but they have an even more
  93. 3:53advanced version you can go and hold
  94. 3:54your finger you see my finger and the
  95. 3:56bottom left there holding down one of my
  96. 3:58fingers and then i use my other finger
  97. 4:00and I comply to filters at the same time
  98. 4:04so like snapchat I think has a lot of
  99. 4:06these hidden gestures and they even have
  100. 4:09to like have a little tutorial just to
  101. 4:13for you to find them at me I don't know
  102. 4:14maybe they're too gesture heavy because
  103. 4:18they don't have any UI elements just
  104. 4:19sort of indicate that you can do it so
  105. 4:23another example here is the sort of like
  106. 4:24double view pager situation right you
  107. 4:27can go up you can go down you can go
  108. 4:29left you can all right
  109. 4:31sorry I'm gonna go back here and I go
  110. 4:34left like there's like multiple
  111. 4:37dimensions and you don't know you don't
  112. 4:38even have like your nav bar at the
  113. 4:40bottom I mean it's cool I don't know if
  114. 4:43it's like one thing that like users
  115. 4:45intuitively figure out and I guess they
  116. 4:47added that tutorial so probably not so
  117. 4:51that might be like one that goes a
  118. 4:52little too far and here's another hidden
  119. 4:54one that I really like you can go and
  120. 4:57flip between different tabs in google
  121. 5:00chrome write without actually going
  122. 5:02through that menu where you can see all
  123. 5:05your tabs and and there's something like
  124. 5:08maybe they should have taught users to
  125. 5:09do something maybe they should have
  126. 5:10added some sort of indicator that you
  127. 5:12can do this or maybe it's just a power
  128. 5:13user feature you know some of these
  129. 5:15things you would have to admit there's
  130. 5:17another way to do it unlike the snapchat
  131. 5:19example so another example is jogging so
  132. 5:26here's a really simple slider this one's
  133. 5:29a little little fancier than your normal
  134. 5:31one that comes with Android but it's
  135. 5:35kind of cool I mean it's you know what
  136. 5:37you're doing you're scrubbing through
  137. 5:38this uh this song or this mixtape but I
  138. 5:43mean it's also tremendously useful like
  139. 5:45if you wanted to reorder something in a
  140. 5:48list like I don't know how I there might
  141. 5:51be some complicated checkbox situation
  142. 5:53for rearranging items but this is
  143. 5:55supernatural right this is something
  144. 5:57that's like you go and you click on the
  145. 5:59item you drag it and then you place it
  146. 6:02where you want it to be you have this
  147. 6:03like hover State situation she sort of
  148. 6:05shadow if shadow is the right word and
  149. 6:11something here's a more complicated
  150. 6:12tumblr feature where you can go and and
  151. 6:14take a set of photos and rearrange them
  152. 6:17and I think this is something it's a
  153. 6:19little more restricted than what you can
  154. 6:21do with our instagrams are things called
  155. 6:25layout and and it's sort of natural in
  156. 6:30some sense but you also get a sense of
  157. 6:31what the rules are you can only have
  158. 6:33three photos in a row each photo must be
  159. 6:37in a row or something like that it's
  160. 6:39something that the animations help you
  161. 6:42figure out what you can and can't do
  162. 6:44right because of the
  163. 6:45the photos don't move then like maybe
  164. 6:47you can't do that cool a example is a
  165. 6:53transitions so here in this case this is
  166. 6:58one that I don't know how I discovered I
  167. 7:00discovered it accidentally and when I
  168. 7:01was like using the dropbox app you can
  169. 7:05kind of do the same sort of thing that
  170. 7:07you can do in newer iOS versions we can
  171. 7:09go and swipe to go back and it's not
  172. 7:15really obvious because you can see I'm
  173. 7:16going back I'm going back forward here
  174. 7:18and then and then what's happening there
  175. 7:21was like how did I know that I could do
  176. 7:24that there was no animation that said oh
  177. 7:25you know you can also swipe to go back
  178. 7:28but it's something is also also really
  179. 7:30useful I mean they added it to iOS
  180. 7:32because I'm on big phones it's something
  181. 7:35that you just can't reach that button
  182. 7:36but I guess they figure it is cool here
  183. 7:38even though there's a back button on the
  184. 7:40bottom left sometimes maybe power users
  185. 7:42want to go back faster I don't know and
  186. 7:46this is all the same sort of transition
  187. 7:49I don't know why they added the 3d part
  188. 7:52but maybe it made it more obvious to to
  189. 7:55users that you're you're in this like
  190. 7:58layered view where you can view the
  191. 8:03multiple tabs in Google Chrome so here's
  192. 8:08a really crazy one I don't know how long
  193. 8:10it took them to do this basically like
  194. 8:14you can you can drag on this on this a
  195. 8:18view and it will transition back to the
  196. 8:21previous screen so i went from that grid
  197. 8:23of snapchat discover partners to to this
  198. 8:30snapchat story and and you can drag and
  199. 8:34it does it's like cool animations
  200. 8:35playing the video while it's like doing
  201. 8:37this reveal transition I'm just a lot
  202. 8:39going on there but it makes sense that
  203. 8:40it means something you'd never really
  204. 8:42need to use there's nothing telling you
  205. 8:44that you can do this but if you hit the
  206. 8:46back button it does the reverse this
  207. 8:47animation so maybe it kind of makes
  208. 8:49sense and here's another one that I
  209. 8:52found in google photos I don't like
  210. 8:54that's pretty crazy you can pinch to go
  211. 8:58back to the pre
  212. 8:59the screen and and and I think I've seen
  213. 9:03this in other in some maybe maybe some
  214. 9:05iOS apps I remember the tumblr iOS app
  215. 9:08had it uh for a while and it's something
  216. 9:12it's like it's cool to do it feels good
  217. 9:14and and it makes sense i mean it's like
  218. 9:17if you weren't sure how to go back and
  219. 9:19like maybe you can just do that at it
  220. 9:21what I mean is this it make it make sure
  221. 9:23your interface feel more more realistic
  222. 9:25as it feels like you you actually have
  223. 9:26something in front of you that you can
  224. 9:29sort of like interact with in a more
  225. 9:31like you don't feel as restricted as
  226. 9:33when you're just tapping buttons and a
  227. 9:38big one that they just added to the
  228. 9:39design support library and also they
  229. 9:42added to the I think the the design
  230. 9:45material design guidelines is the bottom
  231. 9:48sheet what you see in a lot like a lot
  232. 9:50of types of apps have this like a lot of
  233. 9:51them like audio playing apps have some
  234. 9:55like this we can constantly access the
  235. 9:56the currently the phone that you're
  236. 9:58currently playing right cool and just
  237. 10:02like a little more advanced like you can
  238. 10:04go and and and drag this bottom sheet up
  239. 10:08and there's an additional parallax thing
  240. 10:10going on here but it makes sense what's
  241. 10:13going on you can see you can understand
  242. 10:14all the transitions but it's like you
  243. 10:17can also just happen that thing and I'll
  244. 10:18come up right so you just wanted to peek
  245. 10:21at the photo you want to peek at the
  246. 10:23information without actually opening up
  247. 10:25the entire screen I mean you can you can
  248. 10:27also drag and and I just found out
  249. 10:30recently that like Google keep has like
  250. 10:34the ability to just draw things in it
  251. 10:36and here's the other this like double
  252. 10:40stacked like sort of a bottom sheet
  253. 10:43thing where it pops up the the size
  254. 10:45indicator first and then if you want
  255. 10:46some more options you can go in and
  256. 10:47check out the colors that they have any
  257. 10:51I just have so many examples and here's
  258. 10:56one for a calendar you can once you open
  259. 10:57up that calendar view you can drag the
  260. 11:00where you can see my fingers is on is on
  261. 11:03Wednesday and I'm and I'm dragging that
  262. 11:06week view back up and make it and I'm
  263. 11:09making it bigger so then hiding the full
  264. 11:12month you so there's some other insane
  265. 11:17ones i'm just i'm sure there's even more
  266. 11:19than the ones i've found and this is one
  267. 11:22I just made hopefully it works okay cool
  268. 11:25yeah so in in in fourth grade once you
  269. 11:27check in you got this dialogue they have
  270. 11:29something they have a lot of animation
  271. 11:30since app you can drag it you can do
  272. 11:32this like we're dragging thing I don't
  273. 11:34know why they didn't that and then you
  274. 11:38could do it again on all the dialogues
  275. 11:40and there's like that that coin
  276. 11:41animation too but I think one that's
  277. 11:46very very useful unlike the foursquare
  278. 11:49one is the the YouTube
  279. 11:53picture-in-picture sort of video player
  280. 11:55right where you can go and watch a video
  281. 12:01while you're just browsing the rest of
  282. 12:02the of YouTube and and and you can go
  283. 12:06and make make it bigger again I didn't I
  284. 12:08don't have that in this in this video
  285. 12:10but you can you can also drag it back up
  286. 12:11and decide hey I do want to watch this
  287. 12:13video or you can just like swipe it away
  288. 12:17so it's like a lot of interactions that
  289. 12:19are possible but it's it's obvious how
  290. 12:21to how to interact with that in some
  291. 12:24sense and also you can cancel it which
  292. 12:25nice like you can say oh I actually
  293. 12:27don't want this picture picture thing I
  294. 12:30want I want to see the full video so
  295. 12:34like I was saying like what's a good
  296. 12:36gesture as it should be simple um you
  297. 12:39can you can have things that have like
  298. 12:40your car like three fingers four fingers
  299. 12:43I mean I think uh iOS and OS 10 are they
  300. 12:49known for these these like four finger
  301. 12:52gestures I mean those things don't
  302. 12:53really work on a phone they might work
  303. 12:55on an iPad but really if you're using
  304. 12:58your phone in your hand like requiring
  305. 13:00the usually I have like more than one
  306. 13:01finger out that at the same time is a
  307. 13:03little bit difficult and I think a big
  308. 13:05part of it from you is like it should be
  309. 13:06reversible it should be something where
  310. 13:08uh it's obvious like hey I actually
  311. 13:11maybe don't want to do this I'm just
  312. 13:13peeking like going going back to the
  313. 13:14previous screen like sometimes I forgot
  314. 13:16well which folder in my in oh I can go
  315. 13:19and and swipe peak check hmm yeah I
  316. 13:24think I know what folder I'm in now
  317. 13:25just go back to the screen that I was on
  318. 13:27and and then they should be consistent
  319. 13:29nishat it should be obvious like hey if
  320. 13:31I do this action it will do this thing
  321. 13:33if you go and try to overload so like
  322. 13:36operator overloading your you're just
  323. 13:41going to confuse your users there's not
  324. 13:42going to know like Oh what it does this
  325. 13:44action do and part of it is being like
  326. 13:46is related to being reversible if the
  327. 13:48action is reversible then hey they can
  328. 13:50check it out without actually like
  329. 13:52canceling what they're doing I'm sure
  330. 13:55there are a lot of examples i mislike
  331. 13:56you no swiping away your email in inbox
  332. 14:00or gmail it's probably another
  333. 14:02well-known one so I think you all want
  334. 14:05to know how to how to make these I mean
  335. 14:07a lot of these are already in the
  336. 14:08framework like scrolling you could you
  337. 14:10have the scrollview you have the
  338. 14:11recyclerview you have the list view yeah
  339. 14:13the sliders as support library has a lot
  340. 14:18of these additional material design sort
  341. 14:22of components I like the view pager I
  342. 14:25mean there's also in the framework I
  343. 14:26guess and and and bottom sheets I wish
  344. 14:30they just added like I know two weeks
  345. 14:32ago isn't like that and I think the big
  346. 14:37thing I'm trying to I'm going to focus
  347. 14:38on in this talk is is how to use rebound
  348. 14:41like as well as saying yesterday and and
  349. 14:45there's two I think there's other than
  350. 14:47using rebound just by itself there's
  351. 14:50Jagger which I'll show you in a second
  352. 14:51and backward which library that I want
  353. 14:54to talk about because I worked on it all
  354. 14:57right so Jagger so a brief aside it does
  355. 15:01it does allow sort of like that the
  356. 15:02swipe to go back animation was sort of
  357. 15:07gesture where you can go and go back to
  358. 15:09the previous activity which is pretty
  359. 15:11useful to its nice little library that
  360. 15:14lets you do is animation about trying to
  361. 15:16figure out oh do I screenshot the
  362. 15:17previous activity like how do I like
  363. 15:19magic effect but my entire activity is
  364. 15:21moving it just handles that for you very
  365. 15:25nice it's also something that like iOS
  366. 15:26and now has like I've seen before in and
  367. 15:28then and in iOS is just built in they
  368. 15:32don't go and build this this feature so
  369. 15:36we're going to get into a little more
  370. 15:39comp kid and stuff so basically like
  371. 15:43when you try to build this this these
  372. 15:45gestures what's happening is that your
  373. 15:48user is touching the screen you have a
  374. 15:51non-touch designer or maybe a gesture
  375. 15:53detector or whatever that emits like a
  376. 15:56motion event it gives you an emotion
  377. 15:58event and something happens it goes to a
  378. 16:01spring your spring animates so I'm
  379. 16:04assuming you know about rebound where
  380. 16:06you you you set the end value of a
  381. 16:09spring and it goes and in it animates
  382. 16:11and then you get a spring listen to a
  383. 16:12call back every single time the spring
  384. 16:14moves and you take that call back and
  385. 16:17you're given you're given a value for
  386. 16:19like a position in the spring and now I
  387. 16:24think most of the time what you end up
  388. 16:26doing is that you just map it to a few
  389. 16:28in a property like a property of a view
  390. 16:32because if you want to scale of you you
  391. 16:36want to translate a view like these are
  392. 16:38just view properties I mean you can do
  393. 16:42other things that are not UI related but
  394. 16:44I'm you're going to talk about fluid
  395. 16:47gestures so the other thing that's kind
  396. 16:50of complicated about rebound that I i
  397. 16:52found a little bit hard to get my head
  398. 16:57around was you your view has owns you're
  399. 17:01on touch the scenario right you have to
  400. 17:03set the untouched Estonia so no it knows
  401. 17:05about it the on Chester so it goes and
  402. 17:07and sets the n value or modifies this
  403. 17:10the spring the spring uh owns or is
  404. 17:15related to like a spring listener so it
  405. 17:17will go and notify the spring listen to
  406. 17:19every single time it animates and then
  407. 17:21the spring listener you go and and
  408. 17:24modify the view and and this is
  409. 17:26something like you have to set up this
  410. 17:28entire architecture when you when you
  411. 17:31are using rebound and I found that it
  412. 17:35seemed to me like you would have issues
  413. 17:37of like references and and maybe memory
  414. 17:41leaks because you know maybe you forget
  415. 17:43to unassign the spring of the scenario
  416. 17:49from the
  417. 17:50spring or you forgot to like basically
  418. 17:56detach these these callbacks from each
  419. 17:58other and another thing that I was
  420. 18:04talking about I said you had to do
  421. 18:06something to go from motion event to the
  422. 18:08n value of a spring like what what do
  423. 18:10you do and then you have to do the same
  424. 18:12thing in reverse you have to go and take
  425. 18:14that value from the spring and yet the
  426. 18:15map it to to a view position right like
  427. 18:20there's only so many things you're going
  428. 18:22to do here but it's not obviously what
  429. 18:25what what should I like what value
  430. 18:28should I set like a motion event you
  431. 18:30have an x and y and and and maybe that
  432. 18:32corresponds to pixels and your your
  433. 18:37spring value should that be in pixel
  434. 18:39should that be in like DP and then your
  435. 18:42view property probably also set in
  436. 18:44pixels or DP or some like that or maybe
  437. 18:47if you're doing skill like what units
  438. 18:50are scaling I don't know and they've won
  439. 18:54there's one useful utility method a map
  440. 18:57value from range range which I'll talk
  441. 19:00you talk about and basically that will
  442. 19:03help you do this sort of napping so this
  443. 19:06is like the traditional rebound example
  444. 19:10where you go you press on the image and
  445. 19:14it shrinks so I think we'll was talking
  446. 19:18about this yesterday so so what's your
  447. 19:22that being here you get an action down
  448. 19:23motion event you you go from a previous
  449. 19:27value of zero so it's like the lower
  450. 19:28lower left and you go to the upper right
  451. 19:30you go to a value of one instantaneously
  452. 19:32right and then you take that and you map
  453. 19:36that value to the spring so in this case
  454. 19:38is super simple you're mapping from 0 to
  455. 19:421 and then you're going to change your
  456. 19:44the end value of your spring from 0 to 1
  457. 19:47we don't really need an equation here we
  458. 19:50don't really need Mat value from a
  459. 19:52strange so that part is simple but
  460. 19:55remember that was there scaling you're
  461. 19:57not going from a scale of 0 just 22 a
  462. 20:00scale of of one and
  463. 20:02code i think i'm using the same exact
  464. 20:05code that he should rest a because just
  465. 20:08directly from the examples so action
  466. 20:10down you set the in value one you cancel
  467. 20:13you lift up your finger set it in value
  468. 20:15of zero so you can majan the other side
  469. 20:16of this square wave type thing this is a
  470. 20:20the the leading edge be going down from
  471. 20:231 to 0 when you lift your finger up so
  472. 20:29how do you take that swing value and and
  473. 20:32convert that to a scale well in in in
  474. 20:37his example he takes the current value
  475. 20:42applies this function 1 minus 0.5 times
  476. 20:45the current value and he sets that on
  477. 20:48the the the view and it's actually I
  478. 20:52mean simpler as like a map value from
  479. 20:55Asia Ranger going from 0 0 to 1 that
  480. 20:58range and and you're taking that range
  481. 21:02you're mapping arranged from 120 like
  482. 21:07half so you take it you shrink about
  483. 21:08half and then you're also flipping it so
  484. 21:13makes sense I didn't go and prove this
  485. 21:15I'm sure you can go and write a proof
  486. 21:17that that this math works out or you can
  487. 21:21look at the code and and and here's the
  488. 21:23the same code where you go and you use
  489. 21:26that equation to set the scale based on
  490. 21:29the current spring value right and he's
  491. 21:33doing it for scale extant scale why so
  492. 21:35you can imagine you can it have you can
  493. 21:37be changing multiple view properties at
  494. 21:39the same time so it's that same
  495. 21:43animation again when you press down and
  496. 21:45it gets smaller cool so I think I think
  497. 21:51we've all seen the facebook chat heads
  498. 21:53and think I have it here at their yeah
  499. 21:56and you can drag it around I was
  500. 21:59thinking like how do I make this
  501. 22:01animation with rebound how do I make
  502. 22:02this gesture happen with rebound because
  503. 22:05what do I use as my as my range of my
  504. 22:09spring like do I take the screen
  505. 22:11coordinates and say oh 1 is equal to
  506. 22:15the edge of the spring or do I like what
  507. 22:18happens with like why and and the more I
  508. 22:21thought about it is like this is
  509. 22:23something I really shouldn't be thinking
  510. 22:24about this is something that should be a
  511. 22:26lot simpler so actually and another
  512. 22:31thing is that i saw that google play
  513. 22:35games added this the ability to record
  514. 22:37yourself while you're playing a game the
  515. 22:39similar sort of animation but they don't
  516. 22:41have that sort of like physicality where
  517. 22:43where you have that bounciness that
  518. 22:45happens it just it just follows your
  519. 22:47finger directly and when you drop your
  520. 22:49your head I guess my head on the on the
  521. 22:53X it just like goes away it doesn't like
  522. 22:54spring into place I don't know like what
  523. 22:57range I need to be for that X activate
  524. 22:59oh there you go get the the red thing so
  525. 23:04this is similar idea that in a backboard
  526. 23:09where we try to go and and move a view
  527. 23:12so how do we do this in two dimensions
  528. 23:16well you know that you take in it you're
  529. 23:18going to take motion event get X do
  530. 23:22something to it and map it to view a
  531. 23:25translation X right so you're taking a
  532. 23:28property in emotion event and mapping it
  533. 23:31to a property on a view and the thing I
  534. 23:34realized is like you you're never going
  535. 23:36to map X to Y right what were you
  536. 23:41accomplish by doing that uh and and I
  537. 23:44think most of time you you're going to
  538. 23:46you're going to want the same thing if
  539. 23:48you're doing this this relationship
  540. 23:49between from from X in pixels to 2x and
  541. 23:53pixels you're going to want the same
  542. 23:55consistently ship in both axes and on
  543. 23:58the tablet versus a phone write
  544. 24:02something on a tablet you wouldn't want
  545. 24:04your springs to be a little more springy
  546. 24:06because it's a bigger screen it's the
  547. 24:08users doesn't feel like they're on a
  548. 24:10bigger screen they're not switching
  549. 24:12necessarily from device device and
  550. 24:13testing of your animations the same but
  551. 24:17how do we write this this function ik
  552. 24:22and then you have to do you do reverse
  553. 24:23like you you want your pixels going in
  554. 24:26and your pixels coming out and you want
  555. 24:28a direct
  556. 24:29relationship between the users motion
  557. 24:32and the views motion so this is what
  558. 24:37backward tries to solve there's a logo i
  559. 24:41spend way too much time making so
  560. 24:44basically I I saw that and there weren't
  561. 24:50any names that to those concepts of like
  562. 24:52mapping from from a touch listener to a
  563. 24:56spring and then as spring to a view so I
  564. 24:59I mean these are terrible names but
  565. 25:01going from a motion event to the spring
  566. 25:05I called an imitator so in that sense
  567. 25:08from the perspective of spring the the
  568. 25:10spring is imitating the motion of the
  569. 25:12the emotion event and the performer
  570. 25:16takes the spring value the current value
  571. 25:19of the spring and maps that to a view
  572. 25:22property right so here's a here's a
  573. 25:27simple example it takes a motion
  574. 25:31property X so in this case we've defined
  575. 25:35that relationship say like hey i know
  576. 25:37i'm not i'm going to look at the motion
  577. 25:40event x value and i know that's going to
  578. 25:43correlate to the view property
  579. 25:47translation X so when you get a touch
  580. 25:53event we will imitate that and and and
  581. 25:56perturb the spring and a performer goes
  582. 26:01and does that on the other side and well
  583. 26:05in this case the it's a different spring
  584. 26:07but you're taking a the motion at spring
  585. 26:12and mapping that to translation X right
  586. 26:15there's only so many view properties and
  587. 26:17Google's already developed this this
  588. 26:20framework where you can refer to view
  589. 26:21properties using these uh generics right
  590. 26:25that the property generics who so this
  591. 26:33is so basically backward is a sort of
  592. 26:35thin very Swiss cheesy layer on top of
  593. 26:40rebound basically you can go
  594. 26:43you can use a spring listener just like
  595. 26:46using before you can use a touch
  596. 26:47listener like you're using before but in
  597. 26:50this case I gave them names in this case
  598. 26:52I gave them some functionality and and
  599. 26:54if you want to do more complicated
  600. 26:56behavior then you you can go and and
  601. 27:01modify that or put in your own
  602. 27:02components and and this is other thing
  603. 27:05called an actor which tries to tie these
  604. 27:08two concepts together well you know
  605. 27:09about both sides of the animation then
  606. 27:11it can just hook up the components you
  607. 27:13know that you have this gesture
  608. 27:15happening and you know that you want to
  609. 27:17take the users in play and you want to
  610. 27:18map it directly to view I mean you can
  611. 27:20do more sort of like complicated
  612. 27:22interactions where a view moves another
  613. 27:24view in and be bound but we're focusing
  614. 27:30here on making things like chat heads
  615. 27:32what I you're you're moving the same
  616. 27:35view that you are touching so scaling a
  617. 27:42view on press that same animation you
  618. 27:44saw earlier the same gesture uh is how
  619. 27:49you do it in in in backboard you go you
  620. 27:52create a thing so you create a spring
  621. 27:54you have spring system and you take a a
  622. 27:59performer but I will out of a subclass
  623. 28:03of a performer that makes it'll be
  624. 28:04easier to to use and it adds that same
  625. 28:10map value to value method that we that
  626. 28:16we you had to call manually before and
  627. 28:17here we're specifying hey we're going to
  628. 28:19map 0212 to that same 0 0 to 12 half and
  629. 28:24we're going to do it in scale X and
  630. 28:26scale y and then we're going to have a
  631. 28:28toggle imitator so you can go in
  632. 28:31subclass and add that behavior and we
  633. 28:33use that behavior for your spring
  634. 28:36listeners and I toggle imitator just
  635. 28:40says on down I'm going to go to one and
  636. 28:43when you lift up your finger you're
  637. 28:45going to go to you're going to mutate
  638. 28:47the the spring to to be a value of zero
  639. 28:52so the same sort of interaction so this
  640. 28:55is the same thing in in backward so the
  641. 28:59rebound animation in backwards so a
  642. 29:03little bit a digression how did you do
  643. 29:07that X motion in in backboard what part
  644. 29:14of it was you there's only so many
  645. 29:17interactions are possible right you have
  646. 29:19motion events which have like
  647. 29:21translation and you have duration I'm
  648. 29:23you can do things with scale gesture
  649. 29:26maybe that'd be nice to add in the
  650. 29:27future and you have animations which are
  651. 29:30translations they all rotation and maybe
  652. 29:32like frame animations and I mean there's
  653. 29:34other things you can do to views but
  654. 29:36then that sounds very custom to me right
  655. 29:41so yeah so emotion property x like I was
  656. 29:46saying it Maps the get x2 translation X
  657. 29:520 and actors hook hook up those
  658. 29:57interactions they hook up those
  659. 29:59callbacks together and if you don't
  660. 30:01specify an imitator you don't specify a
  661. 30:03performer if you can specify have enough
  662. 30:05information for it to just sort of guess
  663. 30:06at what you're trying to do and if you
  664. 30:10want to customize that behavior you can
  665. 30:11go and specify your own components so
  666. 30:16that same that the tread animation is a
  667. 30:20lot easier in blackboard and I think
  668. 30:23both of the time you're going to do the
  669. 30:24same thing you can you can add so you do
  670. 30:28you call add translate motion emotion
  671. 30:31part of your ex and says oh okay you
  672. 30:34want it move motion in the X direction
  673. 30:36and you gave me a view you gave me a
  674. 30:39spring system so i can create a spring
  675. 30:40and you also know that Oh motion puppy X
  676. 30:46also says translation X is is the
  677. 30:48desired view property to animate so I'm
  678. 30:52going to connect the motion in the X
  679. 30:57direction with the view motion in the X
  680. 31:00direction and two dimensions you're
  681. 31:01going to create another spring so that's
  682. 31:03why you have to pass the spring system
  683. 31:04in for like in
  684. 31:06pendant motion in two directions right
  685. 31:09so you have X on your blog and maybe in
  686. 31:11one day one with VR we could go and do
  687. 31:13it in three dimensions so it's that same
  688. 31:17motion animation movement animation so
  689. 31:21you want to add custom behavior you can
  690. 31:25go in and subclass the motion imitator
  691. 31:27and say in this case on release if the
  692. 31:31current value in the X Direction is more
  693. 31:34than the width of the root view snap to
  694. 31:39the right to the right side and if it's
  695. 31:42more than an injection it's the less
  696. 31:44than that value that the middle value in
  697. 31:47X direction then stop to the left and
  698. 31:51you're going to be moving the
  699. 31:54translation X property on the view and
  700. 31:57it will make a lot more sense when you
  701. 31:58see as I mission you're on the left side
  702. 32:00snap to the left if you're on the right
  703. 32:02sides snap to the right this is
  704. 32:05something we consider doing in tumbler
  705. 32:07with the floating action button maybe if
  706. 32:09you're a left-handed user you'd want to
  707. 32:10go and let the user move the floating
  708. 32:15action button to the left side because
  709. 32:16they're there they're left handed so I
  710. 32:21going back to chat heads they have it
  711. 32:24also has like spring chain going on
  712. 32:27there's like multiple heads and I know
  713. 32:30this scares any of you you might be
  714. 32:32reminded of like control systems with
  715. 32:34some like crazy like mechanics class or
  716. 32:37something where you have these Springs
  717. 32:38coupled together and you're like a lot
  718. 32:40of crazy differential equations going on
  719. 32:42but luckily we do not have to worry
  720. 32:44about that the the solution is
  721. 32:48integrated for us by rebound so what
  722. 32:55will is showing yesterday this sort of
  723. 32:56animation where you can move any of
  724. 32:59these views from side to side and the
  725. 33:00rest of them will move so i think the
  726. 33:05spring chain animation in rebound right
  727. 33:07now is like very specific to to moving
  728. 33:09in one direction i'm not sure actually
  729. 33:13actually haven't tried making you work
  730. 33:14in two directions but it might be
  731. 33:16possible
  732. 33:18so the solution in backboard is that the
  733. 33:23the imitator concepts were more
  734. 33:25generalized and just like you can
  735. 33:26imitate the motion of like a motion
  736. 33:28event you can go and imitate the motion
  737. 33:31of another spring right so this spring
  738. 33:35imitator is also a swing listeners so
  739. 33:36you can add it to a leader spring in
  740. 33:39this case and in the followers spring
  741. 33:41can can get its value set based on the
  742. 33:44value of the leader spring so in this
  743. 33:48case like when the leader spring moves
  744. 33:50the follower spring will move after with
  745. 33:53a delay so here's a nice diagram I made
  746. 33:58where you have this the touchless enter
  747. 34:01it goes the spring mutator is also swing
  748. 34:03listen air so that value of the first
  749. 34:05spring when it changes it goes and
  750. 34:07changes the value the second spring and
  751. 34:09that caused the value of the performer
  752. 34:11attached to the end to also change its
  753. 34:14value and and move the view and also you
  754. 34:17probably want to attach another spring
  755. 34:18listener to the first spring and that
  756. 34:20would change the value of the view
  757. 34:24attached to the first spring right so
  758. 34:26you can get that chat animation chat
  759. 34:28head animation ah I mean if you just
  760. 34:31have two swings in a row that you could
  761. 34:32just like add them together I think to
  762. 34:35create one spring I don't rember physics
  763. 34:36or something like that and and this is
  764. 34:40the same sort of hidden animation in
  765. 34:42tumblr I mean there's no practical
  766. 34:44purpose to this but you can drag the
  767. 34:47floating action button around and and
  768. 34:50see the compose icons underneath so sort
  769. 34:55of like a whimsical College feature or a
  770. 35:00bit of a flourish so that's a basic
  771. 35:04introduction to to backboard and and I'm
  772. 35:07fluid gestures I'm Eric and yeah that's
  773. 35:10how you can contact me ang to check out
  774. 35:12the library alright thanks
  775. 35:20are there any questions i would see with
  776. 35:31activities you should probably use
  777. 35:32something like dragger it's just
  778. 35:34something that it's is purposely built
  779. 35:37for that it's a little bit it's
  780. 35:39problematic though because you may have
  781. 35:41to you uses a translucent activity and
  782. 35:43and actually iOS this is really clever
  783. 35:46trick where if you start to swipe back
  784. 35:48its screenshots the current screen and
  785. 35:50then it starts up the previous screen in
  786. 35:53the background so that that the previous
  787. 35:56screen is the one that's actually active
  788. 35:57and the current screen is the one is
  789. 35:59just a screenshot and that saves on my
  790. 36:01memory you don't have like two screens
  791. 36:02running at the same time so it's unique
  792. 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.