From 1888bf3f568fe37189461b68c5529ce9870fe465 Mon Sep 17 00:00:00 2001 From: Alexandre Lision <alexandre.lision@savoirfairelinux.com> Date: Thu, 31 Oct 2013 09:51:41 -0400 Subject: [PATCH] * #31377: open incall contextual actions by singleTapup instead of LongPress --- res/layout/activity_call_layout.xml | 12 ++------- src/org/sflphone/model/BubbleUser.java | 2 +- src/org/sflphone/model/BubblesView.java | 33 ++++++++++++++----------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/res/layout/activity_call_layout.xml b/res/layout/activity_call_layout.xml index 595ee190d..efc6f4cfd 100644 --- a/res/layout/activity_call_layout.xml +++ b/res/layout/activity_call_layout.xml @@ -40,17 +40,9 @@ as that of the covered work. android:layout_width="300dp" android:layout_height="match_parent" /> - <RelativeLayout + <FrameLayout android:id="@+id/ongoingcall_pane" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layerType="hardware" > - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_centerInParent="true" - android:text="No call Displayed" /> - </RelativeLayout> + android:layout_height="match_parent" /> </org.sflphone.views.CallPaneLayout> \ No newline at end of file diff --git a/src/org/sflphone/model/BubbleUser.java b/src/org/sflphone/model/BubbleUser.java index 2cb67ffe6..ff968c1a2 100644 --- a/src/org/sflphone/model/BubbleUser.java +++ b/src/org/sflphone/model/BubbleUser.java @@ -113,7 +113,7 @@ public class BubbleUser extends Bubble { mSelector = new Paint(); mSelector.setStyle(Style.FILL); - mSelector.setColor(mContext.getResources().getColor(R.color.sfl_light_blue)); + mSelector.setColor(mContext.getResources().getColor(R.color.sfl_blue_9)); mButtonPaint = new Paint(); diff --git a/src/org/sflphone/model/BubblesView.java b/src/org/sflphone/model/BubblesView.java index bc9d78d6a..fe27b5285 100644 --- a/src/org/sflphone/model/BubblesView.java +++ b/src/org/sflphone/model/BubblesView.java @@ -332,6 +332,9 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, int action = event.getActionMasked(); + if (gDetector.onTouchEvent(event)) + return true; + if (action == MotionEvent.ACTION_UP) { if (thread.suspendFlag) { Log.i(TAG, "Relaunch drawing thread"); @@ -377,7 +380,7 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, // TODO return true; case Bubble.actions.MUTE: - + return true; case Bubble.actions.HANGUP: try { @@ -429,7 +432,7 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, // thread.holdDrawing(); } - return gDetector.onTouchEvent(event); + return true; } private Bubble getExpandedBubble() { @@ -468,17 +471,17 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, @Override public boolean onDown(MotionEvent event) { List<Bubble> bubbles = model.getBubbles(); - + Bubble target = getExpandedBubble(); - if(target != null){ + if (target != null) { target.onDown(event); return true; } for (int i = 0; i < bubbles.size(); i++) { Bubble b = bubbles.get(i); - if(b.onDown(event)) - dragging_bubble= true; + if (b.onDown(event)) + dragging_bubble = true; } return true; @@ -487,16 +490,13 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { // Log.d("Main", "onFling"); - return true; + return false; } @Override public void onLongPress(MotionEvent e) { // Log.d("Main", "onLongPress"); - if (isDraggingBubble() && callback.getConference().isOnGoing()) { - Bubble b = getDraggedBubble(e); - b.expand(model.width, model.height); - } + } private Bubble getDraggedBubble(MotionEvent e) { @@ -528,7 +528,7 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, b.speed.x = dx / dt; b.speed.y = dy / dt; - return true; + return false; } } return true; @@ -542,8 +542,13 @@ public class BubblesView extends SurfaceView implements SurfaceHolder.Callback, @Override public boolean onSingleTapUp(MotionEvent e) { - // Log.d("Main", "onSingleTapUp"); - return true; + if (isDraggingBubble() && callback.getConference().isOnGoing()) { + Bubble b = getDraggedBubble(e); + b.expand(model.width, model.height); + + } + return false; + } } } -- GitLab