Making the notes thing more beautiful, and also saves when back button is pressed. i love this. Try it later @FineFindus!

This commit is contained in:
LucasGGamerM 2023-01-17 21:12:04 -03:00
parent 18811ec32a
commit ce89733f2d
2 changed files with 29 additions and 10 deletions

View File

@ -209,7 +209,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
noteEdit = content.findViewById(R.id.note_edit);
noteWrap = content.findViewById(R.id.note_edit_wrap);
ImageButton noteEditConfirm = content.findViewById(R.id.note_edit_confirm);
Button noteEditConfirm = content.findViewById(R.id.note_edit_confirm);
avatar.setOutlineProvider(new ViewOutlineProvider(){
@Override
@ -221,11 +221,13 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
noteEdit.setOnFocusChangeListener((v, hasFocus) -> {
if (hasFocus) {
fab.setVisibility(View.GONE);
noteEditConfirm.setVisibility(View.VISIBLE);
noteEditConfirm.animate()
.alpha(1.0f)
.setDuration(700);
} else {
fab.setVisibility(View.VISIBLE);
noteEditConfirm.animate()
.alpha(0.0f)
.setDuration(700);
@ -978,6 +980,9 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
@Override
public boolean onBackPressed(){
if(noteEdit.hasFocus()) {
savePrivateNote();
}
if(isInEditMode){
exitEditMode();
return true;

View File

@ -258,6 +258,9 @@
android:layout_height="wrap_content"
android:layout_below="@id/username"
android:id="@+id/note_edit_wrap"
android:layout_marginTop="4dp"
android:layout_marginBottom="16dp"
android:layout_marginHorizontal="16dp"
android:visibility="gone">
<EditText
@ -265,9 +268,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingVertical="16dp"
android:layout_marginTop="4dp"
android:layout_marginBottom="16dp"
android:layout_marginHorizontal="16dp"
android:inputType="textMultiLine|textCapSentences"
android:singleLine="false"
android:drawableStart="@drawable/ic_fluent_notepad_20_regular"
@ -279,18 +279,32 @@
android:visibility="gone"
android:hint="@string/sk_personal_note"/>
<ImageButton
<Button
android:id="@+id/note_edit_confirm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_fluent_checkmark_24_filled"
android:backgroundTint="#00000000"
android:layout_marginTop="2dp"
android:layout_marginEnd="8dp"
android:paddingHorizontal="8dp"
android:visibility="invisible"
android:layout_marginEnd="20dp"
android:layout_gravity="right|center_vertical"
android:tooltipText="@string/sk_personal_note_confirm"
android:contentDescription="@string/sk_personal_note_confirm" />
android:contentDescription="@string/sk_personal_note_confirm"
android:drawableStart="@drawable/ic_fluent_checkmark_24_filled"
android:drawableTint="?colorButtonText"
/>
<!-- <ImageButton-->
<!-- android:id="@+id/note_edit_confirm"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:src="@drawable/ic_fluent_checkmark_24_filled"-->
<!-- android:backgroundTint="#00000000"-->
<!-- android:layout_marginTop="2dp"-->
<!-- android:visibility="invisible"-->
<!-- android:layout_marginEnd="20dp"-->
<!-- android:layout_gravity="right|center_vertical"-->
<!-- android:tooltipText="@string/sk_personal_note_confirm"-->
<!-- android:contentDescription="@string/sk_personal_note_confirm" />-->
</FrameLayout>