Code Monkey home page Code Monkey logo

loopbar's Introduction

LoopBar Awesome

Header image

Meet LoopBar - Tab Bar with Infinite Scrolling for Android by Cleveroad

At Cleveroad we’ve recently come to realize that navigation through categories in an app using nothing but a navigation panel is pretty boring and trivial. That’s why, armed with our designer’s creativity, we introduce you our new component for Android-based applications -- LoopBar. The idea was to make the navigation menu right at fingerprints, in a tab bar. What's more the view has a few specific features that make it stand out from the crowd of similar ones. So, try out the LoopBar library in your app and you’ll see the difference.

Demo image

If you strive to create an application with unusual looks and navigation, you are welcome to use the LoopBar library. It’s really easy to integrate and can add spice to any app!

If you need more details on how you can use the component and what benefits it provides, read our blog post: Case Study: Loop Bar for Android

Article image

Awesome

Setup and usage

Installation

by gradle :

dependencies {
    compile "com.cleveroad:loopbar:1.0.0"
}

or just download zip and import module "LoopBar-widget" to be able to modify the sources

Features

View consist from two parts:

  • An infinite list of your selectable groups
  • Selected view

A list of groups will be infinite if all adapter items didn't fit on screen in other case it will be a static list. Selected view by request could overlay layout on screen on which it placed. Widget has horizontal and vertical layouts and also start or end gravity of selected view.

You are allowed to use any RecyclerView adapter, which you want. Concrete infinite scroll logic is fully incapsulated

Android Studio layouts preview is supported.

Usage

    <com.cleveroad.loopbar.widget.LoopBarView
        android:id="@+id/endlessView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:enls_placeholderId="@id/placeHolder"
        app:enls_orientation="horizontal"
        app:enls_selectionGravity="start"
        app:enls_selectionMargin="10dp"
        app:enls_overlaySize="5dp"
        app:enls_selectionInAnimation="@animator/enls_scale_restore"
        app:enls_selectionOutAnimation="@animator/enls_scale_small"
        app:enls_selectionBackground="@android:color/holo_blue_dark"
        />

enls_overlaySize & enls_placeholderId are used for overlay feature.

attribute name description
enls_overlaySize a size of selected view overlaying
enls_placeholderId an id of view on which you should use layout:above or other attributes of RelativeLayouts, because LoopBarView will have increased height in this case. See more in sample
enls_selectionGravity a gravity of selection view. Can be vertical or horizontal. Default horizontal
enls_selectionMargin a margin of selectionView from bounds of view. Default 5dp
enls_selectionInAnimation an animation of appearing an icon inside selection view
enls_selectionOutAnimation an animation of hiding an icon inside selection view
enls_selectionBackground selection background. Default #ff0099cc
android:background View have yellow background by default. Use standart android:background attribute to change it. Default #ffc829

To initialize items in widget and work with it you should setup adapter to it and add item click listener:

LoopBarView loopBarView = findViewById(..);
categoriesAdapter = new SimpleCategoriesAdapter(MockedItemsFactory.getCategoryItemsUniq());
loopBarView.setCategoriesAdapter(categoriesAdapter);
loopBarView.addOnItemClickListener(this);

Here SimpleCategoriesAdapter is used which required collection of ICategoryItem objects (to draw default view with icon and text). And also you are free to use your own adapter with custom items.

To control wrapped RecyclerView animations you are able to use getWrappedRecyclerView().


#### Support #### * * * If you have any other questions regarding the use of this library, please contact us for support at [email protected] (email subject: "LoopBar. Support request.") Also pull requests are welcome.
#### License #### * * * The MIT License (MIT)
Copyright (c) 2016 Cleveroad Inc.

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.

loopbar's People

Contributors

jekaua avatar

Watchers

James Cloos avatar  avatar

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.