kopia lustrzana https://github.com/ryukoposting/Signal-Android
Add Username UI updates.
rodzic
7fbfc09a89
commit
cd79dbbb82
|
@ -201,6 +201,10 @@ public class UsernameEditFragment extends LoggingFragment {
|
||||||
|
|
||||||
break;
|
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) {
|
private void presentButtonState(@NonNull UsernameEditViewModel.ButtonState buttonState) {
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:navigationIcon="@drawable/ic_arrow_left_24"
|
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
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
android:id="@+id/manage_profile_avatar_background"
|
android:id="@+id/manage_profile_avatar_background"
|
||||||
|
|
|
@ -36,17 +36,21 @@
|
||||||
|
|
||||||
<com.google.android.material.textfield.TextInputLayout
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
android:id="@+id/username_text_wrapper"
|
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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginEnd="@dimen/dsl_settings_gutter"
|
||||||
app:boxStrokeColor="@color/signal_colorPrimary"
|
app:boxStrokeColor="@color/signal_colorPrimary"
|
||||||
app:boxStrokeWidthFocused="2dp"
|
app:boxStrokeWidthFocused="2dp"
|
||||||
|
app:errorTextAppearance="@style/Signal.Text.Zero"
|
||||||
app:expandedHintEnabled="false"
|
app:expandedHintEnabled="false"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/summary"
|
app:layout_constraintTop_toBottomOf="@id/summary"
|
||||||
app:suffixTextColor="@color/signal_colorOnSurface"
|
app:suffixTextColor="@color/signal_colorOnSurface"
|
||||||
|
tools:errorEnabled="true"
|
||||||
tools:suffixText="| .1234">
|
tools:suffixText="| .1234">
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
@ -66,6 +70,19 @@
|
||||||
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</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
|
<TextView
|
||||||
android:id="@+id/summary"
|
android:id="@+id/summary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -87,7 +104,7 @@
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
android:layout_marginStart="@dimen/dsl_settings_gutter"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_marginEnd="@dimen/dsl_settings_gutter"
|
android:layout_marginEnd="@dimen/dsl_settings_gutter"
|
||||||
android:layout_marginBottom="24dp"
|
android:layout_marginBottom="24dp"
|
||||||
android:text="@string/UsernameEditFragment__usernames_let_others_message"
|
android:text="@string/UsernameEditFragment__usernames_let_others_message"
|
||||||
|
@ -96,7 +113,7 @@
|
||||||
app:layout_constraintBottom_toTopOf="@id/username_button_barrier"
|
app:layout_constraintBottom_toTopOf="@id/username_button_barrier"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="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" />
|
app:layout_constraintVertical_bias="0" />
|
||||||
|
|
||||||
<com.google.android.material.button.MaterialButton
|
<com.google.android.material.button.MaterialButton
|
||||||
|
|
|
@ -11,10 +11,10 @@
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_badgeManageFragment_to_featuredBadgeFragment"
|
android:id="@+id/action_badgeManageFragment_to_featuredBadgeFragment"
|
||||||
app:destination="@id/featuredBadgeFragment"
|
app:destination="@id/featuredBadgeFragment"
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
app:enterAnim="@anim/fragment_open_enter"
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
app:exitAnim="@anim/fragment_open_exit"
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
app:popEnterAnim="@anim/fragment_close_enter"
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
app:popExitAnim="@anim/fragment_close_exit" />
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_badgeManageFragment_to_expiredBadgeDialog"
|
android:id="@+id/action_badgeManageFragment_to_expiredBadgeDialog"
|
||||||
app:destination="@id/expiredBadgeDialog" />
|
app:destination="@id/expiredBadgeDialog" />
|
||||||
|
|
|
@ -14,34 +14,34 @@
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_manageUsername"
|
android:id="@+id/action_manageUsername"
|
||||||
app:destination="@id/usernameManageFragment"
|
app:destination="@id/usernameManageFragment"
|
||||||
app:enterAnim="@anim/slide_from_end"
|
app:enterAnim="@anim/fragment_open_enter"
|
||||||
app:exitAnim="@anim/slide_to_start"
|
app:exitAnim="@anim/fragment_open_exit"
|
||||||
app:popEnterAnim="@anim/slide_from_start"
|
app:popEnterAnim="@anim/fragment_close_enter"
|
||||||
app:popExitAnim="@anim/slide_to_end" />
|
app:popExitAnim="@anim/fragment_close_exit" />
|
||||||
|
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_manageProfileName"
|
android:id="@+id/action_manageProfileName"
|
||||||
app:destination="@id/profileNameManageFragment"
|
app:destination="@id/profileNameManageFragment"
|
||||||
app:enterAnim="@anim/slide_from_end"
|
app:enterAnim="@anim/fragment_open_enter"
|
||||||
app:exitAnim="@anim/slide_to_start"
|
app:exitAnim="@anim/fragment_open_exit"
|
||||||
app:popEnterAnim="@anim/slide_from_start"
|
app:popEnterAnim="@anim/fragment_close_enter"
|
||||||
app:popExitAnim="@anim/slide_to_end" />
|
app:popExitAnim="@anim/fragment_close_exit" />
|
||||||
|
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_manageAbout"
|
android:id="@+id/action_manageAbout"
|
||||||
app:destination="@id/aboutManageFragment"
|
app:destination="@id/aboutManageFragment"
|
||||||
app:enterAnim="@anim/slide_from_end"
|
app:enterAnim="@anim/fragment_open_enter"
|
||||||
app:exitAnim="@anim/slide_to_start"
|
app:exitAnim="@anim/fragment_open_exit"
|
||||||
app:popEnterAnim="@anim/slide_from_start"
|
app:popEnterAnim="@anim/fragment_close_enter"
|
||||||
app:popExitAnim="@anim/slide_to_end" />
|
app:popExitAnim="@anim/fragment_close_exit" />
|
||||||
|
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_manageProfileFragment_to_avatar_picker"
|
android:id="@+id/action_manageProfileFragment_to_avatar_picker"
|
||||||
app:destination="@id/avatar_picker"
|
app:destination="@id/avatar_picker"
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
app:enterAnim="@anim/fragment_open_enter"
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
app:exitAnim="@anim/fragment_open_exit"
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
app:popEnterAnim="@anim/fragment_close_enter"
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim">
|
app:popExitAnim="@anim/fragment_close_exit">
|
||||||
|
|
||||||
<argument
|
<argument
|
||||||
android:name="group_id"
|
android:name="group_id"
|
||||||
|
@ -58,10 +58,10 @@
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_manageProfileFragment_to_badgeManageFragment"
|
android:id="@+id/action_manageProfileFragment_to_badgeManageFragment"
|
||||||
app:destination="@id/manage_badges"
|
app:destination="@id/manage_badges"
|
||||||
app:enterAnim="@anim/nav_default_enter_anim"
|
app:enterAnim="@anim/fragment_open_enter"
|
||||||
app:exitAnim="@anim/nav_default_exit_anim"
|
app:exitAnim="@anim/fragment_open_exit"
|
||||||
app:popEnterAnim="@anim/nav_default_pop_enter_anim"
|
app:popEnterAnim="@anim/fragment_close_enter"
|
||||||
app:popExitAnim="@anim/nav_default_pop_exit_anim" />
|
app:popExitAnim="@anim/fragment_close_exit" />
|
||||||
<action
|
<action
|
||||||
android:id="@+id/action_manageProfileFragment_to_shareUsernameDialog"
|
android:id="@+id/action_manageProfileFragment_to_shareUsernameDialog"
|
||||||
app:destination="@id/shareUsernameDialog" />
|
app:destination="@id/shareUsernameDialog" />
|
||||||
|
|
|
@ -479,11 +479,11 @@
|
||||||
<style name="Widget.Signal.TextInputLayout.FilledBox" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
|
<style name="Widget.Signal.TextInputLayout.FilledBox" parent="Widget.MaterialComponents.TextInputLayout.FilledBox">
|
||||||
<item name="android:paddingStart">@dimen/dsl_settings_gutter</item>
|
<item name="android:paddingStart">@dimen/dsl_settings_gutter</item>
|
||||||
<item name="android:paddingEnd">@dimen/dsl_settings_gutter</item>
|
<item name="android:paddingEnd">@dimen/dsl_settings_gutter</item>
|
||||||
<item name="boxBackgroundColor">@color/signal_colorSurfaceVariant</item>
|
<item name="boxBackgroundColor">@color/signal_background_secondary</item>
|
||||||
<item name="boxCornerRadiusBottomEnd">0dp</item>
|
<item name="boxCornerRadiusBottomEnd">10dp</item>
|
||||||
<item name="boxCornerRadiusBottomStart">0dp</item>
|
<item name="boxCornerRadiusBottomStart">10dp</item>
|
||||||
<item name="boxCornerRadiusTopEnd">4dp</item>
|
<item name="boxCornerRadiusTopEnd">10dp</item>
|
||||||
<item name="boxCornerRadiusTopStart">4dp</item>
|
<item name="boxCornerRadiusTopStart">10dp</item>
|
||||||
<item name="boxStrokeWidth">0dp</item>
|
<item name="boxStrokeWidth">0dp</item>
|
||||||
<item name="boxStrokeWidthFocused">0dp</item>
|
<item name="boxStrokeWidthFocused">0dp</item>
|
||||||
<item name="hintTextColor">@color/signal_text_hint</item>
|
<item name="hintTextColor">@color/signal_text_hint</item>
|
||||||
|
@ -508,6 +508,8 @@
|
||||||
<item name="android:textColorHint">@color/signal_colorOnSurfaceVariant</item>
|
<item name="android:textColorHint">@color/signal_colorOnSurfaceVariant</item>
|
||||||
<item name="android:textCursorDrawable">@color/signal_colorPrimary</item>
|
<item name="android:textCursorDrawable">@color/signal_colorPrimary</item>
|
||||||
<item name="colorAccent">@android:color/white</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>
|
||||||
|
|
||||||
<style name="Widget.Signal.TextInputEditText.Registration" parent="Widget.MaterialComponents.TextInputEditText.FilledBox">
|
<style name="Widget.Signal.TextInputEditText.Registration" parent="Widget.MaterialComponents.TextInputEditText.FilledBox">
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<style name="Signal.Text.Zero" parent="">
|
||||||
|
<item name="android:textSize">0sp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<!-- region Material3 Styles -->
|
<!-- region Material3 Styles -->
|
||||||
<style name="Signal.Text.HeadlineLarge" parent="TextAppearance.Material3.HeadlineLarge">
|
<style name="Signal.Text.HeadlineLarge" parent="TextAppearance.Material3.HeadlineLarge">
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package org.signal.core.ui.theme
|
package org.signal.core.ui.theme
|
||||||
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Typography
|
import androidx.compose.material3.Typography
|
||||||
import androidx.compose.material3.darkColorScheme
|
import androidx.compose.material3.darkColorScheme
|
||||||
|
|
Ładowanie…
Reference in New Issue