FlippableStackView


Source link: https://github.com/blipinsk/FlippableStackView

FlippableStackView

An Android library introducing a stack of Views with the first item being flippable.

Views inside the stack remain the aspect ratio of the FlippableStackView.

Library in action

Usage

For a working implementation of this library see the sample/ folder.

  1. Include the view inside your layout xml

    <com.bartoszlipinski.flippablestackview.FlippableStackView
    android:id="@+id/stack"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
  2. FlippableStackView is based on the specific PageTransformer used with the ViewPager. Therefore to fill the View you can use just a typical implementation of a PagerAdapter. In your onCreate method (or onCreateView for a fragment), setup all the parameters of the FlippableStackView.

    FlippableStackView stack = (FlippableStackView) findViewById(R.id.stack);
     stack.initStack(2);
     stack.setAdapter(mStackAdapter);
     //assuming mStackAdapter contains your initialized adapter

Important Note: The current implementation of the library will display the elements from the Adapter in the reverse order. In other words: view at position 0 of your adapter will be displayed at the bottom of the stack and view at position adapter.getCount()-1 will be visible first (available for the first flip).

Customization

The FlippableStackView is highly customizable to provide you with just the visual effect you really wanted.

There are three methods that allows for initialization of the stack:

  1. First one sets up the stack in the default way (scale-wise and orientation-wise):

    public void initStack(int numberOfStacked)
  2. The second one sets up the stack in the default way (scale-wise) but let's you choose the orientation of it:

    public void initStack(int numberOfStacked, StackPageTransformer.Orientation orientation)
  3. And the last one... a bit more advanced (lets you customize all the scale-related, orientation-related and alignment-related parameters):

    public void initStack(int numberOfStacked,
    
      StackPageTransformer.Orientation orientation,
    
      float currentPageScale,
    
      float topStackedScale,
    
      float overlapFactor,
    
      StackPageTransformer.Gravity gravity)

Be sure to read about all the parameters in Javadoc before using the last one.

Including In Your Project

You can grab the library via Maven Central. Just add a proper dependency inside your build.gradle. Like this:

dependencies {

  compile 'com.bartoszlipinski.flippablestackview:library:1.2.1' 
}

Developed by

  • Bartosz Lipi?ski

Credits

Maven Central deployment was performed using an awesome Gradle script by Chris Banes. This made things so much easier.

License

Copyright 2015 Bartosz Lipi?ski  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. 

Resources

Attempting to make convenient for working with ViewPager and PagerAdatper.

Android library for grabbing info from link using reactive way.

"Favor composition over inheritance" for ListView.

This library intends to help developers to parse QR text returned from any QR reader to an elegant form which you can display in a TextView.

This plugin add an inspection that check if Activity implements following method.

A small library containing two adapters which allow for easy fragment management with a NavigationView.

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