🍞 The ultimate breadcrumbs view for Android!

Overview

JitPack API License: MIT Android Arsenal

KrumbsView

The ultimate breadcrumbs view for Android!

Inspired by JotterPad's breadcrumbs.

Features:

  • Custom typeface (from /assets and /res/font folders, also works with Downloadable Fonts)
  • Customisable (text colors, text size, separator icon)
  • Cool animations
  • Swipe right to go back to the previous item
  • Survive Activity recreations
  • Extensible (open classes and protected members, extend it to get the job done!)

How to use

Import to your project

First, add it in your root build.gradle at the end of repositories:

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

Next, add the dependency to your app modules:

dependencies {
    ...
    implementation 'com.github.adrielcafe:krumbsview:$latestVersion'
}

Current version:

JitPack

XML

<cafe.adriel.krumbsview.KrumbsView
    ...
    app:krumbsStartItem="[string]"
    app:krumbsPaddingStartItem="[dimension]"
    app:krumbsPreviousItemCharacters="[integer]"
    app:krumbsTypeface="[string|font]"
    app:krumbsTextSize="[dimension]"
    app:krumbsBoldText="[true|false]"
    app:krumbsCurrentItemTextColor="[color]"
    app:krumbsPreviousItemTextColor="[color]"
    app:krumbsSeparatorTintColor="[color]"
    app:krumbsSeparatorIcon="[drawable]"
    app:krumbsAnimationType="[slideLeftRight|fadeInOut|growShrink]"
    app:krumbsAnimationDuration="[shortDuration|longDuration]"/>

Example:

<cafe.adriel.krumbsview.KrumbsView
    android:id="@+id/krumbsView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/colorPrimary"
    app:krumbsStartItem="Home"
    app:krumbsTypeface="@font/quicksand"
    app:krumbsTextSize="24sp"
    app:krumbsCurrentItemTextColor="@color/colorAccent"
    app:krumbsPreviousItemTextColor="@color/colorPrimaryDark"
    app:krumbsSeparatorTintColor="@color/colorPrimaryDark"
    app:krumbsSeparatorIcon="@drawable/ic_play_arrow"
    app:krumbsAnimationType="growShrink"
    app:krumbsAnimationDuration="longDuration"/>

Kotlin/Java

with(krumbsView){
    size
    getItems()
    getCurrentItem()
    addItem(Krumb("Lorem Ipsum"))
    removeLastItem()
    removeAllItems()
    goToFirstItem()
    setOnPreviousItemClickListener { /* ... */ } // Swipe right also triggers this listener
    
    // All XML options are available
    setTypeface("fonts/quicksand.ttf") // From /assets folder
    setTypeface(R.font.quicksand) // From /res/font folder
    setTypeface(MyCustomTypeface)
    setTextSizeSp(20f)
    setTextSizePx(40f)
    setBoldText(true)
    setPaddingStartItem(10f)
    setPreviousItemCharacters(2)
    setCurrentItemTextColor(Color.WHITE)
    setPreviousItemTextColor(color(R.color.transparent_white))
    setSeparatorTintColor(color(R.color.transparent_white))
    setSeparatorIcon(R.drawable.ic_keyboard_arrow_right)
    setAnimationType(KrumbsAnimationType.GROW_SHRINK)
    setAnimationDuration(KrumbsAnimationDuration.SHORT)
}

You can also use your custom Krumb implementation:

data class MyKrumb(val id: Int, 
                   val folderName: String, 
                   val createdAt: Date) : Krumb(folderName)

with(krumbsView){
    addItem(MyKrumb(123, "Folder XYZ", now))

    val myKrumb = getCurrentItem() as MyKrumb
}
You might also like...
A library for creating dynamic skeleton view
A library for creating dynamic skeleton view

Skeleton Placeholder View Overview A Library designed to draw a Skeleton by "skinning" the view from a provided layout. Skeleton is composed of Bone w

A library for otp view with gradient and lines

AndroidOtpView (With gradient color in lines) Preview Otp View library for Android Getting started Add it in your root build.gradle at the end of repo

A fork of our clean architecture boilerplate using the Model-View-Intent pattern

Android Clean Architecture MVI Boilerplate Note: This is a fork of our original Clean Architecture Boilerplate, except in this repo we have switched o

Clean MVVM with eliminating the usage of context from view models by introducing hilt for DI and sealed classes for displaying Errors in views using shared flows (one time event), and Stateflow for data

Clean ViewModel with Sealed Classes Following are the purposes of this repo Showing how you can remove the need of context in ViewModels. I. By using

Location-history-viewer - Small compose-desktop app to view data from google's location history

Google Location History Takeout Viewer This application provides a minimalistic

Modern Calendar View Supporting Both Hijri and Gregorian Calendars but in highly dynamic way
Modern Calendar View Supporting Both Hijri and Gregorian Calendars but in highly dynamic way

KCalendar-View Modern calendar view supporting both Hijri and Gregorian calendar

A simple e-market application that allows users to view the store details and products, add products to the basket, and place an order.
A simple e-market application that allows users to view the store details and products, add products to the basket, and place an order.

E-Market Application Features : Store details & products screen Fetch the store detail from an endpoint and display this upper part of the screen. Fet

UserLoc - A API call using Retrofit to obtain list of users details and show on UI in recycler view and google map
UserLoc - A API call using Retrofit to obtain list of users details and show on UI in recycler view and google map

UserLoc This uses a API call using Retrofit to obtain list of users details and

Android MVVM framework write in kotlin, develop Android has never been so fun.

KBinding 中文版 Android MVVM framework write in kotlin, base on anko, simple but powerful. It depends on my another project AutoAdapter(A library for sim

Comments
  • Add paddingStartItem and previousItemCharacters attributes

    Add paddingStartItem and previousItemCharacters attributes

    • Removed iml files from repo
    • Centered separator imageview vertically and set height to wrap content
    • Added paddingStartItem and previousItemCharacters option - this means the text can be aligned better with other content
    opened by daniel-stoneuk 1
Releases(1.1.5)
Owner
Adriel Café
Remote Android Developer
Adriel Café
View "injection" library for Android.

Kotter Knife Deprecated: This was a terrible idea because it allocates an object for every view reference. Do not use, and do not use anything like it

Jake Wharton 2.2k Dec 28, 2022
Android sliding panel that is part of the view hierarchy, not above it.

sliding-panel A ViewGroup that implements a sliding panel that is part of the view hierarchy, not above it. Difference from other libraries All other

Pierfrancesco Soffritti 441 Nov 12, 2022
:speedboat: Floating navigation view for displaying a list of items dynamically on Android.

Submarine Fully customizable floating navigation view for listing items dynamically on Android. Including in your project Gradle Add below codes to yo

Jaewoong Eum 460 Dec 21, 2022
Android View Lifecycle Extensions

Android View Lifecycle Extensions Extensions for Android View class that let you access a view lifecycle without having to create a custom view (exten

Thomas Gorisse 22 Dec 6, 2022
A simple project that describes the relationship between the view and it's viewmodel in android development

View-ViewModel-Communication A simple project that describes the relationship between the view and it's viewmodel in android development In MVVM archi

Segun Francis 1 Nov 6, 2021
Custom Sneaker view for Android.

SneakerView How to install ? You can add the library to your project using jitpack.io. Add the code below to your project's settings.gradle file. all

Osman Gül 3 Aug 26, 2022
ZoomHelper will make any view to be zoomable just like Instagram pinch-to-zoom

ZoomHelper ZoomHelper will make any view to be zoomable just like the Instagram pinch-to-zoom. ?? Installation ZoomHelper is available in the JCenter,

AmirHosseinAghajari 238 Dec 25, 2022
Arc Layout is a view group with which you can add a arc-shaped container in your layout.

ArcLayout Arc Layout is a view group with which you can add a arc-shaped container in your layout. Two main variables are the direction and the curvat

Ali Rezaiyan 32 Aug 17, 2022
A simple and easy adapter for RecyclerView. You don't have to make adapters and view holders anymore. Slush will help you.

한국어 No more boilerplate adapters and view holders. Slush will make using RecyclerView easy and fast. The goal of this project is to make RecyclerView,

SeungHyun 26 Sep 13, 2022
Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.

Dots What is Dots? Dots is a library that helps in implementing a simple yet effective dots indicator for the View Pagers used in your android code. I

Deepan 23 Feb 16, 2022