Redesign nickname screen of setup wizard

This commit is contained in:
Torsten Grote
2024-05-09 16:52:00 -03:00
parent 04e14cfa29
commit 8980cc07d2
3 changed files with 55 additions and 7 deletions

View File

@@ -114,7 +114,7 @@
<activity
android:name="org.briarproject.briar.android.account.SetupActivity"
android:exported="false"
android:label="@string/setup_title" />
android:theme="@style/BriarTheme.NoActionBar" />
<activity
android:name="org.briarproject.briar.android.splash.SplashScreenActivity"

View File

@@ -18,7 +18,9 @@ import javax.annotation.Nullable;
import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
import static org.briarproject.bramble.util.StringUtils.toUtf8;
import static org.briarproject.briar.android.util.UiUtils.hideViewOnSmallScreen;
import static org.briarproject.briar.android.util.UiUtils.setError;
import static org.briarproject.briar.android.util.UiUtils.showOnboardingDialog;
@MethodsNotNullByDefault
@ParametersNotNullByDefault
@@ -38,19 +40,27 @@ public class AuthorNameFragment extends SetupFragment {
public View onCreateView(LayoutInflater inflater,
@Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
requireActivity().setTitle(getString(R.string.setup_title));
View v = inflater.inflate(R.layout.fragment_setup_author_name,
container, false);
authorNameWrapper = v.findViewById(R.id.nickname_entry_wrapper);
authorNameInput = v.findViewById(R.id.nickname_entry);
Button infoButton = v.findViewById(R.id.info_button);
nextButton = v.findViewById(R.id.next);
authorNameInput.addTextChangedListener(this);
infoButton.setOnClickListener(view ->
showOnboardingDialog(requireContext(), getHelpText()));
nextButton.setOnClickListener(this);
return v;
}
@Override
public void onStart() {
super.onStart();
hideViewOnSmallScreen(requireView().findViewById(R.id.logo));
}
@Override
public String getUniqueTag() {
return TAG;

View File

@@ -16,16 +16,44 @@
android:paddingRight="@dimen/margin_activity_horizontal"
android:paddingBottom="@dimen/margin_activity_vertical">
<ImageView
android:id="@+id/logo"
android:layout_width="0dp"
android:layout_height="@dimen/hero_square"
android:layout_margin="16dp"
android:importantForAccessibility="no"
android:src="@drawable/splash_screen"
app:layout_constraintBottom_toTopOf="@+id/intro"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHeight_default="percent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/intro"
style="@style/TextAppearance.AppCompat.Large"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="@string/setup_title"
app:layout_constraintBottom_toTopOf="@+id/nickname_entry_wrapper"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/logo" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/nickname_entry_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_medium"
android:layout_marginTop="16dp"
app:errorEnabled="true"
app:hintEnabled="false"
app:layout_constraintBottom_toTopOf="@+id/info_button"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent">
app:layout_constraintTop_toBottomOf="@+id/intro">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/nickname_entry"
@@ -40,19 +68,29 @@
</com.google.android.material.textfield.TextInputLayout>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/info_button"
style="@style/BriarButtonFlat.Positive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_info_white"
android:drawablePadding="8dp"
android:text="@string/more_info"
app:drawableTint="@color/briar_button_text_positive"
app:layout_constraintBottom_toTopOf="@+id/next"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nickname_entry_wrapper" />
<Button
android:id="@+id/next"
style="@style/BriarButton"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_activity_horizontal"
android:enabled="false"
android:text="@string/setup_next"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/nickname_entry_wrapper"
app:layout_constraintVertical_bias="1.0"
tools:enabled="true" />
</androidx.constraintlayout.widget.ConstraintLayout>