-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jsaura
committed
Jan 6, 2021
1 parent
5ceecbe
commit 7f14715
Showing
1 changed file
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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. | ||
|