igreenwood / loupe Goto Github PK
View Code? Open in Web Editor NEWTwitter-like Android image viewer library
Twitter-like Android image viewer library
Loupe is not available in repositories of mavenCentral.
Please consider publishing it there
JCenter deprecation and end of service: https://developer.android.com/studio/build/jcenter-migration
I would like to have the Android back button dismiss the loupe viewer if it is visible. I can just hide the ImageView and container, but then there's a bunch of listeners still attached and cleanup()
is private.
Environment
Let me know if this is something you'd be amenable to and I can create a PR to add this method.
when user just touch the imageview with single finger provide the callback as onClickListener()
If you don't set any background on FrameLayout, lupe.create will crash throwing
"java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference"
To Reproduce
Expected behavior
It will crash with "java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.setAlpha(int)' on a null object reference"
Environment
Current functionality just allows swiping up/down to dismiss. It would be super nice to allow horizontal swiping as well.
Environment
I updated the Loupe version 1.0.0
to 1.2.1
. Then found this issue. Once I open an image, it isn't properly centred. The user must either tap on the empty space or drag the image down to the centre. I then downgraded the version back to 1.0.0
then the issue disappeared.
The video below explains the issue.
Describe the bug
After swipe up or down to dismiss the activity, the shared image goes to the top left from the screen and the return animation starts from there.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The shared image should keep the position where the user stopped to scroll and the return animation should start from this position
Environment
Additional context
The problem is caused by the cleanup
method where the properties imageMatrix
and y
are setted to null
and 0
respectively
This is a great library. Do you have plans for more video integration? If so, that would be great
Describe the bug
I use a single-activity architecture with no fragments. I want to show an image viewer inside one of my screen views, dismiss it, and then show it again using the same ImageView. If I do that with the sample code provided, the imageview is not shown the second time you launch it.
Workaround
private fun showImageViewer(destination: ViewImage) {
binding.imageViewer.visibility = VISIBLE
binding.imageViewer.load(destination.url) {
listener(onSuccess = { _, _ ->
binding.imageViewerContainer.visibility = VISIBLE
val loupe = Loupe(binding.imageViewer, binding.imageViewer.parent as ViewGroup)
loupe.onViewTranslateListener = object : Loupe.OnViewTranslateListener {
override fun onDismiss(view: ImageView) {
binding.imageViewerContainer.visibility = INVISIBLE
binding.imageViewerContainer.removeOnLayoutChangeListener(loupe)
binding.imageViewerContainer.setOnTouchListener(null)
binding.imageViewer.imageMatrix = null
binding.imageViewer.y = 0f
binding.imageViewer.animate().cancel()
loupe.onViewTranslateListener = null
}
override fun onRestore(view: ImageView) {
}
override fun onStart(view: ImageView) {
}
override fun onViewTranslate(view: ImageView, amount: Float) {
}
}
})
}
}
Expected behavior
It would be much nicer if Loupe cleaned up after itself after onDismiss is called.
Environment
JCenter is shutting down. Please move this artefact to Maven Central and update the README.md
file with instructions.
Describe the bug
OnScaleChangedListener is only notified on manual zoom via pinch and on double tap zoom, but not on double-tap to return to default.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
OnScaleChangedListener is notified about zoom when return animation is in progress.
Environment
First congratulations on the project, it's really good and helped me this last week a lot!!
On my app, we have some logic running when the user zooms a picture, so it would be nice to have a callback sending us the scale factor and the X, Y focus.
I did a fork from the project and add it to make it works for our project, I can open a PR with the suggested changes.
Hi, very beautiful library
Wanted to ask if there is some way to allow swipe to the next image, when the current image is zoomed, without the need to un-zoom the current image to its initial state?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.