Fix settings issues
This commit is contained in:
parent
35aa663567
commit
4964264bea
5 changed files with 52 additions and 47 deletions
|
@ -53,7 +53,7 @@
|
||||||
<activity android:name="org.linphone.LinphoneActivity"
|
<activity android:name="org.linphone.LinphoneActivity"
|
||||||
android:theme="@android:style/Theme.NoTitleBar"
|
android:theme="@android:style/Theme.NoTitleBar"
|
||||||
android:screenOrientation="nosensor"
|
android:screenOrientation="nosensor"
|
||||||
android:launchMode="singleInstance">
|
android:launchMode="singleTask">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
|
@ -49,7 +49,6 @@ import android.widget.LinearLayout;
|
||||||
/**
|
/**
|
||||||
* @author Sylvain Berfini
|
* @author Sylvain Berfini
|
||||||
*/
|
*/
|
||||||
//TODO Prevent controls from being hidden while user is using numpad
|
|
||||||
public class InCallActivity extends FragmentActivity implements
|
public class InCallActivity extends FragmentActivity implements
|
||||||
LinphoneOnCallStateChangedListener,
|
LinphoneOnCallStateChangedListener,
|
||||||
LinphoneOnCallEncryptionChangedListener,
|
LinphoneOnCallEncryptionChangedListener,
|
||||||
|
@ -382,50 +381,54 @@ public class InCallActivity extends FragmentActivity implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (controlsHandler != null && mControls != null) {
|
resetControlsHidingCallBack();
|
||||||
controlsHandler.removeCallbacks(mControls);
|
|
||||||
}
|
|
||||||
|
|
||||||
controlsHandler.postDelayed(mControls = new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
hideNumpad();
|
|
||||||
|
|
||||||
if (InCallActivity.this.getResources().getBoolean(R.bool.disable_animations)) {
|
|
||||||
transfer.setVisibility(View.GONE);
|
|
||||||
addCall.setVisibility(View.GONE);
|
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
|
||||||
options.setImageResource(R.drawable.options);
|
|
||||||
} else {
|
|
||||||
Animation animation = AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_top_to_bottom);
|
|
||||||
animation.setAnimationListener(new AnimationListener() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationStart(Animation animation) {
|
|
||||||
video.setEnabled(false); // HACK: Used to avoid controls from being hided if video is switched while controls are hiding
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationRepeat(Animation animation) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Animation animation) {
|
|
||||||
video.setEnabled(true); // HACK: Used to avoid controls from being hided if video is switched while controls are hiding
|
|
||||||
transfer.setVisibility(View.GONE);
|
|
||||||
addCall.setVisibility(View.GONE);
|
|
||||||
mControlsLayout.setVisibility(View.GONE);
|
|
||||||
switchCamera.setVisibility(View.INVISIBLE);
|
|
||||||
options.setImageResource(R.drawable.options);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
mControlsLayout.startAnimation(animation);
|
|
||||||
switchCamera.startAnimation(AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_bottom_to_top));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, SECONDS_BEFORE_HIDING_CONTROLS);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetControlsHidingCallBack() {
|
||||||
|
if (controlsHandler != null && mControls != null) {
|
||||||
|
controlsHandler.removeCallbacks(mControls);
|
||||||
|
}
|
||||||
|
|
||||||
|
controlsHandler.postDelayed(mControls = new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
hideNumpad();
|
||||||
|
|
||||||
|
if (InCallActivity.this.getResources().getBoolean(R.bool.disable_animations)) {
|
||||||
|
transfer.setVisibility(View.GONE);
|
||||||
|
addCall.setVisibility(View.GONE);
|
||||||
|
mControlsLayout.setVisibility(View.GONE);
|
||||||
|
switchCamera.setVisibility(View.INVISIBLE);
|
||||||
|
options.setImageResource(R.drawable.options);
|
||||||
|
} else {
|
||||||
|
Animation animation = AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_top_to_bottom);
|
||||||
|
animation.setAnimationListener(new AnimationListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationStart(Animation animation) {
|
||||||
|
video.setEnabled(false); // HACK: Used to avoid controls from being hided if video is switched while controls are hiding
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationRepeat(Animation animation) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAnimationEnd(Animation animation) {
|
||||||
|
video.setEnabled(true); // HACK: Used to avoid controls from being hided if video is switched while controls are hiding
|
||||||
|
transfer.setVisibility(View.GONE);
|
||||||
|
addCall.setVisibility(View.GONE);
|
||||||
|
mControlsLayout.setVisibility(View.GONE);
|
||||||
|
switchCamera.setVisibility(View.INVISIBLE);
|
||||||
|
options.setImageResource(R.drawable.options);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mControlsLayout.startAnimation(animation);
|
||||||
|
switchCamera.startAnimation(AnimationUtils.loadAnimation(InCallActivity.this, R.anim.slide_out_bottom_to_top));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, SECONDS_BEFORE_HIDING_CONTROLS);
|
||||||
|
}
|
||||||
|
|
||||||
public void setCallControlsVisibleAndRemoveCallbacks() {
|
public void setCallControlsVisibleAndRemoveCallbacks() {
|
||||||
if (controlsHandler != null && mControls != null) {
|
if (controlsHandler != null && mControls != null) {
|
||||||
controlsHandler.removeCallbacks(mControls);
|
controlsHandler.removeCallbacks(mControls);
|
||||||
|
|
|
@ -103,6 +103,7 @@ public class LinphonePreferencesActivity extends PreferenceActivity implements O
|
||||||
// If we were on a LinphonePreferences sub activity, and we came back because of a change of tab, we propagate the event
|
// If we were on a LinphonePreferences sub activity, and we came back because of a change of tab, we propagate the event
|
||||||
setResult(RESULT_FIRST_USER, data);
|
setResult(RESULT_FIRST_USER, data);
|
||||||
finish();
|
finish();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -178,6 +178,8 @@ public class PreferencesActivity extends LinphonePreferencesActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
|
||||||
if (requestCode == ADD_SIP_ACCOUNT) {
|
if (requestCode == ADD_SIP_ACCOUNT) {
|
||||||
//Verify if last created account is filled
|
//Verify if last created account is filled
|
||||||
SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
|
SharedPreferences prefs = getPreferenceManager().getSharedPreferences();
|
||||||
|
@ -198,8 +200,6 @@ public class PreferencesActivity extends LinphonePreferencesActivity implements
|
||||||
}
|
}
|
||||||
createDynamicAccountsPreferences();
|
createDynamicAccountsPreferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addWizardPreferenceButton() {
|
private void addWizardPreferenceButton() {
|
||||||
|
|
|
@ -46,6 +46,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
||||||
private native int getNumberOfCallLogs(long nativePtr);
|
private native int getNumberOfCallLogs(long nativePtr);
|
||||||
private native void delete(long nativePtr);
|
private native void delete(long nativePtr);
|
||||||
private native void setNetworkStateReachable(long nativePtr,boolean isReachable);
|
private native void setNetworkStateReachable(long nativePtr,boolean isReachable);
|
||||||
|
private native boolean isNetworkStateReachable(long nativePtr);
|
||||||
private native void setPlaybackGain(long nativeptr, float gain);
|
private native void setPlaybackGain(long nativeptr, float gain);
|
||||||
private native float getPlaybackGain(long nativeptr);
|
private native float getPlaybackGain(long nativeptr);
|
||||||
private native void muteMic(long nativePtr,boolean isMuted);
|
private native void muteMic(long nativePtr,boolean isMuted);
|
||||||
|
@ -109,7 +110,6 @@ class LinphoneCoreImpl implements LinphoneCore {
|
||||||
private native void removeCallLog(long nativePtr, long callLogPtr);
|
private native void removeCallLog(long nativePtr, long callLogPtr);
|
||||||
private native int getMissedCallsCount(long nativePtr);
|
private native int getMissedCallsCount(long nativePtr);
|
||||||
private native void resetMissedCallsCount(long nativePtr);
|
private native void resetMissedCallsCount(long nativePtr);
|
||||||
private native boolean isNetworkReachable(long nativePtr);
|
|
||||||
|
|
||||||
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
||||||
mListener=listener;
|
mListener=listener;
|
||||||
|
@ -442,8 +442,9 @@ class LinphoneCoreImpl implements LinphoneCore {
|
||||||
return codecs;
|
return codecs;
|
||||||
}
|
}
|
||||||
public synchronized boolean isNetworkReachable() {
|
public synchronized boolean isNetworkReachable() {
|
||||||
return isNetworkReachable(nativePtr);
|
return isNetworkStateReachable(nativePtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void enableKeepAlive(boolean enable) {
|
public synchronized void enableKeepAlive(boolean enable) {
|
||||||
enableKeepAlive(nativePtr,enable);
|
enableKeepAlive(nativePtr,enable);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue