mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Merge branch '87-improve-adding-contacts' into 'master'
Improve Adding Contacts These changes provide more detailed instructions for adding contacts. Users were confused by the process of adding a contact for the first time. This change adds additional explanation and a picture of what is going on. Closes #87 This change also shows the current step and the total number of steps when adding a contact. Closes #33 The UI was transferred into XML files and lots of redundant code was deleted such as the custom CodeEntryView. Please note that I did not implement a countdown for Bluetooth discoverability (#71), because of the way how the state machine resets the entire content view of the activity. This should probably be refactored to use fragments which would make the code cleaner and a permanent progress bar easier to implement. See merge request !15
This commit is contained in:
BIN
briar-android/res/drawable/bluetooth.png
Normal file
BIN
briar-android/res/drawable/bluetooth.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,123 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/margin_activity_vertical"
|
||||
android:paddingEnd="@dimen/margin_activity_horizontal"
|
||||
android:paddingRight="@dimen/margin_activity_horizontal"
|
||||
android:paddingStart="@dimen/margin_activity_horizontal"
|
||||
android:paddingLeft="@dimen/margin_activity_horizontal"
|
||||
android:paddingTop="@dimen/margin_activity_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stepView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:padding="@dimen/margin_medium"
|
||||
tools:text="Step 3/3"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/connectedView"
|
||||
style="@style/BriarTextTitle"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/connected_to_contact"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:layout_below="@+id/stepView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:drawableLeft="@drawable/navigation_accept"
|
||||
android:drawableStart="@drawable/navigation_accept"
|
||||
android:gravity="center_vertical"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/yourConfirmationCodeView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/your_confirmation_code"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:layout_below="@+id/connectedView"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/codeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:textSize="50sp"
|
||||
android:layout_below="@+id/yourConfirmationCodeView"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:text="1337"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/waitingView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/searching_format"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:layout_below="@+id/codeView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:visibility="gone"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:layout_below="@+id/waitingView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enterCodeTextView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/enter_confirmation_code"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:layout_below="@+id/codeView"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/codeEntryView"
|
||||
layout="@layout/view_code_entry"
|
||||
android:layout_below="@+id/enterCodeTextView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/continueButton"
|
||||
style="@style/BriarButton.Default"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/continue_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:enabled="false"
|
||||
android:layout_below="@+id/codeEntryView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/margin_activity_vertical"
|
||||
android:paddingEnd="@dimen/margin_activity_horizontal"
|
||||
android:paddingRight="@dimen/margin_activity_horizontal"
|
||||
android:paddingStart="@dimen/margin_activity_horizontal"
|
||||
android:paddingLeft="@dimen/margin_activity_horizontal"
|
||||
android:paddingTop="@dimen/margin_activity_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stepView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/margin_medium"
|
||||
tools:text="Step 2/3"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/yourCodeView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/your_invitation_code"
|
||||
android:layout_marginTop="@dimen/margin_medium"
|
||||
android:layout_below="@+id/stepView"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/codeView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/margin_medium"
|
||||
android:textSize="50sp"
|
||||
android:layout_below="@+id/yourCodeView"
|
||||
android:layout_centerHorizontal="true"
|
||||
tools:text="1337"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/waitingView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/searching_format"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/margin_medium"
|
||||
android:layout_below="@+id/codeView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:visibility="gone"
|
||||
android:gravity="center_horizontal"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminate="true"
|
||||
android:layout_below="@+id/waitingView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/enterCodeTextView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/enter_invitation_code"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:layout_below="@+id/codeView"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/codeEntryView"
|
||||
layout="@layout/view_code_entry"
|
||||
android:layout_below="@+id/enterCodeTextView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/continueButton"
|
||||
style="@style/BriarButton.Default"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/continue_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:enabled="false"
|
||||
android:layout_below="@+id/codeEntryView"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
69
briar-android/res/layout/invitation_bluetooth_start.xml
Normal file
69
briar-android/res/layout/invitation_bluetooth_start.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/margin_activity_vertical"
|
||||
android:paddingEnd="@dimen/margin_activity_horizontal"
|
||||
android:paddingRight="@dimen/margin_activity_horizontal"
|
||||
android:paddingStart="@dimen/margin_activity_horizontal"
|
||||
android:paddingLeft="@dimen/margin_activity_horizontal"
|
||||
android:paddingTop="@dimen/margin_activity_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/stepView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
tools:text="Step 1/3"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/yourNicknameView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/your_nickname"
|
||||
android:layout_marginTop="@dimen/margin_medium"/>
|
||||
|
||||
<Spinner
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/spinner"
|
||||
android:spinnerMode="dropdown"
|
||||
android:layout_marginTop="@dimen/margin_medium"/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/imageView"
|
||||
android:src="@drawable/bluetooth"
|
||||
android:scaleType="fitCenter"
|
||||
android:adjustViewBounds="true"
|
||||
android:layout_marginTop="@dimen/margin_medium"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/faceToFaceView"
|
||||
style="@style/BriarTextBody"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/face_to_face"
|
||||
android:layout_marginTop="@dimen/margin_medium"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/continueButton"
|
||||
style="@style/BriarButton.Default"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/continue_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/margin_medium"/>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
||||
41
briar-android/res/layout/invitation_error.xml
Normal file
41
briar-android/res/layout/invitation_error.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="@dimen/margin_activity_vertical"
|
||||
android:paddingEnd="@dimen/margin_activity_horizontal"
|
||||
android:paddingStart="@dimen/margin_activity_horizontal"
|
||||
android:paddingTop="@dimen/margin_activity_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/errorTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/connection_failed"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
android:drawableStart="@drawable/alerts_and_states_error"
|
||||
android:drawableLeft="@drawable/alerts_and_states_error"
|
||||
android:gravity="center_vertical"
|
||||
android:padding="@dimen/margin_medium"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/explanationTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/interfering"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:padding="@dimen/margin_medium"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/tryAgainButton"
|
||||
style="@style/BriarButton.Default"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/try_again_button"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_margin="@dimen/margin_medium"/>
|
||||
|
||||
</LinearLayout>
|
||||
16
briar-android/res/layout/view_code_entry.xml
Normal file
16
briar-android/res/layout/view_code_entry.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<EditText
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/codeEntryView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="number"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:textSize="@dimen/text_size_xlarge"
|
||||
android:ems="4"
|
||||
android:maxLines="1"
|
||||
android:maxLength="6"
|
||||
android:layout_margin="@dimen/margin_medium"
|
||||
android:imeOptions="actionGo"
|
||||
tools:text="123456"/>
|
||||
@@ -36,12 +36,12 @@
|
||||
<string name="contact_list_title">Contacts</string>
|
||||
<string name="no_contacts">No contacts</string>
|
||||
<string name="add_contact_title">Add a Contact</string>
|
||||
<string name="your_nickname">Your nickname: </string>
|
||||
<string name="face_to_face">For security reasons you must be face-to-face with the person you want to add as a contact.\n\nThis will prevent anyone from impersonating you or reading your messages in future.</string>
|
||||
<string name="your_nickname">Please select the identity you want to use:</string>
|
||||
<string name="face_to_face">You must be face-to-face with the person you want to add as a contact. This will prevent anyone from impersonating you or reading your messages in future.</string>
|
||||
<string name="continue_button">Continue</string>
|
||||
<string name="your_invitation_code">Your invitation code is</string>
|
||||
<string name="enter_invitation_code">Please enter your contact\'s invitation code:</string>
|
||||
<string name="searching_format">Searching for %06d\u2026</string>
|
||||
<string name="searching_format">Searching for contact with invitation code %06d\u2026</string>
|
||||
<string name="connection_failed">Connection failed</string>
|
||||
<string name="could_not_find_contact">Briar could not find your contact nearby</string>
|
||||
<string name="try_again_button">Try Again</string>
|
||||
@@ -110,8 +110,9 @@
|
||||
<string name="notify_sound_setting_default">Default ringtone</string>
|
||||
<string name="notify_sound_setting_disabled">None</string>
|
||||
<string name="choose_ringtone_title">Choose ringtone</string>
|
||||
<string name="step">Step %1$d/%2$d</string>
|
||||
|
||||
<!-- Dialogs -->
|
||||
<string name="dialog_title_lost_password">Lost password</string>
|
||||
<string name="dialog_message_lost_password">Password recovery is not possible. Do you wish to delete your user, all contacts, and re-register ?</string>
|
||||
</resources>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user