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
MDCのBottomAppBarのShadowの実現方法
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
HiroYUKI Seto
January 28, 2019
Technology
1k
0
Share
MDCのBottomAppBarのShadowの実現方法
2019/1/28
potatotips #58
HiroYUKI Seto
January 28, 2019
More Decks by HiroYUKI Seto
See All by HiroYUKI Seto
Androidアプリの 安全なリファクタリングを行うパターン集
seto_hi
2
5k
UI TestやVisual Regression Testを コスパ良くやる
seto_hi
3
1.9k
事業支援というお仕事
seto_hi
0
440
MDCの内部実装から学ぶ 表現力の高いViewの作り方
seto_hi
5
1.8k
CoordinatorLayoutのBehaviorを使い倒す
seto_hi
1
450
Jetpack Compose
seto_hi
2
870
UI改善に繋がるエンジニアの立ち回り
seto_hi
2
4.8k
MDCのButtonのCorner Family
seto_hi
1
240
Kyashは なぜ使いやすいのか
seto_hi
1
2.6k
Other Decks in Technology
See All in Technology
すごいぞManaged Kubernetes
harukasakihara
1
330
バックオフィスPJのPjMをコーポレートITが担うとうまくいく3つの理由
yueda256
1
270
Cursor Subagentsはいいぞ
yug1224
2
140
AgentCore RuntimeからS3 Filesをマウントしてみる
har1101
2
260
スケーリングを封じられたEC2を救いたい
senseofunity129
0
140
Network Firewall Proxyで 自前プロキシを消し去ることができるのか
gusandayo
0
190
Datadog で実現するセキュリティ対策 ~オブザーバビリティとセキュリティを 一緒にやると何がいいのか~
a2ush
0
190
Tour of Agent Protocols: MCP, A2A, AG-UI, A2UI with ADK
meteatamel
1
210
【AWS】CloudTrail LakeとCloudWatch Logs Insightsの使い分け方針
tsurunosd
0
130
Babylon.js Japan Activities (2026/4)
limes2018
0
180
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
11k
Kubernetes基盤における開発者体験 とセキュリティの両⽴ / Balancing developer experience and security in a Kubernetes-based environment
chmikata
0
170
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
160
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
RailsConf 2023
tenderlove
30
1.4k
Technical Leadership for Architectural Decision Making
baasie
3
310
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
What does AI have to do with Human Rights?
axbom
PRO
1
2.1k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
120
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
110
HDC tutorial
michielstock
1
600
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Navigating Weather and Climate Data
rabernat
0
160
Transcript
גࣜձࣾϊϋφɹށ༏೭ .%$ͷ#PUUPN"QQ#BSͷ 4IBEPXͷ࣮ݱํ๏
ށ༏೭ˏTFUP@IJ גࣜձࣾϊϋφ ΞϓϦΤϯδχΞɺ ϦαʔνɺࢪࡦɺσβΠϯ
None
.BUFSJBM%FTJHO$PNQPOFOUT
#PUUPN"QQ#BS
04͕4IBEPXΛඳը͢Δ݅ w "OESPJEˢ w &MFWBUJPO͕ΑΓେ͖͍ w 7JFXͷ0VUMJOF͕ํܗ • Outline.MODE_ROUND_RECT w
·ͨತਤܗ • Outline.MODE_CONVEX_PATH
#PUUPN"QQ#BS
Ͳ͏ͬͯ ࣮ݱ͞Ε͍ͯΔͷ
#PUUPN"QQ#BS࣮ EdgeTreatment topEdgeTreatment = new BottomAppBarTopEdgeTreatment(…); ShapeAppearanceModel appBarModel = materialShapeDrawable.getShapeAppearanceModel();
appBarModel.setTopEdge(topEdgeTreatment); materialShapeDrawable.setShadowCompatibilityMode( SHADOW_COMPAT_MODE_ALWAYS); … ViewCompat. setBackground(this, materialShapeDrawable);
#PUUPN"QQ#BS5PQ&EHF5SFBUNFOU @Override public void getEdgePath(…) { … shapePath.lineTo(…) shapePath.addArc(…) shapePath.addArc(…)
shapePath.addArc(…) shapePath.lineTo(…) … }
BEE"SD BEE"SD BEE-JOF BEE-JOF #PUUPN"QQ#BS BEE"SD
.BUFSJBM4IBQF%SBXBCMFESBX MaterialShapeDrawable.drawCompatShadow → EdgeShadowOperation.draw → ShadowCompatOperation.draw → ShadowRenderer.drawCornerShadow / ShadowRenderer.drawEdgeShadow
canvas.drawBitmap(shadowLayer, …)
4IBEPX3FOEFSFSESBX$PSOFS4IBEPX … cornerShadowPaint.setShader( new RadialGradient( …, Shader.TileMode.CLAMP)); … canvas.drawArc( …,
cornerShadowPaint); …
4IBEPX3FOEFSFS ΜΓ
None
·ͱΊ w #PUUPN"QQ#BS.BUFSJBM4IBQF%SBXBCMFΛ͏ w .BUFSJBM4IBQF%SBXBCMFͷ5PQ&EHF͕ #PUUPN"QQ#BS5PQ&EHF5SFBUNFOU w #PUUPN"QQ#BS5PQ&EHF5SFBUNFOU BSDͰ͘΅ΈΛදݱ͍ͯ͠Δ w
Өͷඳը4IBEPX3FOEFSFS
None