Add Username UI updates.

main
Alex Hart 2023-02-02 14:28:21 -04:00 zatwierdzone przez Nicholas Tinsley
rodzic 7fbfc09a89
commit cd79dbbb82
8 zmienionych plików z 60 dodań i 34 usunięć

Wyświetl plik

@ -201,6 +201,10 @@ public class UsernameEditFragment extends LoggingFragment {
break;
}
CharSequence error = usernameInputWrapper.getError();
binding.usernameError.setVisibility(error != null ? View.VISIBLE : View.GONE);
binding.usernameError.setText(usernameInputWrapper.getError());
}
private void presentButtonState(@NonNull UsernameEditViewModel.ButtonState buttonState) {

Wyświetl plik

@ -23,7 +23,8 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:navigationIcon="@drawable/ic_arrow_left_24"
app:title="@string/CreateProfileActivity__profile" />
app:title="@string/CreateProfileActivity__profile"
app:titleTextAppearance="@style/Signal.Text.TitleLarge" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/manage_profile_avatar_background"

Wyświetl plik

@ -36,17 +36,21 @@
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/username_text_wrapper"
style="@style/Widget.Signal.TextInputLayout.FilledBox.ContactNameEditor"
style="@style/Widget.Signal.TextInputLayout.Registration"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dsl_settings_gutter"
android:layout_marginTop="24dp"
android:layout_marginEnd="@dimen/dsl_settings_gutter"
app:boxStrokeColor="@color/signal_colorPrimary"
app:boxStrokeWidthFocused="2dp"
app:errorTextAppearance="@style/Signal.Text.Zero"
app:expandedHintEnabled="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/summary"
app:suffixTextColor="@color/signal_colorOnSurface"
tools:errorEnabled="true"
tools:suffixText="| .1234">
<EditText
@ -66,6 +70,19 @@
</com.google.android.material.textfield.TextInputLayout>
<TextView
android:id="@+id/username_error"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textAppearance="@style/Signal.Text.BodyMedium"
android:textColor="@color/signal_colorError"
android:visibility="gone"
app:layout_constraintStart_toStartOf="@id/username_description"
app:layout_constraintTop_toBottomOf="@id/username_text_wrapper"
tools:text="Error something bad happened"
tools:visibility="visible" />
<TextView
android:id="@+id/summary"
android:layout_width="match_parent"
@ -87,7 +104,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dsl_settings_gutter"
android:layout_marginTop="24dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="@dimen/dsl_settings_gutter"
android:layout_marginBottom="24dp"
android:text="@string/UsernameEditFragment__usernames_let_others_message"
@ -96,7 +113,7 @@
app:layout_constraintBottom_toTopOf="@id/username_button_barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/username_text_wrapper"
app:layout_constraintTop_toBottomOf="@id/username_error"
app:layout_constraintVertical_bias="0" />
<com.google.android.material.button.MaterialButton

Wyświetl plik

@ -11,10 +11,10 @@
<action
android:id="@+id/action_badgeManageFragment_to_featuredBadgeFragment"
app:destination="@id/featuredBadgeFragment"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
app:enterAnim="@anim/fragment_open_enter"
app:exitAnim="@anim/fragment_open_exit"
app:popEnterAnim="@anim/fragment_close_enter"
app:popExitAnim="@anim/fragment_close_exit" />
<action
android:id="@+id/action_badgeManageFragment_to_expiredBadgeDialog"
app:destination="@id/expiredBadgeDialog" />

Wyświetl plik

@ -14,34 +14,34 @@
<action
android:id="@+id/action_manageUsername"
app:destination="@id/usernameManageFragment"
app:enterAnim="@anim/slide_from_end"
app:exitAnim="@anim/slide_to_start"
app:popEnterAnim="@anim/slide_from_start"
app:popExitAnim="@anim/slide_to_end" />
app:enterAnim="@anim/fragment_open_enter"
app:exitAnim="@anim/fragment_open_exit"
app:popEnterAnim="@anim/fragment_close_enter"
app:popExitAnim="@anim/fragment_close_exit" />
<action
android:id="@+id/action_manageProfileName"
app:destination="@id/profileNameManageFragment"
app:enterAnim="@anim/slide_from_end"
app:exitAnim="@anim/slide_to_start"
app:popEnterAnim="@anim/slide_from_start"
app:popExitAnim="@anim/slide_to_end" />
app:enterAnim="@anim/fragment_open_enter"
app:exitAnim="@anim/fragment_open_exit"
app:popEnterAnim="@anim/fragment_close_enter"
app:popExitAnim="@anim/fragment_close_exit" />
<action
android:id="@+id/action_manageAbout"
app:destination="@id/aboutManageFragment"
app:enterAnim="@anim/slide_from_end"
app:exitAnim="@anim/slide_to_start"
app:popEnterAnim="@anim/slide_from_start"
app:popExitAnim="@anim/slide_to_end" />
app:enterAnim="@anim/fragment_open_enter"
app:exitAnim="@anim/fragment_open_exit"
app:popEnterAnim="@anim/fragment_close_enter"
app:popExitAnim="@anim/fragment_close_exit" />
<action
android:id="@+id/action_manageProfileFragment_to_avatar_picker"
app:destination="@id/avatar_picker"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim">
app:enterAnim="@anim/fragment_open_enter"
app:exitAnim="@anim/fragment_open_exit"
app:popEnterAnim="@anim/fragment_close_enter"
app:popExitAnim="@anim/fragment_close_exit">
<argument
android:name="group_id"
@ -58,10 +58,10 @@
<action
android:id="@+id/action_manageProfileFragment_to_badgeManageFragment"
app:destination="@id/manage_badges"
app:enterAnim="@anim/nav_default_enter_anim"
app:exitAnim="@anim/nav_default_exit_anim"
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
app:enterAnim="@anim/fragment_open_enter"
app:exitAnim="@anim/fragment_open_exit"
app:popEnterAnim="@anim/fragment_close_enter"
app:popExitAnim="@anim/fragment_close_exit" />
<action
android:id="@+id/action_manageProfileFragment_to_shareUsernameDialog"
app:destination="@id/shareUsernameDialog" />

Wyświetl plik

@ -479,11 +479,11 @@
<style name="Widget.Signal.TextInputLayout.FilledBox" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
<item name="android:paddingStart">@dimen/dsl_settings_gutter</item>
<item name="android:paddingEnd">@dimen/dsl_settings_gutter</item>
<item name="boxBackgroundColor">@color/signal_colorSurfaceVariant</item>
<item name="boxCornerRadiusBottomEnd">0dp</item>
<item name="boxCornerRadiusBottomStart">0dp</item>
<item name="boxCornerRadiusTopEnd">4dp</item>
<item name="boxCornerRadiusTopStart">4dp</item>
<item name="boxBackgroundColor">@color/signal_background_secondary</item>
<item name="boxCornerRadiusBottomEnd">10dp</item>
<item name="boxCornerRadiusBottomStart">10dp</item>
<item name="boxCornerRadiusTopEnd">10dp</item>
<item name="boxCornerRadiusTopStart">10dp</item>
<item name="boxStrokeWidth">0dp</item>
<item name="boxStrokeWidthFocused">0dp</item>
<item name="hintTextColor">@color/signal_text_hint</item>
@ -508,6 +508,8 @@
<item name="android:textColorHint">@color/signal_colorOnSurfaceVariant</item>
<item name="android:textCursorDrawable">@color/signal_colorPrimary</item>
<item name="colorAccent">@android:color/white</item>
<item name="hintTextAppearance">@style/Signal.Text.LabelMedium</item>
<item name="boxStrokeErrorColor">@color/signal_colorError</item>
</style>
<style name="Widget.Signal.TextInputEditText.Registration" parent="Widget.MaterialComponents.TextInputEditText.FilledBox">

Wyświetl plik

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools">
<style name="Signal.Text.Zero" parent="">
<item name="android:textSize">0sp</item>
</style>
<!-- region Material3 Styles -->
<style name="Signal.Text.HeadlineLarge" parent="TextAppearance.Material3.HeadlineLarge">

Wyświetl plik

@ -1,6 +1,5 @@
package org.signal.core.ui.theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Typography
import androidx.compose.material3.darkColorScheme