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
360
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
400
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.7k
Jetpack Compose
seto_hi
2
730
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.6k
MDCのButtonのCorner Family
seto_hi
1
160
MDCのBottomAppBarのShadowの実現方法
seto_hi
0
920
Kyashは なぜ使いやすいのか
seto_hi
1
2.4k
Other Decks in Technology
See All in Technology
OPENLOGI Company Profile
hr01
0
58k
ゼロからわかる!!AWSの構成図を書いてみようワークショップ 問題&解答解説 #デッカイギ #羽田デッカイギおつ
_mossann_t
0
1.5k
AWSマルチアカウント統制環境のすゝめ / 20250115 Mitsutoshi Matsuo
shift_evolve
0
100
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
130
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
270
When Windows Meets Kubernetes…
pichuang
0
290
技術に触れたり、顔を出そう
maruto
1
140
Evolving Architecture
rainerhahnekamp
3
250
データ基盤におけるIaCの重要性とその運用
mtpooh
1
200
今から、 今だからこそ始める Terraform で Azure 管理 / Managing Azure with Terraform: The Perfect Time to Start
nnstt1
0
150
あなたの知らないクラフトビールの世界
miura55
0
100
#TRG24 / David Cuartielles / Post Open Source
tarugoconf
0
550
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
860
Speed Design
sergeychernyshev
25
730
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.2k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Code Reviewing Like a Champion
maltzj
521
39k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Become a Pro
speakerdeck
PRO
26
5.1k
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ͷ࡞Γํ ΦϋφγϋπρΫ