diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 83c011bd6..7601dcb72 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -99,6 +99,16 @@
+
+
+
+
+
+
-
@@ -133,7 +143,7 @@
-
@@ -141,7 +151,7 @@
-
diff --git a/res/layout/assistant_account_creation.xml b/res/layout/assistant_account_creation.xml
index 8108f9c9d..5056c9b2a 100644
--- a/res/layout/assistant_account_creation.xml
+++ b/res/layout/assistant_account_creation.xml
@@ -5,30 +5,30 @@
android:orientation="vertical" >
+ android:layout_height="wrap_content"/>
-
+ android:layout_height="wrap_content" />
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
-
+
-
+ android:layout_alignParentRight="true" />
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ 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"/>
-
-
-
+
+
+
+
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ 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"/>
-
-
-
+
+
+
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+ 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"/>
-
+
diff --git a/res/layout/assistant_account_creation_confirm.xml b/res/layout/assistant_account_creation_confirm.xml
index 092817d50..eba5cab81 100644
--- a/res/layout/assistant_account_creation_confirm.xml
+++ b/res/layout/assistant_account_creation_confirm.xml
@@ -6,40 +6,38 @@
android:orientation="vertical" >
+ android:layout_height="wrap_content"/>
diff --git a/res/layout/setup_ec_calibration.xml b/res/layout/assistant_ec_calibration.xml
similarity index 100%
rename from res/layout/setup_ec_calibration.xml
rename to res/layout/assistant_ec_calibration.xml
diff --git a/res/layout/assistant_generic_login.xml b/res/layout/assistant_generic_login.xml
index 1daa35bf6..b06ed8049 100644
--- a/res/layout/assistant_generic_login.xml
+++ b/res/layout/assistant_generic_login.xml
@@ -7,14 +7,12 @@
-
-
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+
-
-
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+
+
-
-
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
+
+
+
-
-
+
+
-
-
+
\ No newline at end of file
diff --git a/res/layout/assistant_linphone_login.xml b/res/layout/assistant_linphone_login.xml
index 690369dfe..be2e0b927 100644
--- a/res/layout/assistant_linphone_login.xml
+++ b/res/layout/assistant_linphone_login.xml
@@ -5,92 +5,103 @@
android:orientation="vertical">
+ android:gravity="center">
+ android:paddingTop="10dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
-
-
-
-
-
+ android:singleLine="true"/>
+
+
+
+
+
+
+
+
-
-
+
-
\ No newline at end of file
diff --git a/res/layout/assistant_menu.xml b/res/layout/assistant_menu.xml
index b5dbbc236..07d20c24b 100644
--- a/res/layout/assistant_menu.xml
+++ b/res/layout/assistant_menu.xml
@@ -5,22 +5,21 @@
android:orientation="vertical">
+ android:layout_gravity="center"/>
+ android:layout_gravity="center">
+ android:layout_centerInParent="true"/>
@@ -48,14 +46,13 @@
+ android:layout_height="wrap_content"/>
@@ -67,14 +64,13 @@
+ android:layout_height="wrap_content"/>
@@ -86,14 +82,13 @@
+ android:layout_height="wrap_content"/>
diff --git a/res/layout/setup_remote_provisioning_login.xml b/res/layout/assistant_remote_provisioning_login.xml
similarity index 98%
rename from res/layout/setup_remote_provisioning_login.xml
rename to res/layout/assistant_remote_provisioning_login.xml
index c3e120838..6ee11bfbe 100644
--- a/res/layout/setup_remote_provisioning_login.xml
+++ b/res/layout/assistant_remote_provisioning_login.xml
@@ -1,7 +1,7 @@
+ android:layout_height="70dp">
+ android:layout_centerInParent="true"/>
+ android:layout_centerInParent="true"/>
-
-
\ No newline at end of file
diff --git a/res/values/color.xml b/res/values/color.xml
index fa60d4d10..101816be1 100644
--- a/res/values/color.xml
+++ b/res/values/color.xml
@@ -1,15 +1,6 @@
- #ffffff
- #000000
- #e1e1e1
- #c4c4c4
- #444444
- #ff5e00
- #96c11f
-
-
#ff5e00
#000000
#444444
diff --git a/res/values/custom.xml b/res/values/custom.xml
index f281116b8..20fdf0aaf 100644
--- a/res/values/custom.xml
+++ b/res/values/custom.xml
@@ -19,14 +19,6 @@
Fails to register to %s
Linphone %s SIP (rfc 3261) compatible phone under GNU Public License V2
http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2015 Belledonne Communications
-
- This assistant will help you to use a SIP account for your calls.
- Create an account on linphone.org
- I already have a linphone.org account
- I already have a SIP account
- Enter your linphone.org username and password
- Enter your SIP account username, password and domain
- username
SIP
diff --git a/res/values/non_localizable_custom.xml b/res/values/non_localizable_custom.xml
index 052f72835..97c647e76 100644
--- a/res/values/non_localizable_custom.xml
+++ b/res/values/non_localizable_custom.xml
@@ -1,5 +1,13 @@
+
+ false
+
+
+
+
+
+
false
@@ -23,7 +31,7 @@
false
false
- false
+
false
false
false
diff --git a/res/values/strings.xml b/res/values/strings.xml
index d8141ddd0..3959a3d27 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -6,24 +6,53 @@
free SIP VOIP client
-
- Welcome
- Assistant
- 1/2
- 2/2
+
+ Welcome
+ Assistant
+ Create a linphone account
+ I have a linphone account
+ I have a sip account
+ Remote provisioning
+ Create an account
+ 1/2
+ 2/2
+ Configure linphohe account
+ Configure Sip account
+ Remote provisioning
+ Create account
+ Apply
+ Apply
+
- Account
- Settings
- Wizard
- About
- - Exit
+
+
+
+
+ incoming call
+ outgoing call
+
+
+
+
+
+ Username
+ Display name
+ Password
+ Domain
+ Provisioning url
+ Email
Edit button
Valid button
+ Valid button
Add to contacts
New contact
@@ -109,9 +138,6 @@
paused
paused by remote
- incoming
- ringing
- calling
Mute
Speaker
Bluetooth
@@ -300,7 +326,6 @@
Registration failed
Number or address
Conference
- Incoming call
Draft
Enter a SIP address to chat with…
No call in your history.
@@ -317,7 +342,6 @@
Video size:
- Apply
password
domain
confirm password
@@ -422,7 +446,6 @@
Please wait...
Updating messages database
Default account
- Download provisioning
This assistant will download an existing configuration.
provisioning url
The configuration you downloaded doesn\'t include your account. Please fill it in.
diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java
index 53063bca0..fe6a9f8ff 100644
--- a/src/org/linphone/LinphoneActivity.java
+++ b/src/org/linphone/LinphoneActivity.java
@@ -27,6 +27,7 @@ import java.util.Collection;
import java.util.List;
import org.linphone.LinphoneManager.AddressType;
+import org.linphone.assistant.AssistantActivity;
import org.linphone.compatibility.Compatibility;
import org.linphone.core.CallDirection;
import org.linphone.core.LinphoneAddress;
@@ -45,8 +46,7 @@ import org.linphone.core.LinphoneCoreListenerBase;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.core.Reason;
import org.linphone.mediastream.Log;
-import org.linphone.setup.RemoteProvisioningLoginActivity;
-import org.linphone.setup.SetupActivity;
+import org.linphone.assistant.RemoteProvisioningLoginActivity;
import org.linphone.ui.AddressText;
import android.annotation.SuppressLint;
@@ -54,24 +54,17 @@ import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
-import android.app.SearchManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
-import android.database.ContentObserver;
import android.content.res.Configuration;
import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
-import android.provider.ContactsContract;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.LayoutInflater;
-import android.view.Menu;
-import android.view.MenuInflater;
-import android.view.MenuItem;
import android.view.OrientationEventListener;
import android.view.Surface;
import android.view.View;
@@ -81,17 +74,14 @@ import android.view.WindowManager;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
-import android.widget.BaseExpandableListAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
-import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.support.v4.widget.DrawerLayout;
import android.support.v4.app.ActionBarDrawerToggle;
-import android.support.v4.view.GravityCompat;
/**
* @author Sylvain Berfini
@@ -122,7 +112,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
private LinphoneCoreListenerBase mListener;
private String[] mParams;
private String mTitle;
- private RelativeLayout mDrawerList;
+ private RelativeLayout mDrawerList, exitLayout, headerLayout;
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mDrawerToggle;
ListView mDrawerListB;
@@ -165,7 +155,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
if (LinphonePreferences.instance().getAccountCount() > 0) {
LinphonePreferences.instance().firstLaunchSuccessful();
} else {
- startActivityForResult(new Intent().setClass(this, SetupActivity.class), FIRST_LOGIN_ACTIVITY);
+ startActivityForResult(new Intent().setClass(this, AssistantActivity.class), FIRST_LOGIN_ACTIVITY);
}
}
@@ -239,12 +229,8 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
public void callState(LinphoneCore lc, LinphoneCall call, LinphoneCall.State state, String message) {
if (state == State.IncomingReceived) {
startActivity(new Intent(LinphoneActivity.instance(), IncomingCallActivity.class));
- } else if (state == State.OutgoingInit) {
- if (call.getCurrentParamsCopy().getVideoEnabled()) {
- startVideoActivity(call);
- } else {
- startIncallActivity(call);
- }
+ } else if (state == State.OutgoingInit || state == State.OutgoingProgress) {
+ startActivity(new Intent(LinphoneActivity.instance(), OutgoingCallActivity.class));
} else if (state == State.CallEnd || state == State.Error || state == State.CallReleased) {
// Convert LinphoneCore message for internalization
if (message != null && call.getReason() == Reason.Declined) {
@@ -299,138 +285,63 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
mParams = getResources().getStringArray(R.array.menu_entry);
mDrawerList = (RelativeLayout) findViewById(R.id.left_drawer);
mDrawerListB = (ListView) findViewById(R.id.list_drawer);
- List dataList = new ArrayList();
-
-
- dataList.add(new DrawerItem("About"));
- dataList.add(new DrawerItem("Settings"));
- dataList.add(new DrawerItem("Help"));
-
- CustomDrawerAdapter adapter;
-
- adapter = new CustomDrawerAdapter(this, R.layout.custom_drawer_item,
- dataList);
-
- mDrawerListB.setAdapter(adapter);
-
- // set a custom shadow that overlays the main content when the drawer opens
- //mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
- // set up the drawer's list view with items and click listener
- // enable ActionBar app icon to behave as action to toggle nav drawer
- //getActionBar().setDisplayHomeAsUpEnabled(true);
- //getActionBar().setHomeButtonEnabled(true);
-
- // ActionBarDrawerToggle ties together the the proper interactions
- // between the sliding drawer and the action bar app icon
-
- //mDrawerLayout.setDrawerListener(mDrawerToggle);
-
-
- }
-
- class DrawerItem {
-
- String ItemName;
- int imgResID;
- String title;
- boolean isAccount;
-
- public DrawerItem(boolean isAccount) {
- this(null, 0);
- this.isAccount = isAccount;
- }
-
- public DrawerItem(String itemName, int imgResID) {
- ItemName = itemName;
- this.imgResID = imgResID;
- }
-
- public DrawerItem(String title) {
- this(null, 0);
- this.title = title;
- }
-
- public String getItemName() {
- return ItemName;
- }
-
- public void setItemName(String itemName) {
- ItemName = itemName;
- }
-
- public int getImgResID() {
- return imgResID;
- }
-
- public void setImgResID(int imgResID) {
- this.imgResID = imgResID;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public boolean isAccount() {
- return isAccount;
- }
-
- }
-
- public class CustomDrawerAdapter extends ArrayAdapter {
-
- Context context;
- List drawerItemList;
- int layoutResID;
-
- public CustomDrawerAdapter(Context context, int layoutResourceID,
- List listItems) {
- super(context, layoutResourceID, listItems);
- this.context = context;
- this.drawerItemList = listItems;
- this.layoutResID = layoutResourceID;
-
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
-
- // TODO Auto-generated method stub
- DrawerItemHolder drawerHolder;
- View view = convertView;
-
-
- if (view == null) {
- LayoutInflater inflater = ((Activity) context).getLayoutInflater();
- drawerHolder = new DrawerItemHolder();
-
- view = inflater.inflate(layoutResID, parent, false);
- drawerHolder.ItemName = (TextView) view.findViewById(R.id.drawer_itemName);
- drawerHolder.icon = (ImageView) view.findViewById(R.id.drawer_icon);
-
- //drawerHolder. = (ImageView) view
- // .findViewById(R.id.s);
-
- // drawerHolder.title = (TextView) view.findViewById(R.id.drawerTitle);
-
+ List dataList = new ArrayList();
+ mDrawerListB.setAdapter(new ArrayAdapter(this,R.layout.drawer_list_item, mParams));
+ mDrawerListB.setOnItemClickListener(new DrawerItemClickListener());
+ ImageView menubar = (ImageView) findViewById(R.id.menu_bar);
+ menubar.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ mDrawerLayout.openDrawer(mDrawerList);
}
+ });
- return view;
+ exitLayout = (RelativeLayout) findViewById(R.id.exitLayout);
+ exitLayout.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ exit();
+ }
+ });
+
+ headerLayout = (RelativeLayout) findViewById(R.id.headerLayout);
+
+ LinphoneProxyConfig proxy = LinphoneManager.getLc().getDefaultProxyConfig();
+ if(proxy != null){
+ try {
+ LinphoneAddress identity = LinphoneCoreFactory.instance().createLinphoneAddress(proxy.getIdentity());
+ TextView address = (TextView) findViewById(R.id.address);
+
+ address.setText(identity.asStringUriOnly());
+ TextView displayName = (TextView) findViewById(R.id.display_name);
+ if(identity.getDisplayName() != null)
+ displayName.setText(identity.getDisplayName());
+ else
+ displayName.setText(identity.getUserName());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else {
+ headerLayout.setVisibility(View.GONE);
}
+ headerLayout.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ displayAccountSettings(0);
+ mDrawerLayout.closeDrawer(mDrawerList);
+ }
+ });
- private class DrawerItemHolder {
- TextView ItemName, title;
- ImageView icon;
- LinearLayout itemLayout;
- RelativeLayout headerLayout, exitLayout;
- }
}
+ private class DrawerItemClickListener implements ListView.OnItemClickListener {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ selectItem(position);
+ }
+ }
private void selectItem(int position) {
// update the main content by replacing fragments
@@ -458,16 +369,13 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
case 3:
displayAbout();
break;
- case 4:
- exit();
- break;
default:
break;
}
mDrawerListB.setItemChecked(position, true);
//
- mDrawerLayout.closeDrawer(mDrawerListB);
+ mDrawerLayout.closeDrawer(mDrawerList);
}
@Override
@@ -841,7 +749,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
}
public void displayAssistant() {
- startActivity(new Intent(LinphoneActivity.this, SetupActivity.class));
+ startActivity(new Intent(LinphoneActivity.this, AssistantActivity.class));
}
public boolean displayChatMessageNotification(String address){
@@ -1346,15 +1254,16 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
LinphoneCall.State callState = call.getState();
if (callState == State.IncomingReceived) {
startActivity(new Intent(this, IncomingCallActivity.class));
+ } else if (callState == State.OutgoingInit) {
+ startActivity(new Intent(this, OutgoingCallActivity.class));
} else {
-
- if (call.getCurrentParamsCopy().getVideoEnabled()) {
- startVideoActivity(call);
- } else {
- startIncallActivity(call);
- }
+ if (call.getCurrentParamsCopy().getVideoEnabled()) {
+ startVideoActivity(call);
+ } else {
+ startIncallActivity(call);
}
}
+ }
}
}
@@ -1428,7 +1337,7 @@ public class LinphoneActivity extends Activity implements OnClickListener, Conta
if (call.getCurrentParamsCopy().getVideoEnabled()) {
startVideoActivity(call);
} else {
- startIncallActivity(call);
+ //startIncallActivity(call);
}
}
}
diff --git a/src/org/linphone/LinphoneLauncherActivity.java b/src/org/linphone/LinphoneLauncherActivity.java
index 7ac7a70c2..0bb5a5848 100644
--- a/src/org/linphone/LinphoneLauncherActivity.java
+++ b/src/org/linphone/LinphoneLauncherActivity.java
@@ -21,7 +21,7 @@ package org.linphone;
import static android.content.Intent.ACTION_MAIN;
import org.linphone.mediastream.Log;
-import org.linphone.setup.RemoteProvisioningActivity;
+import org.linphone.assistant.RemoteProvisioningActivity;
import org.linphone.tutorials.TutorialLauncherActivity;
import android.app.Activity;
diff --git a/src/org/linphone/assistant/AssistantActivity.java b/src/org/linphone/assistant/AssistantActivity.java
index 604d23a29..a61b40e70 100644
--- a/src/org/linphone/assistant/AssistantActivity.java
+++ b/src/org/linphone/assistant/AssistantActivity.java
@@ -49,8 +49,8 @@ import android.widget.Toast;
public class AssistantActivity extends Activity implements OnClickListener {
private static AssistantActivity instance;
private RelativeLayout back, cancel;
- private SetupFragmentsEnum currentFragment;
- private SetupFragmentsEnum firstFragment;
+ private AssistantFragmentsEnum currentFragment;
+ private AssistantFragmentsEnum firstFragment;
private Fragment fragment;
private LinphonePreferences mPrefs;
private boolean accountCreated = false;
@@ -69,12 +69,12 @@ public class AssistantActivity extends Activity implements OnClickListener {
initUI();
firstFragment = getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment) ?
- SetupFragmentsEnum.LINPHONE_LOGIN : SetupFragmentsEnum.MENU;
+ AssistantFragmentsEnum.LINPHONE_LOGIN : AssistantFragmentsEnum.MENU;
if (findViewById(R.id.fragmentContainer) != null) {
if (savedInstanceState == null) {
display(firstFragment);
} else {
- currentFragment = (SetupFragmentsEnum) savedInstanceState.getSerializable("CurrentFragment");
+ currentFragment = (AssistantFragmentsEnum) savedInstanceState.getSerializable("CurrentFragment");
}
}
mPrefs = LinphonePreferences.instance();
@@ -170,15 +170,15 @@ public class AssistantActivity extends Activity implements OnClickListener {
setResult(Activity.RESULT_CANCELED);
finish();
}
- } else if (currentFragment == SetupFragmentsEnum.GENERIC_LOGIN
- || currentFragment == SetupFragmentsEnum.LINPHONE_LOGIN
- || currentFragment == SetupFragmentsEnum.CREATE_ACCOUNT
- || currentFragment == SetupFragmentsEnum.REMOTE_PROVISIONING) {
+ } else if (currentFragment == AssistantFragmentsEnum.GENERIC_LOGIN
+ || currentFragment == AssistantFragmentsEnum.LINPHONE_LOGIN
+ || currentFragment == AssistantFragmentsEnum.CREATE_ACCOUNT
+ || currentFragment == AssistantFragmentsEnum.REMOTE_PROVISIONING) {
MenuFragment fragment = new MenuFragment();
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.MENU;
+ currentFragment = AssistantFragmentsEnum.MENU;
back.setVisibility(View.GONE);
- } else if (currentFragment == SetupFragmentsEnum.MENU) {
+ } else if (currentFragment == AssistantFragmentsEnum.MENU) {
finish();
}
}
@@ -190,7 +190,7 @@ public class AssistantActivity extends Activity implements OnClickListener {
EchoCancellerCalibrationFragment fragment = new EchoCancellerCalibrationFragment();
fragment.enableEcCalibrationResultSending(sendEcCalibrationResult);
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.ECHO_CANCELLER_CALIBRATION;
+ currentFragment = AssistantFragmentsEnum.ECHO_CANCELLER_CALIBRATION;
back.setVisibility(View.VISIBLE);
cancel.setEnabled(false);
} else {
@@ -230,7 +230,7 @@ public class AssistantActivity extends Activity implements OnClickListener {
logIn(username, password, displayName, domain, false);
}
- private void display(SetupFragmentsEnum fragment) {
+ private void display(AssistantFragmentsEnum fragment) {
switch (fragment) {
case MENU:
displayMenu();
@@ -247,35 +247,35 @@ public class AssistantActivity extends Activity implements OnClickListener {
public void displayMenu() {
fragment = new MenuFragment();
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.MENU;
+ currentFragment = AssistantFragmentsEnum.MENU;
back.setVisibility(View.GONE);
}
public void displayLoginGeneric() {
fragment = new GenericLoginFragment();
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.GENERIC_LOGIN;
+ currentFragment = AssistantFragmentsEnum.GENERIC_LOGIN;
back.setVisibility(View.VISIBLE);
}
public void displayLoginLinphone() {
fragment = new LinphoneLoginFragment();
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.LINPHONE_LOGIN;
+ currentFragment = AssistantFragmentsEnum.LINPHONE_LOGIN;
back.setVisibility(View.VISIBLE);
}
public void displayWizard() {
fragment = new CreateAccountFragment();
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.CREATE_ACCOUNT;
+ currentFragment = AssistantFragmentsEnum.CREATE_ACCOUNT;
back.setVisibility(View.VISIBLE);
}
public void displayRemoteProvisioning() {
fragment = new RemoteProvisioningFragment();
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.REMOTE_PROVISIONING;
+ currentFragment = AssistantFragmentsEnum.REMOTE_PROVISIONING;
back.setVisibility(View.VISIBLE);
}
@@ -368,7 +368,7 @@ public class AssistantActivity extends Activity implements OnClickListener {
fragment.setArguments(extras);
changeFragment(fragment);
- currentFragment = SetupFragmentsEnum.CREATE_ACCOUNT_CONFIRM;
+ currentFragment = AssistantFragmentsEnum.CREATE_ACCOUNT_CONFIRM;
back.setVisibility(View.GONE);
}
diff --git a/src/org/linphone/assistant/CreateAccountConfirmFragment.java b/src/org/linphone/assistant/CreateAccountConfirmFragment.java
index 45b76696d..0696e6e35 100644
--- a/src/org/linphone/assistant/CreateAccountConfirmFragment.java
+++ b/src/org/linphone/assistant/CreateAccountConfirmFragment.java
@@ -78,7 +78,7 @@ public class CreateAccountConfirmFragment extends Fragment {
Runnable runOk = new Runnable() {
public void run() {
- SetupActivity.instance().isAccountVerified(username);
+ AssistantActivity.instance().isAccountVerified(username);
}
};
diff --git a/src/org/linphone/assistant/CreateAccountFragment.java b/src/org/linphone/assistant/CreateAccountFragment.java
index 3b5bd87c5..958242c5f 100644
--- a/src/org/linphone/assistant/CreateAccountFragment.java
+++ b/src/org/linphone/assistant/CreateAccountFragment.java
@@ -83,8 +83,8 @@ public class CreateAccountFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.assistant_account_creation, container, false);
- username = (EditText) view.findViewById(R.id.setup_username);
- ImageView usernameOkIV = (ImageView) view.findViewById(R.id.setup_username_ok);
+ username = (EditText) view.findViewById(R.id.assistant_username);
+ ImageView usernameOkIV = (ImageView) view.findViewById(R.id.assistant_username_ok);
addXMLRPCUsernameHandler(username, usernameOkIV);
inputFilterCharacters = new String(acceptedChars);
@@ -106,20 +106,20 @@ public class CreateAccountFragment extends Fragment {
};
username.setFilters(new InputFilter[] { filter });
- password = (EditText) view.findViewById(R.id.setup_password);
- passwordConfirm = (EditText) view.findViewById(R.id.setup_password_confirm);
+ password = (EditText) view.findViewById(R.id.assistant_password);
+ passwordConfirm = (EditText) view.findViewById(R.id.assistant_password_confirm);
- ImageView passwordOkIV = (ImageView) view.findViewById(R.id.setup_password_ok);
+ ImageView passwordOkIV = (ImageView) view.findViewById(R.id.assistant_password_ok);
addXMLRPCPasswordHandler(password, passwordOkIV);
- ImageView passwordConfirmOkIV = (ImageView) view.findViewById(R.id.setup_confirm_password_ok);
+ ImageView passwordConfirmOkIV = (ImageView) view.findViewById(R.id.assistant_confirm_password_ok);
addXMLRPCConfirmPasswordHandler(password, passwordConfirm, passwordConfirmOkIV);
- email = (EditText) view.findViewById(R.id.setup_email);
- ImageView emailOkIV = (ImageView) view.findViewById(R.id.setup_email_ok);
+ email = (EditText) view.findViewById(R.id.assistant_email);
+ ImageView emailOkIV = (ImageView) view.findViewById(R.id.assistant_email_ok);
addXMLRPCEmailHandler(email, emailOkIV);
- errorMessage = (TextView) view.findViewById(R.id.setup_error);
+ errorMessage = (TextView) view.findViewById(R.id.assistant_error);
createAccount = (Button) view.findViewById(R.id.assistant_create);
createAccount.setEnabled(false);
@@ -239,7 +239,7 @@ public class CreateAccountFragment extends Fragment {
}
};
- final Context context = SetupActivity.instance() == null ? LinphoneService.instance().getApplicationContext() : SetupActivity.instance();
+ final Context context = AssistantActivity.instance() == null ? LinphoneService.instance().getApplicationContext() : AssistantActivity.instance();
try {
XMLRPCClient client = new XMLRPCClient(new URL(context.getString(R.string.wizard_url)));
@@ -253,8 +253,8 @@ public class CreateAccountFragment extends Fragment {
Runnable runOk = new Runnable() {
public void run() {
- SetupActivity.instance().saveCreatedAccount(username, password, null, context.getString(R.string.default_domain));
- SetupActivity.instance().displayWizardConfirm(username);
+ AssistantActivity.instance().saveCreatedAccount(username, password, null, context.getString(R.string.default_domain));
+ AssistantActivity.instance().displayWizardConfirm(username);
}
};
diff --git a/src/org/linphone/assistant/EchoCancellerCalibrationFragment.java b/src/org/linphone/assistant/EchoCancellerCalibrationFragment.java
index 1bdf75ebb..84a607ed4 100644
--- a/src/org/linphone/assistant/EchoCancellerCalibrationFragment.java
+++ b/src/org/linphone/assistant/EchoCancellerCalibrationFragment.java
@@ -53,7 +53,7 @@ public class EchoCancellerCalibrationFragment extends Fragment {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.setup_ec_calibration, container, false);
+ View view = inflater.inflate(R.layout.assistant_ec_calibration, container, false);
mListener = new LinphoneCoreListenerBase(){
@Override
@@ -68,7 +68,7 @@ public class EchoCancellerCalibrationFragment extends Fragment {
if (mSendEcCalibrationResult) {
sendEcCalibrationResult(status, delay_ms);
} else {
- SetupActivity.instance().isEchoCalibrationFinished();
+ AssistantActivity.instance().isEchoCalibrationFinished();
}
}
};
@@ -92,7 +92,7 @@ public class EchoCancellerCalibrationFragment extends Fragment {
XMLRPCCallback listener = new XMLRPCCallback() {
Runnable runFinished = new Runnable() {
public void run() {
- SetupActivity.instance().isEchoCalibrationFinished();
+ AssistantActivity.instance().isEchoCalibrationFinished();
}
};
diff --git a/src/org/linphone/assistant/GenericLoginFragment.java b/src/org/linphone/assistant/GenericLoginFragment.java
index 1fc42de22..b864d39a8 100644
--- a/src/org/linphone/assistant/GenericLoginFragment.java
+++ b/src/org/linphone/assistant/GenericLoginFragment.java
@@ -32,18 +32,19 @@ import android.widget.Toast;
* @author Sylvain Berfini
*/
public class GenericLoginFragment extends Fragment implements OnClickListener {
- private EditText login, password, domain;
+ private EditText login, password, displayName, domain;
private Button apply;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.setup_generic_login, container, false);
+ View view = inflater.inflate(R.layout.assistant_generic_login, container, false);
- login = (EditText) view.findViewById(R.id.setup_username);
- password = (EditText) view.findViewById(R.id.setup_password);
- domain = (EditText) view.findViewById(R.id.setup_domain);
- apply = (Button) view.findViewById(R.id.setup_apply);
+ login = (EditText) view.findViewById(R.id.assistant_username);
+ password = (EditText) view.findViewById(R.id.assistant_password);
+ displayName = (EditText) view.findViewById(R.id.assistant_display_name);
+ domain = (EditText) view.findViewById(R.id.assistant_domain);
+ apply = (Button) view.findViewById(R.id.assistant_apply);
apply.setOnClickListener(this);
return view;
@@ -53,13 +54,13 @@ public class GenericLoginFragment extends Fragment implements OnClickListener {
public void onClick(View v) {
int id = v.getId();
- if (id == R.id.setup_apply) {
+ if (id == R.id.assistant_apply) {
if (login.getText() == null || login.length() == 0 || password.getText() == null || password.length() == 0 || domain.getText() == null || domain.length() == 0) {
Toast.makeText(getActivity(), getString(R.string.first_launch_no_login_password), Toast.LENGTH_LONG).show();
return;
}
- SetupActivity.instance().genericLogIn(login.getText().toString(), password.getText().toString(), domain.getText().toString());
+ AssistantActivity.instance().genericLogIn(login.getText().toString(), password.getText().toString(), displayName.getText().toString(), domain.getText().toString());
}
}
}
diff --git a/src/org/linphone/assistant/LinphoneLoginFragment.java b/src/org/linphone/assistant/LinphoneLoginFragment.java
index c36576f88..c5c60d439 100644
--- a/src/org/linphone/assistant/LinphoneLoginFragment.java
+++ b/src/org/linphone/assistant/LinphoneLoginFragment.java
@@ -32,7 +32,7 @@ import android.widget.Toast;
* @author Sylvain Berfini
*/
public class LinphoneLoginFragment extends Fragment implements OnClickListener {
- private EditText login, password;
+ private EditText login, password, displayName;
private Button apply;
@Override
@@ -40,13 +40,14 @@ public class LinphoneLoginFragment extends Fragment implements OnClickListener {
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.assistant_linphone_login, container, false);
- login = (EditText) view.findViewById(R.id.setup_username);
- password = (EditText) view.findViewById(R.id.setup_password);
- apply = (Button) view.findViewById(R.id.setup_apply);
+ login = (EditText) view.findViewById(R.id.assistant_username);
+ password = (EditText) view.findViewById(R.id.assistant_password);
+ displayName = (EditText) view.findViewById(R.id.assistant_display_name);
+ apply = (Button) view.findViewById(R.id.assistant_apply);
apply.setOnClickListener(this);
if (getResources().getBoolean(R.bool.setup_use_linphone_as_first_fragment)) {
- view.findViewById(R.id.setup_apply_button).setVisibility(View.GONE);
+ view.findViewById(R.id.assistant_apply).setVisibility(View.GONE);
}
return view;
@@ -58,14 +59,14 @@ public class LinphoneLoginFragment extends Fragment implements OnClickListener {
return;
}
- SetupActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString(), getResources().getBoolean(R.bool.setup_account_validation_mandatory));
+ AssistantActivity.instance().linphoneLogIn(login.getText().toString(), password.getText().toString(), displayName.getText().toString(), getResources().getBoolean(R.bool.setup_account_validation_mandatory));
}
@Override
public void onClick(View v) {
int id = v.getId();
- if (id == R.id.setup_apply) {
+ if (id == R.id.assistant_apply) {
linphoneLogIn();
}
}
diff --git a/src/org/linphone/assistant/MenuFragment.java b/src/org/linphone/assistant/MenuFragment.java
index fc375ab06..aa51129aa 100644
--- a/src/org/linphone/assistant/MenuFragment.java
+++ b/src/org/linphone/assistant/MenuFragment.java
@@ -68,15 +68,14 @@ public class MenuFragment extends Fragment implements OnClickListener {
@Override
public void onClick(View v) {
int id = v.getId();
-
if (id == R.id.setup_login_generic) {
- SetupActivity.instance().displayLoginGeneric();
+ AssistantActivity.instance().displayLoginGeneric();
} else if (id == R.id.setup_login_linphone) {
- SetupActivity.instance().displayLoginLinphone();
+ AssistantActivity.instance().displayLoginLinphone();
} else if (id == R.id.setup_create_account) {
- SetupActivity.instance().displayWizard();
+ AssistantActivity.instance().displayWizard();
} else if (id == R.id.setup_remote_provisioning) {
- SetupActivity.instance().displayRemoteProvisioning();
+ AssistantActivity.instance().displayRemoteProvisioning();
}
}
}
diff --git a/src/org/linphone/assistant/RemoteProvisioningFragment.java b/src/org/linphone/assistant/RemoteProvisioningFragment.java
index 712574f85..259d4e532 100644
--- a/src/org/linphone/assistant/RemoteProvisioningFragment.java
+++ b/src/org/linphone/assistant/RemoteProvisioningFragment.java
@@ -22,10 +22,10 @@ public class RemoteProvisioningFragment extends Fragment implements OnClickListe
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.setup_remote_provisioning, container, false);
+ View view = inflater.inflate(R.layout.assistant_remote_provisioning, container, false);
remoteProvisioningUrl = (EditText) view.findViewById(R.id.setup_remote_provisioning_url);
- apply = (Button) view.findViewById(R.id.setup_apply);
+ apply = (Button) view.findViewById(R.id.assistant_apply);
apply.setOnClickListener(this);
return view;
@@ -35,7 +35,7 @@ public class RemoteProvisioningFragment extends Fragment implements OnClickListe
public void onClick(View v) {
int id = v.getId();
- if (id == R.id.setup_apply) {
+ if (id == R.id.assistant_apply) {
String url = remoteProvisioningUrl.getText().toString();
LinphonePreferences.instance().setRemoteProvisioningUrl(url);
diff --git a/src/org/linphone/assistant/RemoteProvisioningLoginActivity.java b/src/org/linphone/assistant/RemoteProvisioningLoginActivity.java
index 4eabeb256..8a1e44e43 100644
--- a/src/org/linphone/assistant/RemoteProvisioningLoginActivity.java
+++ b/src/org/linphone/assistant/RemoteProvisioningLoginActivity.java
@@ -44,13 +44,13 @@ public class RemoteProvisioningLoginActivity extends Activity implements OnClick
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.setup_remote_provisioning_login);
+ setContentView(R.layout.assistant_remote_provisioning_login);
login = (EditText) findViewById(R.id.setup_username);
password = (EditText) findViewById(R.id.setup_password);
domain = (EditText) findViewById(R.id.setup_domain);
- cancel = (RelativeLayout) findViewById(R.id.setup_cancel);
+ cancel = (RelativeLayout) findViewById(R.id.assistant_cancel);
cancel.setOnClickListener(this);
String defaultDomain = getIntent().getStringExtra("Domain");
@@ -94,7 +94,7 @@ public class RemoteProvisioningLoginActivity extends Activity implements OnClick
public void onClick(View v) {
int id = v.getId();
- if (id == R.id.setup_cancel) {
+ if (id == R.id.assistant_cancel) {
cancelWizard(false);
}
}
diff --git a/tests/src/org/linphone/test/AccountAssistant.java b/tests/src/org/linphone/test/AccountAssistant.java
index 3b08c857f..0a592ea6f 100644
--- a/tests/src/org/linphone/test/AccountAssistant.java
+++ b/tests/src/org/linphone/test/AccountAssistant.java
@@ -5,9 +5,9 @@ import junit.framework.Assert;
import org.linphone.LinphoneActivity;
import org.linphone.LinphoneManager;
import org.linphone.LinphonePreferences;
+import org.linphone.assistant.AssistantActivity;
import org.linphone.core.LinphoneProxyConfig;
import org.linphone.mediastream.video.capture.hwconf.Hacks;
-import org.linphone.setup.SetupActivity;
import android.test.suitebuilder.annotation.LargeTest;
import android.test.suitebuilder.annotation.MediumTest;
@@ -26,7 +26,7 @@ public class AccountAssistant extends SampleTest {
@LargeTest
public void testAWizardDisplayedAfterInstall() {
solo.waitForActivity("SetupActivity", 3000);
- solo.assertCurrentActivity("Expected Setup Activity", SetupActivity.class);
+ solo.assertCurrentActivity("Expected Setup Activity", AssistantActivity.class);
}
@SmallTest
@@ -34,7 +34,7 @@ public class AccountAssistant extends SampleTest {
@LargeTest
public void testBLoginWithLinphoneAccount() {
solo.waitForActivity("SetupActivity", 3000);
- solo.assertCurrentActivity("Expected Setup Activity", SetupActivity.class);
+ solo.assertCurrentActivity("Expected Setup Activity", AssistantActivity.class);
solo.clickOnView(solo.getView(org.linphone.R.id.setup_next));
solo.clickOnText(aContext.getString(org.linphone.R.string.setup_login_linphone));