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
CoordinatorLayoutのBehaviorを使い倒す
Search
HiroYUKI Seto
December 12, 2019
Technology
1
350
CoordinatorLayoutのBehaviorを使い倒す
19/12/12
DMM Android勉強会 #3
HiroYUKI Seto
December 12, 2019
Tweet
Share
More Decks by HiroYUKI Seto
See All by HiroYUKI Seto
Androidアプリの 安全なリファクタリングを行うパターン集
seto_hi
2
4.9k
UI TestやVisual Regression Testを コスパ良くやる
seto_hi
3
1.8k
事業支援というお仕事
seto_hi
0
390
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.7k
Jetpack Compose
seto_hi
2
710
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.6k
MDCのButtonのCorner Family
seto_hi
1
140
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
910
Kyashは なぜ使いやすいのか
seto_hi
1
2.4k
Other Decks in Technology
See All in Technology
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.3k
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
420
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
430
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
The Role of Developer Relations in AI Product Success.
giftojabu1
0
140
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
Terraform Stacks入門 #HashiTalks
msato
0
360
TypeScript、上達の瞬間
sadnessojisan
46
13k
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
950
Featured
See All Featured
Building Your Own Lightsaber
phodgson
103
6.1k
For a Future-Friendly Web
brad_frost
175
9.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Faster Mobile Websites
deanohume
305
30k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
The Art of Programming - Codeland 2020
erikaheidi
52
13k
YesSQL, Process and Tooling at Scale
rocio
169
14k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Site-Speed That Sticks
csswizardry
0
28
Done Done
chrislema
181
16k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Building Adaptive Systems
keathley
38
2.3k
Transcript
$50ࣨށ༏೭ $PPSEJOBUPS-BZPVUͷ #FIBWJPSΛ ͍͢
X © DMM.com w ށ༏೭ w !TFUP@IJ w ݄ೖࣾ w
$50ࣨॴଐ w ʮೖࣾͨ͠Βطʹొஃ͢Δ͜ͱʹͳ͍ͬͯͨʯ ࣗݾհ
X © DMM.com ͍͢
X © DMM.com ͦͷલʹ ࢥ͍ग़͢
X © DMM.com $PPSEJOBUPS-BZPVUΛ༻ҙ͢Δ $PPSEJOBUPS-BZPVUͷࢠ7JFXʹ app:layout_behavior ଐੑΛՃ͢Δ Ҏ্ʂ $PPSEJOBUPS-BZPVU#FIBWJPS
X © DMM.com $PPSEJOBUPS-BZPVU#FIBWJPS
X © DMM.com
X © DMM.com $PPSEJOBUPS-BZPVU#FIBWJPS
X © DMM.com
X © DMM.com $PPSEJOBUPS-BZPVUΛ༻ҙ͢Δ $PPSEJOBUPS-BZPVUͷࢠ7JFXʹ app:layout_behavior ଐੑΛՃ͢Δ Ҏ্ʂ $PPSEJOBUPS-BZPVU#FIBWJPS
X © DMM.com #FIBWJPSͱ
X © DMM.com l*OUFSBDUJPOCFIBWJPSQMVHJOGPSDIJMEWJFXTPG$PPSEJOBUPS-BZPVU "#FIBWJPSJNQMFNFOUTPOFPSNPSFJOUFSBDUJPOTUIBUBVTFSDBO UBLFPOBDIJMEWJFX5IFTFJOUFSBDUJPOTNBZJODMVEFESBHT TXJQFT qJOHT PSBOZPUIFSHFTUVSFTz
$PPSEJOBUPS-BZPVU#FIBWJPS IUUQTEFWFMPQFSBOESPJEDPNSFGFSFODFBOESPJETVQQPSUEFTJHOXJEHFU$PPSEJOBUPS-BZPVU#FIBWJPS
X © DMM.com w ҙͷ7JFXʹ w Կ͔͕ى͖ͨͱ͖ʹ w ࢦఆͨ͠7JFXʹ w
Կ͔Λ͢Δ Ͳ͏͏͔ w layout_behavior Λॻ͍ͨViewͰͳͯ͘Α͍ w %SBH 4XJQF 'MJOH FUD w ͜͜Λ࣮͢Δ w YNMͰBQQlayout_behavior Λॻ͍ͨ7JFX
X © DMM.com ͳͥࠓ
X © DMM.com .%$ʹΑͬͯ ࠓ #FIBWJPS͕͍ʂʂ
X © DMM.com ࡞Δ
X © DMM.com • layoutDependsOn w ҙͷ7JFXͰ͋Δ͔Λฦ͢ • onDependentViewChanged w
ҙͷ7JFXͷϨΠΞτ͕มΘΔͱݺΕΔ • onNestedScroll / onNestedFling w ରͷ7JFX͕4DSPMM'MJOH͞ΕΔͱݺΕΔ େࣄͳϝιου
X © DMM.com αϯϓϧϦϙδτϦ IUUQTHJUIVCDPNIJSPZVLJTFUPCFIBWJPSTBNQMF
X © DMM.com class FabRotationBehavior() : CoordinatorLayout.Behavior<View>() { // xmlͰࢦఆͨ͠ࡍʹݺΕΔίϯετϥΫλ
constructor( context: Context, attrs: AttributeSet ) : this() } ࣮ίϯετϥΫλ
X © DMM.com override fun layoutDependsOn( … ): Boolean {
return dependency is NestedScrollingChild2 } ࣮PO4UBSU/FTUFE4DSPMM
X © DMM.com override fun onStartNestedScroll( … ): Boolean {
//trueΛฦ͢ͱ onNestedScroll ͕ݺΕΔ return true } ࣮PO4UBSU/FTUFE4DSPMM
X © DMM.com override fun onNestedScroll( … dyConsumed: Int …
) { child.rotation += dyConsumed } ࣮PO/FTUFE4DSPMM
X © DMM.com Ͳ͏͏
X © DMM.com w ҙͷ7JFXʹ w layout_behavior Λॻ͍ͨViewͰͳͯ͘Α͍ w Կ͔͕ى͖ͨͱ͖ʹ
w %SBH 4XJQF 'MJOH FUD w ࢦఆͨ͠7JFXʹ w YNMͰBQQlayout_behavior Λॻ͍ͨ7JFX w Կ͔Λ͢Δ w ͜͜Λ࣮͢Δ Ͳ͏͏͔
X © DMM.com w ͕$PPSEJOBUPS-BZPVU ඞਢ w 7JFXͷϝιουΛୟ͚ͩ͘ w
FYWJFXͷSPUBUJPOΛม͑Δ WJTJCJMJUZΛม͑Δ w FY&YUFOEFE'MPBUJOH"DUJPO#VUUPOFYUFOE TISJOL w Ҡಈมܗ͕ͳ͍Ξχϝʔγϣϯ w FY৭ͷมԽɺճసɺ⾩Ͱͳ͍ΞϧϑΝ w 5SBOTGPSNͷྫʜ #FIBWJPSͷ͍Ͳ͜Ζ
X © DMM.com w ͕$PPSEJOBUPS-BZPVUͰͳ͍߹ w Ξχϝʔγϣϯ͕7JFXʹ࣮͞Ε͍ͯͳ͍ w Ҡಈมܗ͕͋Δ߹ #FIBWJPSͰ࣮͢ΔΑΓ5SBOTJUJPOָ͕
w 5SBOTJUJPOͱ࣮ͯ͠ࡁ͞Ε͍ͯΔ w Ҡಈɺมܗɺग़ݱɺফࣦ 5SBOTJUJPOͷํ͕Α͍ͱ͜Ζ
X © DMM.com ͍Ͳ͜ΖΛͬͯ ྑ͍#FIBWJPSϥΠϑΛ
X © DMM.com w ެࣜϦϑΝϨϯε w IUUQTEFWFMPQFSBOESPJEDPNSFGFSFODFBOESPJETVQQPSUEFTJHOXJEHFU $PPSEJOBUPS-BZPVU#FIBWJPS w NBUFSJBMDPNQPOFOUTBOESPJE
w IUUQTHJUIVCDPNNBUFSJBMDPNQPOFOUTNBUFSJBMDPNQPOFOUTBOESPJEUSFF NBTUFSMJCKBWBDPNHPPHMFBOESPJENBUFSJBMUSBOTGPSNBUJPO ࢀߟจݙ
X © DMM.com w %SPJE,BJHJ .%$ͷ෦࣮͔ΒֶͿදݱྗͷߴ͍7JFXͷ࡞Γํ ΦϋφγϋπρΫ