Skip to content

kargozeyan/CurvedBottomNavigationView

Repository files navigation

CurvedBottomNavigationView

Intro

CurvedBottomNavigationView is Android Library fully written in Kotlin. Currently is has only one type of curve(UP) but I am planning to intergrate also DOWN curve

Preview

Download

Gradle(Project)

allprojects {
    repositories {
      ... 
      maven { url 'https://jitpack.io' }
    }
  }

Gradle(App)

implementation 'com.github.kargoz:CurvedBottomNavigationView:1.1.1'

Usage

Add CurvedBottomNavigationView to your layout

    <com.karen.curvedbottomnavigationview.CurvedBottomNavigationView
        android:id="@+id/curved_bnv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom" />

Fill CurvedBottomNavigationView with NavigationItems

curved_bnv.fill(
            true, NavigationItem("Text 1", R.drawable.drawable1),
            NavigationItem("Text 2", R.drawable.drawable2),
            NavigationItem("Text 3", R.drawable.drawable3),
            NavigationItem("Text 4", R.drawable.drawable4)
            )

Handle onClickListener

curved_bnv.setOnItemClickListener(object :OnItemClickedListener{
            override fun onItemClicked(item: NavigationItem) {
                /** Handle Item Clicked*/
            }

            override fun onItemReClicked(item: NavigationItem) {
                /** Handle Item ReClicked*/
            }

            override fun onCenterItemClicked() {
                /** Handle CenterItem Clicked*/
            }

            override fun onCenterItemReClicked() {
                /** Handle CenterItem ReClicked*/
            }
        })