Skip to content
Snippets Groups Projects
Commit 5cfc35d6 authored by alision's avatar alision
Browse files

* #27064 New creation process (faster), lightened parameters

Refactoring on accounts
parent 5de91788
Branches
Tags
No related merge requests found
Showing
with 764 additions and 317 deletions
...@@ -76,6 +76,15 @@ as that of the covered work. ...@@ -76,6 +76,15 @@ as that of the covered work.
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value="com.savoirfairelinux.sflphone.client.SFLPhoneHome" /> android:value="com.savoirfairelinux.sflphone.client.SFLPhoneHome" />
</activity> </activity>
<activity
android:name="com.savoirfairelinux.sflphone.client.AccountWizard"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.savoirfairelinux.sflphone.client.SFLPhoneHome" />
</activity>
<activity <activity
android:name="com.savoirfairelinux.sflphone.client.AccountPreferenceActivity" android:name="com.savoirfairelinux.sflphone.client.AccountPreferenceActivity"
android:label="@string/app_name" android:label="@string/app_name"
... ...
......
...@@ -76,6 +76,15 @@ as that of the covered work. ...@@ -76,6 +76,15 @@ as that of the covered work.
android:name="android.support.PARENT_ACTIVITY" android:name="android.support.PARENT_ACTIVITY"
android:value="com.savoirfairelinux.sflphone.client.SFLPhoneHome" /> android:value="com.savoirfairelinux.sflphone.client.SFLPhoneHome" />
</activity> </activity>
<activity
android:name="com.savoirfairelinux.sflphone.client.AccountWizard"
android:screenOrientation="portrait" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.savoirfairelinux.sflphone.client.SFLPhoneHome" />
</activity>
<activity <activity
android:name="com.savoirfairelinux.sflphone.client.AccountPreferenceActivity" android:name="com.savoirfairelinux.sflphone.client.AccountPreferenceActivity"
android:label="@string/app_name" android:label="@string/app_name"
... ...
......
...@@ -68,7 +68,7 @@ as that of the covered work. ...@@ -68,7 +68,7 @@ as that of the covered work.
<android.support.v4.view.ViewPager <android.support.v4.view.ViewPager
android:id="@+id/pager" android:id="@+id/pager"
android:layout_width="match_parent" android:layout_width="match_parent"
android:background="#000000" android:background="#FFFFFF"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" /> android:layout_weight="1" />
</LinearLayout> </LinearLayout>
... ...
......
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/login_form"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/light" >
<LinearLayout
style="@style/LoginFormContainer"
android:orientation="vertical" >
<EditText
android:id="@+id/alias"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_alias"
android:inputType="textEmailAddress"
android:maxLines="1"
android:singleLine="true" >
<requestFocus />
</EditText>
<EditText
android:id="@+id/hostname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_hostname"
android:maxLines="1"
android:singleLine="true" >
</EditText>
<EditText
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_username"
android:maxLines="1"
android:singleLine="true" />
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/prompt_password"
android:imeActionId="@+id/login"
android:imeActionLabel="@string/action_create_short"
android:imeOptions="actionUnspecified"
android:inputType="textPassword"
android:maxLines="1"
android:singleLine="true" />
<Button
android:id="@+id/create_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="16dp"
android:paddingLeft="32dp"
android:paddingRight="32dp"
android:text="@string/action_create" />
</LinearLayout>
</ScrollView>
\ No newline at end of file
<resources>
<!-- Strings related to login -->
<string name="prompt_alias">Alias</string>
<string name="prompt_hostname">Hostname</string>
<string name="prompt_username">Username</string>
<string name="prompt_password">Password</string>
<string name="action_create"><b>Create Account</b></string>
<string name="action_create_short">Create</string>
<string name="action_forgot_password">Recover lost password</string>
<string name="login_progress_signing_in">Signing in&#8230;</string>
<string name="error_invalid_email">This email address is invalid</string>
<string name="error_invalid_password">This password is too short</string>
<string name="error_incorrect_password">This password is incorrect</string>
<string name="error_field_required">This field is required</string>
</resources>
...@@ -39,4 +39,10 @@ as that of the covered work. ...@@ -39,4 +39,10 @@ as that of the covered work.
<item name="android:dividerHeight">5dp</item> <item name="android:dividerHeight">5dp</item>
</style> </style>
<style name="LoginFormContainer">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:padding">16dp</item>
</style>
</resources> </resources>
\ No newline at end of file
...@@ -33,14 +33,14 @@ as that of the covered work. ...@@ -33,14 +33,14 @@ as that of the covered work.
<PreferenceCategory <PreferenceCategory
android:id="@+id/account_basic_category" android:id="@+id/account_basic_category"
android:title="Basic settings"> android:title="Basic settings">
<CheckBoxPreference <!-- <CheckBoxPreference -->
android:id="@+id/account_creation_enable" <!-- android:id="@+id/account_creation_enable" -->
android:key="Account.enable" <!-- android:key="Account.enable" -->
android:persistent="false" <!-- android:persistent="false" -->
android:defaultValue="true" <!-- android:defaultValue="true" -->
android:title="Account enabled" <!-- android:title="Account enabled" -->
android:summaryOn="enabled" <!-- android:summaryOn="enabled" -->
android:summaryOff="disabled"/> <!-- android:summaryOff="disabled"/> -->
<!-- <EditTextPreference --> <!-- <EditTextPreference -->
<!-- android:id="@+id/account_creation_type" --> <!-- android:id="@+id/account_creation_type" -->
<!-- android:key="Account.type" --> <!-- android:key="Account.type" -->
... ...
......
...@@ -54,10 +54,14 @@ public class AccountDetailAdvanced implements AccountDetail { ...@@ -54,10 +54,14 @@ public class AccountDetailAdvanced implements AccountDetail {
public static final String CONFIG_LOCAL_PORT = "Account.localPort"; public static final String CONFIG_LOCAL_PORT = "Account.localPort";
public static final String CONFIG_PUBLISHED_PORT = "Account.publishedPort"; public static final String CONFIG_PUBLISHED_PORT = "Account.publishedPort";
public static final String CONFIG_PUBLISHED_ADDRESS = "Account.publishedAddress"; public static final String CONFIG_PUBLISHED_ADDRESS = "Account.publishedAddress";
public static final String CONFIG_DEFAULT_LOCAL_PORT = "5060";
public static final String CONFIG_DEFAULT_PUBLISHED_PORT = "5060";
public static final String CONFIG_DEFAULT_LOCAL_PORT = "5070";
public static final String CONFIG_DEFAULT_PUBLISHED_PORT = "5070";
public static final String CONFIG_DEFAULT_PUBLISHED_SAMEAS_LOCAL = "true"; public static final String CONFIG_DEFAULT_PUBLISHED_SAMEAS_LOCAL = "true";
public static final String CONFIG_DEFAULT_INTERFACE = "default"; public static final String CONFIG_DEFAULT_INTERFACE = "wlan0";
public static final String CONFIG_DEFAULT_REGISTRATION_EXPIRE = "60";
public static final String CONFIG_DISPLAY_NAME = "Account.displayName"; public static final String CONFIG_DISPLAY_NAME = "Account.displayName";
public static final String CONFIG_DEFAULT_ADDRESS = "0.0.0.0"; public static final String CONFIG_DEFAULT_ADDRESS = "0.0.0.0";
... ...
......
...@@ -23,6 +23,7 @@ package com.savoirfairelinux.sflphone.account; ...@@ -23,6 +23,7 @@ package com.savoirfairelinux.sflphone.account;
import com.savoirfairelinux.sflphone.R; import com.savoirfairelinux.sflphone.R;
import com.savoirfairelinux.sflphone.account.AccountDetail; import com.savoirfairelinux.sflphone.account.AccountDetail;
import com.savoirfairelinux.sflphone.service.ServiceConstants;
import android.util.Log; import android.util.Log;
...@@ -36,15 +37,22 @@ public class AccountDetailBasic implements AccountDetail { ...@@ -36,15 +37,22 @@ public class AccountDetailBasic implements AccountDetail {
private static final String TAG = "AccountDetailBasic"; private static final String TAG = "AccountDetailBasic";
public static final String BUNDLE_TAG = "BasicPreferenceArrayList"; public static final String BUNDLE_TAG = "BasicPreferenceArrayList";
public static final String CONFIG_ACCOUNT_ENABLE = "Account.enable";
public static final String CONFIG_ACCOUNT_TYPE = "Account.type";
public static final String CONFIG_ACCOUNT_ALIAS = "Account.alias";
public static final String CONFIG_ACCOUNT_HOSTNAME = "Account.hostname"; public static final String CONFIG_ACCOUNT_HOSTNAME = "Account.hostname";
public static final String CONFIG_ACCOUNT_USERNAME = "Account.username"; public static final String CONFIG_ACCOUNT_USERNAME = "Account.username";
public static final String CONFIG_ACCOUNT_ROUTESET = "Account.routeset"; public static final String CONFIG_ACCOUNT_ROUTESET = "Account.routeset";
public static final String CONFIG_ACCOUNT_PASSWORD = "Account.password"; public static final String CONFIG_ACCOUNT_PASSWORD = "Account.password";
public static final String CONFIG_ACCOUNT_REALM = "Account.realm"; public static final String CONFIG_ACCOUNT_REALM = "Account.realm";
public static final String CONFIG_ACCOUNT_USERAGENT = "Account.useragent"; public static final String CONFIG_ACCOUNT_USERAGENT = "Account.useragent";
public static final String CONFIG_ACCOUNT_AUTOANSWER = "Account.autoAnswer";
public static final String CONFIG_ACCOUNT_TYPE = "Account.type";
public static final String CONFIG_ACCOUNT_ALIAS = "Account.alias";
public static final String CONFIG_ACCOUNT_ENABLE = "Account.enable";
public static final String CONFIG_ACCOUNT_DEFAULT_TYPE = "SIP";
public static final String CONFIG_ACCOUNT_DEFAULT_ENABLE = "true";
public static final String CONFIG_ACCOUNT_DEFAULT_REALM = "*";
public static final String CONFIG_ACCOUNT_DEFAULT_USERAGENT = "SFLphone";
private ArrayList<AccountDetail.PreferenceEntry> privateArray; private ArrayList<AccountDetail.PreferenceEntry> privateArray;
... ...
......
...@@ -24,6 +24,7 @@ package com.savoirfairelinux.sflphone.account; ...@@ -24,6 +24,7 @@ package com.savoirfairelinux.sflphone.account;
import com.savoirfairelinux.sflphone.R; import com.savoirfairelinux.sflphone.R;
import com.savoirfairelinux.sflphone.account.AccountDetail; import com.savoirfairelinux.sflphone.account.AccountDetail;
import com.savoirfairelinux.sflphone.account.AccountDetail.PreferenceEntry; import com.savoirfairelinux.sflphone.account.AccountDetail.PreferenceEntry;
import com.savoirfairelinux.sflphone.service.ServiceConstants;
import android.util.Log; import android.util.Log;
... ...
......
...@@ -21,16 +21,13 @@ ...@@ -21,16 +21,13 @@
*/ */
package com.savoirfairelinux.sflphone.account; package com.savoirfairelinux.sflphone.account;
import com.savoirfairelinux.sflphone.R; import java.util.ArrayList;
import com.savoirfairelinux.sflphone.account.AccountDetail; import java.util.HashMap;
import com.savoirfairelinux.sflphone.account.AccountDetail.PreferenceEntry;
import android.util.Log; import android.util.Log;
import java.util.ArrayList; import com.savoirfairelinux.sflphone.R;
import java.util.Collection; import com.savoirfairelinux.sflphone.service.ServiceConstants;
import java.util.Set;
import java.util.HashMap;
public class AccountDetailTls implements AccountDetail { public class AccountDetailTls implements AccountDetail {
... ...
......
...@@ -36,28 +36,6 @@ public class SectionsPagerAdapter extends FragmentStatePagerAdapter { ...@@ -36,28 +36,6 @@ public class SectionsPagerAdapter extends FragmentStatePagerAdapter {
return fragments.get(i); return fragments.get(i);
} }
// public Fragment getFragment(int i) {
// Fragment fragment;
//
// switch (i) {
// case 0:
// fragment = new DialingFragment();
// break;
// case 1:
// fragment = new CallElementListFragment();
// break;
// case 2:
// fragment = new HistoryFragment();
// break;
// default:
// Log.e(TAG, "getClassName: unknown fragment position " + i);
// fragment = null;
// }
// Log.w(TAG, "getFragment: fragment=" + fragment);
// return fragment;
// }
public String getClassName(int i) { public String getClassName(int i) {
String name; String name;
... ...
......
...@@ -62,19 +62,14 @@ import com.savoirfairelinux.sflphone.account.AccountDetailAdvanced; ...@@ -62,19 +62,14 @@ import com.savoirfairelinux.sflphone.account.AccountDetailAdvanced;
import com.savoirfairelinux.sflphone.account.AccountDetailBasic; import com.savoirfairelinux.sflphone.account.AccountDetailBasic;
import com.savoirfairelinux.sflphone.account.AccountDetailSrtp; import com.savoirfairelinux.sflphone.account.AccountDetailSrtp;
import com.savoirfairelinux.sflphone.account.AccountDetailTls; import com.savoirfairelinux.sflphone.account.AccountDetailTls;
import com.savoirfairelinux.sflphone.service.ServiceConstants;
public class AccountPreferenceActivity extends PreferenceActivity { public class AccountPreferenceActivity extends PreferenceActivity {
private static final String TAG = "AccoutPreferenceActivity"; private static final String TAG = "AccoutPreferenceActivity";
public static final String KEY_MODE = "mode"; public static final String KEY_MODE = "mode";
public interface mode {
static final int CREATION_MODE = 0;
static final int EDITION_MODE = 1;
}
public interface result { public interface result {
static final int ACCOUNT_CREATED = Activity.RESULT_FIRST_USER + 0;
static final int ACCOUNT_MODIFIED = Activity.RESULT_FIRST_USER + 1; static final int ACCOUNT_MODIFIED = Activity.RESULT_FIRST_USER + 1;
static final int ACCOUNT_DELETED = Activity.RESULT_FIRST_USER + 2; static final int ACCOUNT_DELETED = Activity.RESULT_FIRST_USER + 2;
} }
...@@ -93,18 +88,7 @@ public class AccountPreferenceActivity extends PreferenceActivity { ...@@ -93,18 +88,7 @@ public class AccountPreferenceActivity extends PreferenceActivity {
addPreferencesFromResource(R.xml.account_creation_preferences); addPreferencesFromResource(R.xml.account_creation_preferences);
mPreferenceManager = getPreferenceManager(); mPreferenceManager = getPreferenceManager();
Bundle b = getIntent().getExtras();
switch (b.getInt(KEY_MODE)) {
case mode.CREATION_MODE:
Log.i(TAG, "CREATION");
initCreation();
break;
case mode.EDITION_MODE:
Log.i(TAG, "EDITION");
initEdition(); initEdition();
break;
}
getActionBar().setDisplayHomeAsUpEnabled(true); getActionBar().setDisplayHomeAsUpEnabled(true);
...@@ -116,19 +100,6 @@ public class AccountPreferenceActivity extends PreferenceActivity { ...@@ -116,19 +100,6 @@ public class AccountPreferenceActivity extends PreferenceActivity {
} }
private void initCreation() {
basicDetails = new AccountDetailBasic();
advancedDetails = new AccountDetailAdvanced();
srtpDetails = new AccountDetailSrtp();
tlsDetails = new AccountDetailTls();
addPreferenceListener(basicDetails, changeBasicPreferenceListener);
// addPreferenceListener(advancedDetails, changeAdvancedPreferenceListener);
// addPreferenceListener(srtpDetails, changeSrtpPreferenceListener);
// addPreferenceListener(tlsDetails, changeTlsPreferenceListener);
}
private void initEdition() { private void initEdition() {
Bundle b = getIntent().getExtras(); Bundle b = getIntent().getExtras();
...@@ -158,38 +129,18 @@ public class AccountPreferenceActivity extends PreferenceActivity { ...@@ -158,38 +129,18 @@ public class AccountPreferenceActivity extends PreferenceActivity {
public boolean onCreateOptionsMenu(Menu menu) { public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater(); MenuInflater inflater = getMenuInflater();
Bundle b = getIntent().getExtras();
switch (b.getInt(KEY_MODE)) {
case mode.CREATION_MODE:
Log.i(TAG, "CREATION");
inflater.inflate(R.menu.account_creation, menu);
break;
case mode.EDITION_MODE:
Log.i(TAG, "onCreateOptionsMenu: " + mAccountID); Log.i(TAG, "onCreateOptionsMenu: " + mAccountID);
if (mAccountID.equals("IP2IP"))
return true;
inflater.inflate(R.menu.account_edition, menu); inflater.inflate(R.menu.account_edition, menu);
break;
}
return true; return true;
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
Bundle b = getIntent().getExtras();
switch (b.getInt(KEY_MODE)) {
case mode.CREATION_MODE:
Log.i(TAG, "CREATION");
AlertDialog dialog = createCancelDialog(); AlertDialog dialog = createCancelDialog();
dialog.show(); dialog.show();
break;
case mode.EDITION_MODE:
finish();
}
} }
...@@ -204,10 +155,6 @@ public class AccountPreferenceActivity extends PreferenceActivity { ...@@ -204,10 +155,6 @@ public class AccountPreferenceActivity extends PreferenceActivity {
AlertDialog dialog = createDeleteDialog(); AlertDialog dialog = createDeleteDialog();
dialog.show(); dialog.show();
break; break;
case R.id.menuitem_create:
Toast.makeText(this, "ACCOUNT_CREATED", Toast.LENGTH_LONG).show();
processAccount(result.ACCOUNT_CREATED);
break;
case R.id.menuitem_edit: case R.id.menuitem_edit:
processAccount(result.ACCOUNT_MODIFIED); processAccount(result.ACCOUNT_MODIFIED);
break; break;
...@@ -232,7 +179,6 @@ public class AccountPreferenceActivity extends PreferenceActivity { ...@@ -232,7 +179,6 @@ public class AccountPreferenceActivity extends PreferenceActivity {
updateAccountDetails(accountDetails, tlsDetails); updateAccountDetails(accountDetails, tlsDetails);
accountDetails.put("Account.type", "SIP"); accountDetails.put("Account.type", "SIP");
Toast.makeText(this, "updateAccountDetails", Toast.LENGTH_LONG).show();
bundle.putSerializable(AccountDetail.TAG, accountDetails); bundle.putSerializable(AccountDetail.TAG, accountDetails);
Intent resultIntent = new Intent(); Intent resultIntent = new Intent();
resultIntent.putExtras(bundle); resultIntent.putExtras(bundle);
... ...
......
/*
* Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
*
* Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* Additional permission under GNU GPL version 3 section 7:
*
* If you modify this program, or any covered work, by linking or
* combining it with the OpenSSL project's OpenSSL library (or a
* modified version of that library), containing parts covered by the
* terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
* grants you additional permission to convey the resulting work.
* Corresponding Source for a non-source form of such a combination
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
package com.savoirfairelinux.sflphone.client;
import java.util.ArrayList;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v13.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.MenuItem;
import com.savoirfairelinux.sflphone.R;
import com.savoirfairelinux.sflphone.fragments.AccountCreationFragment;
import com.savoirfairelinux.sflphone.interfaces.AccountsInterface;
import com.savoirfairelinux.sflphone.service.ISipService;
import com.savoirfairelinux.sflphone.service.SipService;
public class AccountWizard extends Activity implements AccountsInterface {
static final String TAG = "AccountWizard";
public static final int ACCOUNT_CREATED = Activity.RESULT_OK;
ViewPager mViewPager;
private ISipService service;
private SectionsPagerAdapter mSectionsPagerAdapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_wizard);
mViewPager = (ViewPager) findViewById(R.id.pager);
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
Intent intent = new Intent(this, SipService.class);
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
}
/* activity finishes itself or is being killed by the system */
@Override
protected void onDestroy() {
/* stop the service, if no other bound user, no need to check if it is running */
unbindService(mConnection);
super.onDestroy();
}
/** Defines callbacks for service binding, passed to bindService() */
private ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className, IBinder binder) {
service = ISipService.Stub.asInterface(binder);
mSectionsPagerAdapter = new SectionsPagerAdapter(AccountWizard.this, getFragmentManager());
mViewPager.setAdapter(mSectionsPagerAdapter);
}
@Override
public void onServiceDisconnected(ComponentName arg0) {
}
};
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return true;
}
}
@Override
public void accountsChanged() {
// TODO Auto-generated method stub
}
@Override
public void accountStateChanged(Intent accountState) {
// TODO Auto-generated method stub
}
public class SectionsPagerAdapter extends FragmentStatePagerAdapter {
Context mContext;
final private int[] icon_res_id = { R.drawable.ic_tab_call, R.drawable.ic_tab_call, R.drawable.ic_tab_history };
ArrayList<Fragment> fragments;
public SectionsPagerAdapter(Context c, FragmentManager fm) {
super(fm);
mContext = c;
fragments = new ArrayList<Fragment>();
fragments.add(new AccountCreationFragment());
}
@Override
public Fragment getItem(int i) {
return fragments.get(i);
}
public String getClassName(int i) {
String name;
switch (i) {
case 0:
name = AccountCreationFragment.class.getName();
break;
default:
Log.e(TAG, "getClassName: unknown fragment position " + i);
return null;
}
// Log.w(TAG, "getClassName: name=" + name);
return name;
}
@Override
public int getCount() {
return 1;
}
public int getIconOf(int pos) {
return icon_res_id[pos];
}
@Override
public CharSequence getPageTitle(int position) {
switch (position) {
case 0:
return mContext.getString(R.string.title_section0).toUpperCase();
default:
Log.e(TAG, "getPageTitle: unknown tab position " + position);
break;
}
return null;
}
}
}
...@@ -100,9 +100,6 @@ public class SFLPhoneHomeActivity extends Activity implements DialingFragment.Ca ...@@ -100,9 +100,6 @@ public class SFLPhoneHomeActivity extends Activity implements DialingFragment.Ca
private CharSequence mDrawerTitle; private CharSequence mDrawerTitle;
private CharSequence mTitle; private CharSequence mTitle;
// AccountSelectionAdapter mAdapter;
// private Spinner spinnerAccounts;
public static final int REQUEST_CODE_PREFERENCES = 1; public static final int REQUEST_CODE_PREFERENCES = 1;
private static final int REQUEST_CODE_CALL = 2; private static final int REQUEST_CODE_CALL = 2;
... ...
......
package com.savoirfairelinux.sflphone.fragments;
import java.util.HashMap;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.savoirfairelinux.sflphone.R;
import com.savoirfairelinux.sflphone.account.AccountDetail;
import com.savoirfairelinux.sflphone.account.AccountDetailAdvanced;
import com.savoirfairelinux.sflphone.account.AccountDetailBasic;
import com.savoirfairelinux.sflphone.account.AccountDetailSrtp;
import com.savoirfairelinux.sflphone.account.AccountDetailTls;
public class AccountCreationFragment extends Fragment {
// Values for email and password at the time of the login attempt.
private String mAlias;
private String mHostname;
private String mUsername;
private String mPassword;
// UI references.
private EditText mAliasView;
private EditText mHostnameView;
private EditText mUsernameView;
private EditText mPasswordView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// mAdapter = new HistoryAdapter(getActivity(),new ArrayList<HashMap<String, String>>());
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
View inflatedView = inflater.inflate(R.layout.frag_account_creation, parent, false);
mAliasView = (EditText) inflatedView.findViewById(R.id.alias);
mHostnameView = (EditText) inflatedView.findViewById(R.id.hostname);
mUsernameView = (EditText) inflatedView.findViewById(R.id.username);
mPasswordView = (EditText) inflatedView.findViewById(R.id.password);
inflatedView.findViewById(R.id.create_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
attemptCreation();
}
});
return inflatedView;
}
@Override
public void onResume() {
super.onResume();
}
@Override
public void onStart() {
super.onStart();
}
/**
* Attempts to sign in or register the account specified by the login form. If there are form errors (invalid email, missing fields, etc.), the
* errors are presented and no actual login attempt is made.
*/
public void attemptCreation() {
// Reset errors.
mAliasView.setError(null);
mPasswordView.setError(null);
// Store values at the time of the login attempt.
mAlias = mAliasView.getText().toString();
mHostname = mHostnameView.getText().toString();
mUsername = mUsernameView.getText().toString();
mPassword = mPasswordView.getText().toString();
boolean cancel = false;
View focusView = null;
// Check for a valid password.
if (TextUtils.isEmpty(mPassword)) {
mPasswordView.setError(getString(R.string.error_field_required));
focusView = mPasswordView;
cancel = true;
}
if (TextUtils.isEmpty(mUsername)) {
mUsernameView.setError(getString(R.string.error_field_required));
focusView = mUsernameView;
cancel = true;
}
if (TextUtils.isEmpty(mHostname)) {
mHostnameView.setError(getString(R.string.error_field_required));
focusView = mHostnameView;
cancel = true;
}
// Check for a valid email address.
if (TextUtils.isEmpty(mAlias)) {
mAliasView.setError(getString(R.string.error_field_required));
focusView = mAliasView;
cancel = true;
}
if (cancel) {
// There was an error; don't attempt login and focus the first
// form field with an error.
focusView.requestFocus();
} else {
// Show a progress spinner, and kick off a background task to
// perform the user login attempt.
initCreation();
}
}
private void initCreation() {
HashMap<String, String> accountDetails = new HashMap<String, String>();
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_TYPE, AccountDetailBasic.CONFIG_ACCOUNT_DEFAULT_TYPE);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_ALIAS, mAlias);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_HOSTNAME, mHostname);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_USERNAME, mUsername);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_PASSWORD, mPassword);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_ROUTESET, "");
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_REALM, AccountDetailBasic.CONFIG_ACCOUNT_DEFAULT_REALM);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_ENABLE, AccountDetailBasic.CONFIG_ACCOUNT_DEFAULT_ENABLE);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_PASSWORD, mPassword);
accountDetails.put(AccountDetailBasic.CONFIG_ACCOUNT_USERAGENT, AccountDetailBasic.CONFIG_ACCOUNT_DEFAULT_USERAGENT);
accountDetails.put(AccountDetailAdvanced.CONFIG_LOCAL_PORT, AccountDetailAdvanced.CONFIG_DEFAULT_LOCAL_PORT);
accountDetails.put(AccountDetailAdvanced.CONFIG_LOCAL_INTERFACE, AccountDetailAdvanced.CONFIG_DEFAULT_INTERFACE);
accountDetails.put(AccountDetailAdvanced.CONFIG_PUBLISHED_PORT, AccountDetailAdvanced.CONFIG_DEFAULT_PUBLISHED_PORT);
accountDetails.put(AccountDetailAdvanced.CONFIG_PUBLISHED_ADDRESS, AccountDetailAdvanced.CONFIG_DEFAULT_ADDRESS);
accountDetails.put(AccountDetailAdvanced.CONFIG_ACCOUNT_REGISTRATION_EXPIRE, AccountDetailAdvanced.CONFIG_DEFAULT_REGISTRATION_EXPIRE);
accountDetails.put(AccountDetailAdvanced.CONFIG_STUN_SERVER, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_ACCOUNT_REGISTRATION_STATUS, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_ACCOUNT_REGISTRATION_STATE_CODE, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_ACCOUNT_REGISTRATION_STATE_DESC, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_ACCOUNT_AUTOANSWER, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_ACCOUNT_DTMF_TYPE, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_KEEP_ALIVE_ENABLED, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_STUN_SERVER, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_PUBLISHED_SAMEAS_LOCAL, AccountDetailAdvanced.CONFIG_DEFAULT_PUBLISHED_SAMEAS_LOCAL);
accountDetails.put(AccountDetailAdvanced.CONFIG_RINGTONE_ENABLED, "false");
accountDetails.put(AccountDetailAdvanced.CONFIG_RINGTONE_PATH, "");
accountDetails.put(AccountDetailAdvanced.CONFIG_STUN_ENABLE, "false");
accountDetails.put(AccountDetailSrtp.CONFIG_SRTP_KEY_EXCHANGE, "");
accountDetails.put(AccountDetailSrtp.CONFIG_SRTP_RTP_FALLBACK, "");
accountDetails.put(AccountDetailSrtp.CONFIG_SRTP_ENABLE, "");
accountDetails.put(AccountDetailSrtp.CONFIG_SRTP_KEY_EXCHANGE, "");
accountDetails.put(AccountDetailSrtp.CONFIG_ZRTP_DISPLAY_SAS, "");
accountDetails.put(AccountDetailSrtp.CONFIG_ZRTP_DISPLAY_SAS_ONCE, "");
accountDetails.put(AccountDetailSrtp.CONFIG_SRTP_KEY_EXCHANGE, "");
accountDetails.put(AccountDetailSrtp.CONFIG_ZRTP_HELLO_HASH, "");
accountDetails.put(AccountDetailSrtp.CONFIG_ZRTP_NOT_SUPP_WARNING, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_CIPHERS, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_LISTENER_PORT, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_METHOD, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_ENABLE, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_PASSWORD, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_PRIVATE_KEY_FILE, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_SERVER_NAME, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_REQUIRE_CLIENT_CERTIFICATE, "false");
accountDetails.put(AccountDetailTls.CONFIG_TLS_LISTENER_PORT, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_VERIFY_CLIENT, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_CERTIFICATE_FILE, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_CA_LIST_FILE, "");
accountDetails.put(AccountDetailTls.CONFIG_TLS_VERIFY_SERVER, "");
Bundle bundle = new Bundle();
bundle.putSerializable(AccountDetail.TAG, accountDetails);
Intent resultIntent = new Intent();
resultIntent.putExtras(bundle);
getActivity().setResult(Activity.RESULT_OK, resultIntent);
getActivity().finish();
}
private AlertDialog createCancelDialog() {
Activity ownerActivity = getActivity();
AlertDialog.Builder builder = new AlertDialog.Builder(ownerActivity);
builder.setMessage("All parameters will be lost").setTitle("Account Creation").setPositiveButton("Ok", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
Activity activity = ((Dialog) dialog).getOwnerActivity();
activity.finish();
}
}).setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
/* Terminate with no action */
}
});
AlertDialog alertDialog = builder.create();
alertDialog.setOwnerActivity(ownerActivity);
return alertDialog;
}
}
/* /*
* Copyright (C) 2004-2012 Savoir-Faire Linux Inc. * Copyright (C) 2004-2013 Savoir-Faire Linux Inc.
* *
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com> * Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
* Alexandre Lision <alexandre.lision@savoirfairelinux.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -41,7 +42,6 @@ import android.content.Context; ...@@ -41,7 +42,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment;
import android.os.RemoteException; import android.os.RemoteException;
import android.preference.Preference; import android.preference.Preference;
import android.preference.PreferenceCategory; import android.preference.PreferenceCategory;
...@@ -49,6 +49,7 @@ import android.preference.PreferenceFragment; ...@@ -49,6 +49,7 @@ import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen; import android.preference.PreferenceScreen;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
import android.util.Log; import android.util.Log;
import android.widget.Toast;
import com.savoirfairelinux.sflphone.R; import com.savoirfairelinux.sflphone.R;
import com.savoirfairelinux.sflphone.account.AccountDetail; import com.savoirfairelinux.sflphone.account.AccountDetail;
...@@ -57,8 +58,10 @@ import com.savoirfairelinux.sflphone.account.AccountDetailBasic; ...@@ -57,8 +58,10 @@ import com.savoirfairelinux.sflphone.account.AccountDetailBasic;
import com.savoirfairelinux.sflphone.account.AccountDetailSrtp; import com.savoirfairelinux.sflphone.account.AccountDetailSrtp;
import com.savoirfairelinux.sflphone.account.AccountDetailTls; import com.savoirfairelinux.sflphone.account.AccountDetailTls;
import com.savoirfairelinux.sflphone.client.AccountPreferenceActivity; import com.savoirfairelinux.sflphone.client.AccountPreferenceActivity;
import com.savoirfairelinux.sflphone.client.AccountWizard;
import com.savoirfairelinux.sflphone.client.SFLPhonePreferenceActivity; import com.savoirfairelinux.sflphone.client.SFLPhonePreferenceActivity;
import com.savoirfairelinux.sflphone.client.SFLphoneApplication; import com.savoirfairelinux.sflphone.client.SFLphoneApplication;
import com.savoirfairelinux.sflphone.model.Account;
import com.savoirfairelinux.sflphone.service.ConfigurationManagerCallback; import com.savoirfairelinux.sflphone.service.ConfigurationManagerCallback;
import com.savoirfairelinux.sflphone.service.ISipService; import com.savoirfairelinux.sflphone.service.ISipService;
import com.savoirfairelinux.sflphone.service.ServiceConstants; import com.savoirfairelinux.sflphone.service.ServiceConstants;
...@@ -71,7 +74,7 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -71,7 +74,7 @@ public class AccountManagementFragment extends PreferenceFragment {
private SFLPhonePreferenceActivity sflphonePreferenceActivity; private SFLPhonePreferenceActivity sflphonePreferenceActivity;
private ISipService service = null; private ISipService service = null;
ArrayList<AccountDetail.PreferenceEntry> basicDetailKeys = null; // ArrayList<AccountDetail.PreferenceEntry> basicDetailKeys = null;
// ArrayList<AccountDetail.PreferenceEntry> advancedDetailKeys = null; // ArrayList<AccountDetail.PreferenceEntry> advancedDetailKeys = null;
// ArrayList<AccountDetail.PreferenceEntry> srtpDetailKeys = null; // ArrayList<AccountDetail.PreferenceEntry> srtpDetailKeys = null;
// ArrayList<AccountDetail.PreferenceEntry> tlsDetailKeys = null; // ArrayList<AccountDetail.PreferenceEntry> tlsDetailKeys = null;
...@@ -87,7 +90,7 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -87,7 +90,7 @@ public class AccountManagementFragment extends PreferenceFragment {
} }
public AccountManagementFragment() { public AccountManagementFragment() {
basicDetailKeys = AccountDetailBasic.getPreferenceEntries(); // basicDetailKeys = AccountDetailBasic.getPreferenceEntries();
// advancedDetailKeys = AccountDetailAdvanced.getPreferenceEntries(); // advancedDetailKeys = AccountDetailAdvanced.getPreferenceEntries();
// srtpDetailKeys = AccountDetailSrtp.getPreferenceEntries(); // srtpDetailKeys = AccountDetailSrtp.getPreferenceEntries();
// tlsDetailKeys = AccountDetailTls.getPreferenceEntries(); // tlsDetailKeys = AccountDetailTls.getPreferenceEntries();
...@@ -111,7 +114,6 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -111,7 +114,6 @@ public class AccountManagementFragment extends PreferenceFragment {
Log.e(TAG, "onCreate() service=" + service); Log.e(TAG, "onCreate() service=" + service);
} }
} }
Log.w(TAG, "onCreate() service=" + service);
setPreferenceScreen(getAccountListPreferenceScreen()); setPreferenceScreen(getAccountListPreferenceScreen());
...@@ -136,11 +138,15 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -136,11 +138,15 @@ public class AccountManagementFragment extends PreferenceFragment {
public void onActivityResult(int requestCode, int resultCode, Intent data) { public void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (requestCode) { switch (requestCode) {
case ACCOUNT_CREATE_REQUEST: case ACCOUNT_CREATE_REQUEST:
if (resultCode == AccountPreferenceActivity.result.ACCOUNT_CREATED) { if (resultCode == AccountWizard.ACCOUNT_CREATED) {
Bundle bundle = data.getExtras(); Bundle bundle = data.getExtras();
Log.i(TAG, "Create account settings"); Log.i(TAG, "Create account settings");
HashMap<String, String> accountDetails = new HashMap<String, String>(); HashMap<String, String> accountDetails = new HashMap<String, String>();
accountDetails = (HashMap<String, String>) bundle.getSerializable(AccountDetail.TAG); accountDetails = (HashMap<String, String>) bundle.getSerializable(AccountDetail.TAG);
// if(accountDetails == null){
// Toast.makeText(getActivity(), "NUUUUL", Toast.LENGTH_SHORT).show();
// } else
// Toast.makeText(getActivity(), "OKKKK", Toast.LENGTH_SHORT).show();
createNewAccount(accountDetails); createNewAccount(accountDetails);
} }
break; break;
...@@ -247,28 +253,23 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -247,28 +253,23 @@ public class AccountManagementFragment extends PreferenceFragment {
private void launchAccountCreationActivity(Preference preference) { private void launchAccountCreationActivity(Preference preference) {
Log.i(TAG, "Launch account creation activity"); Log.i(TAG, "Launch account creation activity");
Intent intent = preference.getIntent(); Intent intent = preference.getIntent();
intent.putExtra(AccountPreferenceActivity.KEY_MODE, AccountPreferenceActivity.mode.CREATION_MODE);
startActivityForResult(intent, ACCOUNT_CREATE_REQUEST); startActivityForResult(intent, ACCOUNT_CREATE_REQUEST);
} }
private void launchAccountEditActivity(Preference preference) { private void launchAccountEditActivity(Preference preference) {
Log.i(TAG, "Launch account edit activity"); Log.i(TAG, "Launch account edit activity");
Intent intent = preference.getIntent(); Intent intent = preference.getIntent();
intent.putExtra(AccountPreferenceActivity.KEY_MODE, AccountPreferenceActivity.mode.EDITION_MODE);
Bundle bundle = intent.getExtras(); Bundle bundle = intent.getExtras();
String accountID = bundle.getString("AccountID"); String accountID = bundle.getString("AccountID");
HashMap<String, String> preferenceMap = getAccountDetails(accountID); HashMap<String, String> preferenceMap = getAccountDetails(accountID);
AccountDetailBasic basicDetails = new AccountDetailBasic(preferenceMap); Account d = new Account(accountID, preferenceMap);
AccountDetailAdvanced advancedDetails = new AccountDetailAdvanced(preferenceMap);
AccountDetailSrtp srtpDetails = new AccountDetailSrtp(preferenceMap);
AccountDetailTls tlsDetails = new AccountDetailTls(preferenceMap);
bundle.putStringArrayList(AccountDetailBasic.BUNDLE_TAG, basicDetails.getValuesOnly()); bundle.putStringArrayList(AccountDetailBasic.BUNDLE_TAG, d.getBasicDetails().getValuesOnly());
bundle.putStringArrayList(AccountDetailAdvanced.BUNDLE_TAG, advancedDetails.getValuesOnly()); bundle.putStringArrayList(AccountDetailAdvanced.BUNDLE_TAG, d.getAdvancedDetails().getValuesOnly());
bundle.putStringArrayList(AccountDetailSrtp.BUNDLE_TAG, srtpDetails.getValuesOnly()); bundle.putStringArrayList(AccountDetailSrtp.BUNDLE_TAG, d.getSrtpDetails().getValuesOnly());
bundle.putStringArrayList(AccountDetailTls.BUNDLE_TAG, tlsDetails.getValuesOnly()); bundle.putStringArrayList(AccountDetailTls.BUNDLE_TAG, d.getTlsDetails().getValuesOnly());
intent.putExtras(bundle); intent.putExtras(bundle);
...@@ -293,13 +294,6 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -293,13 +294,6 @@ public class AccountManagementFragment extends PreferenceFragment {
HashMap<String, String> accountDetails = null; HashMap<String, String> accountDetails = null;
try { try {
accountDetails = (HashMap<String, String>) service.getAccountDetails(accountID); accountDetails = (HashMap<String, String>) service.getAccountDetails(accountID);
// ArrayList<Integer> tmp = (ArrayList<Integer>) service.getAudioCodecList(accountID);
// for(Integer i : tmp){
// Log.w(TAG,"Codec : "+i);
// }
// if (accountDetails.containsKey("TLS.negotiationTimeoutSec"))
// Log.i(TAG, "localinterface existe");
} catch (RemoteException e) { } catch (RemoteException e) {
Log.e(TAG, "Cannot call service method", e); Log.e(TAG, "Cannot call service method", e);
} }
...@@ -313,11 +307,11 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -313,11 +307,11 @@ public class AccountManagementFragment extends PreferenceFragment {
mRoot = getPreferenceManager().createPreferenceScreen(currentContext); mRoot = getPreferenceManager().createPreferenceScreen(currentContext);
// Default account category // Default account category
PreferenceCategory defaultAccountCat = new PreferenceCategory(currentContext); // PreferenceCategory defaultAccountCat = new PreferenceCategory(currentContext);
defaultAccountCat.setTitle(R.string.default_account_category); // defaultAccountCat.setTitle(R.string.default_account_category);
mRoot.addPreference(defaultAccountCat); // mRoot.addPreference(defaultAccountCat);
//
mRoot.addPreference(createAccountPreferenceScreen(DEFAULT_ACCOUNT_ID)); // mRoot.addPreference(createAccountPreferenceScreen(DEFAULT_ACCOUNT_ID));
// Account list category // Account list category
PreferenceCategory accountListCat = new PreferenceCategory(currentContext); PreferenceCategory accountListCat = new PreferenceCategory(currentContext);
...@@ -327,7 +321,7 @@ public class AccountManagementFragment extends PreferenceFragment { ...@@ -327,7 +321,7 @@ public class AccountManagementFragment extends PreferenceFragment {
Preference createNewAccount = new Preference(currentContext); Preference createNewAccount = new Preference(currentContext);
createNewAccount.setTitle("Create New Account"); createNewAccount.setTitle("Create New Account");
createNewAccount.setOnPreferenceClickListener(launchAccountCreationOnClick); createNewAccount.setOnPreferenceClickListener(launchAccountCreationOnClick);
createNewAccount.setIntent(new Intent().setClass(getActivity(), AccountPreferenceActivity.class)); createNewAccount.setIntent(new Intent().setClass(getActivity(), AccountWizard.class));
mRoot.addPreference(createNewAccount); mRoot.addPreference(createNewAccount);
ArrayList<String> accountList = getAccountList(); ArrayList<String> accountList = getAccountList();
... ...
......
...@@ -31,9 +31,12 @@ ...@@ -31,9 +31,12 @@
package com.savoirfairelinux.sflphone.fragments; package com.savoirfairelinux.sflphone.fragments;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.app.Activity; import android.app.Activity;
import android.app.Fragment; import android.app.Fragment;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
...@@ -54,7 +57,6 @@ public class DialingFragment extends Fragment { ...@@ -54,7 +57,6 @@ public class DialingFragment extends Fragment {
private static final String TAG = DialingFragment.class.getSimpleName(); private static final String TAG = DialingFragment.class.getSimpleName();
public static final String ARG_SECTION_NUMBER = "section_number"; public static final String ARG_SECTION_NUMBER = "section_number";
ClearableEditText textField; ClearableEditText textField;
// private AccountSelectionSpinner mAccountSelectionSpinner; // private AccountSelectionSpinner mAccountSelectionSpinner;
...@@ -62,8 +64,6 @@ public class DialingFragment extends Fragment { ...@@ -62,8 +64,6 @@ public class DialingFragment extends Fragment {
private Callbacks mCallbacks = sDummyCallbacks; private Callbacks mCallbacks = sDummyCallbacks;
// private Spinner spinnerAccounts; // private Spinner spinnerAccounts;
/** /**
* A dummy implementation of the {@link Callbacks} interface that does nothing. Used only when this fragment is not attached to an activity. * A dummy implementation of the {@link Callbacks} interface that does nothing. Used only when this fragment is not attached to an activity.
*/ */
...@@ -118,8 +118,6 @@ public class DialingFragment extends Fragment { ...@@ -118,8 +118,6 @@ public class DialingFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {
View inflatedView = inflater.inflate(R.layout.frag_dialing, parent, false); View inflatedView = inflater.inflate(R.layout.frag_dialing, parent, false);
textField = (ClearableEditText) inflatedView.findViewById(R.id.textField); textField = (ClearableEditText) inflatedView.findViewById(R.id.textField);
((ImageButton) inflatedView.findViewById(R.id.buttonCall)).setOnClickListener(new OnClickListener() { ((ImageButton) inflatedView.findViewById(R.id.buttonCall)).setOnClickListener(new OnClickListener() {
@Override @Override
...@@ -157,6 +155,7 @@ public class DialingFragment extends Fragment { ...@@ -157,6 +155,7 @@ public class DialingFragment extends Fragment {
return inflatedView; return inflatedView;
} }
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment