walker引导页

[复制链接]
来自: MrlLee 分类: Android精品源码 上传时间: 2016-4-14 17:50:45
Tag:walker 引导页

项目介绍:

Permalink
Failed to load latest commit information.
gradle/wrapper walker gets up.
sample Rename sample
walker Rename sample
.gitignore Rename sample
CHANGE_LOG.md Rename sample
LICENSE walker gets up.
README.md Update README.md
build.gradle Rename sample
gradle.properties walker gets up.
gradlew walker gets up.
gradlew.bat walker gets up.
settings.gradle Rename sample
walker.gif Rename sample

walker



Android Arsenal





Easy to create cool walkthrough page.



Inspired by BWWalkthrough.



Usage



Page



public class PageFragment extends WalkerFragment {

public static final String TAG = PageFragment.class.getSimpleName();

public static final int PAGE_POSITION = 0;

private WalkerLayout walkerLayout;

public static PageFragment newInstance() {
Bundle args = new Bundle();
PageFragment fragment = new PageFragment();
fragment.setArguments(args);
return fragment;
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.page, container, false);
}

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
walkerLayout = (WalkerLayout) view.findViewById(R.id.walker);

// Adjust speed
walkerLayout.setSpeed(new PointF(1.0f, 0.0f));
walkerLayout.setSpeedVariance(new PointF(1.2f, 0.0f));

// Enable alpha
walkerLayout.setEnableAlphaAnimation(true);

// Basic animate (Linear, Curve, Zoom, InOut)
walkerLayout.setAnimationType(WalkerLayout.AnimationType.InOut);

// Custom animation
walkerLayout.setAnimationType(WalkerLayout.AnimationType.Custom);
walkerLayout.setCustomAnimationListener(new WalkerLayout.CustomAnimationListener() {
@Override
public void animate(int index, float offset, WalkerLayout.Direction direction) {
View child = walkerLayout.getChildAt(index);
String tag = String.valueOf(child.getTag());
switch (tag) {
case "1":
child.setRotation((180.0f) * (1.0f - offset));
break;
case "2":
child.setTranslationX(0.0f);
child.setTranslationY((1.0f - offset) * 200);
break;
}
}
});

// Tag list that view does not animate.
walkerLayout.setIgnoredViewTags(Arrays.asList("1", "2"));

// Setup layout (MUST call
walkerLayout.setup();
}

@Override
protected int getPagePosition() {
return PAGE_POSITION;
}

@Override
protected WalkerLayout getWalkerLayout() {
return walkerLayout;
}
}


Gradle



[Java] 查看源文件 复制代码
repositories {
    jcenter()
}

dependencies {
    compile 'com.goka:walker:1.0.0'
}

相关源码推荐:

我来说两句
所有评论(9)
.Right 2016-4-18 20:22:52
楼主威武啊,安卓巴士有你更给力!
回复
a824210678 2016-4-21 14:10:31
强烈支持楼主ing……
回复
wow185 2016-4-25 14:39:12
感谢分享,安卓巴士有你更精彩:)
回复
11428224 2016-5-3 18:59:04
我只是路过打酱油的。
回复
雪洗中关村 2016-7-5 10:55:33
精华内容,楼主V5!
回复
Zcmirror 2016-7-20 00:27:47
淡定,淡定,淡定……
回复
shu_1123 2016-8-1 14:21:29
很给力,安卓巴士有你更精彩!
回复
12下一页
提取码:  下载次数:9 状态:已购或VIP 售价:10(原价:10)金钱 下载权限:初级码农 
1235 0 9
代码贡献英雄榜
用户名 下载数
联系我们
首页/微信公众账号投稿
帖子代码编辑/版权问题
QQ:435399051,1294855032
如何获得代码达人称号?
如何成为签约作者?
领先的中文移动开发者社区
18620764416
7*24全天服务
意见反馈:1294855032@qq.com

扫一扫关注我们

Powered by Discuz! X3.2© 2001-2019 Comsenz Inc.( 粤ICP备15117877号 )