PhotoViewSlider - Android应用程序一个简单图片浏览器

网友投稿 781 2022-10-23 20:49:01

PhotoViewSlider - Android应用程序一个简单图片浏览器

PhotoViewSlider

Gradle Dependency

dependencies { // ... other dependencies compile 'io.github.jeancsanchez.photoviewslider:photoviewslider:1.2.0'}

Maven

io.github.jeancsanchez.photoviewslider photoviewslider 1.2.0 pom

Getting Started

You only need a PhotosViewSlider on your Layout Activity.

Code Setup

Setup the view on your Activity

photoViewSlider = (PhotosViewSlider) findViewById(R.id.photosViewSlider);

Option 1: Set the urls on demand and initialize the photo view.

photoViewSlider.setPhotoUrl("http://awesomeimg.com.br", "any description");photoViewSlider.setPhotoUrl("http://awesomeimg.com.br");photoViewSlider.initializePhotos();

Option 2: Create a list of String urls, so initialize the photo view.

stringsList = new ArrayList<>();stringsList.add("http://awesomeimg.com.br");stringsList.add("http://awesomeimg.com.br");photoViewSlider.initializePhotosUrls(stringsList);

Option 3: Create a list of Photo objects and set the values to it, so initialize the photo view .

photoList = new ArrayList<>();Photo photo1 = new Photo();photo1.setImage("http://modmyi.com/attachments/forums/iphone-4-4s-new-skins-themes-launches/555329d1322802429-ice-cream-sandwich-android-4-0-a-android_ice_cream_sandwich_electronic_bytes.png");photo1.setDescription("Android Ice Cream Sandwich");Photo photo2 = new Photo();photo2.setImage("http://cdn.gigjets.com/wp-content/uploads/2012/10/Android-Jelly-Bean-Logo-Sort-Of.jpg");photo2.setDescription("Android Jelly Bean");photoList.add(photo1);photoList.add(photo2);photoViewSlider.initializePhotos(photosList);

Change transition animation (Optional)

photoViewSlider.setTechniqueAnimation(Techniques.BounceIn);

TO DO LIST

Make the recycler view "responsive"

Thanks

Picasso[Android View Animations] (https://github.com/daimajia/AndroidViewAnimations)

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:SpiritJS 构建web应用程序的现代模块化库
下一篇:漂亮MM和普通MM的区别
相关文章