Git Product home page Git Product logo

gallaryslide's Introduction

GallarySlide

untitled

Download

Use Maven :

<dependency>
  <groupId>com.duongsonthong.gallarySlide</groupId>
  <artifactId>gallaryslide</artifactId>
  <version>1.0</version>
  <type>pom</type>
</dependency>

Use Gradle:

compile 'com.duongsonthong.gallarySlide:gallaryslide:1.0'

How to use?

  • first : create main slide
<android.support.v4.view.ViewPager
     android:id="@+id/main_slide"
     android:layout_width="match_parent"
     android:layout_height="300dp"/>
  • second : create indicator slide under main slide
<com.sip.gallaryslide.IndicatorViewPager
     android:id="@+id/indicator"
     android:paddingLeft="@dimen/card_padding"
     android:paddingRight="@dimen/card_padding"
     android:paddingStart="@dimen/card_padding"
     android:layout_below="@id/main_slide"
     android:layout_width="wrap_content"
     android:layout_height="60dp"/>
  • Configurate slideshow on MainActivity

    Create a String array which hold links image, for example

    String[] links = new String[5];
     links[0] = "http://img.f10.giaitri.vnecdn.net/2017/03/28/Kevin-Costner-1490673411_660x0.jpg";
     links[1] = "http://img.f12.giaitri.vnecdn.net/2017/03/28/kevin-costner-2-1490673023_660x0.jpg";
     links[2] = "http://img.f11.giaitri.vnecdn.net/2017/03/28/kevin-costner-3-1490673024_660x0.jpg";
     links[3] = "http://img.f12.giaitri.vnecdn.net/2017/03/28/kevin-costner-4-1490673024_660x0.jpg";
     links[4] = "http://img.f11.giaitri.vnecdn.net/2017/03/28/kevin-costner-5-1490673024_660x0.jpg";

    Create MainSliderAdapter with links array above

    MainSliderAdapter mainSliderAdapter = new MainSliderAdapter(links);

    set adapter for main slide

     ViewPager mainSlider = (ViewPager)findViewById(R.id.main_slide);
    mainSlider.setAdapter(mainSliderAdapter);

    set the number of images is displayed on Indicator and then set main slide for indicator

    IndicatorViewPager indicatorViewPager = (IndicatorViewPager)findViewById(R.id.indicator);
    indicatorViewPager.setImageVisible(3).setMainSlide(mainSlider);

Demo

ย dowload on Play store

gallaryslide's People

Contributors

duongsonthong avatar thongds avatar

Watchers

James Cloos 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.