Skip to content

kibotu/MediaGallery

Repository files navigation

Donation About Jan Rabe

MediaGallery Hits-of-Code Javadoc Build Status API Gradle Version Kotlin GitHub license androidx

Simple full screen media gallery

Screenshot

Features:

  • list of imageMedia objects
  • list of video media objects
  • asset uris
  • hls uris
  • file uri
  • youtube
  • 360
  • youtube 360
  • images
  • streaming urls
  • click listener
  • zoomable
  • translatable
  • player controls
  • blurry
  • crossfade background
  • quit button
  • swipe down to quit
  • preload
  • preload progressbar
  • viewpager indicators
  • resume seek position
  • scroll to position
  • return scroll position
  • configuration change events (orientation|screenSize|screenLayout|keyboardHidden)
  • no dot indicator if there is only one element

How to use

MediaGalleryActivity.Builder.with(this) {
    autoPlay = true
    isBlurrable = true
    isTranslatable = true
    isZoomable = true
    showVideoControls = true
    showVideoControlsTimeOut = 1750
    autoPlay = true,
    scrollPosition = 0
    smoothScroll = true
    preload = media.size
    showPageIndicator = true
    media = mutableListOf<MediaData>().apply {
        add(youtubeVideo)
        add(youtube360Video)
        add(youtubeHlsVideo)
        add(assetVideo)
        add(externalStorageVideo)
        add(internalStorageVideo)
        add(hlsVideo)
        add(fileVideo)
    }
}.startActivity()

Style

Page Indicator

    <color name="default_selected_dot_color">@color/colorPrimary</color>
    <color name="default_dot_color">@color/colorPrimaryDark</color>

How to install

repositories {
    maven {
	url "https://jitpack.io"
    }
}

dependencies {
    implementation 'com.github.kibotu:MediaGallery:-SNAPSHOT'
}

Notes

Follow me on Twitter: @wolkenschauer

Let me know what you think: jan.rabe@kibotu.net

Contributions welcome!

License

Copyright 2021 Jan Rabe

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.