Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Androidの物理ベースアニメーション
Search
Takahiro Shimokawa
December 18, 2017
Programming
1
560
Androidの物理ベースアニメーション
SpringAnimationクラスを例に、追加されたPhysics-based Animationの導入を紹介します。
Takahiro Shimokawa
December 18, 2017
Tweet
Share
More Decks by Takahiro Shimokawa
See All by Takahiro Shimokawa
PlayStoreでの新しいユーザー訴求 -LiveOpsの活用とその成果-
androhi
0
2.3k
ConcatAdapterを深掘る
androhi
1
370
Android Studio 4.1推しポイント!
androhi
0
1.2k
一人開発でつまづいたときの処方箋
androhi
0
300
ConstraintLayout再入門
androhi
2
3.4k
Firebase Analytics 使用感
androhi
0
850
Support Library v23.2 overview
androhi
0
650
Support Library 総復習
androhi
2
2.4k
(続)エンジニアのためのSketch3入門
androhi
1
2.8k
Other Decks in Programming
See All in Programming
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
命名をリントする
chiroruxx
1
420
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
280
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
500
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
Jakarta EE meets AI
ivargrimstad
0
260
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
nekko cloudにおけるProxmox VE利用事例
irumaru
3
440
From Translations to Multi Dimension Entities
alexanderschranz
2
130
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Fireside Chat
paigeccino
34
3.1k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building Adaptive Systems
keathley
38
2.3k
The Language of Interfaces
destraynor
154
24k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Agile that works and the tools we love
rasmusluckow
328
21k
Transcript
AndroidͷཧϕʔεΞχϝʔ γϣϯ Լܟ߂ on potatotips#46 1
Introduction — Twitter/GitHub : @androhi — Android application engineer at
FiNC inc. — https://play.google.com/store/apps/details? id=jp.co.fincapp&hl=ja 2
Android animation — Property Animation — ΦϒδΣΫτͷҐஔେ͖͞ͳͲͷϓϩύςΟΛมԽͤ͞Δ — View Animation
— ΞχϝʔγϣϯΛఆٛͨ͠xmlϑΝΠϧΛ͏ — Drawable Animation — ύϥύϥອը — Physics-based Animation <- Added! — ཧ๏ଇʹԊͬͨϦΞϧͳΞχϝʔγϣϯ 3
Physics-based Animation — APIΨΠυ — https://developer.android.com/guide/topics/ graphics/physics-based-animation.html — Google I/O
2017 video (Android Animations Spring to Life) — https://www.youtube.com/watch?v=BNcODK-Ju0g 4
Physics-based Animation 1. Spring Animation — όωͷྗʹΑΔΞχϝʔγϣϯ 2. Fling Animation
— ॳظͷ͍Λ࣋ͪঃʑʹݮ͢ΔΞχϝʔγϣϯ 5
Spring Animation dependencies { compile "com.android.support:support-dynamic-animation:27.0.2" } ओʹ͜ΕΒͷΫϥεΛ༻͢Δ — SpringAnimation
class — SpringForce class 6
Create spring animation val springAnimation = SpringAnimation(imageView, SpringAnimation.TRANSLATION_X) springAnimation.spring =
SpringForce().apply { // ݮਰΛઃఆ dampingRatio = SpringForce.DAMPING_RATIO_MEDIUM_BOUNCY // ߶ੑΛઃఆ stiffness = SpringForce.STIFFNESS_MEDIUM } springAnimation.start() 7
Demo https://github.com/androhi/ PhysicsBasedAnimationSample 8
Tips: animateToFinalPosition() method ҎԼΛ྆ํॲཧͯ͘͠ΕΔ 1. ࠷ޙͷҐஔΛηοτ — call setFinalPosition() 2.
ΞχϝʔγϣϯΛ։࢝ — call start() 9
Summary — ͜Ε·ͰͷΞχϝʔγϣϯΫϥεͷΑ͏ʹࡉ͔͍ύϥϝʔ λʔΛௐͤͣʹɺϦΞϧͳΞχϝʔγϣϯ͕࣮Ͱ͖ Δɻ — ΦϒδΣΫτಉ࢜ͷ࿈ಈͳͲɺෳࡶͳΞχϝʔγϣϯ࣮ Ͱ͖Δɻ 10
Thank you for listening 11