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
BottomBarAndSnackBar
Search
funnelbit
December 26, 2016
Technology
0
470
BottomBarAndSnackBar
funnelbit
December 26, 2016
Tweet
Share
More Decks by funnelbit
See All by funnelbit
Hatena Engineer Seminar #9
funnelbit
5
7.2k
droidkaigi-2017-renovation
funnelbit
10
10k
Dart
funnelbit
0
250
Dagger2 Optional bindings
funnelbit
0
540
WearableRecyclerView
funnelbit
1
770
QucikSettingsTileAPI
funnelbit
0
350
Mobile Vision
funnelbit
0
440
AwarenessAPI
funnelbit
0
130
Asynchronous Injection
funnelbit
1
230
Other Decks in Technology
See All in Technology
podman_update_2024-12
orimanabu
1
280
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
750
フロントエンド設計にモブ設計を導入してみた / 20241212_cloudsign_TechFrontMeetup
bengo4com
0
1.9k
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
17
14k
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1.1k
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
290
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.6k
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Optimizing for Happiness
mojombo
376
70k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
A designer walks into a library…
pauljervisheath
204
24k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Gamification - CAS2011
davidbonilla
80
5.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Transcript
#PUUPN#BS ͱ 4OBDL#BS
ࣗݾհ ଜྋ גࣜձࣾͯͳ )BUFOBGVOOFMCJU 5XJUUFS!FYQFSPQFSP
%SPJE,BJHJͰൃද͠·͢ w λΠτϧʮେنΞϓϦͷϦϊϕʔγϣϯʯ w ͓ٓ͘͠ئ͍͠·͢"
4OBDL#BSͱ#PUUPN#BS ͷΈ߹Θͤʹ͍ͭͯ
"DUJWJUZ 'SBHNFOU Ͱ'SBHNFOU͔Β 4OBDL#BSΛͩ͢
"DUJWJUZ 'SBHNFOU 4OBDL#BS
"DUJWJUZ 'SBHNFOU 4OBDL#BS Snackbar.make(v, "SnackBar!!", Snackbar.LENGTH_LONG).show(); w 'SBHNFOUͰݺͿ
None
"DUJWJUZ #PUUPN#BS 'SBHNFOUͰ'SBHNFOU͔ Β4OBDL#BSΛͩ͢
"DUJWJUZ #PUUPN#BS 'SBHNFOU 4OBDL#BS
None
"DUJWJUZ #PUUPN#BS 'SBHNFOU 4OBDL#BS w 4OBDL#BSදࣔ͢Δ࣌ɺ7JFXΛḷͬͯద ͳ7JFX(SPVQʹදࣔ͞ΕΔ
"DUJWJUZ #PUUPN#BS 'SBHNFOU 4OBDL#BS w 3FMBUJWF-BZPVU w "QQCBS
w $PPSEJOBUPS-BZPVU w 'SBHNFOU w $PPSEJOBUPS-BZPVU w 5PPMCBS w 3FMBUJWF-BZPVU w "DUJWJUZͷϨΠΞτΛॻ͖͑Δ
None
"DUJWJUZ ಈ͘"QQ#BSͱ #PUUPN#BS 'SBHNFOUͰ 'SBHNFOU͔Β4OBDL#BSΛͩ͢
None
"DUJWJUZͷ#FIBWJPSͰͳΜ ͱ͔͢Δʁ if (dependency instanceof Snackbar.SnackbarLayout) { int targetPadding =
Math.max(0, bottomBar.getMeasuredHeight() - (int) (bottomBar.getY() - bottomBar.getTop())); dependency.setPadding(dependency.getPaddingLeft(), dependency.getPaddingTop(), dependency.getPaddingRight(), targetPadding); } w #PUUPN#BSͷ#FIBWJPSͱͯ͜͠ΜͳͷΛॻ͘
None
w 4OBL#BSʹ&MFWBUJPO͕͋Δ EQ w IUUQTNBUFSJBMJPHVJEFMJOFTDPNQPOFOUT CPUUPNOBWJHBUJPOIUNMCPUUPNOBWJHBUJPO TQFDT
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_behavior="com.example.funnelbit.snackbarapp.BottomBarB ehavior" android:layout_gravity="bottom" android:elevation="8dp"
ݹ͍όʔδϣϯΛߟྀ // ͠ KITKAT ҎԼͰ͋Δ߹ɺelevation ͕͑ͳ͍ͨΊɺbottomBar ͷ্ʹ Snackbar ͕ඃͬͯ͞͠·͏ɻ //
ͦ͜Ͱ bringToFront() Λ͍ɺॏͶॱΛม͑Δɻ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { bottomBar.bringToFront(); // KITKAT ΑΓલͷόʔδϣϯͷ߹ɺrequestLayout() ͱ invalidate() Λݺͳ͚Ε ॏͶॱͷมߋ͕ͳ͞Εͳ͍ɻ if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { bottomBar.getParent().requestLayout(); ((View) bottomBar.getParent()).invalidate(); } } return true; w #PUUPN#BSͷ#FIBWJPSͱͯ͜͠ΜͳͷΛॻ͘ʢଓ͖ʣ
None
None
w Ͱಈ͔͢ͱͪΐͬͱ͓͔͘͠ͳΔ
*OUFSGBDF public interface ErrorMessageInterface { void show(String text); }
'SBHNFOU ((ErrorMessageInterface) getActivity()).show("SnackBar!!");
"DUJWJUZ Snackbar.make(findViewById(R.id.snackbar_container), "SnackBar!!", Snackbar.LENGTH_LONG).show();
-BZPVU "DUJWJUZ w $PPSEJOBUPS-BZPVU w "QQ#BS w 'SBHNFOU w #PUUPN#BS$POUBJOFS
w $PPSEJOBUPS-BZPVU w #PUUPN#BS$POUFOU w $PPSEJOBUPS-BZPVU
None
·ͱΊ w ৭ʑํ๏͕͋Γͦ͏͕ͩʜ w ݁ہ"DUJWJUZʹΤϥʔදࣔΛͤΔͷ͕Α͍ w 'SBHNFOU͕Կͳͷ͔Δ༝ͳ͍ͷͰ w ࡦ͕͋Εڭ͍͑ͯͩ͘͞
͋Γ͕ͱ͏͍͟͝·ͨ͠