OfficialFoldingTabBar.Android


Source link: https://github.com/Yalantis/OfficialFoldingTabBar.Android

OfficialFoldingTabBar.Android

Folding Tab Bar and Tab Bar Menu

Inspired by our project on Dribbble

Read how we did it on our blog

##Requirements

  • Android SDK 19+

##Usage

Add to your root build.gradle:

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

Add the dependency:

dependencies {
  compile 'com.github.Yalantis:OfficialFoldingTabBar.Android:v0.9' 
}

How to use this library

  • Create menu.xml for your menu
<?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item

android:id="@+id/ftb_menu_nearby"

android:icon="@drawable/ic_nearby_icon"

android:title="Nearby"/>

<item

android:id="@+id/ftb_menu_new_chat"

android:icon="@drawable/ic_new_chat_icon"

android:title="Chat"/>

<item

android:id="@+id/ftb_menu_profile"

android:icon="@drawable/ic_profile_icon"

android:title="Profile"/>

<item

android:id="@+id/ftb_menu_settings"

android:icon="@drawable/ic_settings_icon"

android:title="Settings"/>  </menu>
  • Add FoldingTabBar into your layout
<RelativeLayout
  android:id="@+id/activity_main"
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:background="@color/colorAccent"
  tools:context="client.yalantis.com.foldingtabbarandroid.MainActivity">

...

<client.yalantis.com.foldingtabbar.FoldingTabBar

android:id="@+id/folding_tab_bar"

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_alignParentBottom="true"

android:layout_centerInParent="true"

android:layout_marginBottom="@dimen/activity_horizontal_margin"

app:menu="@menu/menu_tab_bar"/>

...

</RelativeLayout>
  • Initialize it in your java/kotlin code
FoldingTabBar tabBar = (FoldingTabBar) findViewById(R.id.folding_tab_bar);

Features

  • We have useful callbacks for you - Handle menu items clicks:
 tabBar.setOnFoldingItemClickListener(new FoldingTabBar.OnFoldingItemSelectedListener() {

 @Override

 public boolean onFoldingItemSelected(@NotNull MenuItem item) {

  return false;

 
}

}
);

and one more to handle main button clicks:

  tabBar.setOnMainButtonClickListener(new FoldingTabBar.OnMainButtonClickedListener() {

@Override

public void onMainButtonClicked() {

 
}

  
}
);
  • Attributes for customizing FoldingTabBar:

Name | Description | --- | --- | --- app:itemPadding | sets padding for your menu items. Default item padding is 17dp. app:mainImage | here you can link your image resource for the main image. app:selectionColor | our menu supports color selection. You can change the menu’s color here.

Let us know!

We’d be really happy if you sent us links to your projects where you use our component. Just send an email to [email protected] And do let us know if you have any questions or suggestion regarding the animation.

P.S. We’re going to publish more awesomeness wrapped in code and a tutorial on how to make UI for iOS (Android) better than better. Stay tuned!

##License

The MIT License (MIT)  Copyright © 2016 Yalantis  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. 

Resources

Android library with some Widgets and handy pieces of code I have developed.

Library contains:

  • Horizontal list.
  • Horizontal list with support for item removal.
  • Horizontal list with endless repeating of items.
  • CoverFlow widget derived from endless horizontal list.
  • ContentBand widget which allows for specify finer positioning of views inside scroll-able band using coordinates

Android CoverFlow widget with demo. Forked from ma-components.

DSAvataImageView is a subclass of ImageView to create a circle avatar image view with user name initial image view.

This library is used for converting Bitmap or Drawable images to Round or Circular Shape.

The Google APIs Client Library for Java is a flexible, efficient, and powerful Java client library for accessing any HTTP-based API on the web, not just Google APIs.

The library has the following features:

  • A powerful OAuth 2.0 library with a consistent interface.
  • Lightweight, efficient XML and JSON data models that support any data schema.
  • Support for protocol buffers.
  • A set of generated libraries for Google APIs.

RxJava-Optional allows to use Optional with RxJava.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes