From 91cb6161646c061f77a2b82c4e5099bc4e930f53 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Sun, 11 Aug 2024 11:47:34 +0200 Subject: [PATCH 1/2] refactor(ProfileFragment): remove duplicated InputType setting The NoteEdit InputType is already set in the UI file. --- .../joinmastodon/android/fragments/ProfileFragment.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index a15630a526..c094e869bf 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -287,11 +287,10 @@ public View onCreateContentView(LayoutInflater inflater, ViewGroup container, Bu noteEdit.setOnFocusChangeListener((v, hasFocus)->{ if(hasFocus){ hideFab(); - noteEdit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); - }else{ - showFab(); - savePrivateNote(noteEdit.getText().toString()); + return; } + showFab(); + savePrivateNote(noteEdit.getText().toString()); }); FrameLayout sizeWrapper=new FrameLayout(getActivity()){ From 134513babdbe955000319f6c188e26cedb590669 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Sun, 11 Aug 2024 11:48:51 +0200 Subject: [PATCH 2/2] feat(ProfileFragment): display toast when saving note It can be quite unclear if the note has been saved. This adds a toast, to indicate that the profile note has been saved. --- .../java/org/joinmastodon/android/fragments/ProfileFragment.java | 1 + mastodon/src/main/res/values/strings_mo.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index c094e869bf..b25c0e4053 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -468,6 +468,7 @@ private void savePrivateNote(String note){ public void onSuccess(Relationship result) { updateRelationship(result); invalidateOptionsMenu(); + Toast.makeText(getContext(), R.string.mo_personal_note_saved, Toast.LENGTH_SHORT).show(); } @Override diff --git a/mastodon/src/main/res/values/strings_mo.xml b/mastodon/src/main/res/values/strings_mo.xml index f529ec0165..4881f8d069 100644 --- a/mastodon/src/main/res/values/strings_mo.xml +++ b/mastodon/src/main/res/values/strings_mo.xml @@ -16,6 +16,7 @@ Moshidon v%1$s (%2$d) Add a note about this profile + Note saved Confirm changes to note Failed to save note Contribute to Moshidon