martinwithaar / PinchToZoom

Android's ImageView pinch-to-zoom made easy
MIT License
110 stars 27 forks source link

Nothing happens #2

Closed silviuungureanu closed 6 years ago

silviuungureanu commented 7 years ago

I have integrated the library as in the description and it does not work, unfortunately.

martinwithaar commented 7 years ago

Could you tell me how you test your app? What version of Android is your device running? What is your project's target API?

bvisonl commented 7 years ago

same thing here, I am doing something as simple as this:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ImageView imageView = (ImageView) findViewById(R.id.imageView2);
        imageView.setOnTouchListener(new ImageMatrixTouchHandler(this));
    }
    // I've tried passing the getApplicationContext() as well...

target: 25 android 5.0

Also, I am trying to do something this simple because the MainActivity.java doesn't display anything when I run that code.. everything compiles fine but the screen is just plain white.. so I decided to just take the piece that I need (pinch and zoom) and implement the viewpager myself

chrismeistre commented 7 years ago

I know this is old, but for anyone looking to resolve this, try using this:

imageView = (ImageView) findViewById(R.id.imageLarge);
imageView.setOnTouchListener(new ImageMatrixTouchHandler(imageView.getContext()));
martinwithaar commented 7 years ago

You indeed need to pass the view's context in order for it to work. I will update the documentation so that it is more clear.

Dinesh2411 commented 7 years ago

I also solved this issue by setting image view's context but i want to detect the state of image view whether it's zoomed or not in if it is possible

redviper00 commented 7 years ago

Its not working either way, neither by using view.getContext() nor by using imageView.getContext()

martinwithaar commented 6 years ago

@Dinesh2411 you should be able to detect this by inspecting the image matrix values.

martinwithaar commented 6 years ago

Closed due to lack of activity