GithubHelp home page GithubHelp logo

imagesadapter's Introduction

Build Status

ImagesAdapter

A RecyclerView.Adapter that allows to add, remove, blur and slideshow images inside a RecyclerView.

This is how it works with allowDelete = false

alt text

This is with allowDelete = true

alt text

Installing

Add the JitPack.io repository to the project build.grade:

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

Then import the latest version in the build.gradle of the modules you need:

dependencies {
    implementation 'com.github.Lamba92:imagesAdapter:{latest_version}'
}

Getting Started

Create a new ImagesAdapter and assign it to a RecyclerView:

val imagesAdapter = ImagesAdapter(context) //by default allowDelete = false
recyclerView.adapter = imagesAdapter

Then add all the image files:

imagesAdapter.add(file)  //single file, by default isImageNew = true
imagesAdapter.add(files, false) //a List of files

Keep in mind that isImageNew flag changes the behaviour of the delete fab. If set to true, tapping the fab will remove the image from the adapter completely. If set to false tapping the fab will blur the image and the image won't be present in the list returned by getImages()

To retrieve the images inside the adapter use getImages(type: ImagesType)

imagesAdapter.getImages(ImagesAdapter.ImagesType.NewImages) //by default type = ImagesType.NewImages
imagesAdapter.getImages(ImagesAdapter.ImagesType.OldImages).apply{
    //do something with the images List
}

Check the KDocs.

Author

imagesadapter's People

Contributors

lamba92 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.