Skip to content

Commit

Permalink
update zoom callback
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjelijah committed Jun 22, 2018
1 parent 4e3180a commit 8040f62
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
//GLTextureView
public class ZoomableTextureView extends GLESTextureView {

public interface OnTouchCb{
void onTouchCb(View view,MotionEvent motionEvent);
}
private static final String SUPERSTATE_KEY = "superState";
private static final String MIN_SCALE_KEY = "minScale";
private static final String MAX_SCALE_KEY = "maxScale";
Expand All @@ -26,6 +29,11 @@ public class ZoomableTextureView extends GLESTextureView {
private float minScale = 1f;
private float maxScale = 5f;
private float saveScale = 1f;
OnTouchCb mCb;

public void setOnTouchCallback(OnTouchCb cb){
mCb = cb;
}

public void setMinScale(float scale) {
if (scale < 1.0f || scale > maxScale)
Expand Down Expand Up @@ -126,6 +134,9 @@ public boolean onTouch(View view, MotionEvent motionEvent) {
mode = DRAG;
break;
case MotionEvent.ACTION_UP:
if (mCb!=null && mode != ZOOM){
mCb.onTouchCb(view,motionEvent);
}
mode = NONE;
break;
case MotionEvent.ACTION_POINTER_DOWN:
Expand Down

0 comments on commit 8040f62

Please sign in to comment.