Skip to content

A full screen gallery with pinch to zoom and tap to hide navigation that pages through a set of image urls

License

Notifications You must be signed in to change notification settings

jt-gilkeson/FullScreenGallery

Repository files navigation

FullScreenGallery

A full screen gallery with pinch to zoom and tap to hide navigation that pages through a set of image urls

Installation

Add the following dependency to your build.gradle file

repositories {
    maven { url "https://jitpack.io" }
}
	
dependencies {
    implementation 'com.github.jt-gilkeson:fullscreengallery:0.3.1'
}

How to use it

Add GalleryActivity to your AndroidManifest

<activity android:name="com.jt.gallery.GalleryActivity"/>

Usage

To launch the gallery, simply use the newIntent method then start the activity.

Kotlin:

startActivity(
    GalleryActivity.newIntent(
        this,
        listOf(
            "http://www.gstatic.com/webp/gallery/1.jpg",
            "http://www.gstatic.com/webp/gallery/2.jpg",
            "http://www.gstatic.com/webp/gallery/3.jpg",
            "http://www.gstatic.com/webp/gallery/4.jpg",
            "http://www.gstatic.com/webp/gallery/5.jpg"
        )
    )
)

Java:

startActivity(
    GalleryActivity.newIntent(
        this,
        Arrays.asList(
            "http://www.gstatic.com/webp/gallery/1.jpg",
            "http://www.gstatic.com/webp/gallery/2.jpg",
            "http://www.gstatic.com/webp/gallery/3.jpg",
            "http://www.gstatic.com/webp/gallery/4.jpg",
            "http://www.gstatic.com/webp/gallery/5.jpg"
        )
    )
);

Optional Parameters

When you call newIntent, you can optionally specify:

currentImage: Initial image to display (index for imageList)

useFullBrightness: Set screen brightness to full (useful for displaying barcodes)

allowDelete: Allows user to long press to delete image. To use this feature you should startActivityForResult, and to get the updated list you can call getStringArrayListExtra(GalleryActivity.IMAGE_LIST) for the intent returned in onActivityResult.

Known apps using this library

About

A full screen gallery with pinch to zoom and tap to hide navigation that pages through a set of image urls

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages