Zoomy是一款简单易用的缩放Android图书馆
ZoomCenter在JCenter中可用,因此您只需将其添加为依赖关系即可
compile 'com.ablanco.zoomy:zoomy:{latest version}'
其中{latest version}
对应于JCenter中的已发布版本
##用法
要开始使用Zoomy,只需注册您想要可缩放的View
Zoomy.Builder builder = new Zoomy.Builder(this).target(mZoomableView);
builder.register();
就这样。现在您的意见可以缩小!
##定制
Zoomy允许在其行为中进行一些自定义:
ZoomyConfig config = new ZoomyConfig();
config.setZoomAnimationEnabled(false); //Enables zoom out animation when view is released (true by default)
config.setImmersiveModeEnabled(false); //Enables entering in inmersive mode when zooming a view (true by default)
Zoomy.setDefaultConfig(config);
Zoomy构建器还允许一些定制
Zoomy.Builder builder = new Zoomy.Builder(this)
.target(mZoomableView)
.enableImmersiveMode(false)
.animateZooming(false);
Zoomy.Builder builder = new Zoomy.Builder(this)
.target(mZoomableView)
.tapListener(new TapListener() {
@Override
public void onTap(View v) {
//View tapped, do stuff
}
})
.zoomListener(new ZoomListener() {
@Override
public void onViewStartedZooming(View view) {
//View started zooming
}
@Override
public void onViewEndedZooming(View view) {
//View ended zooming
}
});
Zoomy.Builder builder = new Zoomy.Builder(this)
.target(mZoomableView)
.interpolator(new OvershootInterpolator());
热门源码