Updated default and wizard settings
This commit is contained in:
parent
acd9b95d20
commit
59b79eb7c1
6 changed files with 41 additions and 8 deletions
|
@ -57,15 +57,15 @@
|
|||
android:background="@drawable/chat_field_background">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_send_message"
|
||||
android:id="@+id/sendPicture"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:adjustViewBounds="true"
|
||||
android:src="@drawable/chat_send_picture"
|
||||
android:paddingLeft="10dp" />
|
||||
android:contentDescription="@string/content_description_send_message"
|
||||
android:paddingLeft="8dp"
|
||||
android:src="@drawable/chat_send_picture" />
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_send_message"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_edit"
|
||||
android:id="@+id/editContact"
|
||||
android:src="@drawable/contact_edit"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -143,6 +143,7 @@
|
|||
|
||||
<CheckBoxPreference
|
||||
android:key="@string/pref_video_use_front_camera_key"
|
||||
android:defaultValue="true"
|
||||
android:title="@string/pref_video_use_front_camera_title"
|
||||
android:dependency="@string/pref_video_enable_key"/>
|
||||
|
||||
|
@ -246,7 +247,7 @@
|
|||
<CheckBoxPreference
|
||||
android:key="@string/pref_push_notification_key"
|
||||
android:title="@string/pref_push_notification"
|
||||
android:defaultValue="true"/>
|
||||
android:defaultValue="false"/>
|
||||
|
||||
</PreferenceScreen>
|
||||
|
||||
|
|
|
@ -95,6 +95,9 @@ public class ContactFragment extends Fragment implements OnClickListener {
|
|||
for (String numberOrAddress : contact.getNumerosOrAddresses()) {
|
||||
View v = inflater.inflate(R.layout.contact_control_row, null);
|
||||
|
||||
if (numberOrAddress.startsWith("sip:")) {
|
||||
numberOrAddress = numberOrAddress.substring(4);
|
||||
}
|
||||
((TextView) v.findViewById(R.id.numeroOrAddress)).setText(numberOrAddress);
|
||||
|
||||
v.findViewById(R.id.dial).setOnClickListener(dialListener);
|
||||
|
|
|
@ -47,6 +47,7 @@ import org.linphone.setup.SetupActivity;
|
|||
import org.linphone.ui.LedPreference;
|
||||
import org.linphone.ui.PreferencesListFragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
|
@ -73,6 +74,7 @@ public class PreferencesFragment extends PreferencesListFragment implements EcCa
|
|||
private static final int ACCOUNTS_SETTINGS_ID = 0;
|
||||
private static final int WIZARD_SETTINGS_ID = 1;
|
||||
private static final int CAMERA_SETTINGS_ID = 5;
|
||||
private static final int WIZARD_INTENT = 1;
|
||||
|
||||
public PreferencesFragment() {
|
||||
super(R.xml.preferences);
|
||||
|
@ -131,8 +133,10 @@ public class PreferencesFragment extends PreferencesListFragment implements EcCa
|
|||
// No video
|
||||
if (!Version.isVideoCapable()) {
|
||||
uncheckAndDisableCheckbox(pref_video_enable_key);
|
||||
} else if (!AndroidCameraConfiguration.hasFrontCamera()) {
|
||||
uncheckDisableAndHideCheckbox(R.string.pref_video_use_front_camera_key);
|
||||
} else {
|
||||
if (!AndroidCameraConfiguration.hasFrontCamera()) {
|
||||
uncheckDisableAndHideCheckbox(R.string.pref_video_use_front_camera_key);
|
||||
}
|
||||
}
|
||||
|
||||
if (prefs().getBoolean(LinphoneActivity.PREF_FIRST_LAUNCH,true)) {
|
||||
|
@ -413,11 +417,20 @@ public class PreferencesFragment extends PreferencesListFragment implements EcCa
|
|||
wizard.setOnPreferenceClickListener(new OnPreferenceClickListener() {
|
||||
public boolean onPreferenceClick(Preference preference) {
|
||||
Intent intent = new Intent(mContext, SetupActivity.class);
|
||||
startActivity(intent);
|
||||
startActivityForResult(intent, WIZARD_INTENT);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == WIZARD_INTENT && resultCode == Activity.RESULT_OK) {
|
||||
if (LinphoneActivity.isInstanciated()) {
|
||||
LinphoneActivity.instance().goToDialer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeMediaEncryptionPreferences() {
|
||||
LinphoneCore lc=LinphoneManager.getLc();
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.linphone.LinphoneManager;
|
|||
import org.linphone.R;
|
||||
import org.linphone.core.Log;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
|
@ -143,6 +144,7 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
|
|||
|
||||
if (LinphoneManager.getLc().getDefaultProxyConfig() != null) {
|
||||
writePreference(R.string.first_launch_suceeded_once_key, true);
|
||||
setResult(Activity.RESULT_OK);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
@ -189,6 +191,19 @@ public class SetupActivity extends FragmentActivity implements OnClickListener {
|
|||
writePreference(R.string.pref_username_key, username);
|
||||
writePreference(R.string.pref_passwd_key, password);
|
||||
writePreference(R.string.pref_domain_key, domain);
|
||||
|
||||
boolean isMainAccountLinphoneDotOrg = domain.equals(getString(R.string.default_domain));
|
||||
if (isMainAccountLinphoneDotOrg) {
|
||||
writePreference(R.string.pref_proxy_key, domain + ":5223");
|
||||
writePreference(R.string.pref_enable_outbound_proxy_key, true);
|
||||
writePreference(R.string.pref_stun_server_key, "stun.linphone.org");
|
||||
|
||||
writePreference(R.string.pref_ice_enable_key, true);
|
||||
writePreference(R.string.pref_push_notification_key, true);
|
||||
writePreference(R.string.pref_transport_tls_key, true);
|
||||
writePreference(R.string.pref_transport_tcp_key, false);
|
||||
writePreference(R.string.pref_transport_udp_key, false);
|
||||
}
|
||||
} else {
|
||||
writePreference(getString(R.string.pref_username_key) + newAccountId, username);
|
||||
writePreference(getString(R.string.pref_passwd_key) + newAccountId, password);
|
||||
|
|
Loading…
Reference in a new issue