Update assistant
This commit is contained in:
parent
3eca96e3c5
commit
4c895ecb51
19 changed files with 151 additions and 195 deletions
BIN
res/drawable-xhdpi/resizable_assistant_button_over.9.png
Normal file
BIN
res/drawable-xhdpi/resizable_assistant_button_over.9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 506 B |
8
res/drawable/assistant_button.xml
Normal file
8
res/drawable/assistant_button.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true"
|
||||
android:drawable="@drawable/resizable_assistant_button_over" />
|
||||
<item
|
||||
android:drawable="@drawable/resizable_assistant_button" />
|
||||
</selector>
|
||||
|
7
res/drawable/menu_burger.xml
Normal file
7
res/drawable/menu_burger.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false"
|
||||
android:drawable="@drawable/menu_disabled" />
|
||||
<item
|
||||
android:drawable="@drawable/menu" />
|
||||
</selector>
|
5
res/drawable/menu_disabled.xml
Normal file
5
res/drawable/menu_disabled.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<bitmap
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:src="@drawable/menu"
|
||||
android:alpha="0.3" />
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/colorH"
|
||||
android:layout_height="match_parent">
|
||||
|
@ -9,7 +10,13 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include layout="@layout/status" android:id="@+id/status" />
|
||||
<fragment
|
||||
android:id="@+id/status"
|
||||
android:name="org.linphone.StatusFragment"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
tools:layout="@layout/status" />
|
||||
|
||||
<include layout="@layout/assistant_toolbar" android:id="@+id/toolbar" />
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
@ -45,34 +45,18 @@
|
|||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/assistant_username"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="textEmailAddress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assistant_username_ok"
|
||||
android:src="@drawable/wizard_notok"
|
||||
android:contentDescription="@string/content_description_setup_ok"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
<EditText
|
||||
android:id="@+id/assistant_username"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="textEmailAddress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/password"
|
||||
|
@ -81,35 +65,19 @@
|
|||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/assistant_password"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="textEmailAddress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assistant_password_ok"
|
||||
android:src="@drawable/wizard_notok"
|
||||
android:contentDescription="@string/content_description_setup_ok"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
<EditText
|
||||
android:id="@+id/assistant_password"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="textEmailAddress"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/assistant_password_confirm"
|
||||
|
@ -118,34 +86,19 @@
|
|||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/assistant_password_confirm"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assistant_confirm_password_ok"
|
||||
android:src="@drawable/wizard_notok"
|
||||
android:contentDescription="@string/content_description_setup_ok"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/assistant_password_confirm"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/email"
|
||||
|
@ -154,34 +107,18 @@
|
|||
android:paddingTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/assistant_email"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/assistant_email_ok"
|
||||
android:src="@drawable/wizard_notok"
|
||||
android:contentDescription="@string/content_description_setup_ok"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingRight="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/assistant_email"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
android:inputType="text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:singleLine="true"/>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="20dp"
|
||||
|
@ -191,7 +128,7 @@
|
|||
<Button
|
||||
android:id="@+id/assistant_create"
|
||||
android:text="@string/assistant_create"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/content_description_validate"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<Button
|
||||
android:id="@+id/assistant_check"
|
||||
android:text="@string/assistant_create"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/content_description_validate"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -3,30 +3,29 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:text="@string/assistant_ec_calibration"
|
||||
android:contentDescription="@string/content_description_welcome"
|
||||
style="@style/font6"
|
||||
android:textAllCaps="true"
|
||||
android:paddingTop="20dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
<ImageView
|
||||
android:contentDescription="@string/content_description_welcome"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_width="200dp"
|
||||
android:layout_height="200dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/logo"/>
|
||||
android:src="@drawable/linphone_orange"/>
|
||||
|
||||
<ProgressBar
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/black"
|
||||
android:textStyle="bold"
|
||||
android:textSize="20dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:text="@string/setup_ec_calibration" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
|
|
@ -87,7 +87,7 @@
|
|||
android:singleLine="true"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/display_name"
|
||||
android:text="@string/assistant_display_name"
|
||||
style="@style/font13"
|
||||
android:textAllCaps="true"
|
||||
android:paddingTop="10dp"
|
||||
|
@ -114,7 +114,7 @@
|
|||
<Button
|
||||
android:id="@+id/assistant_apply"
|
||||
android:text="@string/assistant_apply"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/content_description_validate"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
android:singleLine="true"/>
|
||||
|
||||
<TextView
|
||||
android:text="@string/display_name"
|
||||
android:text="@string/assistant_display_name"
|
||||
style="@style/font13"
|
||||
android:textAllCaps="true"
|
||||
android:paddingTop="10dp"
|
||||
|
@ -92,7 +92,7 @@
|
|||
<Button
|
||||
android:id="@+id/assistant_apply"
|
||||
android:text="@string/assistant_apply"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/content_description_validate"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
android:padding="10dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/setup_create_account"
|
||||
android:id="@+id/create_account"
|
||||
android:text="@string/assistant_create_account"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/setup_create_account"
|
||||
android:contentDescription="@string/assistant_create_account"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
@ -39,17 +39,16 @@
|
|||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/setup_login_linphone_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/setup_login_linphone"
|
||||
android:id="@+id/login_linphone"
|
||||
android:text="@string/assistant_login_linphone"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/setup_login_linphone"
|
||||
android:contentDescription="@string/assistant_login_linphone"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
@ -57,17 +56,16 @@
|
|||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/setup_login_generic_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/setup_login_generic"
|
||||
android:id="@+id/login_generic"
|
||||
android:text="@string/assistant_login_generic"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/setup_login_generic"
|
||||
android:contentDescription="@string/assistant_login_generic"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
@ -75,17 +73,16 @@
|
|||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/setup_remote_provisioning_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="10dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/setup_remote_provisioning"
|
||||
android:id="@+id/remote_provisioning"
|
||||
android:text="@string/assistant_remote_provisioning"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/setup_remote_provisioning"
|
||||
android:contentDescription="@string/assistant_remote_provisioning"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
android:layout_height="wrap_content"/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/setup_remote_provisioning_url"
|
||||
android:id="@+id/assistant_remote_provisioning_url"
|
||||
android:background="@drawable/resizable_textfield"
|
||||
android:textColor="@color/colorB"
|
||||
android:textCursorDrawable="@null"
|
||||
|
@ -52,7 +52,7 @@
|
|||
<Button
|
||||
android:id="@+id/assistant_apply"
|
||||
android:text="@string/assistant_apply"
|
||||
android:background="@drawable/resizable_assistant_button"
|
||||
android:background="@drawable/assistant_button"
|
||||
style="@style/font8"
|
||||
android:contentDescription="@string/content_description_validate"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
android:textColor="@android:color/black"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/setup_title_assistant"/>
|
||||
android:text="@string/assistant_title"/>
|
||||
|
||||
<TextView
|
||||
android:paddingTop="10dp"
|
||||
|
|
|
@ -27,11 +27,13 @@
|
|||
<string name="assistant_create_account_title">Create an account</string>
|
||||
<string name="assistant_create_account_part_1">1/2</string>
|
||||
<string name="assistant_create_account_part_2">2/2</string>
|
||||
<string name="assistant_display_name">Display name (optional)</string>
|
||||
<string name="assistant_linphone_account_title">Configure linphohe account</string>
|
||||
<string name="assistant_general_account_title">Configure Sip account</string>
|
||||
<string name="assistant_remote_provisioning_title">Remote provisioning</string>
|
||||
<string name="assistant_create">Create account</string>
|
||||
<string name="assistant_apply">Apply</string>
|
||||
<string name="assistant_ec_calibration">Echo canceller calibration in progress</string>
|
||||
<string name="assistant_password_confirm">Apply</string>
|
||||
|
||||
<!-- 1. Dailer -->
|
||||
|
@ -401,7 +403,7 @@
|
|||
<string name="pref_auto_accept_friends_desc">Automatically accept new friend requests</string>
|
||||
<string name="linphone_friend_new_request_title">Friend request</string>
|
||||
<string name="linphone_friend_new_request_desc">wants to share it\'s presence status with you and be aware of yours.</string>
|
||||
<string name="setup_ec_calibration">Echo canceller calibration in progress</string>
|
||||
|
||||
<string name="pref_image_sharing_server_title">Sharing server</string>
|
||||
<string name="pref_remote_provisioning_title">Remote provisioning</string>
|
||||
<string name="delete_contact">Delete</string>
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.linphone.LinphoneManager;
|
|||
import org.linphone.LinphonePreferences;
|
||||
import org.linphone.LinphonePreferences.AccountBuilder;
|
||||
import org.linphone.R;
|
||||
import org.linphone.StatusFragment;
|
||||
import org.linphone.core.LinphoneAddress;
|
||||
import org.linphone.core.LinphoneAddress.TransportType;
|
||||
import org.linphone.core.LinphoneCore;
|
||||
|
@ -56,6 +57,7 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
private boolean accountCreated = false;
|
||||
private LinphoneCoreListenerBase mListener;
|
||||
private LinphoneAddress address;
|
||||
private StatusFragment status;
|
||||
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
@ -65,10 +67,9 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
|
||||
setContentView(R.layout.assistant);
|
||||
|
||||
initUI();
|
||||
|
||||
firstFragment = getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment) ?
|
||||
firstFragment = getResources().getBoolean(R.bool.assistant_use_linphone_login_as_first_fragment) ?
|
||||
AssistantFragmentsEnum.LINPHONE_LOGIN : AssistantFragmentsEnum.MENU;
|
||||
if (findViewById(R.id.fragmentContainer) != null) {
|
||||
if (savedInstanceState == null) {
|
||||
|
@ -95,7 +96,6 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
instance = this;
|
||||
};
|
||||
|
||||
|
@ -128,17 +128,21 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
public static AssistantActivity instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
|
||||
public void updateStatusFragment(StatusFragment fragment) {
|
||||
status = fragment;
|
||||
}
|
||||
|
||||
private void initUI() {
|
||||
back = (RelativeLayout) findViewById(R.id.assistant_back);
|
||||
back.setOnClickListener(this);
|
||||
cancel = (RelativeLayout) findViewById(R.id.assistant_cancel);
|
||||
cancel.setOnClickListener(this);
|
||||
status.enableLeftMenu(false);
|
||||
}
|
||||
|
||||
private void changeFragment(Fragment newFragment) {
|
||||
FragmentTransaction transaction = getFragmentManager().beginTransaction();
|
||||
// transaction.addToBackStack("");
|
||||
transaction.replace(R.id.fragmentContainer, newFragment);
|
||||
transaction.commitAllowingStateLoss();
|
||||
}
|
||||
|
@ -194,9 +198,6 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
back.setVisibility(View.VISIBLE);
|
||||
cancel.setEnabled(false);
|
||||
} else {
|
||||
if (mPrefs.isFirstLaunch()) {
|
||||
mPrefs.setEchoCancellation(LinphoneManager.getLc().hasBuiltInEchoCanceler());
|
||||
}
|
||||
success();
|
||||
}
|
||||
}
|
||||
|
@ -241,7 +242,6 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
default:
|
||||
throw new IllegalStateException("Can't handle " + fragment);
|
||||
}
|
||||
back.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void displayMenu() {
|
||||
|
@ -260,12 +260,19 @@ public class AssistantActivity extends Activity implements OnClickListener {
|
|||
|
||||
public void displayLoginLinphone() {
|
||||
fragment = new LinphoneLoginFragment();
|
||||
|
||||
//LinphoneManager.getInstance().loadConfig(R.raw.config_linphone_account);
|
||||
//LinphoneManager.getInstance().resetLinphoneCore(this);
|
||||
|
||||
|
||||
//Log.w(LinphoneManager.getLc().getConfig().getString("proxy_default_values","reg_proxy","loool"));
|
||||
|
||||
changeFragment(fragment);
|
||||
currentFragment = AssistantFragmentsEnum.LINPHONE_LOGIN;
|
||||
back.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void displayWizard() {
|
||||
public void displayCreateAccount() {
|
||||
fragment = new CreateAccountFragment();
|
||||
changeFragment(fragment);
|
||||
currentFragment = AssistantFragmentsEnum.CREATE_ACCOUNT;
|
||||
|
|
|
@ -84,8 +84,7 @@ public class CreateAccountFragment extends Fragment {
|
|||
View view = inflater.inflate(R.layout.assistant_account_creation, container, false);
|
||||
|
||||
username = (EditText) view.findViewById(R.id.assistant_username);
|
||||
ImageView usernameOkIV = (ImageView) view.findViewById(R.id.assistant_username_ok);
|
||||
addXMLRPCUsernameHandler(username, usernameOkIV);
|
||||
addXMLRPCUsernameHandler(username, null);
|
||||
|
||||
inputFilterCharacters = new String(acceptedChars);
|
||||
if (getResources().getBoolean(R.bool.allow_only_phone_numbers_in_wizard)) {
|
||||
|
@ -108,16 +107,12 @@ public class CreateAccountFragment extends Fragment {
|
|||
|
||||
password = (EditText) view.findViewById(R.id.assistant_password);
|
||||
passwordConfirm = (EditText) view.findViewById(R.id.assistant_password_confirm);
|
||||
|
||||
ImageView passwordOkIV = (ImageView) view.findViewById(R.id.assistant_password_ok);
|
||||
addXMLRPCPasswordHandler(password, passwordOkIV);
|
||||
|
||||
ImageView passwordConfirmOkIV = (ImageView) view.findViewById(R.id.assistant_confirm_password_ok);
|
||||
addXMLRPCConfirmPasswordHandler(password, passwordConfirm, passwordConfirmOkIV);
|
||||
|
||||
addXMLRPCPasswordHandler(password, null);
|
||||
addXMLRPCConfirmPasswordHandler(password, passwordConfirm, null);
|
||||
|
||||
email = (EditText) view.findViewById(R.id.assistant_email);
|
||||
ImageView emailOkIV = (ImageView) view.findViewById(R.id.assistant_email_ok);
|
||||
addXMLRPCEmailHandler(email, emailOkIV);
|
||||
addXMLRPCEmailHandler(email, null);
|
||||
|
||||
errorMessage = (TextView) view.findViewById(R.id.assistant_error);
|
||||
|
||||
|
@ -170,7 +165,6 @@ public class CreateAccountFragment extends Fragment {
|
|||
public void run() {
|
||||
errorMessage.setText(R.string.wizard_server_unavailable);
|
||||
usernameOk = false;
|
||||
icon.setImageResource(R.drawable.wizard_notok);
|
||||
createAccount.setEnabled(usernameOk && passwordOk && confirmPasswordOk && emailOk);
|
||||
}
|
||||
};
|
||||
|
@ -183,7 +177,6 @@ public class CreateAccountFragment extends Fragment {
|
|||
public void run() {
|
||||
errorMessage.setText(R.string.wizard_username_unavailable);
|
||||
usernameOk = false;
|
||||
icon.setImageResource(R.drawable.wizard_notok);
|
||||
createAccount.setEnabled(usernameOk && passwordOk && confirmPasswordOk && emailOk);
|
||||
}
|
||||
};
|
||||
|
@ -191,7 +184,6 @@ public class CreateAccountFragment extends Fragment {
|
|||
Runnable runOk = new Runnable() {
|
||||
public void run() {
|
||||
errorMessage.setText("");
|
||||
icon.setImageResource(R.drawable.wizard_ok);
|
||||
usernameOk = true;
|
||||
createAccount.setEnabled(usernameOk && passwordOk && confirmPasswordOk && emailOk);
|
||||
}
|
||||
|
@ -304,7 +296,6 @@ public class CreateAccountFragment extends Fragment {
|
|||
isUsernameRegistred(username, icon);
|
||||
} else {
|
||||
errorMessage.setText(R.string.wizard_username_incorrect);
|
||||
icon.setImageResource(R.drawable.wizard_notok);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -324,13 +315,11 @@ public class CreateAccountFragment extends Fragment {
|
|||
{
|
||||
emailOk = false;
|
||||
if (isEmailCorrect(field.getText().toString())) {
|
||||
icon.setImageResource(R.drawable.wizard_ok);
|
||||
emailOk = true;
|
||||
errorMessage.setText("");
|
||||
}
|
||||
else {
|
||||
errorMessage.setText(R.string.wizard_email_incorrect);
|
||||
icon.setImageResource(R.drawable.wizard_notok);
|
||||
}
|
||||
createAccount.setEnabled(usernameOk && passwordOk && confirmPasswordOk && emailOk);
|
||||
}
|
||||
|
@ -352,12 +341,10 @@ public class CreateAccountFragment extends Fragment {
|
|||
passwordOk = false;
|
||||
if (isPasswordCorrect(field1.getText().toString())) {
|
||||
passwordOk = true;
|
||||
icon.setImageResource(R.drawable.wizard_ok);
|
||||
errorMessage.setText("");
|
||||
}
|
||||
else {
|
||||
errorMessage.setText(R.string.wizard_password_incorrect);
|
||||
icon.setImageResource(R.drawable.wizard_notok);
|
||||
}
|
||||
createAccount.setEnabled(usernameOk && passwordOk && confirmPasswordOk && emailOk);
|
||||
}
|
||||
|
@ -381,7 +368,6 @@ public class CreateAccountFragment extends Fragment {
|
|||
confirmPasswordOk = false;
|
||||
if (field1.getText().toString().equals(field2.getText().toString())) {
|
||||
confirmPasswordOk = true;
|
||||
icon.setImageResource(R.drawable.wizard_ok);
|
||||
|
||||
if (!isPasswordCorrect(field1.getText().toString())) {
|
||||
errorMessage.setText(R.string.wizard_password_incorrect);
|
||||
|
@ -392,7 +378,6 @@ public class CreateAccountFragment extends Fragment {
|
|||
}
|
||||
else {
|
||||
errorMessage.setText(R.string.wizard_passwords_unmatched);
|
||||
icon.setImageResource(R.drawable.wizard_notok);
|
||||
}
|
||||
createAccount.setEnabled(usernameOk && passwordOk && confirmPasswordOk && emailOk);
|
||||
}
|
||||
|
|
|
@ -17,10 +17,12 @@ You should have received a copy of the GNU General Public License
|
|||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
import org.linphone.LinphoneManager;
|
||||
import org.linphone.R;
|
||||
|
||||
import android.app.Fragment;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
|
@ -46,10 +48,10 @@ public class LinphoneLoginFragment extends Fragment implements OnClickListener {
|
|||
apply = (Button) view.findViewById(R.id.assistant_apply);
|
||||
apply.setOnClickListener(this);
|
||||
|
||||
if (getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment)) {
|
||||
if (getResources().getBoolean(R.bool.assistant_use_linphone_login_as_first_fragment)) {
|
||||
view.findViewById(R.id.assistant_apply).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,26 +38,26 @@ public class MenuFragment extends Fragment implements OnClickListener {
|
|||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.assistant_menu, container, false);
|
||||
|
||||
createAccount = (Button) view.findViewById(R.id.setup_create_account);
|
||||
createAccount = (Button) view.findViewById(R.id.create_account);
|
||||
createAccount.setOnClickListener(this);
|
||||
|
||||
logLinphoneAccount = (Button) view.findViewById(R.id.setup_login_linphone);
|
||||
logLinphoneAccount = (Button) view.findViewById(R.id.login_linphone);
|
||||
if (getResources().getBoolean(R.bool.hide_linphone_accounts_wizard)) {
|
||||
view.findViewById(R.id.setup_login_linphone_layout).setVisibility(View.GONE);
|
||||
logLinphoneAccount.setVisibility(View.GONE);
|
||||
} else {
|
||||
logLinphoneAccount.setOnClickListener(this);
|
||||
}
|
||||
|
||||
logGenericAccount = (Button) view.findViewById(R.id.setup_login_generic);
|
||||
logGenericAccount = (Button) view.findViewById(R.id.login_generic);
|
||||
if (getResources().getBoolean(R.bool.hide_generic_accounts_wizard)) {
|
||||
view.findViewById(R.id.setup_login_generic_layout).setVisibility(View.GONE);
|
||||
logGenericAccount.setVisibility(View.GONE);
|
||||
} else {
|
||||
logGenericAccount.setOnClickListener(this);
|
||||
}
|
||||
|
||||
remoteProvisioning = (Button) view.findViewById(R.id.setup_remote_provisioning);
|
||||
remoteProvisioning = (Button) view.findViewById(R.id.remote_provisioning);
|
||||
if (getResources().getBoolean(R.bool.hide_remote_provisioning_in_wizard)) {
|
||||
view.findViewById(R.id.setup_remote_provisioning_layout).setVisibility(View.GONE);
|
||||
remoteProvisioning.setVisibility(View.GONE);
|
||||
} else {
|
||||
remoteProvisioning.setOnClickListener(this);
|
||||
}
|
||||
|
@ -68,13 +68,13 @@ public class MenuFragment extends Fragment implements OnClickListener {
|
|||
@Override
|
||||
public void onClick(View v) {
|
||||
int id = v.getId();
|
||||
if (id == R.id.setup_login_generic) {
|
||||
if (id == R.id.login_generic) {
|
||||
AssistantActivity.instance().displayLoginGeneric();
|
||||
} else if (id == R.id.setup_login_linphone) {
|
||||
} else if (id == R.id.login_linphone) {
|
||||
AssistantActivity.instance().displayLoginLinphone();
|
||||
} else if (id == R.id.setup_create_account) {
|
||||
AssistantActivity.instance().displayWizard();
|
||||
} else if (id == R.id.setup_remote_provisioning) {
|
||||
} else if (id == R.id.create_account) {
|
||||
AssistantActivity.instance().displayCreateAccount();
|
||||
} else if (id == R.id.remote_provisioning) {
|
||||
AssistantActivity.instance().displayRemoteProvisioning();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public class RemoteProvisioningFragment extends Fragment implements OnClickListe
|
|||
Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.assistant_remote_provisioning, container, false);
|
||||
|
||||
remoteProvisioningUrl = (EditText) view.findViewById(R.id.setup_remote_provisioning_url);
|
||||
remoteProvisioningUrl = (EditText) view.findViewById(R.id.assistant_remote_provisioning_url);
|
||||
apply = (Button) view.findViewById(R.id.assistant_apply);
|
||||
apply.setOnClickListener(this);
|
||||
|
||||
|
|
Loading…
Reference in a new issue