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:
Torsten Grote
2015-12-08 16:31:43 -02:00
parent 878a70620d
commit 04be7c9b92
4 changed files with 61 additions and 24 deletions

View File

@@ -21,6 +21,7 @@ import org.briarproject.api.LocalAuthor;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
@@ -35,7 +36,6 @@ implements OnItemSelectedListener, OnClickListener {
private LocalAuthorSpinnerAdapter adapter = null;
private Spinner spinner = null;
private Button continueButton = null;
ChooseIdentityView(Context ctx) {
super(ctx);
@@ -45,34 +45,17 @@ implements OnItemSelectedListener, OnClickListener {
removeAllViews();
Context ctx = getContext();
LinearLayout innerLayout = new LinearLayout(ctx);
innerLayout.setLayoutParams(MATCH_WRAP);
innerLayout.setOrientation(HORIZONTAL);
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);
LayoutInflater inflater = (LayoutInflater) ctx.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
View view = inflater.inflate(R.layout.invitation_bluetooth_start, this);
adapter = new LocalAuthorSpinnerAdapter(ctx, false);
spinner = new Spinner(ctx);
spinner = (Spinner) view.findViewById(R.id.spinner);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(this);
innerLayout.addView(spinner);
addView(innerLayout);
TextView faceToFace = new TextView(ctx);
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);
Button continueButton = (Button) view.findViewById(R.id.continueButton);
continueButton.setOnClickListener(this);
addView(continueButton);
container.loadLocalAuthors();
}