Picture viewer, daLao to provide better service for you in pursuit of user experience it can 1, click the picture with a seamless smooth animation switch to the picture view interface, also with a seamless smooth animation exit picture view interface 2, support multi-picture view, quick page turning, double click to enlarge, click exit, 3, pull down to exit the operation of viewing pictures, and the effect is the biggest selling point of this View (imitating wechat)

download

DemoApp.apk

Supreme experience; DaLao dedicated; Not enough Gif? Download APK for your own experience; /doge

Implementation steps

First, in the XML layout

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <! -- some layout here --> <ch.ielse.demo.p02.ImageWatcher android:id="@+id/v_image_watcher" android:layout_width="match_parent" android:layout_height="match_parent"/> <! - in the cover to the bottom of the layout of a ImageWatcher ImageWatcher initialization is INVISIABLE by default -- > < / FrameLayout >Copy the code

After that, the Activity onCreate usually needs to call these three apis for simple initialization

ImageWatcher vImageWatcher = (ImageWatcher) findViewById(R.id.v_image_watcher); / / if the status bar is transparent, you need to give ImageWatcher marked an offset value, to correct click ImageView start animation Y starting point of view of incorrect vImageWatcher. SetTranslucentStatus (! isTranslucentStatus ? Utils.calcStatusBarHeight(this) : 0); / / configuration error icon vImageWatcher. SetErrorImageRes (R.m ipmap. Error_picture); / / long according to the pictures of the callback, you can display a box to provide some copy, send the function such as vImageWatcher. SetOnPictureLongPressListener (this);Copy the code

By this time all your preparations will have been completed

/** * @param ImageView * @param ImageView * @param ImageView * @param ImageView * @param urlList List of loaded image urls. The number must be greater than or equal to imageGrouplist.size. Public void show(ImageView I, List<ImageView> imageGroupList, final List<String> urlList) { ... }Copy the code

And the last thing you need to do is call vimageWatcher.show () and you can look at the source code demo, and this project will work, this project will work, this project will work

Write in the last

Why did I write this Demo? 1. DaLao can save some development time for those who have this function requirement on the project. 2

Ps: I should write more demos because of the goal above, every Star of yours is my motivation to struggle, thank you/lick

Q group of 274306954