Fundamental ios-like ui change for incall view.
Minor bug fixes: - back from contact picker; - video + conference workaround.
BIN
res/drawable/incall_add.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
res/drawable/incall_back.png
Executable file
After Width: | Height: | Size: 2.6 KiB |
BIN
res/drawable/incall_contact.png
Executable file
After Width: | Height: | Size: 4.1 KiB |
BIN
res/drawable/incall_dialpad.png
Executable file
After Width: | Height: | Size: 3.3 KiB |
BIN
res/drawable/incall_merge.png
Executable file
After Width: | Height: | Size: 3.3 KiB |
BIN
res/drawable/incall_micro.png
Executable file
After Width: | Height: | Size: 4.6 KiB |
BIN
res/drawable/incall_micro_inverse.png
Executable file
After Width: | Height: | Size: 10 KiB |
BIN
res/drawable/incall_pause.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
res/drawable/incall_pause_inverse.png
Executable file
After Width: | Height: | Size: 7.1 KiB |
BIN
res/drawable/incall_speaker.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
res/drawable/incall_speaker_inverse.png
Executable file
After Width: | Height: | Size: 7.9 KiB |
|
@ -1,5 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:ui="http://schemas.android.com/apk/res/org.linphone"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
|
@ -22,12 +24,16 @@
|
|||
<LinearLayout android:id="@+id/conf_speaker_mic_row"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content">
|
||||
<ToggleButton android:id="@+id/toggleMuteMic" style="@style/conf_toggle_button"
|
||||
android:textOn="@string/mutemic_button_txt" android:textOff="@string/mutemic_button_txt" />
|
||||
<ToggleButton android:id="@+id/toggleSpeaker" style="@style/conf_toggle_button"
|
||||
android:textOn="@string/speaker_button_txt" android:textOff="@string/speaker_button_txt" />
|
||||
<ToggleButton android:id="@+id/toggleBluetooth" style="@style/conf_toggle_button"
|
||||
android:textOn="@string/bluetooth_button_txt" android:textOff="@string/bluetooth_button_txt"
|
||||
android:visibility="gone"/>
|
||||
<org.linphone.ui.ToggleImageButton android:id="@+id/toggleMuteMic"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_micro_inverse"
|
||||
ui:unchecked="@drawable/incall_micro"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
<org.linphone.ui.ToggleImageButton android:id="@+id/toggleSpeaker"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_speaker_inverse"
|
||||
ui:unchecked="@drawable/incall_speaker"
|
||||
ui:bgdrawables="true" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:ui="http://schemas.android.com/apk/res/org.linphone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp" >
|
||||
|
||||
|
||||
<LinearLayout android:id="@+id/conf_header" android:layout_alignParentTop="true"
|
||||
android:orientation="vertical" android:layout_marginBottom="10dip"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||
|
@ -21,57 +22,70 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<LinearLayout android:id="@+id/conf_speaker_mic_row"
|
||||
android:layout_alignParentBottom="true"
|
||||
<LinearLayout android:id="@+id/incall_controls_layout"
|
||||
android:layout_alignParentBottom="true" android:orientation="vertical"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content">
|
||||
<ToggleButton android:id="@+id/toggleMuteMic" style="@style/conf_toggle_button"
|
||||
android:textOn="@string/mutemic_button_txt" android:textOff="@string/mutemic_button_txt" />
|
||||
<ToggleButton android:id="@+id/toggleSpeaker" style="@style/conf_toggle_button"
|
||||
android:textOn="@string/speaker_button_txt" android:textOff="@string/speaker_button_txt" />
|
||||
<ToggleButton android:id="@+id/toggleBluetooth" style="@style/conf_toggle_button"
|
||||
android:textOn="@string/bluetooth_button_txt" android:textOff="@string/bluetooth_button_txt"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
|
||||
<org.linphone.ui.ToggleImageButton android:id="@+id/toggleMuteMic"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_micro_inverse"
|
||||
ui:unchecked="@drawable/incall_micro"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
<ImageButton android:id="@+id/incallNumpadShow"
|
||||
style="@style/incall_control"
|
||||
android:background="@drawable/incall_dialpad" />
|
||||
|
||||
<org.linphone.ui.ToggleImageButton android:id="@+id/toggleSpeaker"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_speaker_inverse"
|
||||
ui:unchecked="@drawable/incall_speaker"
|
||||
ui:bgdrawables="true" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/conf_terminate_row"
|
||||
android:layout_above="@id/conf_speaker_mic_row"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content">
|
||||
<Button android:text="@string/AddCallButtonText" android:id="@+id/addCall"
|
||||
style="@style/conf_icon_text_button" android:drawableTop="@drawable/plus" />
|
||||
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content">
|
||||
<ImageButton android:id="@+id/addCall"
|
||||
style="@style/incall_control"
|
||||
android:background="@drawable/incall_add" />
|
||||
|
||||
<Button android:id="@+id/incallHang" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/stopcall_red" android:text="@string/hangup"/>
|
||||
<ImageButton android:id="@+id/conf_simple_merge"
|
||||
style="@style/incall_control"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/incall_merge" />
|
||||
|
||||
<Button android:id="@+id/incallNumpadShow" style="@style/conf_icon_text_button"
|
||||
android:text="@string/show_send_dtmfs_button" android:drawableTop="@drawable/numpad_big" />
|
||||
<org.linphone.ui.ToggleImageButton android:id="@+id/conf_simple_pause"
|
||||
style="@style/incall_control"
|
||||
ui:checked="@drawable/incall_pause_inverse"
|
||||
ui:unchecked="@drawable/incall_pause"
|
||||
ui:bgdrawables="true" />
|
||||
|
||||
<ImageButton android:id="@+id/conf_simple_video"
|
||||
style="@style/incall_control"
|
||||
android:background="@drawable/incall_back" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/conf_advanced_buttons"
|
||||
android:layout_width="fill_parent" android:layout_height="wrap_content"
|
||||
android:layout_above="@id/conf_terminate_row">
|
||||
<Button android:id="@+id/conf_simple_video" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/conf_video"
|
||||
android:text="@string/conf_simple_video_bt_txt"/>
|
||||
<Button android:id="@+id/conf_simple_merge" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/conf_merge"
|
||||
android:text="@string/conf_simple_merge_bt_txt"/>
|
||||
<Button android:id="@+id/conf_simple_transfer" style="@style/conf_icon_text_button"
|
||||
android:drawableTop="@drawable/conf_transfer"
|
||||
android:text="@string/conf_simple_transfer_bt_txt" />
|
||||
<ImageButton
|
||||
android:id="@+id/incallHang"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/clavier_bg"
|
||||
android:minHeight="60dip"
|
||||
android:src="@drawable/stopcall_red" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
<RelativeLayout android:id="@+id/picture_wrapper"
|
||||
android:layout_height="wrap_content" android:layout_width="fill_parent"
|
||||
android:layout_above="@id/incall_controls_layout">
|
||||
<ImageView android:id="@+id/incall_picture" android:visibility="gone"
|
||||
android:layout_centerInParent="true" android:paddingBottom="15px"
|
||||
android:layout_height="wrap_content" android:layout_width="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center" android:scaleType="fitCenter"
|
||||
android:minWidth="192px" android:minHeight="192px"
|
||||
android:paddingBottom="60px"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<ListView android:id="@android:id/list"
|
||||
android:layout_width="fill_parent"
|
||||
|
@ -80,7 +94,7 @@
|
|||
android:dividerHeight="10dip"
|
||||
android:divider="@android:color/transparent"
|
||||
android:layout_below="@id/conf_header"
|
||||
android:layout_above="@id/conf_advanced_buttons"
|
||||
android:layout_above="@id/picture_wrapper"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:fadeScrollbars="false"
|
||||
/>
|
||||
|
|
|
@ -9,4 +9,27 @@
|
|||
<item name="android:paddingRight">15sp</item>
|
||||
</style>
|
||||
|
||||
<style name="incall_control" parent="@android:style/Widget.ImageButton">
|
||||
<item name="android:height">104px</item>
|
||||
<item name="android:width">164px</item>
|
||||
<item name="android:layout_height">104px</item>
|
||||
<item name="android:layout_width">fill_parent</item>
|
||||
<item name="android:layout_weight">1</item>
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<item name="android:scaleType">fitCenter</item>
|
||||
<item name="android:adjustViewBounds">true</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="ToggleImageButton">
|
||||
<attr name="android:scaleType" />
|
||||
<attr name="android:height" />
|
||||
<attr name="android:width" />
|
||||
<attr name="android:layout_width" />
|
||||
<attr name="android:layout_height" />
|
||||
<attr name="android:layout_weight" />
|
||||
<attr name="android:id" />
|
||||
<attr name="checked" format="integer" />
|
||||
<attr name="unchecked" format="integer" />
|
||||
<attr name="bgdrawables" format="boolean" />
|
||||
</declare-styleable>
|
||||
</resources>
|
|
@ -11,7 +11,6 @@
|
|||
<string name="waiting_for_startup">Starting up...</string>
|
||||
<string name="couldnt_accept_call">An error occurred while accepting call</string>
|
||||
|
||||
<string name="uri_picking_canceled">Canceled</string>
|
||||
<string name="error_adding_new_call">Error adding new call</string>
|
||||
<string name="transfer_started">Transfer initiated</string>
|
||||
<string name="transfer_dialog_title">Transfer call to</string>
|
||||
|
|
|
@ -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<LinphoneCall> 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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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,7 +287,15 @@ 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) {
|
||||
|
@ -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());
|
||||
// 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);
|
||||
boolean enableMerge = nonConfCallsNb >=2;
|
||||
enableMerge |= nonConfCallsNb >=1 && lc().getConferenceSize() > 0;
|
||||
mergeView.setEnabled(enableMerge);
|
||||
pauseView.setVisibility(GONE);
|
||||
mergeView.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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|