Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BottomAppBarの話

 BottomAppBarの話

shibuya.apk #23

star_zero

March 20, 2018
Tweet

More Decks by star_zero

Other Decks in Technology

Transcript

  1. build.gradle apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions'

    android { compileSdkVersion 'android-P' // ... } dependencies { // ... implementation 'com.android.support:appcompat-v7:28.0.0-alpha1' implementation 'com.android.support:design:28.0.0-alpha1' }
  2. Layout XML <android.support.design.widget.CoordinatorLayout> <android.support.design.widget.AppBarLayout> <android.support.v7.widget.Toolbar /> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_main" />

    <android.support.design.bottomappbar.BottomAppBar android:id="@+id/bottomappbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:layout_gravity="bottom" app:backgroundTint="@color/colorPrimary" app:layout_dodgeInsetEdges="bottom" app:popupTheme="@style/AppTheme.PopupOverlay" /> <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_anchor="@id/bottomappbar" app:srcCompat="@drawable/ic_add" /> </android.support.design.widget.CoordinatorLayout>