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
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.2k
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
470
5分でわかるDuckDB
chanyou0311
10
3.2k
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
180
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
210
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
150
Wantedly での Datadog 活用事例
bgpat
1
410
.NET 9 のパフォーマンス改善
nenonaninu
0
500
祝!Iceberg祭開幕!re:Invent 2024データレイク関連アップデート10分総ざらい
kniino
2
240
生成AIのガバナンスの全体像と現実解
fnifni
1
180
ずっと昔に Star をつけたはずの思い出せない GitHub リポジトリを見つけたい!
rokuosan
0
150
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
110
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Faster Mobile Websites
deanohume
305
30k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Building Adaptive Systems
keathley
38
2.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Mobile First: as difficult as doing things right
swwweet
222
9k
Unsuck your backbone
ammeep
669
57k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
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 ࡦ͕͋Εڭ͍͑ͯͩ͘͞
͋Γ͕ͱ͏͍͟͝·ͨ͠