Better back button handle + no more dtmf send using add call dialer

This commit is contained in:
Sylvain Berfini 2012-05-11 14:23:25 +02:00
parent abd5871b23
commit bed0621168
3 changed files with 12 additions and 3 deletions

View file

@ -84,6 +84,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
private LinearLayout mInCallControls;
private static DialerActivity instance;
public boolean mVisible;
private boolean mPreventDoubleCallOnRotation;
private AlertDialog wizardDialog;
@ -359,6 +360,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
@Override
protected void onPause() {
super.onPause();
mVisible = false;
if (mCamera != null) {
mCamera.release();
@ -502,6 +504,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
// and set to the to be destroyed Dialer.
// Note1: We wait as long as possible before setting the last message.
// Note2: Linphone service is in charge of instantiating LinphoneManager
mVisible = true;
mStatus.setText(LinphoneManager.getInstance().getLastLcStatusMessage());
super.onResume();
@ -534,6 +537,11 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (LinphoneUtils.onKeyVolumeSoftAdjust(keyCode)) return true;
if (keyCode == KeyEvent.KEYCODE_BACK && LinphoneManager.getLc().isIncall()) {
// If we are in call on dialer, we go back to the incall view
LinphoneActivity.instance().startIncallActivity();
return true;
}
return super.onKeyDown(keyCode, event);
}
}

View file

@ -480,6 +480,7 @@ public class VideoCallActivity extends Activity implements
params.setMargins(0, 0, 15, 15);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
params.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
if (mVideoViewReady != null)
mVideoCaptureViewReady.setLayoutParams(params);
}

View file

@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.linphone.ui;
import org.linphone.DialerActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphoneService;
import org.linphone.R;
@ -103,9 +104,8 @@ public class Digit extends Button implements AddressAware {
LinphoneCore lc = LinphoneManager.getLc();
lc.stopDtmf();
mIsDtmfStarted =false;
if (lc.isIncall()) {
if (lc.isIncall() && !DialerActivity.instance().mVisible) {
lc.sendDtmf(mKeyCode.charAt(0));
// return;
}
}