ui: update account preferences

Tuleap: #102
Change-Id: I89f6a285d84cbc40784963077b92683269f0ce4a
diff --git a/ring-android/app/src/main/AndroidManifest.xml b/ring-android/app/src/main/AndroidManifest.xml
index f0e0ef6..03f54ec 100644
--- a/ring-android/app/src/main/AndroidManifest.xml
+++ b/ring-android/app/src/main/AndroidManifest.xml
@@ -113,7 +113,7 @@
             android:name=".client.AccountEditionActivity"
             android:label="@string/app_name"
             android:screenOrientation="portrait"
-            android:theme="@style/AppThemeWithoutOverlay" />
+            android:theme="@style/AppThemeWithoutOverlayCompatNoShadow" />
         <activity
             android:name=".client.DetailHistoryActivity"
             android:label="@string/app_name"
diff --git a/ring-android/app/src/main/java/cx/ring/client/AccountEditionActivity.java b/ring-android/app/src/main/java/cx/ring/client/AccountEditionActivity.java
index d53f4cb..5d3c11f 100644
--- a/ring-android/app/src/main/java/cx/ring/client/AccountEditionActivity.java
+++ b/ring-android/app/src/main/java/cx/ring/client/AccountEditionActivity.java
@@ -1,8 +1,9 @@
 /*
- *  Copyright (C) 2004-2014 Savoir-Faire Linux Inc.
+ *  Copyright (C) 2004-2015 Savoir-faire Linux Inc.
  *
  *  Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
  *          Alexandre Savard <alexandre.savard@savoirfairelinux.com>
+ *          Adrien Béraud <adrien.beraud@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
@@ -17,17 +18,6 @@
  *  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 cx.ring.client;
@@ -41,9 +31,12 @@
 import android.os.Bundle;
 import android.os.IBinder;
 import android.os.RemoteException;
-import android.support.v13.app.FragmentStatePagerAdapter;
+import android.support.v13.app.FragmentPagerAdapter;
 import android.support.v4.view.ViewPager;
+import android.support.v7.app.ActionBar;
+import android.support.v7.app.AppCompatActivity;
 import android.util.Log;
+import android.util.Pair;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -55,16 +48,14 @@
 import cx.ring.model.account.Account;
 import cx.ring.service.IDRingService;
 import cx.ring.service.LocalService;
-import com.astuetz.PagerSlidingTabStrip;
 import java.util.ArrayList;
-import java.util.Locale;
 import java.util.Map;
 import java.util.Observable;
 import java.util.Observer;
 
 import cx.ring.fragments.GeneralAccountFragment;
 
-public class AccountEditionActivity extends Activity implements LocalService.Callbacks, GeneralAccountFragment.Callbacks, AudioManagementFragment.Callbacks,
+public class AccountEditionActivity extends AppCompatActivity implements LocalService.Callbacks, GeneralAccountFragment.Callbacks, AudioManagementFragment.Callbacks,
         AdvancedAccountFragment.Callbacks, SecurityAccountFragment.Callbacks, NestedSettingsFragment.Callbacks {
     private static final String TAG = AccountEditionActivity.class.getSimpleName();
 
@@ -96,36 +87,38 @@
             mBound = true;
 
             setContentView(R.layout.activity_account_settings);
-            getActionBar().setDisplayHomeAsUpEnabled(true);
+
+            final ActionBar actionBar = getSupportActionBar();
+
+            actionBar.setDisplayHomeAsUpEnabled(true);
+            actionBar.setElevation(0);
+
             String account_id = getIntent().getData().getLastPathSegment();
             Log.i(TAG, "Service connected " + className.getClassName() + " " + getIntent().getData().toString());
 
             acc_selected = service.getAccount(account_id);
             acc_selected.addObserver(mAccountObserver);
-            getActionBar().setTitle(acc_selected.getAlias());
+            actionBar.setTitle(acc_selected.getAlias());
 
-            ArrayList<Fragment> fragments = new ArrayList<>();
+            ArrayList<Pair<String, Fragment>> fragments = new ArrayList<>();
             if (acc_selected.isIP2IP()) {
-                fragments.add(new AudioManagementFragment());
+                fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_audio_tab), new AudioManagementFragment()));
             } else {
-                fragments.add(new GeneralAccountFragment());
-                fragments.add(new AudioManagementFragment());
+                fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_basic_tab), new GeneralAccountFragment()));
+                fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_audio_tab), new AudioManagementFragment()));
                 if(acc_selected.isSip())
                 {
-                    fragments.add(new AdvancedAccountFragment());
-                    fragments.add(new SecurityAccountFragment());
+                    fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_advanced_tab), new AdvancedAccountFragment()));
+                    fragments.add(new Pair<String, Fragment>(getString(R.string.account_preferences_security_tab), new SecurityAccountFragment()));
                 }
             }
 
-            ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);
-
+            final ViewPager mViewPager = (ViewPager) findViewById(R.id.pager);
             mPreferencesPagerAdapter = new PreferencesPagerAdapter(AccountEditionActivity.this, getFragmentManager(), fragments);
             mViewPager.setAdapter(mPreferencesPagerAdapter);
             mViewPager.setOffscreenPageLimit(3);
-
-            final PagerSlidingTabStrip strip = PagerSlidingTabStrip.class.cast(findViewById(R.id.pager_sliding_strip));
-
-            strip.setViewPager(mViewPager);
+            com.astuetz.PagerSlidingTabStrip mSlidingTabLayout = (com.astuetz.PagerSlidingTabStrip) findViewById(R.id.sliding_tabs);
+            mSlidingTabLayout.setViewPager(mViewPager);
         }
 
         @Override
@@ -215,7 +208,7 @@
             Map<String, String> details = acc_selected.getDetails();
             service.getRemoteService().setAccountDetails(acc_selected.getAccountID(), details);
             Log.w(TAG, "service.setAccountDetails " + details.get("Account.hostname"));
-            getActionBar().setTitle(acc_selected.getAlias());;
+            getSupportActionBar().setTitle(acc_selected.getAlias());;
 
         } catch (RemoteException e) {
             e.printStackTrace();
@@ -263,16 +256,15 @@
         return service;
     }
 
-    public class PreferencesPagerAdapter extends FragmentStatePagerAdapter {
+    public class PreferencesPagerAdapter extends FragmentPagerAdapter {
 
         Context mContext;
-        ArrayList<Fragment> fragments;
+        ArrayList<Pair<String, Fragment>> fragments;
 
-        public PreferencesPagerAdapter(Context c, FragmentManager fm, ArrayList<Fragment> items) {
+        public PreferencesPagerAdapter(Context c, FragmentManager fm, ArrayList<Pair<String, Fragment>> items) {
             super(fm);
             mContext = c;
-            fragments = new ArrayList<Fragment>(items);
-
+            fragments = items;
         }
 
         @Override
@@ -282,29 +274,12 @@
 
         @Override
         public Fragment getItem(int position) {
-            return fragments.get(position);
+            return fragments.get(position).second;
         }
 
         @Override
         public CharSequence getPageTitle(int position) {
-            switch (position) {
-            case 0:
-                if (acc_selected.isIP2IP()) {
-                    return getString(R.string.account_preferences_audio_tab).toUpperCase(Locale.getDefault());
-                } else {
-                    return getString(R.string.account_preferences_basic_tab).toUpperCase(Locale.getDefault());
-                }
-            case 1:
-                return getString(R.string.account_preferences_audio_tab).toUpperCase(Locale.getDefault());
-            case 2:
-                return getString(R.string.account_preferences_advanced_tab).toUpperCase(Locale.getDefault());
-            case 3:
-                return getString(R.string.account_preferences_security_tab).toUpperCase(Locale.getDefault());
-            default:
-                Log.e(TAG, "getPreferencePageTitle: unknown tab position " + position);
-                break;
-            }
-            return null;
+            return fragments.get(position).first;
         }
     }
 
diff --git a/ring-android/app/src/main/java/cx/ring/fragments/AccountCreationFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/AccountCreationFragment.java
index 07e0d53..5bc1c7f 100644
--- a/ring-android/app/src/main/java/cx/ring/fragments/AccountCreationFragment.java
+++ b/ring-android/app/src/main/java/cx/ring/fragments/AccountCreationFragment.java
@@ -39,9 +39,7 @@
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.AdapterView;
 import android.widget.EditText;
-import android.widget.Spinner;
 import android.widget.TextView;
 import android.widget.TextView.OnEditorActionListener;
 import android.widget.Toast;
diff --git a/ring-android/app/src/main/java/cx/ring/fragments/AccountsManagementFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/AccountsManagementFragment.java
index 065dada..fd47509 100644
--- a/ring-android/app/src/main/java/cx/ring/fragments/AccountsManagementFragment.java
+++ b/ring-android/app/src/main/java/cx/ring/fragments/AccountsManagementFragment.java
@@ -122,7 +122,6 @@
         this.setHasOptionsMenu(true);
 
         mShortAnimationDuration = getResources().getInteger(android.R.integer.config_mediumAnimTime);
-        Log.i(TAG, "anim time: " + mShortAnimationDuration);
         //getLoaderManager().initLoader(LoaderConstants.ACCOUNTS_LOADER, null, this);
 
         IntentFilter intentFilter = new IntentFilter();
@@ -416,11 +415,14 @@
 
     private void refreshAccountList() {
         Log.i(TAG, "refreshAccountList");
-        mAccountsAdapter.replaceAll(mCallbacks.getService().getAccounts());
+        LocalService service = mCallbacks.getService();
+        if (service == null)
+            return;
+        mAccountsAdapter.replaceAll(service.getAccounts());
         if (mAccountsAdapter.isEmpty()) {
             mDnDListView.setEmptyView(getView().findViewById(R.id.empty_account_list));
         }
-        mIP2IPAdapter.replaceAll(mCallbacks.getService().getIP2IPAccount());
+        mIP2IPAdapter.replaceAll(service.getIP2IPAccount());
         Log.i(TAG, "refreshAccountList DONE");
         mAccountsAdapter.notifyDataSetChanged();
         mIP2IPAdapter.notifyDataSetChanged();
diff --git a/ring-android/app/src/main/java/cx/ring/fragments/AdvancedAccountFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/AdvancedAccountFragment.java
index 71e7da4..a25e6f1 100644
--- a/ring-android/app/src/main/java/cx/ring/fragments/AdvancedAccountFragment.java
+++ b/ring-android/app/src/main/java/cx/ring/fragments/AdvancedAccountFragment.java
@@ -44,6 +44,7 @@
 import android.preference.Preference;
 import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.PreferenceFragment;
+import android.preference.SwitchPreference;
 import android.util.Log;
 import cx.ring.model.account.AccountDetail;
 import cx.ring.model.account.AccountDetailAdvanced;
@@ -113,7 +114,7 @@
                 if (!p.isTwoState) {
                     pref.setSummary(p.mValue);
                 } else if (pref.getKey().contentEquals(AccountDetailAdvanced.CONFIG_STUN_ENABLE)) {
-                    ((CheckBoxPreference) pref).setChecked(p.mValue.contentEquals("true"));
+                    ((SwitchPreference) pref).setChecked(p.mValue.contentEquals("true"));
                     findPreference(AccountDetailAdvanced.CONFIG_STUN_SERVER).setEnabled(p.mValue.contentEquals("true"));
                 } else if (pref.getKey().contentEquals("Account.publishedSameAsLocal")) {
                     ((CheckBoxPreference) pref).setChecked(p.mValue.contentEquals("true"));
diff --git a/ring-android/app/src/main/java/cx/ring/fragments/AudioManagementFragment.java b/ring-android/app/src/main/java/cx/ring/fragments/AudioManagementFragment.java
index d41cfe4..da44a8e 100644
--- a/ring-android/app/src/main/java/cx/ring/fragments/AudioManagementFragment.java
+++ b/ring-android/app/src/main/java/cx/ring/fragments/AudioManagementFragment.java
@@ -49,10 +49,9 @@
 import android.content.Context;
 import android.os.Bundle;
 import android.os.RemoteException;
-import android.preference.CheckBoxPreference;
 import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.PreferenceFragment;
+import android.preference.SwitchPreference;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -67,7 +66,8 @@
 import android.widget.ListView;
 import android.widget.TextView;
 
-public class AudioManagementFragment extends PreferenceFragment {
+public class AudioManagementFragment extends PreferenceFragment
+{
     static final String TAG = AudioManagementFragment.class.getSimpleName();
 
     protected Callbacks mCallbacks = sDummyCallbacks;
@@ -235,7 +235,6 @@
             totalHeight += firstHeight;
         }
 
-        totalHeight += getView().findViewById(R.id.list_header_title).getMeasuredHeight();
         LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) llMain.getLayoutParams();
         params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount()));
         llMain.setLayoutParams(params);
@@ -243,23 +242,22 @@
     }
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-
+    public void onCreate(Bundle bundle) {
+        super.onCreate(bundle);
         addPreferencesFromResource(R.xml.account_audio_prefs);
         listAdapter = new CodecAdapter(getActivity());
         listAdapter.setDataset(codecs);
 
         setPreferenceDetails(mCallbacks.getAccount().getAdvancedDetails());
         findPreference(AccountDetailAdvanced.CONFIG_RINGTONE_PATH).setEnabled(
-                ((CheckBoxPreference) findPreference(AccountDetailAdvanced.CONFIG_RINGTONE_ENABLED)).isChecked());
+                ((SwitchPreference) findPreference(AccountDetailAdvanced.CONFIG_RINGTONE_ENABLED)).isChecked());
         addPreferenceListener(mCallbacks.getAccount().getAdvancedDetails(), changeAudioPreferenceListener);
     }
 
     Preference.OnPreferenceChangeListener changeAudioPreferenceListener = new Preference.OnPreferenceChangeListener() {
         @Override
         public boolean onPreferenceChange(Preference preference, Object newValue) {
-            if (preference instanceof CheckBoxPreference) {
+            if (preference instanceof SwitchPreference) {
                 if (preference.getKey().contentEquals(AccountDetailAdvanced.CONFIG_RINGTONE_ENABLED))
                     getPreferenceScreen().findPreference(AccountDetailAdvanced.CONFIG_RINGTONE_PATH).setEnabled((Boolean) newValue);
                 mCallbacks.getAccount().getAdvancedDetails().setDetailString(preference.getKey(), newValue.toString());
@@ -296,7 +294,7 @@
                     }
 
                 } else {
-                    ((CheckBoxPreference) pref).setChecked(p.mValue.contentEquals("true"));
+                    ((SwitchPreference) pref).setChecked(p.mValue.contentEquals("true"));
                 }
 
             } else {
@@ -305,7 +303,7 @@
         }
     }
 
-    private void addPreferenceListener(AccountDetail details, OnPreferenceChangeListener listener) {
+    private void addPreferenceListener(AccountDetail details, Preference.OnPreferenceChangeListener listener) {
         for (AccountDetail.PreferenceEntry p : details.getDetailValues()) {
             Log.i(TAG, "addPreferenceListener: pref " + p.mKey + p.mValue);
             Preference pref = findPreference(p.mKey);
@@ -377,14 +375,16 @@
                 entryView = (CodecView) rowView.getTag();
             }
 
-            if (items.get(pos).isSpeex())
+            Codec codec = items.get(pos);
+
+            if (codec.isSpeex())
                 entryView.samplerate.setVisibility(View.VISIBLE);
             else
                 entryView.samplerate.setVisibility(View.GONE);
 
-            entryView.name.setText(items.get(pos).getName());
-            entryView.samplerate.setText(items.get(pos).getSampleRate());
-            entryView.enabled.setChecked(items.get(pos).isEnabled());
+            entryView.name.setText(codec.getName());
+            entryView.samplerate.setText(codec.getSampleRate());
+            entryView.enabled.setChecked(codec.isEnabled());
 
             return rowView;
 
diff --git a/ring-android/app/src/main/res/layout/activity_account_settings.xml b/ring-android/app/src/main/res/layout/activity_account_settings.xml
index f9473ad..9c7e2fe 100644
--- a/ring-android/app/src/main/res/layout/activity_account_settings.xml
+++ b/ring-android/app/src/main/res/layout/activity_account_settings.xml
@@ -1,33 +1,37 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical"
     tools:context=".client.AccountEditionActivity">
 
     <com.astuetz.PagerSlidingTabStrip
-        android:id="@+id/pager_sliding_strip"
+        android:id="@+id/sliding_tabs"
         android:layout_width="match_parent"
-        android:layout_height="?android:attr/actionBarSize"
-        android:layout_alignParentTop="true"
-        android:textColor="@color/white"
-        android:background="@color/color_primary_light_shadow"
-        app:pstsIndicatorColor="@color/color_primary_light"
+        android:layout_height="48dp"
+        android:background="@color/color_primary_light"
+        android:elevation="4dp"
+        android:textColor="@color/text_color_primary_dark"
+        app:pstsUnderlineHeight="0dp"
         app:pstsShouldExpand="true"
-        app:pstsUnderlineColor="@color/color_primary_light"
-        />
+        app:paddingStart="20dp"
+        app:pstsIndicatorHeight="2dp"
+        app:pstsIndicatorColor="@android:color/white"
+        app:pstsDividerColor="@android:color/transparent"/>
 
     <android.support.v4.view.ViewPager
         android:id="@+id/pager"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:layout_below="@+id/pager_sliding_strip" />
+        android:layout_below="@id/sliding_tabs"
+        android:layout_alignParentBottom="true" />
 
     <FrameLayout
         android:id="@+id/hidden_container"
         android:layout_width="match_parent"
-        android:layout_height="match_parent" >
+        android:layout_height="match_parent"
+        android:layout_alignTop="@+id/pager">
     </FrameLayout>
 
 </RelativeLayout>
\ No newline at end of file
diff --git a/ring-android/app/src/main/res/layout/frag_accounts_list.xml b/ring-android/app/src/main/res/layout/frag_accounts_list.xml
index ebd1421..3de8015 100644
--- a/ring-android/app/src/main/res/layout/frag_accounts_list.xml
+++ b/ring-android/app/src/main/res/layout/frag_accounts_list.xml
@@ -5,56 +5,58 @@
     android:layout_height="match_parent"
     android:orientation="vertical">
 
-        <TextView
+    <TextView
+        style="@style/Subheader"
+        android:layout_width="match_parent"
+        android:layout_height="48dp"
+        android:gravity="center_vertical"
+        android:paddingStart="72dp"
+        android:paddingEnd="72dp"
+        android:text="@string/normal_accounts_titles" />
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:minHeight="72dp">
+
+        <cx.ring.views.dragsortlv.DragSortListView
+            android:id="@+id/accounts_list"
             android:layout_width="match_parent"
-            android:layout_height="48dp"
-            android:paddingLeft="72dp"
-            android:text="Comptes"
-            style="@style/Subheader"
-            android:gravity="center_vertical" />
+            android:layout_height="wrap_content"
+            android:background="@color/white"
+            android:choiceMode="multipleChoice"
+            android:dividerHeight="1px"
+            android:elevation="2dp"
+            android:visibility="visible"
+            dslv:collapsed_height="1px"
+            dslv:drag_enabled="true"
+            dslv:drag_handle_id="@id/drag_handle"
+            dslv:drag_scroll_start="0.33"
+            dslv:drag_start_mode="onDown"
+            dslv:float_alpha="0.6"
+            dslv:float_background_color="@color/action_blue"
+            dslv:remove_enabled="false"
+            dslv:slide_shuffle_speed="0.3" />
 
-       <RelativeLayout
-           android:layout_width="match_parent"
-           android:layout_height="wrap_content"
-           android:minHeight="72dp">
+        <TextView
+            android:id="@+id/empty_account_list"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerInParent="true"
+            android:layout_gravity="center"
+            android:gravity="center"
+            android:text="@string/empty_account_list"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:textColor="@color/text_color_secondary"
+            android:visibility="gone" />
 
-           <cx.ring.views.dragsortlv.DragSortListView
-               android:id="@+id/accounts_list"
-               android:layout_width="match_parent"
-               android:layout_height="wrap_content"
-               android:background="@color/white"
-               android:choiceMode="multipleChoice"
-               android:dividerHeight="1px"
-               android:visibility="visible"
-               dslv:collapsed_height="1px"
-               dslv:drag_enabled="true"
-               dslv:drag_handle_id="@id/drag_handle"
-               dslv:drag_scroll_start="0.33"
-               dslv:drag_start_mode="onDown"
-               dslv:float_alpha="0.6"
-               dslv:float_background_color="@color/action_blue"
-               dslv:remove_enabled="false"
-               dslv:slide_shuffle_speed="0.3" />
-
-           <TextView
-               android:id="@+id/empty_account_list"
-               android:layout_width="wrap_content"
-               android:layout_height="wrap_content"
-               android:layout_centerInParent="true"
-               android:layout_gravity="center"
-               android:gravity="center"
-               android:text="@string/empty_account_list"
-               android:textAppearance="?android:attr/textAppearanceMedium"
-               android:textColor="@color/text_color_secondary"
-               android:visibility="gone">
-           </TextView>
-
-       </RelativeLayout>
+    </RelativeLayout>
 
     <ListView
         android:id="@+id/ip2ip"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@color/white" />
+        android:background="@color/white"
+        android:elevation="2dp" />
 
 </LinearLayout>
\ No newline at end of file
diff --git a/ring-android/app/src/main/res/layout/frag_audio_mgmt.xml b/ring-android/app/src/main/res/layout/frag_audio_mgmt.xml
index b89a291..4247b5c 100644
--- a/ring-android/app/src/main/res/layout/frag_audio_mgmt.xml
+++ b/ring-android/app/src/main/res/layout/frag_audio_mgmt.xml
@@ -5,7 +5,7 @@
 
     <LinearLayout
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
+        android:layout_height="wrap_content"
         android:layout_marginLeft="10dp"
         android:layout_marginRight="10dp"
         android:orientation="vertical" >
@@ -13,43 +13,28 @@
         <LinearLayout
             android:id="@+id/lv_holder_prefs"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:orientation="vertical"
-            android:weightSum="1" >
-
+            android:weightSum="1">
             <ListView
                 android:id="@android:id/list"
                 android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_margin="5dp" >
+                android:layout_height="wrap_content">
             </ListView>
         </LinearLayout>
 
-        <TextView
-            android:id="@+id/list_header_title"
-            style="?android:attr/listSeparatorTextViewStyle"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginLeft="10dp"
-            android:layout_marginRight="10dp"
-            android:paddingBottom="2dip"
-            android:paddingLeft="5dp"
-            android:paddingTop="2dp"
-            android:text="Codecs" />
-
         <LinearLayout
             android:id="@+id/lv_holder"
             android:layout_width="match_parent"
-            android:layout_height="match_parent"
+            android:layout_height="wrap_content"
             android:orientation="vertical"
-            android:weightSum="1" >
+            android:weightSum="1">
 
             <cx.ring.views.dragsortlv.DragSortListView
                 xmlns:dslv="http://schemas.android.com/apk/res/cx.ring"
                 android:id="@+id/dndlistview"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_margin="5dp"
                 android:choiceMode="multipleChoice"
                 android:descendantFocusability="beforeDescendants"
                 android:dividerHeight="1px"
@@ -63,6 +48,7 @@
                 dslv:float_background_color="@color/action_blue"
                 dslv:remove_enabled="false"
                 dslv:slide_shuffle_speed="0.3" />
+
         </LinearLayout>
     </LinearLayout>
 
diff --git a/ring-android/app/src/main/res/layout/item_codec.xml b/ring-android/app/src/main/res/layout/item_codec.xml
index cd0bd51..8488463 100644
--- a/ring-android/app/src/main/res/layout/item_codec.xml
+++ b/ring-android/app/src/main/res/layout/item_codec.xml
@@ -12,7 +12,7 @@
             android:layout_height="wrap_content"
             android:layout_centerVertical="true"
             android:layout_alignParentLeft="true"
-            android:layout_marginLeft="10dp"
+            android:layout_marginLeft="16dp"
             android:src="@drawable/ic_reorder_black_24dp"/>
 
     <TextView
@@ -20,22 +20,24 @@
         android:layout_width="wrap_content"
         android:layout_height="?android:attr/listPreferredItemHeight"
         android:layout_toRightOf="@+id/drag_handle"
-        android:layout_marginLeft="4dp"
+        android:layout_marginLeft="32dp"
         android:gravity="center_vertical"
-        android:textSize="18sp" />
+        android:textSize="16sp"
+        android:textColor="@color/text_color_primary"
+        android:text="H.264" />
 
     <TextView
         android:id="@+id/codec_samplerate"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignBottom="@+id/codec_name"
-        android:layout_alignTop="@+id/codec_name"
         android:layout_centerVertical="true"
-        android:layout_marginLeft="4dp"
         android:layout_toRightOf="@+id/codec_name"
         android:gravity="center_vertical"
         android:textSize="12sp"
-        android:visibility="gone" />
+        android:text="32000"
+        android:textColor="@color/text_color_secondary"
+        android:layout_marginLeft="16dp"
+        android:layout_alignBaseline="@+id/codec_name" />
 
     <CheckBox
         android:id="@+id/codec_checked"
@@ -44,6 +46,8 @@
         android:layout_alignParentRight="true"
         android:layout_centerVertical="true"
         android:clickable="false"
-        android:focusable="false" />
+        android:focusable="false"
+        android:layout_marginLeft="16dp"
+        android:layout_marginRight="16dp" />
 
 </RelativeLayout>
\ No newline at end of file
diff --git a/ring-android/app/src/main/res/menu/account_edition.xml b/ring-android/app/src/main/res/menu/account_edition.xml
index 5e8a7a6..0454d01 100644
--- a/ring-android/app/src/main/res/menu/account_edition.xml
+++ b/ring-android/app/src/main/res/menu/account_edition.xml
@@ -1,10 +1,11 @@
 <?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <item
         android:id="@+id/menuitem_delete"
         android:icon="@drawable/ic_delete_white_24dp"
-        android:showAsAction="ifRoom"
-        android:title="@string/ab_account_edition_1"/>
+        android:title="@string/ab_account_edition_1"
+        app:showAsAction="ifRoom"/>
 
 </menu>
\ No newline at end of file
diff --git a/ring-android/app/src/main/res/xml/account_advanced_prefs.xml b/ring-android/app/src/main/res/xml/account_advanced_prefs.xml
index c779ef4..a7ffb9e 100644
--- a/ring-android/app/src/main/res/xml/account_advanced_prefs.xml
+++ b/ring-android/app/src/main/res/xml/account_advanced_prefs.xml
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!--
-Copyright (C) 2004-2014 Savoir-Faire Linux Inc.                     
+Copyright (C) 2004-2015 Savoir-faire Linux Inc.                     
                                                                     
-Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>                   
+Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>    
+Author: Adrien Béraud <adrien.beraud@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
@@ -17,19 +18,7 @@
 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.
 -->
-
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res/cx.ring" >
 
@@ -79,7 +68,7 @@
             android:id="@+id/account_stun_category"
             android:title="@string/account_published_address_label" >
 
-        <CheckBoxPreference
+        <SwitchPreference
             android:id="@+id/account_stun_enable"
             android:key="STUN.enable"
             android:persistent="false"
diff --git a/ring-android/app/src/main/res/xml/account_audio_prefs.xml b/ring-android/app/src/main/res/xml/account_audio_prefs.xml
index 6f9e62f..313dac6 100644
--- a/ring-android/app/src/main/res/xml/account_audio_prefs.xml
+++ b/ring-android/app/src/main/res/xml/account_audio_prefs.xml
@@ -1,9 +1,9 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Copyright (C) 2004-2014 Savoir-Faire Linux Inc.                     
+<?xml version="1.0" encoding="utf-8"?><!--
+Copyright (C) 2004-2015 Savoir-faire Linux Inc.                     
                                                                     
-Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>                   
-                                                                    
+Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
+Author: Adrien Béraud <adrien.beraud@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   
@@ -15,25 +15,14 @@
 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         
+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.
 -->
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" >
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
 
     <PreferenceCategory
         android:id="@+id/audio_dtmf_category"
-        android:title="@string/account_dtmf_label" >
+        android:title="@string/account_dtmf_label">
         <ListPreference
             android:id="@+id/account_dtmf_type"
             android:entries="@array/dtmf_types_entries"
@@ -44,8 +33,8 @@
     </PreferenceCategory>
     <PreferenceCategory
         android:id="@+id/audio_ringtone_category"
-        android:title="@string/account_ringtone_label" >
-        <CheckBoxPreference
+        android:title="@string/account_ringtone_label">
+        <SwitchPreference
             android:id="@+id/audio_ringtone"
             android:key="Account.ringtoneEnabled"
             android:persistent="false"
@@ -53,10 +42,15 @@
 
         <Preference
             android:id="@+id/audio_ringtone_path"
-            android:key="Account.ringtonePath"
             android:enabled="false"
+            android:key="Account.ringtonePath"
             android:persistent="false"
             android:title="@string/account_ringtone_path_label" />
     </PreferenceCategory>
 
+    <PreferenceCategory
+        android:id="@+id/audio_codecs"
+        android:title="Codecs">
+    </PreferenceCategory>
+
 </PreferenceScreen>
\ No newline at end of file