Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of ZoomView #1

Open
gkapusta opened this issue Apr 16, 2014 · 5 comments
Open

Use of ZoomView #1

gkapusta opened this issue Apr 16, 2014 · 5 comments

Comments

@gkapusta
Copy link
Contributor

From [email protected] on January 29, 2013 22:40:51

My question is quite simple, how to ue ZoomView ?

I have put the jar in my buildpath, but after ?

When I tried this into myview.xml:

    <ZoomView>
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginBottom="5dip"
        android:src="@drawable/plan" />
    </ZoomView>

It crashes.

Original issue: http://code.google.com/p/android-zoom-view/issues/detail?id=1

@gkapusta
Copy link
Contributor Author

From [email protected] on January 29, 2013 13:43:38

01-29 22:33:22.082: E/android.view.InflateException(1449): Caused by: java.lang.ClassNotFoundException: android.view.ZoomView in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.montpellier.zoo-2.apk]

@gkapusta
Copy link
Contributor Author

From [email protected] on March 05, 2013 05:20:09

you must specifiy correct class path and proper layout params (zoom view is extension of framelayout)

you would also rather use fill_parent instead of wrap_content for zoomed image.

so try doing somethin like this:

<pl.polidea.view.ZoomView
android:layout_width="fill_parent"
android:layout_height="fill_parent">

</pl.polidea.view.ZoomView>

@gkapusta
Copy link
Contributor Author

From [email protected] on May 07, 2013 04:24:00

i am using zoomview.jar file everthing is fine but when i touch edges of layout it is automatically zooms in and zoom out how to fix this issue.

@gkapusta
Copy link
Contributor Author

From [email protected] on May 18, 2013 15:13:10

Hey,

I added the jar to the buildpath. I created the following xml:

<pl.polidea.view.ZoomView xmlns:android=" http://schemas.android.com/apk/res/android "
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

 <ImageView
        android:id="@+id/webcam1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_gravity="center"
        android:layout_marginBottom="20dp"
        android:scaleType="matrix" />

    <ImageView
        android:id="@+id/webcam2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:scaleType="matrix" />

</pl.polidea.view.ZoomView>

and added the following code to my activity:

View v = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE))
.inflate(R.layout.zoomable_view, null, false);
v.setLayoutParams(new LinearLayout.LayoutParams(
LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

    zoomView = new ZoomView(this);
    zoomView.addView(v);

    LinearLayout main_container = (LinearLayout) findViewById(R.id.LinearLayout1);
    main_container.addView(zoomView);

what am I doing wrong?
I get the following error:

Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class pl.polidea.view.ZoomView

Thank you!

@gkapusta
Copy link
Contributor Author

From [email protected] on May 29, 2013 03:13:46

inflating ZoomView from XML is not supported at the moment.
What is exactly in R.layout.zoomable_view? Is this a layout you posted?
If yes, you don't have to put ZoomView again in it. Just place images in FrameLayout instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant