Personally my problem is the second one. I need to expand a ImageView
with that well known tweezers movement, but I'm already on the third day researching the internet how to do and hitting my head, but the most I got was a tutorial code that only enlarges the image, not allowing the the enlarged image it only magnifies at a fixed point and stays. I will be putting the code and I would like to know how to implement the movement of the image or if someone can help, put a code right, because as I said I hit too much head and nothing came out here rsrs. Hugs.
public class tela87 extends SherlockFragmentActivity {
private ImageView img;
private Matrix matrix = new Matrix();
private float scale = 1f;
private ScaleGestureDetector SGD;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.tela835gavetti);
img = (ImageView)findViewById(R.id.imageView1);
SGD = new ScaleGestureDetector(this,new ScaleListener());
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
SGD.onTouchEvent(ev);
return true;
}
private class ScaleListener extends ScaleGestureDetector.
SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
scale *= detector.getScaleFactor();
scale = Math.max(0.1f, Math.min(scale, 5.0f));
matrix.setScale(scale, scale);
img.setImageMatrix(matrix);
return true;
}
}
}