#FlycoBanner-Master
A powerful android view looper library animing to simplify this high frequency function in daily development. Support for Android 2.2 and up.
#Background
Image loop banner is high frequency used in most apps. So is the app of the company I work for. At first, this is only used in home page. Later with the app update, there are some simliar functions needed in other pages both image and text. I copy the same code here and there, finally I can not standing copying anymore. I explore on the github to find libs that meet my needs. Though I find some poewful libs, but the lib what I want should support view looping not only ImageView. And I do not want a lib having a ImageLoad Framework inside.
So I decide to code a libray with features below:
>
* Use Executors instead of Task
* Supports both normal banner and endless auto loop banner
* Supports inflate item view and logic operation such as loading image outside.
* Supports set source using data list with different entity
* Supports smartly pause scroll and continue scroll.
* Touch down pause. Touch up continue.
* Window of activty off pause.Window of activty on continue.
* Supports inner indictaors
* Supports page transformer (not often used in my daily work, just support this feature for others if needed)
##Demo
![](https://github.com/H07000223/FlycoBanner_Master/blob/master/preview_FlycoBanner.gif)
####[Here is a DemoApk download](http://fir.im/7qzm)
##Gradle
```groovy
dependencies{
compile 'com.android.support:support-v4:22.2.1'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.flyco.banner:FlycoBanner_Lib:1.1.8@aar'
}
```
##Usage
###Extends BaseIndicaorBanner and Set Data Type
```Java
public class SimpleImageBanner extends BaseIndicaorBanner<BannerItem, SimpleImageBanner> {
private ColorDrawable colorDrawable;
public SimpleImageBanner(Context context) {
this(context, null, 0);
}
public SimpleImageBanner(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public SimpleImageBanner(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
colorDrawable = new ColorDrawable(Color.parseColor("#555555"));
}
@Override
public void onTitleSlect(TextView tv, int position) {
final BannerItem item = list.get(position);
tv.setText(item.title);
}
@Override
public View onCreateItemView(int position) {
View inflate = View.inflate(context, R.layout.adapter_simple_image, null);
ImageView iv = ViewFindUtils.find(inflate, R.id.iv);
final BannerItem item = list.get(position);
int itemWidth = dm.widthPixels;
int itemHeight = (int) (itemWidth * 360 * 1.0f / 640);
iv.setScaleType(ImageView.ScaleType.CENTER_CROP);
iv.setLayoutParams(new LinearLayout.LayoutParams(itemWidth, itemHeight));
String imgUrl = item.imgUrl;
if (!TextUtils.isEmpty(imgUrl)) {
Glide.with(context)
.load(imgUrl)
.override(itemWidth, itemHeight)
.centerCrop()
.placeholder(colorDrawable)
.into(iv);
} else {
iv.setImageDrawable(colorDrawable);
}
return inflate;
}
}
```
###The Most Complex
in layout xml
``` xml
<com.flyco.bannersamples.banner.SimpleImageBanner
android:id="@+id/sib_the_most_comlex_usage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
banner:bb_barColor="#88000000"
banner:bb_barPaddingBottom="5dp"
banner:bb_barPaddingLeft="10dp"
banner:bb_barPaddingRight="10dp"
banner:bb_barPaddingTop="5dp"
banner:bb_delay="2"
banner:bb_indicatorGravity="RIGHT"
banner:bb_isAutoScrollEnable="true"
banner:bb_isBarShowWhenLast="true"
banner:bb_isIndicatorShow="true"
banner:bb_isLoopEnable="true"
banner:bb_isTitleShow="true"
banner:bb_period="10"
banner:bb_scale="0.5625"
banner:bb_textColor="#ffffff"
banner:bb_textSize="13.5sp"
banner:bib_indicatorCornerRadius="3dp"
banner:bib_indicatorGap="8dp"
banner:bib_indicatorHeight="6dp"
banner:bib_indicatorSelectColor="#ffffff"
banner:bib_indicatorStyle="CORNER_RECTANGLE"
banner:bib_indicatorUnselectColor="#88ffffff"
banner:bib_indicatorWidth="6dp"/>
```
int Java Code
``` Java
sib
.setSelectAnimClass(ZoomInEnter.class) //set indicator select anim
.setSource(DataProvider.getList()) //data source list
.setTransformerClass(ZoomOutSlideTransformer.class) //set page transformer
.startScroll();
```
###The Simplest
in layout xml
``` xml
<com.flyco.bannersamples.banner.SimpleImageBanner
android:id="@+id/sib_simple_usage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
banner:bb_scale="0.5625"/>
```
int Java Code
``` Java
sib
.setSource(DataProvider.getList())
.startScroll();
```
###Attributes
####BaseBanner
|name|format|description|
|:---:|:---:|:---:|
| bb_scale | float |scale of Banner height and width,height/screenWidth
| bb_isLoopEnable | boolean |is LoopViewPager or not,default true
| bb_delay | integer |delay before start scroll,unit second,default 5 seconds
| bb_period | integer |scroll period,unit second,default 5 seconds
| bb_isAutoScrollEnable | boolean |is auto scroll enable,default true
| bb_barColor | color |set bootom bar color,default transparent
| bb_isBarShowWhenLast | boolean |set bottom bar show or not when the position is the last
| bb_barPaddingLeft | dimension |set bottom bar padding,unit dp
| bb_barPaddingTop | dimension |set bottom bar padding,unit dp
| bb_barPaddingRight | dimension |set bottom bar padding,unit dp
| bb_barPaddingBottom | dimension |set bottom bar padding,unit dp
| bb_textColor | color |set title text color,default "#ffffff"
| bb_textSize | dimension |set title text size,unit sp,default 14sp
| bb_isTitleShow | boolean |set title show or not,default true
| bb_isIndicatorShow | boolean |set indicator show or not,default true
| bb_indicatorGravity |enum| Gravity.CENTER or RIGHT or LEFT.if gravity equals CENTER,title will not be supported,default CENTER
####BaseIndicaorBanner
|name|format|description|
|:---:|:---:|:---:|
| bib_indicatorStyle |enum|indicator style, `STYLE_DRAWABLE_RESOURCE` or `STYLE_CORNER_RECTANGLE`
| bib_indicatorWidth | dimension |indicator width, unit dp, default 6dp
| bib_indicatorHeight | dimension |indicator height,unit dp,default 6dp
| bib_indicatorGap | dimension |gap between two indicators,unit dp,default 6dp
| bib_indicatorSelectColor | color |indicator select color for `STYLE_CORNER_RECTANGLE`, default `"#ffffff"`
| bib_indicatorUnselectColor | color |indicator unselect color for `STYLE_CORNER_RECTANGLE`, default `"#88ffffff" `
| bib_indicatorCornerRadius | dimension |indicator corner raduis for `STYLE_CORNER_RECTANGLE`,unit dp, default 3dp
| bib_indicatorSelectRes | reference |indicator select drawable resource for `STYLE_DRAWABLE_RESOURCE`
| bib_indicatorUnselectRes | reference |indicator unselect drawable resource for `STYLE_DRAWABLE_RESOURCE`
##Thanks
* [LoopingViewPager](https://github.com/imbryk/LoopingViewPager)
* [NineOldAndroids](https://github.com/JakeWharton/NineOldAndroids)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
各种android弹出dialog效果以及各种dialog样式大全,项目中包含十多种dialog样式和风格,以及弹出和退出效果。 谢谢Flyco分享的,在这里我整理到IT蓝豹上面供大家学习研究。 本项目中主要由两个部分组成,一就是FlycoDialog_lib,二是FlycoAnimation_lib两个项目构成。以后方便大家直接集成。
资源推荐
资源详情
资源评论
收起资源包目录
Android 自定义Dialog多种效果 源码 (347个子文件)
FlycoBanner_Lib-debug.aar 32KB
FlycoBanner_Lib-release.aar 32KB
MediaSessionCompat.aidl 787B
MediaSessionCompat.aidl 787B
ParcelableVolumeInfo.aidl 689B
ParcelableVolumeInfo.aidl 689B
PlaybackStateCompat.aidl 688B
PlaybackStateCompat.aidl 688B
MediaMetadataCompat.aidl 680B
MediaMetadataCompat.aidl 680B
RatingCompat.aidl 673B
RatingCompat.aidl 673B
resources-debug.ap_ 179KB
resources-debug-androidTest.ap_ 3KB
resources-debug-androidTest.ap_ 765B
app-debug.apk 809KB
app-debug-unaligned.apk 809KB
gradlew.bat 2KB
fileSnapshots.bin 128KB
taskArtifacts.bin 56KB
fileHashes.bin 35KB
outputFileStates.bin 21KB
gradle_project_sync_data.bin 651B
BaseBanner.class 17KB
BaseBanner.class 17KB
BannerHomeActivity.class 8KB
BaseIndicaorBanner.class 8KB
BaseIndicaorBanner.class 8KB
SimpleImageBanner.class 4KB
LoopViewPager.class 4KB
LoopViewPager.class 4KB
LoopPagerAdapterWrapper.class 4KB
LoopPagerAdapterWrapper.class 4KB
UserGuideActivity.class 3KB
SimpleGuideBanner.class 3KB
BannerDialog.class 3KB
DataProvider.class 3KB
BaseAnimator.class 3KB
BaseAnimator.class 3KB
LoopViewPager$1.class 3KB
LoopViewPager$1.class 3KB
BaseBanner$InnerBannerAdapter.class 3KB
BaseBanner$InnerBannerAdapter.class 3KB
R$styleable.class 2KB
R$styleable.class 2KB
R$styleable.class 2KB
R$styleable.class 2KB
R$styleable.class 2KB
R$styleable.class 2KB
BaseBanner$2.class 2KB
BaseBanner$2.class 2KB
BannerHomeActivity$14.class 2KB
SimpleTextBanner.class 2KB
T.class 2KB
R$attr.class 2KB
R$attr.class 2KB
BaseBanner$InnerBannerAdapter$1.class 2KB
BaseBanner$InnerBannerAdapter$1.class 2KB
BaseAnimator$1.class 1KB
BaseAnimator$1.class 1KB
R$attr.class 1KB
R$attr.class 1KB
R$attr.class 1KB
R$attr.class 1KB
ZoomOutSlideTransformer.class 1KB
ZoomOutSlideTransformer.class 1KB
UserGuideActivity$1.class 1KB
BannerHomeActivity$10.class 1KB
BannerHomeActivity$9.class 1KB
BannerHomeActivity$1.class 1KB
BannerHomeActivity$5.class 1KB
BannerHomeActivity$8.class 1KB
BaseIndicaorBanner$ReverseInterpolator.class 1KB
BaseIndicaorBanner$ReverseInterpolator.class 1KB
BannerHomeActivity$4.class 1KB
BannerHomeActivity$7.class 1KB
BannerHomeActivity$12.class 1KB
BannerHomeActivity$11.class 1KB
BannerHomeActivity$6.class 1KB
BannerHomeActivity$13.class 1KB
BannerDialog$1.class 1KB
ViewFindUtils.class 1KB
R$id.class 1KB
SimpleGuideBanner$1.class 1KB
DepthTransformer.class 1KB
DepthTransformer.class 1KB
BannerHomeActivity$15.class 1013B
RotateDownTransformer.class 1012B
RotateDownTransformer.class 1012B
ZoomInEnter.class 1009B
ZoomInEnter.class 1009B
FixedSpeedScroller.class 1004B
FixedSpeedScroller.class 1004B
BaseBanner$3.class 994B
BaseBanner$3.class 994B
RotateUpTransformer.class 982B
RotateUpTransformer.class 982B
RotateEnter.class 974B
RotateEnter.class 974B
NoAnimExist.class 969B
共 347 条
- 1
- 2
- 3
- 4
资源评论
LeBron_Six
- 粉丝: 802
- 资源: 208
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- DSP开发实战教程-国产DSP替代进口TI DSP的使用技巧 进芯DSP替换文件
- 植被恢复能力估算python代码(KNDVI代码).zip
- 基于java打造的深度学习框架,帮助你快速搭建神经网络,实现模型推理与训练,引擎支持自动求导,多线程与GPU运算
- 界线与不动产测绘智能计算经纬度及标注软件
- CANOPEN使用方法与教程
- 极影毁片圆 · 电脑字体设置.zip
- 同态加密部分算法实现Homomorphic-Encryption-main.zip
- helib同态加密socket通信helibsocket-master.zip
- pll_inst.vhd
- 快速入门同态加密homomorphic-encryption-master.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功