GithubHelp home page GithubHelp logo

oneplussongxuguang / cycleviewpager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from androiddevelop/cycleviewpager

0.0 1.0 0.0 1.49 MB

循环滚动,自动播放的ViewPager

Home Page: http://www.androiddevelop.cn

License: Apache License 2.0

Java 100.00%

cycleviewpager's Introduction

CycleViewPager


####系统要求 ######android 4.0以上

####快速使用 ######1. 导入CycleViewPager项目:该项目是一个库,在对应项目的java build path中添加该项目

######2. 在layout中引入cn.androiddevelop.cycleviewpager.lib.CycleViewPager这个Fragment.

  <fragment
    android:id="@+id/cycleViewPager"
android:name="cn.androiddevelop.cycleviewpager.lib.CycleViewPager"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
3. 在Activity(Fragment)中设置CycleViewPager的views以及滚动与轮播属性
CycleViewPager cycleViewPager = (CycleViewPager) getFragmentManager()
			.findFragmentById(R.id.cycleViewPager);
// 设置循环,在调用setData方法前调用
cycleViewPager.setCycle(true);

// 在加载数据前设置是否循环
cycleViewPager.setData(views);

// 设置自动播放
cycleViewPager.setWheel(true);

####例子 ######项目中给出了6个例子,可以直接运行项目或者下载项目中得apk进行查看效果

1. NoCycleTextView

######没有滚动的CycleTextView,与ViewPager相同

2. CycleTextView

######可以滚动的CycleTextView

3. WheelCycleTextView

######可以滚动与自动切换的CycleTextView

4. EventCycleTextView

######监听CycleTextView滚动事件

5. FixedCycleTextView

######固定高度的CycleTextView

6. NestedCycleTextView

######CycleTextView嵌套在ViewPager中,实现拨动CycleTextView时外层ViewPager不滚动

####api文档 javadoc

####注意事项

1. 设置是否循环需要在设置数据之前,即在setData前调用setCycle,CycleViewPager默认不循环。
2. 外层有viewPager时,需要继承cn.androiddevelop.cycleviewpager.lib.BaseViewPager。
3. 设置自动播放时,CycleViewPager自动为可循环滚动.滚动是轮播的基础。

cycleviewpager's People

Contributors

androiddevelop avatar

Watchers

 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.