Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ivanespitiac/sliderimage
Kotlin library to load images with a view pager with indicator and fullscreen.
https://github.com/ivanespitiac/sliderimage
android fresco fullscreen image image-viewer images indicator kotlin kotlin-android library slider slider-image slides viewpager
Last synced: 3 months ago
JSON representation
Kotlin library to load images with a view pager with indicator and fullscreen.
- Host: GitHub
- URL: https://github.com/ivanespitiac/sliderimage
- Owner: ivanespitiac
- License: apache-2.0
- Created: 2018-08-16T20:46:23.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-29T23:31:18.000Z (over 5 years ago)
- Last Synced: 2023-07-28T10:09:34.487Z (over 1 year ago)
- Topics: android, fresco, fullscreen, image, image-viewer, images, indicator, kotlin, kotlin-android, library, slider, slider-image, slides, viewpager
- Language: Java
- Homepage:
- Size: 69.3 KB
- Stars: 13
- Watchers: 1
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# SliderImage
Libreria de carrusel de imagenes por medio de una o mas String URL.
Desarrollada en kotlin 1.1.51, utilizando fresco para la carga de imagenes.Slider image library for images with diferent URI types.
Fresco Library reference (https://frescolib.org/docs/supported-uris.html)
```
TYPE SCHEME FETCH METHOD USED
File on network http://, https:// HttpURLConnection or network layer
File on device file:// FileInputStream
Content provider content:// ContentResolver
Asset in app asset:// AssetManager
Resource in app res:// as in res:///12345 Resources.openRawResource
Data in URI data:mime/type;base64, Following data URI spec (UTF-8 only)
```Requere la habilitacion de la aceleracion por hardware.
```
android:hardwareAccelerated="true"
```## Implementacion:
```
dependecies {
implementation 'io.github.ivanespitiac:imageslider:1.0.3'
}
```
```
repositories {
maven { url 'https://jitpack.io' }
}
```## Uso:
Agrega el componente en la interfa grafica: (Add the component to UI)
```
```
Agrega el component a nivel de codigo: (Add the component programatically)
```
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
// Create slider image component
val sliderImage = SliderImage(this)
// add images URLs
val images = listOf(
"url image",
"url image",
"url image")
// Add image URLs to sliderImage
slider.setItems(items)
// Add slider component to a container
container_main_images.addView(slider)
}
```Añadir tiempo para recorrer imagenes automaticamente: (Add timer to show images automatically.)
```
slider.addTimerToSlide(2000)
```Remover tiempo añadido anteriormente: (Remove timer to show images)
```
slider.removeTimerSlide()
```Inicializar el objeto SliderImage (Init SliderImage component programatically)
```
val slider = SliderImage(context)
```lista de url de imagenes cargadas en el slider: (Get URLs array from component)
```
slider.getItems()
```funciones porporcionadas por el slider:
```
slider.onPageListener(onPageScroll = { position, offSet, offSetPixels ->
logD("position $position offSet: $offSet pixels $offSetPixels")
}, onPageStateChange = { state ->
logD("State change $state")
}, onPageSelected = { position ->
logD("page select $position")
})
```Lanzar full screen activity sin inicializar el component (view pager open full screen automatically when press page, but if you want to use only full screen image slider, you can use the next line):
```
SliderImage.openfullScreen(items = items, position = 0)
```obtener propiedades del indicador (get circle indicator from 'me.relex:circleindicator:1.2.2@aar'):
```
slider.getIndicator()
```## License
```
Copyright (C) 2014 relexLicensed 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 athttp://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.
```