• Stars
    star
    752
  • Rank 60,353 (Top 2 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

BubbleTabBar is a bottom navigation bar with customizable bubble-like tabs

BubbleTabBar

BubbleTabBar is bottom navigation bar with customizable bubble like tabs

Android Weekly Google Dev Library Codacy Badge BubbleTabBar

Usage

    <io.ak1.BubbleTabBar
               android:id="@+id/bubbleTabBar"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:background="#FFF"
               android:elevation="16dp"
               android:padding="7dp"
               app:bubbletab_menuResource="@menu/list"
               app:bubbletab_custom_font="@font/opensans"
               app:bubbletab_disabled_icon_color="@color/colorPrimaryDark"
               app:bubbletab_horizontal_padding="20dp"
               app:bubbletab_icon_size="20dp"
               app:bubbletab_title_size="16sp"
               app:bubbletab_icon_padding="5sp"
               app:bubbletab_vertical_padding="10dp"
               app:bubbletab_tab_corner_radius="25dp">
       </io.ak1.BubbleTabBar>

or just use

    <io.ak1.BubbleTabBar
               android:id="@+id/bubbleTabBar"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:padding="7dp"
               app:bubbletab_menuResource="@menu/list">
       </io.ak1.BubbleTabBar>

Inflate menu list

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/home"
        android:icon="@drawable/ic_grid"
        android:title="Home"
        android:checked="true"
        android:color="@color/home"/>

    <item
        android:id="@+id/log"
        android:icon="@drawable/ic_clock"
        android:title="Logger"
        android:color="@color/logger"/>
</menu>
            

Add onclick listener

   bubbleTabBar.addBubbLeListener(object : OnBubbleClickListener{
               override fun onBubbleClick(id: Int) {
                   
               }
           })

Connect with components like ViewPager, ViewPager2 and NavController

Setup ViewPager to BubbleTabBar

    viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
            override fun onPageScrolled(
                position: Int,
                positionOffset: Float,
                positionOffsetPixels: Int
            ) {

            }

            override fun onPageSelected(position: Int) {
                bubbleTabBar.setSelected(position, false)
            }

            override fun onPageScrollStateChanged(state: Int) {
            }
        })
   

Setup ViewPager2 to BubbleTabBar

    viewPager2.registerOnPageChangeCallback(object : ViewPager2.OnPageChangeCallback() {
                               override fun onPageSelected(position: Int) {
                                   super.onPageSelected(position)
                                   bubbleTabBar.setSelected(position)
                               }
                           })

Setup NavController to BubbleTabBar

onNavDestinationSelected can be found in here

    bubbleTabBar.addBubbleListener { id ->
                bubbleTabBar.onNavDestinationSelected(id, navController)
            }
    navController.addOnDestinationChangedListener { _, destination, _ ->
                setSelectedWithId(destination.id, false)
            }

Java Implementation

for Java-Implementation

Credits

Thanks to Ariana for transition in sample

Download

include in app level build.gradle

       repositories {
         mavenCentral()
       }
        implementation  'io.ak1:bubbletabbar:1.0.8'

or Maven:

        <dependency>
            <groupId>io.ak1</groupId>
            <artifactId>bubbletabbar</artifactId>
            <version>1.0.8</version>
            <type>pom</type>
        </dependency>

or ivy:

        <dependency org='io.ak1' name='bubbletabbar' rev='1.0.8'>
            <artifact name='bubbletabbar' ext='pom' ></artifact>
        </dependency>

License

Licensed under the Apache License, Version 2.0, click here for the full license.

Author & support

This project was created by Akshay Sharma.

If you appreciate my work, consider buying me a cup of ☕ to keep me recharged 🤘 by PayPal

I love using my work and I'm available for contract work. Freelancing helps to maintain and keep my open source projects up to date!

More Repositories

1

PixImagePicker

Pix is a Whatsapp image picker replica. with this, you can integrate an image picker just like WhatsApp.
Kotlin
863
star
2

Oblique

With Oblique explore new styles of displaying images
Java
652
star
3

MusicWave

With MusicWave represent your Sound in a gradient colored Visualization
Java
567
star
4

DrawBox

DrawBox is a multi-purpose tool to draw anything on canvas, written completely on jetpack compose.
Kotlin
303
star
5

Paper

A minimal notes application in Jetpack Compose with MVVM architecture. Built with components like DataStore, Coroutines, ViewModel, LiveData, Room, Navigation-Compose, Coil, koin etc.
Kotlin
176
star
6

NYTimes-Compose

An offline-first application in Jetpack Compose with MVVM architecture, representing a minimalistic implementation of Top Stories API.
Kotlin
126
star
7

Ariana

Provide Multiple Gradients in ImageViews and Texts. Integrate with ViewPager to change colors dynamically.
Java
79
star
8

Stash

This Library allows you to store custom objects and arrrayLists in SharedPreference just like you store string and int.
Java
68
star
9

Cue

Library to create fully customizable Bootstrap styled alerts
Java
51
star
10

Numpad

Numpad is light weight library for multipurpose usage in numaric input
Java
44
star
11

PixEditor

PixEditor is a Whatsapp image Editor replica. with this, you can integrate an image editor just like WhatsApp.
Kotlin
16
star
12

JetAlarm

Alarm Application on android compose
Kotlin
14
star
13

akshay2211.github.io

Akshay Sharma Portfolio
HTML
12
star
14

akshay2211

readme
8
star
15

rang-vikalp

Simple Color picker in Jetpack Compose
Kotlin
8
star
16

ImgurSearchSample

Android Application sample based on Mvvm, Koin, LiveData, Paging, Room & Coroutines
Kotlin
7
star
17

UserList

Android Application sample in Compose which follows SSOT concept and demonstrate the power of Paging
Kotlin
6
star
18

LineUp

Todo list app (on going Project )
Kotlin
6
star
19

splice

sorting alogs
Vue
5
star
20

android-ui-libraries

List of UI/UX & Utility Libraries and Components for Android
CSS
3
star
21

Huddle

Kotlin
3
star
22

Stamps

Kotlin
2
star
23

pexels-api

Kotlin
1
star
24

Profiler

Profiler is a dynamic banner for your readme.md
Kotlin
1
star