diff --git a/README.md b/README.md index afc03ea..108b71c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ A simple and useful Android Gallery. [![JitPack](https://jitpack.io/v/jdsdhp/gallery-droid.svg)](https://jitpack.io/#jdsdhp/gallery-droid) [![API](https://img.shields.io/badge/API-17%2B-red.svg?style=flat)](https://android-arsenal.com/api?level=17) -[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/jdsdhp/gallery-droid/blob/master/LICENSE) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Twitter](https://img.shields.io/badge/Twitter-@jdsdhp-9C27B0.svg)](https://twitter.com/jdsdhp) ## Including in your project @@ -127,6 +127,25 @@ fragment.onItemClickListener = object : OnPictureItemClickListener { } } ``` +##### Using just fragment detail +It's a way to use your own activity or fragment instead of using PictureDetailActivity as the default detail view handler. PicturePagerFragment is the one that contains the image viewer and can be used directly through a transition after having created your own OnPictureItemClickListener and having set "autoClickHandler" to false. + +In your own onClick method: +```kotlin +override fun onClick(picture: Picture, position: Int){ + supportFragmentManager + .beginTransaction() + .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE) //Optional + .replace(R.id.container, + PicturePagerFragment.newInstance( + pictures, + position, + transformerId + ) + ) + .commit() +} +``` ## Sample project It's very important to check out the sample app. Most techniques that you would want to implement are already implemented in the examples.