# viewer **Repository Path**: shaodongAndroid/viewer ## Basic Information - **Project Name**: viewer - **Description**: No description available - **Primary Language**: Android - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2024-09-25 - **Last Updated**: 2024-09-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Viewer [![](https://jitpack.io/v/com.sunzn/viewer.svg)](https://jitpack.io/#com.sunzn/viewer) [![](https://img.shields.io/badge/License-Apache%202.0-orange.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) ### ScreenShot ![Sample](./screen/001.gif) ![Sample](./screen/002.gif) ### Gradle #### 1. Add the JitPack repository to your build file. ```groovy allprojects { repositories { ... maven { url 'https://jitpack.io' } } } ``` #### 2. Add the dependency. ```groovy dependencies { implementation 'com.sunzn.viewer:viewer:1.1.0' } ``` ### How to use #### 1. Create a java bean class implements ImageEntry. ```kotlin data class Image(var name: String?, var url: String?) : ImageEntry { override fun initImageUrl(): String? { return url } override fun initImageTxt(): String? { return name } } ``` #### 2. Fill data and browse pictures. ```kotlin val data: ArrayList = ArrayList() for (i in 0..10) { data.add( Image( i.toString(), "http://pic1.win4000.com/mobile/2019-11-22/5dd73dfccb5a7.jpg" ) ) } ImageViewer().setTransformer(Transformer.STACK).setImages(data).setPosition(0).view(this) ``` #### 3. Custom theme, improve UI display. ```xml ``` ```xml ... ``` ### License ``` Copyright [2019-2024] sunzn 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. ```