question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImageView loaded with Picasso from url and pinch zoom not working

See original GitHub issue

I have problem with creating pinch to zoom effect, as i load ImageView into PhotoViewAttacher. ImageView was previously created with picasso from remote server url source.

Here is my code:

FullScreenActivity

public class FullScreenActivity extends AppCompatActivity {

private ImageView imageView;
private PhotoViewAttacher photoViewAttacher;


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_full_screen);

    imageView = (ImageView) findViewById(R.id.photoView);

        String imageUrl = getIntent().getExtras().getString("imageUrl");
    Picasso.with(getApplicationContext())
            .load(imageUrl)
            .into(imageView);


    photoViewAttacher = new PhotoViewAttacher(imageView);
    photoViewAttacher.update();

}

}`

Layout

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
    android:id="@+id/photoView"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

</FrameLayout>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
gohvcommented, May 28, 2017
ImageView imageView = (ImageView) findViewById(R.id.photo_view);
        Intent intent = getIntent();
        String imagePath = intent.getExtras().getString("IMAGE_");
Picasso.with(this).load(imagePath).into(imageView);

Where:

    <com.github.chrisbanes.photoview.PhotoView
        android:id="@+id/photo_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

Super simple.

4reactions
cse-msncommented, Feb 12, 2018

Still not working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ImageView loaded with Picasso from url and pinch zoom not ...
I have problem with creating pinch to zoom effect, as i load ImageView into PhotoViewAttacher. ImageView was previously created with picasso ...
Read more >
How to implement Pinch Zoom in Picasso library?
Picasso library is used only to load the images from network. You need to address your request with other library such as PhotoView...
Read more >
Java – How to implement Pinch Zoom in Picasso library – iTecNote
Everything is working fine but I just can't figure out how to implement Pinch Zoom for all images that are being loaded from...
Read more >
Android Image Gallery App: Using Gestures and Transition
Create an Android Gallery using Glide and support for gestures. Learn about shared element transitions between RecyclerView and a ViewPager.
Read more >
Pinch to Zoom Android ImageView Tutorial - Coding Demos
Learn how to build pinch to zoom Android function, where you can tap on Android ImageView to see image inside an AlertDialog and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found