Skip to content

Commit

Permalink
Merge pull request #503 from FineFindus/feat/profile-note-save-feedback
Browse files Browse the repository at this point in the history
feat(Profile): display Toast when saving note
  • Loading branch information
LucasGGamerM authored Aug 11, 2024
2 parents c26df57 + 134513b commit 13545fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()){
Expand Down Expand Up @@ -469,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
Expand Down
1 change: 1 addition & 0 deletions mastodon/src/main/res/values/strings_mo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<string name="mo_settings_app_version" translatable="false">Moshidon v%1$s (%2$d)</string>

<string name="mo_personal_note">Add a note about this profile</string>
<string name="mo_personal_note_saved">Note saved</string>
<string name="mo_personal_note_confirm">Confirm changes to note</string>
<string name="mo_personal_note_update_failed">Failed to save note</string>
<string name="mo_settings_contribute">Contribute to Moshidon</string>
Expand Down

0 comments on commit 13545fd

Please sign in to comment.