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
580
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.5k
ConcatAdapterを深掘る
androhi
1
400
Android Studio 4.1推しポイント!
androhi
0
1.3k
一人開発でつまづいたときの処方箋
androhi
0
330
ConstraintLayout再入門
androhi
2
3.5k
Firebase Analytics 使用感
androhi
0
870
Support Library v23.2 overview
androhi
0
670
Support Library 総復習
androhi
2
2.5k
(続)エンジニアのためのSketch3入門
androhi
1
2.8k
Other Decks in Programming
See All in Programming
今から始めるCursor / Windsurf / Cline
kengo_hayano
0
110
Compose Navigation実装の見通しを良くする
hiroaki404
0
180
Preact、HooksとSignalsの両立 / Preact: Harmonizing Hooks and Signals
ssssota
1
790
家族・子育て重視/沖縄在住を維持しながらエンジニアとしてのキャリアをどのように育てていくか?
ug
0
250
本当だってば!俺もTRICK 2022に入賞してたんだってば!
jinroq
0
260
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
270
AIコードエディタの基盤となるLLMのFlutter性能評価
alquist4121
0
130
新卒から4年間、20年もののWebサービスと 向き合って学んだソフトウェア考古学
oguri
8
6.9k
体得しよう!RSA暗号の原理と解読
laysakura
3
540
‘무차별 LGTM~👍’만 외치던 우리가 ‘고봉밥 코드 리뷰’를?
hannah0731
0
530
コンテナでLambdaをデプロイするときに知っておきたかったこと
_takahash
0
150
自分のために作ったアプリが、グローバルに使われるまで / Indie App Development Lunch LT
pixyzehn
1
130
Featured
See All Featured
Six Lessons from altMBA
skipperchong
27
3.7k
Side Projects
sachag
452
42k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
12
620
BBQ
matthewcrist
88
9.5k
A Philosophy of Restraint
colly
203
16k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.5k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Unsuck your backbone
ammeep
670
57k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
39
7.2k
Code Review Best Practice
trishagee
67
18k
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