Fix tablet speaker
This commit is contained in:
parent
66b93e92f6
commit
2d32567158
1 changed files with 18 additions and 7 deletions
|
@ -91,7 +91,7 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
private StatusFragment status;
|
private StatusFragment status;
|
||||||
private AudioCallFragment audioCallFragment;
|
private AudioCallFragment audioCallFragment;
|
||||||
private VideoCallFragment videoCallFragment;
|
private VideoCallFragment videoCallFragment;
|
||||||
private boolean isSpeakerEnabled = false, isMicMuted = false, isVideoEnabled, isTransferAllowed, isAnimationDisabled;
|
private boolean isSpeakerEnabled = false, isMicMuted = false, isTransferAllowed, isAnimationDisabled;
|
||||||
private ViewGroup mControlsLayout;
|
private ViewGroup mControlsLayout;
|
||||||
private Numpad numpad;
|
private Numpad numpad;
|
||||||
private int cameraNumber;
|
private int cameraNumber;
|
||||||
|
@ -153,6 +153,7 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
if (isVideoEnabled(LinphoneManager.getLc().getCurrentCall())) {
|
||||||
callFragment = new VideoCallFragment();
|
callFragment = new VideoCallFragment();
|
||||||
videoCallFragment = (VideoCallFragment) callFragment;
|
videoCallFragment = (VideoCallFragment) callFragment;
|
||||||
|
isSpeakerEnabled = true;
|
||||||
|
|
||||||
if (cameraNumber > 1) {
|
if (cameraNumber > 1) {
|
||||||
switchCamera.setVisibility(View.VISIBLE);
|
switchCamera.setVisibility(View.VISIBLE);
|
||||||
|
@ -164,6 +165,7 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
}
|
}
|
||||||
callFragment.setArguments(getIntent().getExtras());
|
callFragment.setArguments(getIntent().getExtras());
|
||||||
getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainer, callFragment).commitAllowingStateLoss();
|
getSupportFragmentManager().beginTransaction().add(R.id.fragmentContainer, callFragment).commitAllowingStateLoss();
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,19 +178,24 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
outState.putBoolean("Speaker", isSpeakerEnabled);
|
outState.putBoolean("Speaker", LinphoneManager.getLc().isSpeakerEnabled());
|
||||||
outState.putBoolean("Mic", isMicMuted);
|
outState.putBoolean("Mic", LinphoneManager.getLc().isMicMuted());
|
||||||
outState.putBoolean("VideoCallPaused", isVideoCallPaused);
|
outState.putBoolean("VideoCallPaused", isVideoCallPaused);
|
||||||
|
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isTablet() {
|
||||||
|
return getResources().getBoolean(R.bool.isTablet);
|
||||||
|
}
|
||||||
|
|
||||||
private void initUI() {
|
private void initUI() {
|
||||||
inflater = LayoutInflater.from(this);
|
inflater = LayoutInflater.from(this);
|
||||||
container = (ViewGroup) findViewById(R.id.topLayout);
|
container = (ViewGroup) findViewById(R.id.topLayout);
|
||||||
callsList = (TableLayout) findViewById(R.id.calls);
|
callsList = (TableLayout) findViewById(R.id.calls);
|
||||||
if (!showCallListInVideo) {
|
if (!showCallListInVideo) {
|
||||||
callsList.setVisibility(View.GONE);
|
callsList.setVisibility(View.GONE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
video = (TextView) findViewById(R.id.video);
|
video = (TextView) findViewById(R.id.video);
|
||||||
|
@ -199,6 +206,9 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
// micro.setEnabled(false);
|
// micro.setEnabled(false);
|
||||||
speaker = (TextView) findViewById(R.id.speaker);
|
speaker = (TextView) findViewById(R.id.speaker);
|
||||||
speaker.setOnClickListener(this);
|
speaker.setOnClickListener(this);
|
||||||
|
if(isTablet()){
|
||||||
|
speaker.setEnabled(false);
|
||||||
|
}
|
||||||
// speaker.setEnabled(false);
|
// speaker.setEnabled(false);
|
||||||
addCall = (TextView) findViewById(R.id.addCall);
|
addCall = (TextView) findViewById(R.id.addCall);
|
||||||
addCall.setOnClickListener(this);
|
addCall.setOnClickListener(this);
|
||||||
|
@ -330,7 +340,6 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
pause.setBackgroundResource(R.drawable.pause_off);
|
pause.setBackgroundResource(R.drawable.pause_off);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -348,7 +357,9 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
|
|
||||||
video.setEnabled(true);
|
video.setEnabled(true);
|
||||||
micro.setEnabled(true);
|
micro.setEnabled(true);
|
||||||
speaker.setEnabled(true);
|
if(!isTablet()){
|
||||||
|
speaker.setEnabled(true);
|
||||||
|
}
|
||||||
transfer.setEnabled(true);
|
transfer.setEnabled(true);
|
||||||
pause.setEnabled(true);
|
pause.setEnabled(true);
|
||||||
dialer.setEnabled(true);
|
dialer.setEnabled(true);
|
||||||
|
@ -464,7 +475,7 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void switchVideo(final boolean displayVideo, final boolean isInitiator) {
|
private void switchVideo(final boolean displayVideo, final boolean isInitiator) {
|
||||||
final LinphoneCall call = LinphoneManager.getLc().getCalls()[0];
|
final LinphoneCall call = LinphoneManager.getLc().getCurrentCall();
|
||||||
if (call == null) {
|
if (call == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue