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 LinearLayout mInCallControls;
private static DialerActivity instance; private static DialerActivity instance;
public boolean mVisible;
private boolean mPreventDoubleCallOnRotation; private boolean mPreventDoubleCallOnRotation;
private AlertDialog wizardDialog; private AlertDialog wizardDialog;
@ -359,6 +360,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
@Override @Override
protected void onPause() { protected void onPause() {
super.onPause(); super.onPause();
mVisible = false;
if (mCamera != null) { if (mCamera != null) {
mCamera.release(); mCamera.release();
@ -502,6 +504,7 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
// and set to the to be destroyed Dialer. // and set to the to be destroyed Dialer.
// Note1: We wait as long as possible before setting the last message. // Note1: We wait as long as possible before setting the last message.
// Note2: Linphone service is in charge of instantiating LinphoneManager // Note2: Linphone service is in charge of instantiating LinphoneManager
mVisible = true;
mStatus.setText(LinphoneManager.getInstance().getLastLcStatusMessage()); mStatus.setText(LinphoneManager.getInstance().getLastLcStatusMessage());
super.onResume(); super.onResume();
@ -534,6 +537,11 @@ public class DialerActivity extends Activity implements LinphoneGuiListener {
@Override @Override
public boolean onKeyDown(int keyCode, KeyEvent event) { public boolean onKeyDown(int keyCode, KeyEvent event) {
if (LinphoneUtils.onKeyVolumeSoftAdjust(keyCode)) return true; 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); return super.onKeyDown(keyCode, event);
} }
} }

View file

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

View file

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