码迷,mamicode.com
首页 > 其他好文 > 详细

一个仿爱奇艺视频,腾讯视频,搜狐视频首页推荐位轮播图类库

时间:2016-08-30 14:46:20      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:

前言:本篇只是一个介绍这个一个类库,具体实现思路代码会下篇中进行分析出来,

一个仿爱奇艺视频,腾讯视频,搜狐视频首页推荐位轮播图类库,  github地址: https://github.com/hejunlin2013/SuperIndicator , 
如果觉得还行,欢迎点个star。

SuperIndicator

a superindicatorlibray for viewpager, banner

  • 仿爱奇艺视频,腾讯视频,搜狐视频首页推荐位轮播图
  • 专业轮播图库,没有之一
  • 也可以应用于广告位banner
  • 支持无限循环(4->5,5->1),可以自己设定点的样试
  • 图片支持设置圆角边
  • 只需要几行代码就能写了banner图

效果图

技术分享

SuperIndicator

爱奇艺视频,腾讯视频,搜狐视频首页推荐位轮播图

技术分享技术分享技术分享

Gradle

如果引用不到包,可以把library拷贝你的工程中,在setting.gradle中include下,也是一样。

dependencies {
    compile ‘com.hejunlin.superindicatorlibray:superindicatorlibray:1.0.2
}

Usage

xml

<com.hejunlin.superindicatorlibray.CircleIndicator
        android:id="@id/indicator"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:layout_gravity="right|center_vertical"
        android:layout_marginRight="@dimen/dimen_14dp"
        android:gravity="center"
        android:orientation="horizontal" />

<com.hejunlin.superindicatorlibray.LoopViewPager
        android:id="@+id/viewpager"
        android:layout_width="match_parent"
        android:layout_marginTop="@dimen/dimen_25dp"
        android:layout_height="@dimen/dimen_400dp"/>

java

    ViewPager viewpager = (ViewPager) view.findViewById(R.id.viewpager);
    CircleIndicator indicator = (CircleIndicator) view.findViewById(R.id.indicator);
    viewpager.setAdapter(mPageAdapter);
    indicator.setViewPager(viewpager);

欢迎关注我的个人公众号,android 技术干货,问题深度总结,FrameWork源码解析,插件化研究,最新开源项目推荐

技术分享

License

Copyright (C) 2016 hejunlin

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.

 

 
 

一个仿爱奇艺视频,腾讯视频,搜狐视频首页推荐位轮播图类库

标签:

原文地址:http://www.cnblogs.com/hejunlin/p/5821940.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!