If I wanted to reference an int from another class how would I go about doing that?
public class Zoom extends View {
private Drawable image;
public int zoomControler = 20;
public Zoom(Context context) {
super(context);
image=context.getResources().getDrawable(R.drawable.icon);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
image.setBounds((getWidth ()/2)-zoomControler,
(getHeight()/2)-zoomControler,
(getWidth ()/2)+zoomControler,
(getHeight()/2)+zoomControler);
image.draw(canvas);
}
}
class HelloOnTouchListener implements OnTouchListener{
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
return true;
}
}
In this case I want to reference the zoomControler
from the first class in the second HelloOnTouchListener
class.