Android Kotlin: Membuat Bottom Navigation

Avin Riyan
Sep 3, 2018 · 2 min read
Image result for android kotlin

pengen membuat bottom navigation seperti pada aplikasi instagram? mau coba bikin pakai kotlin?

langkah-langkahnya

  1. Membuat project android baru yang support kotlin

2. Add dependencies library dibawah, lalu sync project anda

implementation 'com.android.support:design:27.1.1'

3. pada folder res tambahkan folder dengan nama menu lalu didalam nya tambahkan menu resource file bernama navigation.xml

4. edit isi file navigation.xml

5. edit file activity_main.xml

6. buat dua fragment blank baru dengan nama FirstFragment dan SecondFragment, edit xml nya menjadi

fragment_first.xml

fragment_second.xml

lalu edit FirstFragment.kt menjadi

7. edit MainActivity.kt

hasilnya seperti ini

teman2 bisa kustom bottom navigation sesuai dengan yang diinginkan tinggal edit xml nya, sekian dulu terimakasih.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade