Giter Club home page Giter Club logo

loupe's People

Contributors

adrianolc avatar edenman avatar igreenwood avatar vitaliybelyaev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

loupe's Issues

v1.2.1 - Image is not centered

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.

vid.mp4

Remaining Tasks

  • Add overscroll action(optional)
  • Update sample(list -> detail)
    • add data binding
    • add groupie
    • implement master and detail screen
    • implement swipe down animation
    • implement shared elements(required)
    • implement setting view
    • implement view pager(optional)
  • Refactor
  • Add ProGuard
  • Create gif image of README.md
  • Create app icon
  • Add README.md
  • Release to jCenter

View state is not cleared on dismiss

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

  • Library Version: 1.0.1

Feature Request: ability to programmatically dismiss

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

  • Library Version: 1.0.2

Let me know if this is something you'd be amenable to and I can create a PR to add this method.

Feature request: have a onScaleChangedListener to listener the zoom changes.

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.

Environment

  • Library Version: 1.0.2

Shared element return animation starting from the screen top left

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:

  1. Go to details activity or the activity opened with the shared element scene
  2. Scroll down to dismiss
  3. The image first go straight to top left screen then the animation return begins

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

  • Library Version: 1.0.2

Additional context
The problem is caused by the cleanup method where the properties imageMatrix and y are setted to null and 0 respectively

It crashes if the container has no background

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

  1. Go to your xml file
  2. In your framelayout container don't set any background
  3. try to create loupe

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

  • Library Version: 1.2.2
  • Device: HUAWEI ANE-LX1
  • OS: Android 9.0

OnScaleChangedListener not notified on zoomOutToMinimumScale

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:

  1. Attach OnScaleChangedListener to Loupe instance
  2. Double tap to zoom, OnScaleChangedListener is notified
  3. Double tap again to return to default zoom

Expected behavior
OnScaleChangedListener is notified about zoom when return animation is in progress.

Environment

  • Library Version: 1.2.1
  • Device: Emulator
  • OS: Android 11

Image disappears on drag/fling

Image does not center automatically if the user drags it out of the screen even if UseFlingToDismissGesture is false.

ezgif com-optimize

Migrate to Maven Central

JCenter is shutting down. Please move this artefact to Maven Central and update the README.md file with instructions.

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.