BottomBarAndSnackBar

8928b5277aa7234dbca4ff782952343a?s=47 funnelbit
December 26, 2016

 BottomBarAndSnackBar

8928b5277aa7234dbca4ff782952343a?s=128

funnelbit

December 26, 2016
Tweet

Transcript

  1. 8.
  2. 11.
  3. 13.

    "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ͷϨΠΞ΢τΛॻ͖׵͑Δ
  4. 14.
  5. 16.
  6. 17.

    "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ͱͯ͜͠ΜͳͷΛॻ͘
  7. 18.
  8. 21.

    ݹ͍όʔδϣϯΛߟྀ // ΋͠΋ 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ͱͯ͜͠ΜͳͷΛॻ͘ʢଓ͖ʣ
  9. 22.
  10. 23.
  11. 28.

    -BZPVU "DUJWJUZ w $PPSEJOBUPS-BZPVU w "QQ#BS w 'SBHNFOU w #PUUPN#BS$POUBJOFS

    w $PPSEJOBUPS-BZPVU w #PUUPN#BS$POUFOU w $PPSEJOBUPS-BZPVU
  12. 29.