百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
A

Android-LoopView

> 编程语言
开源

自定义无限旋转控件

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

自定义无限旋转控件

Loop View for Android

English 中文

Android LoopView is a powerful widget for unlimited rotation picture, It provides some configuration options and good control the appearance and operational requirements.

Simple usage picture:

Custom layout usage picture:

Using LoopView in your application

If you are building with Gradle, simply add the following line to the dependencies section of your build.gradle file:

androidX

implementation 'com.zwenkai:loopview:2.0.1'

support

implementation 'com.kevin:loopview:1.5.6'

Simple Usage

Configured as View in layout.xml

To add the LoopView to your application, specify `


### Configured Programmatically ###

BannerView mBannerView = (BannerView) this.findViewById(R.id.main_act_banner); // set image loader, can set up any image engine. mBannerView.setImageLoader(new ImageLoader() { @Override public void loadImage(ImageView imageView, String url, int placeholder) { Glide.with(imageView.getContext()).load(url).into(imageView); } }); String json = LocalFileUtils.getStringFormAsset(this, "loopview_date.json"); LoopData loopData = new Gson().fromJson(json, LoopData.class); mBannerView.setData(loopData); // begin to loop mBannerView.startAutoLoop();

mBannerView.setOnItemClickListener(new BaseLoopAdapter.OnItemClickListener() { @Override public void onItemClick(View view, LoopData.ItemData itemData, int position) { // Open connection with browser Intent intent = new Intent(); intent.setData(Uri.parse(itemData.link)); intent.setAction(Intent.ACTION_VIEW); startActivity(intent); } });


## More configuration Usage ##

### XML Usage ###

If you decide to use BannerView as a view, you can define it in your xml layout like this:

xmlns:app="http://schemas.android.com/apk/res-auto"


### Programme Usage ###

// Set page switching transition time mLoopView.setScrollDuration(1000); // Set time interval mLoopView.setInterval(3000); // To initialize the data in a collection mLoopView.setData(List> data); // Initialized data in entity mode mLoopView.setData(LoopData rotateData); // Initialized data in a collection mode mLoopView.setData(List images); // Initialized data in a collection mode mLoopView.setData(List images, List links); // Initialized data in a collection mode mLoopView.setData(List images, List descs, List links); // Get the running loop date mLoopView.getData(); // Begin to auto Loop mLoopView.startAutoLoop(); // Begin to auto Loop delay mLoopView.startAutoLoop(long delayTimeInMills); // Stop to auto Loop mLoopView.stopAutoLoop(); // Set a custom loop layout mLoopView.setLoopLayout(int layoutResId);


### Notes: ###

In custom layout you must to use those ids `loop_view_pager` in ViewPager `loop_view_dots` in indicate point parent LinearLayout and `loop_view_desc` in description TextView;

Make sure you at least have `loop_view_pager`.

## License

    Copyright 2015 Kevin zhou

    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.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言