Behavior change for answering a call, now it's like the device was lock
This commit is contained in:
parent
8bbdd2f5ae
commit
23a9f95d88
1 changed files with 67 additions and 74 deletions
|
@ -57,7 +57,7 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
|||
private LinphoneCoreListenerBase mListener;
|
||||
private LinearLayout acceptUnlock;
|
||||
private LinearLayout declineUnlock;
|
||||
private boolean isScreenActive, alreadyAcceptedOrDeniedCall;
|
||||
private boolean alreadyAcceptedOrDeniedCall;
|
||||
private float answerX;
|
||||
private float declineX;
|
||||
|
||||
|
@ -89,7 +89,6 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
|||
getWindow().addFlags(flags);
|
||||
|
||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
isScreenActive = Compatibility.isScreenOn(pm);
|
||||
|
||||
final int screenWidth = getResources().getDisplayMetrics().widthPixels;
|
||||
|
||||
|
@ -101,16 +100,14 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
|||
accept.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(isScreenActive) {
|
||||
answer();
|
||||
} else {
|
||||
|
||||
decline.setVisibility(View.GONE);
|
||||
acceptUnlock.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if(!isScreenActive) {
|
||||
|
||||
accept.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent motionEvent) {
|
||||
|
@ -171,18 +168,14 @@ public class CallIncomingActivity extends LinphoneGenericActivity implements Lin
|
|||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
decline.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if(isScreenActive) {
|
||||
decline();
|
||||
} else {
|
||||
accept.setVisibility(View.GONE);
|
||||
acceptUnlock.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mListener = new LinphoneCoreListenerBase(){
|
||||
|
|
Loading…
Reference in a new issue