Skip to content
🍞 The ultimate breadcrumbs view for Android!
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Fix state restoration crash Mar 5, 2019
gradle/wrapper
library Load typeface asynchronously Mar 12, 2019
.gitignore
KrumbsView.iml Allons-y! Feb 19, 2019
LICENSE.md Initial commit Feb 19, 2019
README.md Add Android Arsenal badge Mar 9, 2019
build.gradle Load typeface asynchronously Mar 12, 2019
demo.gif Update demo gif Feb 27, 2019
gradle.properties
gradlew
gradlew.bat
settings.gradle

README.md

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 {
    ...
    compile 'com.github.adrielcafe:krumbsview:$latestVersion'
}

Current version:

JitPack

XML

<cafe.adriel.krumbsview.KrumbsView
    ...
    app:krumbsStartItem="[string]"
    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)
    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 can’t perform that action at this time.