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
460
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
530
WearableRecyclerView
funnelbit
1
770
QucikSettingsTileAPI
funnelbit
0
340
Mobile Vision
funnelbit
0
430
AwarenessAPI
funnelbit
0
130
Asynchronous Injection
funnelbit
1
230
Other Decks in Technology
See All in Technology
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.3k
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
180
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
データプロダクトの定義からはじめる、データコントラクト駆動なデータ基盤
chanyou0311
2
330
SSMRunbook作成の勘所_20241120
koichiotomo
3
160
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
The Rise of LLMOps
asei
7
1.7k
Lambdaと地方とコミュニティ
miu_crescent
2
370
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
100
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
230
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
370
Featured
See All Featured
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Code Review Best Practice
trishagee
64
17k
Navigating Team Friction
lara
183
14k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
How STYLIGHT went responsive
nonsquared
95
5.2k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Into the Great Unknown - MozCon
thekraken
32
1.5k
How GitHub (no longer) Works
holman
310
140k
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 ࡦ͕͋Εڭ͍͑ͯͩ͘͞
͋Γ͕ͱ͏͍͟͝·ͨ͠