Speaker toggle checked and disabled if needed
This commit is contained in:
parent
cfbfbb717d
commit
6ddc0d8f0c
2 changed files with 22 additions and 0 deletions
|
@ -31,6 +31,7 @@ import org.linphone.core.LinphoneCall;
|
||||||
import org.linphone.core.LinphoneCall.State;
|
import org.linphone.core.LinphoneCall.State;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.Log;
|
import org.linphone.core.Log;
|
||||||
|
import org.linphone.ui.ToggleImageButton;
|
||||||
|
|
||||||
import android.app.ListActivity;
|
import android.app.ListActivity;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -85,6 +86,11 @@ public abstract class AbstractCalleesActivity extends ListActivity implements Li
|
||||||
View speaker = findViewById(R.id.toggleSpeaker);
|
View speaker = findViewById(R.id.toggleSpeaker);
|
||||||
speaker.setOnClickListener(this);
|
speaker.setOnClickListener(this);
|
||||||
mSpeakerButton = (Checkable) speaker;
|
mSpeakerButton = (Checkable) speaker;
|
||||||
|
if (LinphoneManager.getInstance().isSpeakerOn())
|
||||||
|
{
|
||||||
|
((ToggleImageButton) speaker).setChecked(true);
|
||||||
|
speaker.setEnabled(false);
|
||||||
|
}
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.linphone.mediastream.Version;
|
||||||
import org.linphone.mediastream.video.AndroidVideoWindowImpl;
|
import org.linphone.mediastream.video.AndroidVideoWindowImpl;
|
||||||
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
import org.linphone.mediastream.video.capture.hwconf.AndroidCameraConfiguration;
|
||||||
import org.linphone.ui.Numpad;
|
import org.linphone.ui.Numpad;
|
||||||
|
import org.linphone.ui.ToggleImageButton;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
@ -163,11 +164,19 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
|
||||||
if (Version.isXLargeScreen(this))
|
if (Version.isXLargeScreen(this))
|
||||||
{
|
{
|
||||||
findViewById(R.id.toggleMuteMic).setOnClickListener(this);
|
findViewById(R.id.toggleMuteMic).setOnClickListener(this);
|
||||||
|
findViewById(R.id.toggleSpeaker).setOnClickListener(this);
|
||||||
findViewById(R.id.incallNumpadShow).setOnClickListener(this);
|
findViewById(R.id.incallNumpadShow).setOnClickListener(this);
|
||||||
findViewById(R.id.incallHang).setOnClickListener(this);
|
findViewById(R.id.incallHang).setOnClickListener(this);
|
||||||
findViewById(R.id.switch_camera).setOnClickListener(this);
|
findViewById(R.id.switch_camera).setOnClickListener(this);
|
||||||
findViewById(R.id.conf_simple_pause).setOnClickListener(this);
|
findViewById(R.id.conf_simple_pause).setOnClickListener(this);
|
||||||
findViewById(R.id.conf_simple_video).setOnClickListener(this);
|
findViewById(R.id.conf_simple_video).setOnClickListener(this);
|
||||||
|
|
||||||
|
if (LinphoneManager.getInstance().isSpeakerOn())
|
||||||
|
{
|
||||||
|
ToggleImageButton speaker = (ToggleImageButton) findViewById(R.id.toggleSpeaker);
|
||||||
|
speaker.setChecked(true);
|
||||||
|
speaker.setEnabled(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -350,6 +359,13 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
|
||||||
case R.id.incallHang:
|
case R.id.incallHang:
|
||||||
terminateCurrentCallOrConferenceOrAll();
|
terminateCurrentCallOrConferenceOrAll();
|
||||||
break;
|
break;
|
||||||
|
case R.id.toggleSpeaker:
|
||||||
|
if (((Checkable) v).isChecked()) {
|
||||||
|
LinphoneManager.getInstance().routeAudioToSpeaker();
|
||||||
|
} else {
|
||||||
|
LinphoneManager.getInstance().routeAudioToReceiver();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case R.id.incallNumpadShow:
|
case R.id.incallNumpadShow:
|
||||||
showDialog(numpadDialogId);
|
showDialog(numpadDialogId);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue