diff --git a/res/drawable/incall_add.png b/res/drawable/incall_add.png
new file mode 100755
index 000000000..c1526d8ba
Binary files /dev/null and b/res/drawable/incall_add.png differ
diff --git a/res/drawable/incall_back.png b/res/drawable/incall_back.png
new file mode 100755
index 000000000..685c72cbb
Binary files /dev/null and b/res/drawable/incall_back.png differ
diff --git a/res/drawable/incall_contact.png b/res/drawable/incall_contact.png
new file mode 100755
index 000000000..ecf2b1603
Binary files /dev/null and b/res/drawable/incall_contact.png differ
diff --git a/res/drawable/incall_dialpad.png b/res/drawable/incall_dialpad.png
new file mode 100755
index 000000000..3d2d9495b
Binary files /dev/null and b/res/drawable/incall_dialpad.png differ
diff --git a/res/drawable/incall_merge.png b/res/drawable/incall_merge.png
new file mode 100755
index 000000000..70ed3cbc7
Binary files /dev/null and b/res/drawable/incall_merge.png differ
diff --git a/res/drawable/incall_micro.png b/res/drawable/incall_micro.png
new file mode 100755
index 000000000..7c694fbff
Binary files /dev/null and b/res/drawable/incall_micro.png differ
diff --git a/res/drawable/incall_micro_inverse.png b/res/drawable/incall_micro_inverse.png
new file mode 100755
index 000000000..dc38d85a6
Binary files /dev/null and b/res/drawable/incall_micro_inverse.png differ
diff --git a/res/drawable/incall_pause.png b/res/drawable/incall_pause.png
new file mode 100755
index 000000000..37d96580b
Binary files /dev/null and b/res/drawable/incall_pause.png differ
diff --git a/res/drawable/incall_pause_inverse.png b/res/drawable/incall_pause_inverse.png
new file mode 100755
index 000000000..0b46f283c
Binary files /dev/null and b/res/drawable/incall_pause_inverse.png differ
diff --git a/res/drawable/incall_speaker.png b/res/drawable/incall_speaker.png
new file mode 100755
index 000000000..95d132189
Binary files /dev/null and b/res/drawable/incall_speaker.png differ
diff --git a/res/drawable/incall_speaker_inverse.png b/res/drawable/incall_speaker_inverse.png
new file mode 100755
index 000000000..e343dba73
Binary files /dev/null and b/res/drawable/incall_speaker_inverse.png differ
diff --git a/res/layout/conference_details_layout.xml b/res/layout/conference_details_layout.xml
index 1960221e6..d24e59153 100644
--- a/res/layout/conference_details_layout.xml
+++ b/res/layout/conference_details_layout.xml
@@ -1,5 +1,7 @@
-
-
-
-
-
+
+
+
diff --git a/res/layout/incall_layout.xml b/res/layout/incall_layout.xml
index 0f5e54146..37819b6fb 100644
--- a/res/layout/incall_layout.xml
+++ b/res/layout/incall_layout.xml
@@ -1,11 +1,12 @@
-
-
+
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/values/conf_style.xml b/res/values/conf_style.xml
index 3aa046546..08b1e2778 100644
--- a/res/values/conf_style.xml
+++ b/res/values/conf_style.xml
@@ -9,4 +9,27 @@
- 15sp
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/values/strings.xml b/res/values/strings.xml
index ae9b8f282..99b7d5708 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -11,7 +11,6 @@
Starting up...
An error occurred while accepting call
- Canceled
Error adding new call
Transfer initiated
Transfer call to
diff --git a/src/org/linphone/AbstractCalleesActivity.java b/src/org/linphone/AbstractCalleesActivity.java
index 185cd7172..abf16eafd 100644
--- a/src/org/linphone/AbstractCalleesActivity.java
+++ b/src/org/linphone/AbstractCalleesActivity.java
@@ -39,9 +39,9 @@ import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.BaseAdapter;
+import android.widget.Checkable;
import android.widget.Chronometer;
import android.widget.ImageView;
-import android.widget.ToggleButton;
/**
* @author Guillaume Beraudo
@@ -53,8 +53,8 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
private List mSpecificCalls = Collections.emptyList();
private Handler mHandler = new Handler();
- private ToggleButton mMuteMicButton;
- private ToggleButton mSpeakerButton;
+ private Checkable mMuteMicButton;
+ private Checkable mSpeakerButton;
protected abstract boolean isActive();
protected abstract void setActive(boolean active);
@@ -70,10 +70,13 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
protected void onCreate(Bundle savedInstanceState) {
setListAdapter(mListAdapter = createCalleeListAdapter());
- mMuteMicButton = (ToggleButton) findViewById(R.id.toggleMuteMic);
- mMuteMicButton.setOnClickListener(this);
- mSpeakerButton = (ToggleButton) findViewById(R.id.toggleSpeaker);
- mSpeakerButton.setOnClickListener(this);
+ View muteMic = findViewById(R.id.toggleMuteMic);
+ muteMic.setOnClickListener(this);
+ mMuteMicButton = (Checkable) muteMic;
+
+ View speaker = findViewById(R.id.toggleSpeaker);
+ speaker.setOnClickListener(this);
+ mSpeakerButton = (Checkable) speaker;
super.onCreate(savedInstanceState);
}
@@ -190,10 +193,10 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
public void onClick(View v) {
switch (v.getId()) {
case R.id.toggleMuteMic:
- lc().muteMic(((ToggleButton) v).isChecked());
+ lc().muteMic(((Checkable) v).isChecked());
break;
case R.id.toggleSpeaker:
- if (((ToggleButton) v).isChecked()) {
+ if (((Checkable) v).isChecked()) {
LinphoneManager.getInstance().routeAudioToSpeaker();
} else {
LinphoneManager.getInstance().routeAudioToReceiver();
@@ -206,7 +209,7 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
@Override
public void onAudioStateChanged(final AudioState state) {
- mSpeakerButton.post(new Runnable() {
+ mHandler.post(new Runnable() {
@Override
public void run() {
switch (state) {
diff --git a/src/org/linphone/ContactPickerActivityNew.java b/src/org/linphone/ContactPickerActivityNew.java
index 885c1d7e8..89132ab10 100644
--- a/src/org/linphone/ContactPickerActivityNew.java
+++ b/src/org/linphone/ContactPickerActivityNew.java
@@ -28,7 +28,6 @@ import android.content.ContentUris;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
-import android.os.Bundle;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
import android.text.TextUtils;
@@ -158,7 +157,7 @@ public class ContactPickerActivityNew extends AbstractContactPickerActivityNew {
}
}
- LinphoneActivity.instance().getTabHost().setCurrentTabByTag(LinphoneActivity.DIALER_TAB);
+ ((ContactPicked) getParent()).goToDialer();
}
diff --git a/src/org/linphone/IncallActivity.java b/src/org/linphone/IncallActivity.java
index eb0d52207..7342e1943 100644
--- a/src/org/linphone/IncallActivity.java
+++ b/src/org/linphone/IncallActivity.java
@@ -49,11 +49,11 @@ import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.View.OnLongClickListener;
import android.widget.ArrayAdapter;
+import android.widget.Checkable;
import android.widget.ImageView;
import android.widget.ListAdapter;
import android.widget.TextView;
import android.widget.Toast;
-import android.widget.ToggleButton;
/**
* @author Guillaume Beraudo
@@ -96,11 +96,7 @@ public class IncallActivity extends AbstractCalleesActivity implements
findViewById(R.id.incallNumpadShow).setOnClickListener(this);
findViewById(R.id.conf_simple_merge).setOnClickListener(this);
- View transferView = findViewById(R.id.conf_simple_transfer);
- transferView.setOnClickListener(this);
- if (!mAllowTransfers) {
- transferView.setVisibility(View.GONE);
- }
+ findViewById(R.id.conf_simple_pause).setOnClickListener(this);
findViewById(R.id.incallHang).setOnClickListener(this);
mMultipleCallsLimit = lc().getMaxCalls();
@@ -212,7 +208,7 @@ public class IncallActivity extends AbstractCalleesActivity implements
if (!lc().isMicMuted()) {
mUnMuteOnReturnFromUriPicker = true;
lc().muteMic(true);
- ((ToggleButton) findViewById(R.id.toggleMuteMic)).setChecked(true);
+ ((Checkable) findViewById(R.id.toggleMuteMic)).setChecked(true);
}
}
@@ -248,7 +244,7 @@ public class IncallActivity extends AbstractCalleesActivity implements
lc().terminateAllCalls();
}
- // activity wille be closed automatically by LinphoneActivity when no more calls exist
+ // activity will be closed automatically by LinphoneActivity when no more calls exist
}
public void onClick(View v) {
@@ -269,12 +265,12 @@ public class IncallActivity extends AbstractCalleesActivity implements
case R.id.conf_simple_merge:
lc().addAllToConference();
break;
- case R.id.conf_simple_transfer:
- LinphoneCall tCall = lc().getCurrentCall();
- if (tCall != null) {
- prepareForTransferingExistingOrNewCall(tCall);
+ case R.id.conf_simple_pause:
+ LinphoneCall call = lc().getCurrentCall();
+ if (call != null) {
+ lc().pauseCall(call);
} else {
- Toast.makeText(this, R.string.conf_simple_no_current_call, Toast.LENGTH_SHORT).show();
+ ((Checkable) v).setChecked(true);
}
break;
case R.id.conf_simple_video:
@@ -291,9 +287,17 @@ public class IncallActivity extends AbstractCalleesActivity implements
// mic, speaker
super.onClick(v);
}
-
}
+ private void doTransfer() {
+ LinphoneCall tCall = lc().getCurrentCall();
+ if (tCall != null) {
+ prepareForTransferingExistingOrNewCall(tCall);
+ } else {
+ Toast.makeText(this, R.string.conf_simple_no_current_call, Toast.LENGTH_SHORT).show();
+ }
+ }
+
private void prepareForTransferingExistingOrNewCall(final LinphoneCall call) {
// Include inconf calls
final List existingCalls = LinphoneUtils.getLinphoneCalls(lc());
@@ -545,30 +549,26 @@ public class IncallActivity extends AbstractCalleesActivity implements
return getString(id);
}
- private void updateAdvancedButtons() {
- LinphoneCall activeCall = lc().getCurrentCall();
- View bar = findViewById(R.id.conf_advanced_buttons);
+ private void updatePauseMergeButtons() {
+ View controls = findViewById(R.id.incall_controls_layout);
- if (activeCall == null) {
- bar.setVisibility(GONE);
- return;
+ int nbCalls = lc().getCallsNb();
+ View pauseView = controls.findViewById(R.id.conf_simple_pause);
+ View mergeView = controls.findViewById(R.id.conf_simple_merge);
+
+ if (nbCalls <= 1) {
+ ((Checkable) pauseView).setChecked(lc().getCurrentCall() == null);
+ mergeView.setVisibility(GONE);
+ pauseView.setVisibility(VISIBLE);
+
+ } else {
+ int nonConfCallsNb = LinphoneUtils.countNonConferenceCalls(lc());
+ boolean enableMerge = nonConfCallsNb >=2;
+ enableMerge |= nonConfCallsNb >=1 && lc().getConferenceSize() > 0;
+ mergeView.setEnabled(enableMerge);
+ pauseView.setVisibility(GONE);
+ mergeView.setVisibility(VISIBLE);
}
-
- int nonConfCallsNb = LinphoneUtils.countNonConferenceCalls(lc());
- // in this part, we know nonConfCallsNb > 0 as the active call cannot be a conf call
-
- View merge = bar.findViewById(R.id.conf_simple_merge);
- boolean enableMerge = nonConfCallsNb >=2 || lc().getConferenceSize() > 0;
- enableMerge = true;
- merge.setEnabled(enableMerge);
-
- View transfer = bar.findViewById(R.id.conf_simple_transfer);
- boolean enableTransfer = mAllowTransfers && activeCall != null;
- transfer.setEnabled(enableTransfer);
-
- // video always enabled when a call active (though may not be shown)
-
- bar.setVisibility(VISIBLE);
}
private void updateConfItem() {
@@ -586,7 +586,7 @@ public class IncallActivity extends AbstractCalleesActivity implements
}
protected void updateUI() {
- updateAdvancedButtons();
+ updatePauseMergeButtons();
updateCalleeImage();
updateSoundLock();
updateAddCallButton();
@@ -634,7 +634,7 @@ public class IncallActivity extends AbstractCalleesActivity implements
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (mUnMuteOnReturnFromUriPicker) {
lc().muteMic(false);
- ((ToggleButton) findViewById(R.id.toggleMuteMic)).setChecked(false);
+ ((Checkable) findViewById(R.id.toggleMuteMic)).setChecked(false);
}
String uri = null;
@@ -643,7 +643,6 @@ public class IncallActivity extends AbstractCalleesActivity implements
}
if (resultCode != RESULT_OK || TextUtils.isEmpty(uri)) {
mCallToTransfer = null;
- Toast.makeText(this, R.string.uri_picking_canceled, Toast.LENGTH_LONG).show();
eventuallyResumeConfOrCallOnPickerReturn(true);
return;
}
diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java
index 0c8e7a9f8..45275e64e 100644
--- a/src/org/linphone/LinphoneActivity.java
+++ b/src/org/linphone/LinphoneActivity.java
@@ -486,7 +486,7 @@ public class LinphoneActivity extends TabActivity implements
startIncallActivity();
}
}
- if (state == LinphoneCall.State.StreamsRunning && Version.isVideoCapable()) {
+ if (state == LinphoneCall.State.StreamsRunning && Version.isVideoCapable() && !call.isInConference()) {
boolean videoEnabled = call.getCurrentParamsCopy().getVideoEnabled();
if (videoEnabled) {
startVideoActivity(call, 1000);
diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java
index 307369aa8..cacff619d 100644
--- a/src/org/linphone/LinphoneService.java
+++ b/src/org/linphone/LinphoneService.java
@@ -25,6 +25,7 @@ import java.lang.reflect.Method;
import org.linphone.LinphoneManager.NewOutgoingCallUiListener;
import org.linphone.LinphoneSimpleListener.LinphoneServiceListener;
import org.linphone.core.LinphoneCall;
+import org.linphone.core.LinphoneProxyConfig;
import org.linphone.core.Log;
import org.linphone.core.OnlineStatus;
import org.linphone.core.LinphoneCall.State;
@@ -268,7 +269,8 @@ public final class LinphoneService extends Service implements LinphoneServiceLis
mNotif.when=System.currentTimeMillis();
String text = getString(textId);
if (text.contains("%s")) {
- String id = LinphoneManager.getLc().getDefaultProxyConfig().getIdentity();
+ LinphoneProxyConfig lpc = LinphoneManager.getLc().getDefaultProxyConfig();
+ String id = lpc != null ? lpc.getIdentity() : "";
text = String.format(text, id);
}
diff --git a/src/org/linphone/UriPickerActivity.java b/src/org/linphone/UriPickerActivity.java
index f39e09d59..5763823e8 100644
--- a/src/org/linphone/UriPickerActivity.java
+++ b/src/org/linphone/UriPickerActivity.java
@@ -69,7 +69,7 @@ public class UriPickerActivity extends TabActivity implements ContactPicked {
startActivityInTab("contact",
- new Intent().setClass(this, Version.sdkAboveOrEqual(5) ?
+ new Intent().setClass(this, Version.sdkAboveOrEqual(Version.API05_ECLAIR_20) ?
ContactPickerActivityNew.class : ContactPickerActivityOld.class),
R.string.tab_contact, R.drawable.contact_orange);
diff --git a/src/org/linphone/ui/ToggleImageButton.java b/src/org/linphone/ui/ToggleImageButton.java
index d4e61006d..45cbc0b8e 100644
--- a/src/org/linphone/ui/ToggleImageButton.java
+++ b/src/org/linphone/ui/ToggleImageButton.java
@@ -25,6 +25,7 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.Checkable;
import android.widget.ImageButton;
/**
@@ -35,18 +36,19 @@ import android.widget.ImageButton;
* @author Guillaume Beraudo
*
*/
-public class ToggleImageButton extends ImageButton implements OnClickListener {
-// private static final String ns = "http://schemas.android.com/apk/res/linphone";
- private static final String ns = null;
+public class ToggleImageButton extends ImageButton implements Checkable, OnClickListener {
+ private static final String ns = "http://schemas.android.com/apk/res/org.linphone";
private boolean checked;
private Drawable stateChecked;
private Drawable stateUnChecked;
+ private boolean drawablesForBackground;
private OnCheckedChangeListener onCheckedChangeListener;
public ToggleImageButton(Context context, AttributeSet attrs) {
super(context, attrs);
stateChecked = getResources().getDrawable(attrs.getAttributeResourceValue(ns, "checked", -1));
stateUnChecked = getResources().getDrawable(attrs.getAttributeResourceValue(ns, "unchecked", -1));
+ drawablesForBackground = attrs.getAttributeBooleanValue(ns, "bgdrawables", false);
setBackgroundColor(Color.TRANSPARENT);
setOnClickListener(this);
@@ -66,7 +68,12 @@ public class ToggleImageButton extends ImageButton implements OnClickListener {
private void handleCheckChanged() {
- setImageDrawable(checked?stateChecked:stateUnChecked);
+ Drawable d = checked? stateChecked : stateUnChecked;
+ if (drawablesForBackground) {
+ setBackgroundDrawable(d);
+ } else {
+ setImageDrawable(d);
+ }
requestLayout();
invalidate();
if (onCheckedChangeListener != null) onCheckedChangeListener.onCheckedChanged(this, checked);
@@ -82,7 +89,18 @@ public class ToggleImageButton extends ImageButton implements OnClickListener {
}
public void onClick(View v) {
- checked = !checked;
- handleCheckChanged();
+ toggle();
}
+
+
+ @Override
+ public void toggle() {
+ setChecked(!isChecked());
+ }
+
+ @Override
+ public boolean performClick() {
+ toggle();
+ return super.performClick();
+ }
}