mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 22:29: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:
@@ -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"/>
|
||||
Reference in New Issue
Block a user