ui: add Ring account type
Change-Id: Id1bd9da2e3e7ce07d60d2781869774f8c655cc15
diff --git a/ring-android/app/src/main/res/layout/frag_account_creation.xml b/ring-android/app/src/main/res/layout/frag_account_creation.xml
index 05829b9..b8af89d 100644
--- a/ring-android/app/src/main/res/layout/frag_account_creation.xml
+++ b/ring-android/app/src/main/res/layout/frag_account_creation.xml
@@ -2,58 +2,104 @@
<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" >
+ android:layout_height="match_parent">
<LinearLayout
style="@style/AccountFormContainer"
- android:orientation="vertical" >
+ android:orientation="vertical"
+ android:descendantFocusability="beforeDescendants"
+ android:focusableInTouchMode="true" >
- <Spinner
- android:id="@+id/account_type"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:entries="@array/accountType"
- android:typeface="monospace" />
-
- <EditText
- android:id="@+id/alias"
+ <LinearLayout
+ android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:hint="@string/prompt_alias"
- android:singleLine="true"
- android:typeface="monospace" >
+ android:gravity="center_vertical">
- <requestFocus />
- </EditText>
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/account_type"
+ android:id="@+id/textView3"
+ android:layout_marginRight="16dp" />
- <EditText
- android:id="@+id/hostname"
+ <Spinner
+ android:id="@+id/account_type"
+ android:layout_width="match_parent"
+ android:layout_height="52dp"
+android:minHeight="52dp"
+ android:entries="@array/accountType"
+ android:typeface="monospace" />
+
+ </LinearLayout>
+
+ <FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:hint="@string/prompt_hostname"
- android:singleLine="true"
- android:typeface="monospace" >
- </EditText>
+ android:id="@+id/field_flipper"
+ >
- <EditText
- android:id="@+id/username"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/prompt_username"
- android:singleLine="true"
- android:typeface="monospace" />
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/sip_fields"
+ android:visibility="gone">
- <cx.ring.views.PasswordEditText
- android:id="@+id/password"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:hint="@string/prompt_password"
- android:imeActionLabel="@string/action_create_short"
- android:imeOptions="actionGo"
- android:inputType="textPassword"
- android:singleLine="true"
- android:typeface="sans" />
+ <EditText
+ android:id="@+id/alias"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/prompt_alias"
+ android:singleLine="true"
+ android:typeface="monospace" >
+ </EditText>
+
+ <EditText
+ android:id="@+id/hostname"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/prompt_hostname"
+ android:singleLine="true"
+ android:typeface="monospace" >
+ </EditText>
+
+ <EditText
+ android:id="@+id/username"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:hint="@string/prompt_username"
+ android:singleLine="true"
+ android:typeface="monospace" />
+
+ <cx.ring.views.PasswordEditText
+ android:id="@+id/password"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:hint="@string/prompt_password"
+ android:imeActionLabel="@string/action_create_short"
+ android:imeOptions="actionGo"
+ android:inputType="textPassword"
+ android:singleLine="true"
+ android:typeface="sans" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/ring_fields">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/help_ring"
+ android:id="@+id/textView"
+ android:singleLine="false" />
+ </LinearLayout>
+ </FrameLayout>
<Button
android:id="@+id/create_button"
diff --git a/ring-android/app/src/main/res/layout/item_account_pref.xml b/ring-android/app/src/main/res/layout/item_account_pref.xml
index 24bd7a4..8785b10 100644
--- a/ring-android/app/src/main/res/layout/item_account_pref.xml
+++ b/ring-android/app/src/main/res/layout/item_account_pref.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@id/container"
+ android:id="@+id/account_container"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:padding="4dp" >
+ android:layout_height="72dp"
+ android:minHeight="72dp">
<ImageView
android:id="@+id/drag_handle"
@@ -11,34 +11,36 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
- android:layout_marginLeft="10dp"
+ android:layout_marginLeft="16dp"
android:src="@drawable/handle"/>
<TextView
android:id="@+id/account_alias"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/drag_handle"
android:layout_alignParentTop="true"
- android:layout_marginBottom="4dp"
- android:layout_marginLeft="4dp"
- android:textAppearance="?android:attr/textAppearanceLarge" />
+ android:layout_marginLeft="72dp"
+ android:text="Acount name"
+ android:textAppearance="@style/ListPrimary"
+ android:layout_alignParentLeft="true"
+ android:layout_marginTop="16dp" />
<TextView
android:id="@+id/account_host"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/drag_handle"
android:layout_below="@+id/account_alias"
- android:layout_marginLeft="4dp"
- android:textAppearance="?android:attr/textAppearanceSmall" />
+ android:layout_marginLeft="72dp"
+ android:textAppearance="@style/ListSecondary"
+ android:text="hostname"
+ android:layout_alignParentLeft="true" />
<CheckBox
android:id="@+id/account_checked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
- android:layout_marginRight="10dp"
+ android:layout_marginRight="16dp"
android:focusable="false"
android:layout_centerVertical="true" />
diff --git a/ring-android/app/src/main/res/values-fr/strings.xml b/ring-android/app/src/main/res/values-fr/strings.xml
index fe70eea..5d4f89f 100644
--- a/ring-android/app/src/main/res/values-fr/strings.xml
+++ b/ring-android/app/src/main/res/values-fr/strings.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
Copyright (C) 2004-2014 Savoir-Faire Linux Inc.
Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
@@ -78,7 +77,7 @@
<!-- Home Fragment -->
<plurals name="home_conferences_title">
<item quantity="zero">No Conversation</item>
- <item quantity="one">%d Conversation</item>
+ <item quantity="one">%d Conversation</item>
<item quantity="other">%d Conversations</item>
</plurals>
<string name="home_transfering">Transfert de %1$s à %1$s</string>
@@ -113,10 +112,14 @@
<string name="web_site">Site web</string>
<string name="help_gestures"> This view will help users with different interactions during calls. Different actions will be described; Long press, fling, swype etc.</string>
- <!-- combobox protocole -->
- <string-array name="accountType">
- <item>SIP</item>
- <item>IAX</item>
- </string-array>
+ <!-- combobox protocole -->
+ <string-array name="accountType">
+ <item>RING</item>
+ <item>SIP</item>
+ <item>IAX</item>
+ </string-array>
+ <string name="help_ring">Les comptes Ring vous permettent de discuter de manière sécurisée en connexion directe de pair à pair à l\'aide d\'un réseau distribué.\n\n
+En créant un compte Ring, une nouvelle clef RSA de 4096 bits sera générée. L\'identifiant de la clef publique devient alors votre ID Ring.</string>
+ <string name="account_type">Type de compte</string>
</resources>
diff --git a/ring-android/app/src/main/res/values/strings.xml b/ring-android/app/src/main/res/values/strings.xml
index 9a1c9cc..93ca321 100644
--- a/ring-android/app/src/main/res/values/strings.xml
+++ b/ring-android/app/src/main/res/values/strings.xml
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
+<?xml version="1.0" encoding="utf-8"?><!--
Copyright (C) 2004-2014 Savoir-Faire Linux Inc.
Author: Alexandre Lision <alexandre.lision@savoirfairelinux.com>
@@ -34,7 +33,7 @@
<string name="app_name">Ring</string>
- <!-- SFLPhoneActivity -->
+ <!-- RingActivity -->
<string name="close_msg">Press back again to leave</string>
<string name="title_section0">Dial</string>
<string name="title_section1">Call</string>
@@ -71,7 +70,7 @@
<string name="hist_no_history">No history</string>
<string name="hist_in_calls">In:%1$d</string>
<string name="hist_out_calls">Out:%1$d</string>
-
+
<!-- DetailsHistory Fragment -->
<string name="detail_hist_call_number">Call %1$s</string>
@@ -114,10 +113,15 @@
<string name="web_site">Website</string>
<string name="help_gestures"> This view will help users with different interactions during calls. Different actions will be described; Long press, fling, swype etc.</string>
- <!-- combobox protocol -->
- <string-array name="accountType">
- <item>SIP</item>
- <item>IAX</item>
- </string-array>
+ <!-- combobox protocol -->
+ <string-array name="accountType">
+ <item>RING</item>
+ <item>SIP</item>
+ <item>IAX</item>
+ </string-array>
+ <string name="help_ring">Ring accounts allow you to reach people securely in peer to peer through a fully distributed network.\n\n
+When creating a Ring account, a new 4096 bits RSA key pair is generated. The hash of the public key then becomes your Ring ID.
+ </string>
+ <string name="account_type">Account type</string>
</resources>