Coder Social home page Coder Social logo

breadcrumblayout's Introduction

BreadcrumbLayout

A simple breadcrumb view based on the design support library's TabLayout

Download

Maven:

    <dependency>
      <groupId>com.github.ayvazj.android</groupId>
      <artifactId>breadcrumblayout</artifactId>
      <version>0.1.0</version>
    </dependency>

or Gradle:

    compile 'com.github.ayvazj.android:breadcrumblayout:0.1.0'

Usage

Add the following to your layout

    <com.github.ayvazj.breadcrumblayout.BreadcrumbLayout
        android:id="@+id/breadcrumbLayout"
        android:layout_width="match_parent"
        android:layout_height="60dp"
        android:background="@android:color/white" />
/>

Code

    // add a breadcrumb
    breadcrumbLayout.addCrumb(breadcrumbLayout.newCrumb().setText("breadcrumb text"));
    
    // remove a breadcrumb
    breadcrumbLayout.removeCrumbAt(breadcrumbLayout.getCrumbCount() - 1);

    // listen for selections
    breadcrumbLayout.setOnBreadcrumbSelectedListener(new BreadcrumbLayout.OnBreadcrumbSelectedListener() {
        @Override
        public void onBreadcrumbSelected(BreadcrumbLayout.Breadcrumb crumb) {
            if ( crumb.getTag() != null && crumb.getTag() instanceof Pokemon) {
                imageView.setImageResource(((Pokemon)crumb.getTag()).drawableRes);
            }
            else {
                imageView.setImageDrawable(null);
            }
        }
    
        @Override
        public void onBreadcrumbUnselected(BreadcrumbLayout.Breadcrumb crumb) {
    
        }
    
        @Override
        public void onBreadcrumbReselected(BreadcrumbLayout.Breadcrumb crumb) {
    
        }
    });
        

License

Copyright 2016 James Ayvaz.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

breadcrumblayout's People

Contributors

ayvazj 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

breadcrumblayout's Issues

text size

Please guide how to set the text size in BreadcrumbLayout

Animation prevents adding more than 2 crumbs at the same time

Hi, I'm developing an application that uses this library.

I sometimes need to add more crumbs at the same time and I saw that if I add more than two, the third one and the following are not added.
Debugging the source code I noticed that this happens because , from the second crumb, in the addCrumb(@NonNull Breadcrumb crumb, int position, boolean setSelected) method, the animating flag value is true and it returns.

How can I solve this?

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.