Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Profile): display Toast when saving note #503

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading