4

I am having an xml file which I want to make zoomable.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Baby Be'el
  • 234
  • 1
  • 4
  • 12

1 Answers1

28

use this jar in your application

1.Create a new layout (R.layout.zoomableview) for Views that i want to apply the zooming functionality.

2.Place it inside ZoomView.

3.Then place the ZoomView to the main container where you want to show the zoomable view.

private ZoomView zoomView;

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

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

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

main_container = (LinearLayout) findViewById(R.id.main_container);
main_container.addView(zoomView);            }
Venkat
  • 3,447
  • 6
  • 42
  • 61