Code Monkey home page Code Monkey logo

lottiebottomnavbar's Introduction

Lottie Bottom Navbar

A customisable bottom navigation bar with Lottie Animation

Current Latest Version 1.0.8

Usage

Add maven url Inside Project Level build.gradle

buildscript {
	...
    repositories {
    	...
        maven {
            url  "https://dl.bintray.com/subsub/maven"
        }
    }
    dependencies {
    	...
    }
}

...

allprojects {
    repositories {
    	...
        maven {
            url  "https://dl.bintray.com/subsub/maven"
        }
    }
}

Add dependency into your app build.gradle

implementation "com.subkhansarif.libs:bottomnavbarlib:{latestVersion}"

Sample

See sample project.

Add LottieBottomNavbar to your layout

<com.subkhansarif.bottomnavbar.LottieBottomNavbar
        android:id="@+id/bottom_navbar"
        android:layout_width="0dp"
        android:layout_height="56dp"
        android:background="@color/colorWhite"
        android:elevation="15dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

Setup menus for navbar

ArrayList<BottomMenu> menu = ArrayList();
menu.add(new BottomMenu(0L, getString(R.string.lbl_menu_profile), R.drawable.ic_person_grey, "a_cup_of_coffee.json"));
menu.add(new BottomMenu(1L, getString(R.string.lbl_menu_pet), R.drawable.ic_pets_grey, "a_cup_of_coffee.json"));
menu.add(new BottomMenu(2L, getString(R.string.lbl_menu_Food), R.drawable.ic_restaurant_menu_grey, null));

BottomMenu constructor parameters:

  • id: Long, id for your button
  • label: String, label for this button. This will be shown below button icon
  • icon: drawable res, image resource for this button
  • (optional) lottie_animation: String, a String of json file name for Lottie Animation.

Add menus to navbar

LottieBottomNavbar bottom_navbar = findViewById(R.id.bottom_navbar)
bottom_navbar.setSelected(1)
bottom_navbar.setMenu(menu)
bottom_navbar.setMenuClickListener(this)

lottiebottomnavbar's People

Contributors

subsub avatar

Watchers

James Cloos avatar /r/dumbDevpr* avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.