comments: fixed indentation
diff --git a/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java b/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java
index f0d6b02..e012af2 100644
--- a/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java
+++ b/src/com/savoirfairelinux/sflphone/fragments/CallFragment.java
@@ -45,6 +45,7 @@
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
+import android.inputmethodservice.InputMethodService;
import android.os.Bundle;
import android.os.RemoteException;
import android.util.Log;
@@ -252,14 +253,15 @@
// TODO Auto-generated catch block
e.printStackTrace();
}
-// Toast.makeText(getActivity(), "Transfer complete", Toast.LENGTH_LONG).show();
+ // Toast.makeText(getActivity(), "Transfer complete", Toast.LENGTH_LONG).show();
break;
case TransferDFragment.RESULT_TRANSFER_NUMBER:
String to = data.getStringExtra("to_number");
transfer = data.getParcelableExtra("transfer");
try {
-// Toast.makeText(getActivity(), "Transferring " + transfer.getContact().getmDisplayName() + " to " + to, Toast.LENGTH_SHORT).show();
+ // Toast.makeText(getActivity(), "Transferring " + transfer.getContact().getmDisplayName() + " to " + to,
+ // Toast.LENGTH_SHORT).show();
mCallbacks.getService().transfer(transfer.getCallId(), to);
mCallbacks.getService().hangUp(transfer.getCallId());
} catch (RemoteException e) {
@@ -327,40 +329,40 @@
}
model.clearAttractors();
-// model.addAttractor(new Attractor(new PointF(model.width * 0.9f, model.height * 0.1f), ATTRACTOR_SIZE, new Attractor.Callback() {
-// @Override
-// public boolean onBubbleSucked(Bubble b) {
-// Log.w(TAG, "Bubble sucked ! ");
-//
-// if (b.associated_call.getContact().isUser()) {
-//
-// try {
-// if (conf.hasMultipleParticipants())
-// mCallbacks.getService().hangUpConference(conf.getId());
-// else
-// mCallbacks.onCallEnded(conf.getParticipants().get(0));
-//
-// model.clearAttractors();
-// } catch (RemoteException e) {
-// e.printStackTrace();
-// }
-//
-// } else {
-// mCallbacks.onCallEnded(b.associated_call);
-// }
-// bubbleRemoved(b);
-// return true;
-// }
-// }, hangup_icon));
+ // model.addAttractor(new Attractor(new PointF(model.width * 0.9f, model.height * 0.1f), ATTRACTOR_SIZE, new Attractor.Callback() {
+ // @Override
+ // public boolean onBubbleSucked(Bubble b) {
+ // Log.w(TAG, "Bubble sucked ! ");
+ //
+ // if (b.associated_call.getContact().isUser()) {
+ //
+ // try {
+ // if (conf.hasMultipleParticipants())
+ // mCallbacks.getService().hangUpConference(conf.getId());
+ // else
+ // mCallbacks.onCallEnded(conf.getParticipants().get(0));
+ //
+ // model.clearAttractors();
+ // } catch (RemoteException e) {
+ // e.printStackTrace();
+ // }
+ //
+ // } else {
+ // mCallbacks.onCallEnded(b.associated_call);
+ // }
+ // bubbleRemoved(b);
+ // return true;
+ // }
+ // }, hangup_icon));
-// model.addAttractor(new Attractor(new PointF(model.width * .8f, model.height * 0.9f), ATTRACTOR_SIZE, new Attractor.Callback() {
-// @Override
-// public boolean onBubbleSucked(Bubble b) {
-// Log.w(TAG, "Bubble sucked ! ");
-// makeTransfer(b);
-// return true;
-// }
-// }, transfer_icon));
+ // model.addAttractor(new Attractor(new PointF(model.width * .8f, model.height * 0.9f), ATTRACTOR_SIZE, new Attractor.Callback() {
+ // @Override
+ // public boolean onBubbleSucked(Bubble b) {
+ // Log.w(TAG, "Bubble sucked ! ");
+ // makeTransfer(b);
+ // return true;
+ // }
+ // }, transfer_icon));
// if (conf.hasMultipleParticipants()) {
// model.addAttractor(new Attractor(new PointF(model.width / 1.1f, model.height * .9f), ATTRACTOR_SIZE, new Attractor.Callback() {
@@ -428,15 +430,15 @@
model.clearAttractors();
-// model.addAttractor(new Attractor(new PointF(model.width / 2f, model.height * .9f), 40, new Attractor.Callback() {
-// @Override
-// public boolean onBubbleSucked(Bubble b) {
-// Log.w(TAG, "Bubble sucked ! ");
-// mCallbacks.onCallEnded(conf.getParticipants().get(0));
-// bubbleRemoved(b);
-// return true;
-// }
-// }, hangup_icon));
+ // model.addAttractor(new Attractor(new PointF(model.width / 2f, model.height * .9f), 40, new Attractor.Callback() {
+ // @Override
+ // public boolean onBubbleSucked(Bubble b) {
+ // Log.w(TAG, "Bubble sucked ! ");
+ // mCallbacks.onCallEnded(conf.getParticipants().get(0));
+ // bubbleRemoved(b);
+ // return true;
+ // }
+ // }, hangup_icon));
}
/**
@@ -588,13 +590,13 @@
Log.i(TAG, "onSensorChanged:" + event.sensor.getName());
Log.i(TAG, "onSensorChanged:" + event.sensor.getType());
if (event.values[0] == 0) {
-// PowerManager pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE);
-// pm.goToSleep(SystemClock.uptimeMillis());
+ // PowerManager pm = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE);
+ // pm.goToSleep(SystemClock.uptimeMillis());
WindowManager.LayoutParams params = getActivity().getWindow().getAttributes();
params.flags |= WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
params.screenBrightness = 0.004f;
getActivity().getWindow().setAttributes(params);
-// Settings.System.putInt(getActivity().getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 1000);
+ // Settings.System.putInt(getActivity().getContentResolver(), Settings.System.SCREEN_OFF_TIMEOUT, 1000);
} else {
WindowManager.LayoutParams params = getActivity().getWindow().getAttributes();
params.flags = WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
diff --git a/src/com/savoirfairelinux/sflphone/model/Bubble.java b/src/com/savoirfairelinux/sflphone/model/Bubble.java
index 843fe50..05229c9 100644
--- a/src/com/savoirfairelinux/sflphone/model/Bubble.java
+++ b/src/com/savoirfairelinux/sflphone/model/Bubble.java
@@ -32,7 +32,7 @@
public PointF attractor = null;
public boolean dragged = false;
-
+
public boolean markedToDie = false;
public long last_drag;
public boolean expanded; // determine if we draw the buttons around the bubble
@@ -248,27 +248,30 @@
float relativeX = x - pos.x + externalBMP.getWidth() / 2;
float relativeY = y - pos.y + externalBMP.getHeight() / 2;
- Log.i("Bubble", "relativeX:" + relativeX);
- Log.i("Bubble", "relativeY:" + relativeY);
-
- Log.i("Bubble", "pos.x:" + pos.x);
- Log.i("Bubble", "pos.y:" + pos.y);
-
- Log.i("Bubble", "externalBMP.getWidth():" + externalBMP.getWidth());
- Log.i("Bubble", "externalBMP.getHeight():" + externalBMP.getHeight());
+ // Log.i("Bubble", "relativeX:" + relativeX);
+ // Log.i("Bubble", "relativeY:" + relativeY);
+ //
+ // Log.i("Bubble", "pos.x:" + pos.x);
+ // Log.i("Bubble", "pos.y:" + pos.y);
+ //
+ // Log.i("Bubble", "externalBMP.getWidth():" + externalBMP.getWidth());
+ // Log.i("Bubble", "externalBMP.getHeight():" + externalBMP.getHeight());
// Hold - Left
if (relativeX < externalBMP.getWidth() / 3 && relativeY > externalBMP.getHeight() / 3) {
+ Log.i("Bubble", "Holding");
return 1;
}
// Record - Right
if (relativeX > externalBMP.getWidth() * 2 / 3 && relativeY > externalBMP.getHeight() / 3) {
+ Log.i("Bubble", "Record");
return 2;
}
// Transfer - Bottom
if (relativeY > externalBMP.getHeight() * 2 / 3) {
+ Log.i("Bubble", "Transfer");
return 3;
}
return 0;
diff --git a/src/com/savoirfairelinux/sflphone/model/BubbleModel.java b/src/com/savoirfairelinux/sflphone/model/BubbleModel.java
index 1ad013e..9ca9bb6 100644
--- a/src/com/savoirfairelinux/sflphone/model/BubbleModel.java
+++ b/src/com/savoirfairelinux/sflphone/model/BubbleModel.java
@@ -175,7 +175,6 @@
// Log.i(TAG,"Model:");
if(attractor != null && attractor_dist < attractor_dist_suck*attractor_dist_suck) {
b.dragged = false;
- Log.i(TAG,"Model:Sucking");
if(attractor.callback.onBubbleSucked(b)) {
bubbles.remove(b);
n--;
diff --git a/src/com/savoirfairelinux/sflphone/model/BubblesView.java b/src/com/savoirfairelinux/sflphone/model/BubblesView.java
index 57cd67e..2a03ce8 100644
--- a/src/com/savoirfairelinux/sflphone/model/BubblesView.java
+++ b/src/com/savoirfairelinux/sflphone/model/BubblesView.java
@@ -37,15 +37,10 @@
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
-import android.graphics.LinearGradient;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.Paint.Style;
-import android.graphics.PorterDuffXfermode;
-import android.graphics.RadialGradient;
import android.graphics.RectF;
-import android.graphics.Shader.TileMode;
-import android.graphics.Xfermode;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
@@ -375,7 +370,7 @@
@Override
public boolean onTouch(View v, MotionEvent event) {
-// Log.w(TAG, "onTouch " + event.getAction());
+ // Log.w(TAG, "onTouch " + event.getAction());
int action = event.getActionMasked();
@@ -452,7 +447,7 @@
if (!expand.intersects(event.getX(), event.getY())) {
expand.retract();
} else {
-// Log.d("Main", "getAction");
+ // Log.d("Main", "getAction");
switch (expand.getAction(event.getX(), event.getY())) {
case 0:
expand.retract();
@@ -477,7 +472,7 @@
}
return true;
}
-// Log.d("Main", "onDown");
+ // Log.d("Main", "onDown");
for (int i = 0; i < n_bubbles; i++) {
Bubble b = bubbles.get(i);
if (b.intersects(event.getX(), event.getY()) && !b.expanded) {
@@ -493,13 +488,13 @@
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
-// Log.d("Main", "onFling");
+ // Log.d("Main", "onFling");
return true;
}
@Override
public void onLongPress(MotionEvent e) {
-// Log.d("Main", "onLongPress");
+ // Log.d("Main", "onLongPress");
if (isDraggingBubble()) {
Bubble b = getDraggedBubble(e);
b.expand();
@@ -520,7 +515,7 @@
@Override
public boolean onScroll(MotionEvent e1, MotionEvent event, float distanceX, float distanceY) {
-// Log.d("Main", "onScroll");
+ // Log.d("Main", "onScroll");
List<Bubble> bubbles = model.getBubbles();
final int n_bubbles = bubbles.size();
long now = System.nanoTime();
@@ -543,13 +538,13 @@
@Override
public void onShowPress(MotionEvent e) {
-// Log.d("Main", "onShowPress");
+ // Log.d("Main", "onShowPress");
}
@Override
public boolean onSingleTapUp(MotionEvent e) {
-// Log.d("Main", "onSingleTapUp");
+ // Log.d("Main", "onSingleTapUp");
return true;
}
}
diff --git a/src/com/savoirfairelinux/sflphone/service/SipService.java b/src/com/savoirfairelinux/sflphone/service/SipService.java
index 7a6a895..7a5a6f2 100644
--- a/src/com/savoirfairelinux/sflphone/service/SipService.java
+++ b/src/com/savoirfairelinux/sflphone/service/SipService.java
@@ -229,6 +229,7 @@
System.loadLibrary("codec_ulaw");
System.loadLibrary("codec_alaw");
System.loadLibrary("codec_g722");
+ System.loadLibrary("codec_opus");
System.loadLibrary("speexresampler");
System.loadLibrary("sflphone");
isPjSipStackStarted = true;