mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Providing 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. It also moves part of the UI into XML files. Closes #87
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: 20 KiB |
53
briar-android/res/layout/invitation_bluetooth_start.xml
Normal file
53
briar-android/res/layout/invitation_bluetooth_start.xml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?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:padding="7dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/your_nickname"
|
||||||
|
android:id="@+id/yourNicknameView"
|
||||||
|
android:padding="7dp"/>
|
||||||
|
|
||||||
|
<Spinner
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/spinner"
|
||||||
|
android:spinnerMode="dropdown"
|
||||||
|
android:padding="7dp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/face_to_face"
|
||||||
|
android:id="@+id/faceToFaceView"
|
||||||
|
android:padding="7dp"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/imageView"
|
||||||
|
android:src="@drawable/bluetooth"
|
||||||
|
android:scaleType="fitCenter"
|
||||||
|
android:baselineAlignBottom="false"
|
||||||
|
android:cropToPadding="false"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/bluetooth_explanation"
|
||||||
|
android:id="@+id/explanationView"
|
||||||
|
android:padding="7dp"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/continue_button"
|
||||||
|
android:id="@+id/continueButton"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_weight="0"/>
|
||||||
|
</LinearLayout>
|
||||||
@@ -36,8 +36,9 @@
|
|||||||
<string name="contact_list_title">Contacts</string>
|
<string name="contact_list_title">Contacts</string>
|
||||||
<string name="no_contacts">No contacts</string>
|
<string name="no_contacts">No contacts</string>
|
||||||
<string name="add_contact_title">Add a Contact</string>
|
<string name="add_contact_title">Add a Contact</string>
|
||||||
<string name="your_nickname">Your nickname: </string>
|
<string name="your_nickname">Please select the identity you want to use:</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="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="bluetooth_explanation">Contacts need to add each other at the same time. Please continue together and allow Bluetooth to be enabled for the process to work.</string>
|
||||||
<string name="continue_button">Continue</string>
|
<string name="continue_button">Continue</string>
|
||||||
<string name="your_invitation_code">Your invitation code is</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="enter_invitation_code">Please enter your contact\'s invitation code:</string>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.briarproject.api.LocalAuthor;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
@@ -35,7 +36,6 @@ implements OnItemSelectedListener, OnClickListener {
|
|||||||
|
|
||||||
private LocalAuthorSpinnerAdapter adapter = null;
|
private LocalAuthorSpinnerAdapter adapter = null;
|
||||||
private Spinner spinner = null;
|
private Spinner spinner = null;
|
||||||
private Button continueButton = null;
|
|
||||||
|
|
||||||
ChooseIdentityView(Context ctx) {
|
ChooseIdentityView(Context ctx) {
|
||||||
super(ctx);
|
super(ctx);
|
||||||
@@ -45,34 +45,17 @@ implements OnItemSelectedListener, OnClickListener {
|
|||||||
removeAllViews();
|
removeAllViews();
|
||||||
Context ctx = getContext();
|
Context ctx = getContext();
|
||||||
|
|
||||||
LinearLayout innerLayout = new LinearLayout(ctx);
|
LayoutInflater inflater = (LayoutInflater) ctx.getSystemService
|
||||||
innerLayout.setLayoutParams(MATCH_WRAP);
|
(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
innerLayout.setOrientation(HORIZONTAL);
|
View view = inflater.inflate(R.layout.invitation_bluetooth_start, this);
|
||||||
innerLayout.setGravity(CENTER);
|
|
||||||
|
|
||||||
TextView yourNickname = new TextView(ctx);
|
|
||||||
yourNickname.setTextSize(18);
|
|
||||||
yourNickname.setPadding(pad, pad, pad, pad);
|
|
||||||
yourNickname.setText(R.string.your_nickname);
|
|
||||||
innerLayout.addView(yourNickname);
|
|
||||||
|
|
||||||
adapter = new LocalAuthorSpinnerAdapter(ctx, false);
|
adapter = new LocalAuthorSpinnerAdapter(ctx, false);
|
||||||
spinner = new Spinner(ctx);
|
spinner = (Spinner) view.findViewById(R.id.spinner);
|
||||||
spinner.setAdapter(adapter);
|
spinner.setAdapter(adapter);
|
||||||
spinner.setOnItemSelectedListener(this);
|
spinner.setOnItemSelectedListener(this);
|
||||||
innerLayout.addView(spinner);
|
|
||||||
addView(innerLayout);
|
|
||||||
|
|
||||||
TextView faceToFace = new TextView(ctx);
|
Button continueButton = (Button) view.findViewById(R.id.continueButton);
|
||||||
faceToFace.setPadding(pad, pad, pad, pad);
|
|
||||||
faceToFace.setText(R.string.face_to_face);
|
|
||||||
addView(faceToFace);
|
|
||||||
|
|
||||||
continueButton = new Button(ctx);
|
|
||||||
continueButton.setLayoutParams(WRAP_WRAP);
|
|
||||||
continueButton.setText(R.string.continue_button);
|
|
||||||
continueButton.setOnClickListener(this);
|
continueButton.setOnClickListener(this);
|
||||||
addView(continueButton);
|
|
||||||
|
|
||||||
container.loadLocalAuthors();
|
container.loadLocalAuthors();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user