Coder Social home page Coder Social logo

finn-no / showroom Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maxhves/showroom

0.0 2.0 0.0 11.77 MB

A fully contained and complete image gallery view component library for Android ๐Ÿ–ผ

License: Apache License 2.0

Kotlin 100.00%

showroom's Introduction



Showroom

Showroom is an image gallery library built for Android. The aim of this library is to provide a single view component that provides an image gallery experience almost completely out-of-the-box with as little configuration from the consumer as possible. The project utilizes Kotlin and is very much in active development.

Note: currently the project is using a Release Canditate version of the AndroidX Core KTX library, this is to get access to the latest compatibility APIs that the library has to offer due to issues with immersive mode pre version 1.5.0.

Features

The project makes use of the following features:

  • Highly customizable
  • Pre-defined customizable gallery UI
  • Optional infinite image scrolling
  • Immersion toggling
  • Support for API versions 21 to 30
  • Simple design

Third Party Libraries

Currently, the project also makes use the following open source libraries:

Show me it

Dependency

This library is currently accessible via JitPack and can therefore be used in your project by adding the following to your build.gradle file:

dependencies {
    implementation 'com.github.finn-no:showroom:1.1.5'
}

Setup

Please see the sameple app for a more detailed example of a suggested way to setup this project in your own app.

Initial setup

Showroom should be instantiated by calling the provided attach() function:

showroom.attach((activity as AppCompatActivity), provideGalleryData())

Whereby activity must by of type AppCompatActivity and provideGalleryData must be of type List<GalleryData>

Exiting the gallery

In the case of supporting custom routines when click the 'exit' icon in the gallery the following callback is provided:

showroom.setNavigationExitEvent { /** exit routine */  }

Further to this, Showroom provides a function to reset the activity state upon exit, you may choose to use this in, for example onDestroy or inside of an onBackPressed event:

override fun onDestroy() {
    super.onDestroy()
    showroom.restoreWindowPreGallery()
}

Display cutout

For devices running Android 9 (API level 28) and above, there is a possiblity that the device will have a cutout. Therefore it is strongly encouraged that you support display cutouts in your app. If you don't then unexpected graphical issues will occur when entering/exiting immersive mode. A suggested way to support display cutouts is by adding the following to your MainActivity:

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
        window.attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
    }
}

Releases

The current release is v1.1.5 found at the respective link otherwise visit releases for the complete list.

License

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.

showroom's People

Contributors

maxhves avatar kvitvik avatar elisabethfindahl avatar

Watchers

James Cloos 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.