From 8040f62df032de9c296585b61973a14a5faed656 Mon Sep 17 00:00:00 2001 From: Bjelijah Date: Fri, 22 Jun 2018 15:43:32 +0800 Subject: [PATCH] update zoom callback --- .idea/caches/build_file_checksums.ser | Bin 724 -> 724 bytes .../api/player/ZoomableTextureView.java | 11 +++++++++++ 2 files changed, 11 insertions(+) diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index 0894feb212747830bf12ab5267e725dd85d72b52..a6a8ee3e5196cb117d7b8e319b540729eaf866e7 100644 GIT binary patch delta 15 Xcmcb@dWChu3>LM#!;?17v0wrKG_3|t delta 15 Xcmcb@dWChu3>K#4YF9SSv0wrKGPni_ diff --git a/howellsdk/src/main/java/com/howellsdk/api/player/ZoomableTextureView.java b/howellsdk/src/main/java/com/howellsdk/api/player/ZoomableTextureView.java index bf9f640..238299f 100644 --- a/howellsdk/src/main/java/com/howellsdk/api/player/ZoomableTextureView.java +++ b/howellsdk/src/main/java/com/howellsdk/api/player/ZoomableTextureView.java @@ -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"; @@ -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) @@ -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: