kopia lustrzana https://github.com/ryukoposting/Signal-Android
Various improvements to About UI/UX.
rodzic
36395ced89
commit
427869d4ca
|
@ -104,10 +104,10 @@ public class EditAboutFragment extends Fragment implements ManageProfileActivity
|
|||
presetAdapter.submitList(PRESETS);
|
||||
|
||||
if (savedInstanceState != null && savedInstanceState.containsKey(KEY_SELECTED_EMOJI)) {
|
||||
onEmojiSelected(savedInstanceState.getString(KEY_SELECTED_EMOJI, ""));
|
||||
onEmojiSelectedInternal(savedInstanceState.getString(KEY_SELECTED_EMOJI, ""));
|
||||
} else {
|
||||
this.bodyView.setText(Recipient.self().getAbout());
|
||||
onEmojiSelected(Optional.fromNullable(Recipient.self().getAboutEmoji()).or(""));
|
||||
onEmojiSelectedInternal(Optional.fromNullable(Recipient.self().getAboutEmoji()).or(""));
|
||||
}
|
||||
|
||||
ViewUtil.focusAndMoveCursorToEndAndOpenKeyboard(bodyView);
|
||||
|
@ -120,6 +120,11 @@ public class EditAboutFragment extends Fragment implements ManageProfileActivity
|
|||
|
||||
@Override
|
||||
public void onEmojiSelected(@NonNull String emoji) {
|
||||
onEmojiSelectedInternal(emoji);
|
||||
ViewUtil.focusAndMoveCursorToEndAndOpenKeyboard(bodyView);
|
||||
}
|
||||
|
||||
private void onEmojiSelectedInternal(@NonNull String emoji) {
|
||||
Drawable drawable = EmojiUtil.convertToDrawable(requireContext(), emoji);
|
||||
if (drawable != null) {
|
||||
this.emojiView.setImageDrawable(drawable);
|
||||
|
@ -155,7 +160,7 @@ public class EditAboutFragment extends Fragment implements ManageProfileActivity
|
|||
|
||||
private void onClearClicked() {
|
||||
bodyView.setText("");
|
||||
onEmojiSelected("");
|
||||
onEmojiSelectedInternal("");
|
||||
}
|
||||
|
||||
private static void trimFieldToMaxByteLength(Editable s) {
|
||||
|
@ -167,7 +172,7 @@ public class EditAboutFragment extends Fragment implements ManageProfileActivity
|
|||
}
|
||||
|
||||
private void onPresetSelected(@NonNull AboutPreset preset) {
|
||||
onEmojiSelected(preset.getEmoji());
|
||||
onEmojiSelectedInternal(preset.getEmoji());
|
||||
bodyView.setText(requireContext().getString(preset.getBodyRes()));
|
||||
}
|
||||
|
||||
|
|
|
@ -78,17 +78,23 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/edit_about_count"
|
||||
app:layout_constraintBottom_toBottomOf="parent" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/edit_about_save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
style="@style/Signal.Widget.Button.Medium.Primary"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/EditProfileNameFragment_save"
|
||||
app:cornerRadius="80dp"
|
||||
app:elevation="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="?colorAccent"
|
||||
app:cpb_cornerRadius="28dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/EditProfileNameFragment_save" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -45,17 +45,23 @@
|
|||
app:layout_constraintTop_toBottomOf="@id/edit_profile_name_given_name"
|
||||
app:layout_constraintStart_toStartOf="parent"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
<com.dd.CircularProgressButton
|
||||
android:id="@+id/edit_profile_name_save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
style="@style/Signal.Widget.Button.Medium.Primary"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/EditProfileNameFragment_save"
|
||||
app:cornerRadius="80dp"
|
||||
app:elevation="4dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:cpb_colorIndicator="@color/white"
|
||||
app:cpb_colorProgress="?colorAccent"
|
||||
app:cpb_cornerRadius="28dp"
|
||||
app:cpb_selectorIdle="@drawable/progress_button_state"
|
||||
app:cpb_textIdle="@string/EditProfileNameFragment_save" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -25,7 +25,7 @@
|
|||
android:id="@+id/manage_profile_avatar_background"
|
||||
android:layout_width="96dp"
|
||||
android:layout_height="96dp"
|
||||
android:layout_marginTop="33dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:src="@drawable/circle_tintable"
|
||||
android:tint="@color/core_grey_05"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -75,7 +75,7 @@
|
|||
android:id="@+id/manage_profile_name_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="33dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:paddingStart="26dp"
|
||||
android:paddingEnd="26dp"
|
||||
android:paddingTop="16dp"
|
||||
|
|
Ładowanie…
Reference in New Issue