Skip to content

Commit

Permalink
README.md updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsaura committed Jan 6, 2021
1 parent 5ceecbe commit 7f14715
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected])](https://twitter.com/jdsdhp)

## Including in your project
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 7f14715

Please sign in to comment.