Coder Social home page Coder Social logo

androidimageslider's Introduction

#Android Image Slider

This is an amazing image slider in Android platform. I decide to open source this because there is really not an attractive,and convenient slide widget in Android.

You can easily load image from net,drawable or file. And there are many kind of amazing animations you can choose. :-D

##Demo

Download Apk

##Usage

<com.daimajia.slider.library.SliderLayout
        android:id="@+id/slider"
        android:layout_width="match_parent"
        android:layout_height="200dp"
/>

There are some default indicators, while,if you want to custom your own indicator:

<com.daimajia.slider.library.Indicators.PagerIndicator
        android:id="@+id/custom_indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        />

====

##Some Details

###SliderLayout

SliderLayout is a compound layout, contains:

  • PagerIndicator : actually extends from LinearLayout),
  • InfiniteViewPager : a wrapper of ViewPager
  • BaseTransformer : a slider transformer instance, this can be used to implement effects transform.
  • BaseAnimationInterface: user custom animation.

####Properties:

  • Indicator
    • indicator_visibility : visibile | invisible
    • auto_cycle : true | false
    • pager_animation: Default | Accordion | Background2Foreground | CubeIn | DepthPage | Fade | FlipHorizontal | FlipPage | Foreground2Background | RotateDown | RotateUp | Stack | Tablet | ZoomIn | ZoomOutSlide | ZoomOut
    • pager_animation_span : the slider animation time length. integer, milliseconds

###PagerIndicator

PagerIndicator is extended from LinearLayout. It is bind with a adapter, detect the adapter item count by adapter.getCount() , and then add ImageView into the LinearLayout.

There are two kind indicators, selected status and unselected status.

  • Both properties:

    • shape : oval(default) | rect , the shape of indicator (if you set your custom drawable, then this will not work).
    • visibility visibile | invisible
  • Selected indicator's properties:

    • selected_drawable : if you set this drawable, then the below settings will not work.
    • selected_color
    • selected_width
    • selected_height
    • selected_padding_left
    • selected_padding_right
    • selected_padding_top
    • selected_padding_bottom
  • Unselected indicator properties:

    • unselected_drawable : if you set this drawable, then the below settings will not work.
    • unselected_color
    • unselected_width
    • unselected_height
    • unselected_padding_left
    • unselected_padding_right
    • unselected_padding_top
    • unselected_padding_bottom

###BaseTransformer

A PageTransformer is invoked whenever a visible/attached page is scrolled. You can add slide animation by extends BaseTransformer. And add your animation effect into onTransform() method. I supply a lot of examples, if you are not so clear on PageTransformer, you can learn from them, and try to make your own.

###BaseAnimationInterface

If you need to manipulate your slide view(for example: add an animation to a target view, when slide animation is finished), to make it simple, I made an interface to help you to concentrate on the view that are animating. You can see the example if you want to make your own.

##About me

A student in China mainland. I love Google, love Android, love everything that interesting. If you get any problems when using this library or you have an internship opportunity, please feel relax to email me. :-D

androidimageslider's People

Contributors

daimajia 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.