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
520
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
1.9k
ConcatAdapterを深掘る
androhi
1
310
Android Studio 4.1推しポイント!
androhi
0
1.1k
一人開発でつまづいたときの処方箋
androhi
0
240
ConstraintLayout再入門
androhi
2
3.4k
Firebase Analytics 使用感
androhi
0
840
Support Library v23.2 overview
androhi
0
610
Support Library 総復習
androhi
2
2.3k
(続)エンジニアのためのSketch3入門
androhi
1
2.7k
Other Decks in Programming
See All in Programming
Tailwind CSSを本気でカスタマイズする方法
fsubal
2
260
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
430
Build with AI 2024 Seoul - 제로부터 시작하는 Flutter with Gemini 생활 - 박제창
itsmedreamwalker
0
200
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
330
[SF Ruby, March 2024] Rails on Wasm
palkan
0
380
雑に思考を整理する技術と効能
konifar
55
25k
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
3
770
HUIT新歓2024「競技プログラミング、やってみませんか?」
slephy2784
1
250
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
ログラスを支える設計標準について / loglass-design-standards
urmot
10
2.1k
Git Lint
bkuhlmann
4
740
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
120
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
36
2.1k
How to name files
jennybc
64
92k
Raft: Consensus for Rubyists
vanstee
132
6.2k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
76
41k
Building Applications with DynamoDB
mza
88
5.6k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
The Brand Is Dead. Long Live the Brand.
mthomps
48
28k
A better future with KSS
kneath
231
16k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
220
21k
The World Runs on Bad Software
bkeepers
PRO
61
6.7k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
119
38k
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