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

JazzyViewPager

> 编程语言
开源

一个易于使用的 ViewPager,添加了一组令人惊叹的自定义滑动动画。只需将您的 ViewPager 更改为 JazzyViewPager,再做两步,就可以使用了。

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

工具介绍

一个易于使用的 ViewPager,添加了一组令人惊叹的自定义滑动动画。只需将您的 ViewPager 更改为 JazzyViewPager,再做两步,就可以使用了。

JazzyViewPager

An easy to use ViewPager that adds an awesome set of custom swiping animations. Just change your ViewPagers to JazzyViewPagers and you're good to go!

If you're looking at the name of the library and thinking "... so what does jazz have to do with it?" I'd like to direct you to the following definition that I found in a dictionary:

jazz someone or something up:
	to make someone or something more exciting or sexy;
	to make someone or something appeal more to contemporary tastes.

The aim of this library is to do exactly this: jazz up the normal, everyday ViewPager

I've included a pretty barebones apk to show what the TransitionEffect.Tablet animation does. The example app will get better, but this is just to get something in your hands quickly :D!

This project was inspired by CyanogenMod's Trebuchet launcher.

Animations Available

The JazzyViewPager's animations are encapsulated in TransitionEffect. I'll be adding more, but if you can think of anything in particular, let me know by filing an "Enhancement" in the Issues section.

public enum TransitionEffect {
    	Standard,
		Tablet,
		CubeIn,
		CubeOut,
		Flip,
		Stack,
		ZoomIn,
		ZoomOut,
		RotateUp,
		RotateDown,
		Accordion
	}

You can select your animation by calling

private JazzyViewPager mJazzy;
/* ... */
mJazzy.setTransitionEffect(TransitionEffect.*);

Modifying your PagerAdapter

Due to the limitations of the ViewPager class (which JazzyViewPager is built upon) in order to get the animations to work correctly for more than 3 Views, you'll have to add the following to the instantiateItem method of your PagerAdapter.

private JazzyViewPager mJazzy;
/* ... */
@Override
public Object instantiateItem(ViewGroup container, final int position) {
    Object obj = super.instantiateItem(container, position);
	mJazzy.setObjectForPosition(obj, position);
	return obj;
}

Once your Object is registered with the JazzyViewPager, you're good to go!

License

Copyright 2013 Jeremy Feinstein

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.

GitHub Issues· 0 开放

在 GitHub 查看全部

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

核心特点

  • •Java

> 标签

Java

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

> 工具信息

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

> 相关工具

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