Coder Social home page Coder Social logo

felixsoares / animatedbottombar Goto Github PK

View Code? Open in Web Editor NEW
25.0 1.0 4.0 370 KB

This library allows you to show bottom navigation quickly, simply and animated.

License: MIT License

Java 5.75% Kotlin 94.25%
android bottomnavigationview bottombar kotlin

animatedbottombar's Introduction

This library allows you to show bottom navigation quickly, simply and animated.

AnimatedBottomBar

Please, have a test in google play clicking here.

Android Arsenal

Getting Started

Add it in your root build.gradle (Project module)

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

Add the dependency in build.gradle (App module)

dependencies {
	implementation 'com.github.felixsoares:AnimatedBottomBar:1.1'
}

Usage example

In layout file

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <com.felixsoares.animatedbottombar.ui.BottomBar
            android:id="@+id/bottom"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            app:layout_constraintBottom_toBottomOf="parent"/>

</android.support.constraint.ConstraintLayout>

In Activity or Fragment

bottom
            .addItem(Item("Home", R.drawable.ic_home))
            .addItem(Item("Search", R.drawable.ic_search))
            .addItem(Item("Profile", R.drawable.ic_person))
            .build()

Documentation

  1. Support click listener.
import com.felixsoares.animatedbottombar.NavigationListner

class MainActivity : AppCompatActivity(), NavigationListner {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_default)

        bottom
            .setupListner(this)
            .addItem(Item("Home", R.drawable.ic_home))
            .addItem(Item("Search", R.drawable.ic_search))
            .addItem(Item("Profile", R.drawable.ic_person))
            .build()
    }

    override fun OnClick(position: Int) {
        Log.i("OnClick", "position $position")
    }
}
  1. Support multi color (layout).
<com.felixsoares.animatedbottombar.ui.BottomBar
            android:id="@+id/bottom"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            app:text_size="14sp"
            app:bg_color="#ec4f16"
            app:bg_icon_color="#a43fcc20"
            app:tint_icon_color="#191793"
            app:text_color="@color/colorPrimary"
            app:indicator_color="@color/colorAccent"/>

2.1) Support multi color (code).

bottom
            .setBgColor(android.R.color.black)
            .setBgIconColor(android.R.color.holo_blue_dark)
            .setIconColor(android.R.color.holo_green_dark)
            .setIndicatorColor(android.R.color.holo_red_dark)
            .setTextColor(android.R.color.holo_orange_dark)
            .setTextSize(12f)
            .addItem(Item("Home", R.drawable.ic_home))
            .addItem(Item("Search", R.drawable.ic_search))
            .addItem(Item("Profile", R.drawable.ic_person))
            .build()
  1. Add item by item.
bottom.addItem(Item("Home", R.drawable.ic_home))

3.1) Add list of Itens.

val list = mutableListOf<Item>()
list.add(Item("Home", R.drawable.ic_home))
list.add(Item("Search", R.drawable.ic_search))
list.add(Item("Profile", R.drawable.ic_person))

bottom
		.setupItens(list)
		.build()
  1. Support itens with text or icons.
bottom
		.addItem(Item("Home", R.drawable.ic_home))
		.addItem(Item("Search", R.drawable.ic_search))
		.addItem(Item(R.drawable.ic_notifications_gray, R.drawable.ic_notifications))

MIT License

Copyright (c) 2019 Felix Soares

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

animatedbottombar's People

Contributors

felixsoares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

animatedbottombar's Issues

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.