Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Androidの物理ベースアニメーション
Takahiro Shimokawa
December 18, 2017
Programming
1
450
Androidの物理ベースアニメーション
SpringAnimationクラスを例に、追加されたPhysics-based Animationの導入を紹介します。
Takahiro Shimokawa
December 18, 2017
Tweet
Share
More Decks by Takahiro Shimokawa
See All by Takahiro Shimokawa
ConcatAdapterを深掘る
androhi
1
110
Android Studio 4.1推しポイント!
androhi
0
930
一人開発でつまづいたときの処方箋
androhi
0
160
ConstraintLayout再入門
androhi
2
2.8k
Firebase Analytics 使用感
androhi
0
770
Support Library v23.2 overview
androhi
0
500
Support Library 総復習
androhi
2
2.1k
(続)エンジニアのためのSketch3入門
androhi
1
2.5k
エンジニアのためのSketch3入門
androhi
1
1k
Other Decks in Programming
See All in Programming
Recap CDN, Edge, WebAssembly | ワインと鍋.js#1
sadnessojisan
2
1.2k
ECサイトの脆弱性診断をいい感じにやりたい/OWASPKansaiNight_LT1_220727
owaspkansai
0
300
kintone × LINE Bot で餃子検定Botを作った話
naberina
0
340
レビュー駆動学習のススメ_StaPy#83
soogie
0
320
How GitHub Supports Vim License Detection, The Five Years Journey
othree
1
390
クラウド KMS の活用 / TOKYO BLOCKCHAIN TECH MEETUP 2022
odanado
PRO
0
190
There's an API for that!
mariatta
PRO
0
110
このタイミングで知っておきたい 開発生産性の高いエンジニア組織の特徴とは / dev-sumi-20220721-productivity-features
findyinc
7
2.7k
企業内スモールデータでのデータ解析
hamage9
0
910
ExplainableAIの概要とAmazon SageMaker Clarifyでの実装例
hacarus
0
110
Automating Gradle benchmarks at N26
ubiratansoares
PRO
2
150
LetsTry
maimux2x
0
100
Featured
See All Featured
Web development in the modern age
philhawksworth
197
9.3k
Faster Mobile Websites
deanohume
294
29k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
237
19k
The MySQL Ecosystem @ GitHub 2015
samlambert
239
11k
GitHub's CSS Performance
jonrohan
1020
420k
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
173
8.6k
Gamification - CAS2011
davidbonilla
75
3.9k
Rebuilding a faster, lazier Slack
samanthasiow
62
7.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_i
25
15k
Principles of Awesome APIs and How to Build Them.
keavy
113
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
181
15k
Documentation Writing (for coders)
carmenintech
48
2.6k
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