Fix settings issues
This commit is contained in:
parent
00d1541e94
commit
d9e49d9cac
3 changed files with 7 additions and 6 deletions
|
@ -94,7 +94,7 @@ public class AccountPreferencesFragment extends PreferencesListFragment {
|
||||||
|
|
||||||
final Preference disable = advanced.getPreference(2);
|
final Preference disable = advanced.getPreference(2);
|
||||||
disable.setEnabled(prefs.getInt(getString(R.string.pref_default_account), 0) != n);
|
disable.setEnabled(prefs.getInt(getString(R.string.pref_default_account), 0) != n);
|
||||||
Compatibility.setPreferenceChecked(outboundProxy, prefs.getBoolean(getString(R.string.pref_disable_account_key) + getAccountNumber(n), false));
|
Compatibility.setPreferenceChecked(disable, prefs.getBoolean(getString(R.string.pref_disable_account_key) + getAccountNumber(n), false));
|
||||||
disable.setKey(getString(R.string.pref_disable_account_key) + getAccountNumber(n));
|
disable.setKey(getString(R.string.pref_disable_account_key) + getAccountNumber(n));
|
||||||
|
|
||||||
final Preference delete = advanced.getPreference(4);
|
final Preference delete = advanced.getPreference(4);
|
||||||
|
|
|
@ -33,6 +33,7 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.linphone.LinphoneManager.EcCalibrationListener;
|
import org.linphone.LinphoneManager.EcCalibrationListener;
|
||||||
|
import org.linphone.compatibility.Compatibility;
|
||||||
import org.linphone.core.LinphoneCore;
|
import org.linphone.core.LinphoneCore;
|
||||||
import org.linphone.core.LinphoneCore.EcCalibratorStatus;
|
import org.linphone.core.LinphoneCore.EcCalibratorStatus;
|
||||||
import org.linphone.core.LinphoneCore.MediaEncryption;
|
import org.linphone.core.LinphoneCore.MediaEncryption;
|
||||||
|
@ -299,9 +300,9 @@ public class PreferencesFragment extends PreferencesListFragment implements EcCa
|
||||||
}
|
}
|
||||||
|
|
||||||
private void manageCheckbox(int key, boolean value, boolean enabled, boolean hidden) {
|
private void manageCheckbox(int key, boolean value, boolean enabled, boolean hidden) {
|
||||||
CheckBoxPreference box = (CheckBoxPreference) findPreference(key);
|
Preference box = findPreference(key);
|
||||||
box.setEnabled(enabled);
|
box.setEnabled(enabled);
|
||||||
box.setChecked(value);
|
Compatibility.setPreferenceChecked(box, value);
|
||||||
writeBoolean(key, value);
|
writeBoolean(key, value);
|
||||||
if (hidden) box.setLayoutResource(R.layout.hidden);
|
if (hidden) box.setLayoutResource(R.layout.hidden);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package org.linphone.compatibility;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.SwitchPreference;
|
import android.preference.TwoStatePreference;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ApiFourteenPlus.java
|
ApiFourteenPlus.java
|
||||||
|
@ -29,10 +29,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
public class ApiFourteenPlus {
|
public class ApiFourteenPlus {
|
||||||
|
|
||||||
public static void setPreferenceChecked(Preference preference, boolean checked) {
|
public static void setPreferenceChecked(Preference preference, boolean checked) {
|
||||||
((SwitchPreference) preference).setChecked(checked);
|
((TwoStatePreference) preference).setChecked(checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isPreferenceChecked(Preference preference) {
|
public static boolean isPreferenceChecked(Preference preference) {
|
||||||
return ((SwitchPreference) preference).isChecked();
|
return ((TwoStatePreference) preference).isChecked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue