feat(profile/note): add toast on save failure
This commit is contained in:
parent
2c1b8da475
commit
5a8fed3c06
|
@ -470,7 +470,6 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||
username.setText('@'+account.acct+(isSelf ? ('@'+AccountSessionManager.getInstance().getAccount(accountID).domain) : ""));
|
||||
}
|
||||
CharSequence parsedBio=HtmlParser.parse(account.note, account.emojis, Collections.emptyList(), Collections.emptyList(), accountID);
|
||||
// bio.setOnClickListener(v->savePrivateNote());
|
||||
if(TextUtils.isEmpty(parsedBio)){
|
||||
bio.setVisibility(View.GONE);
|
||||
}else{
|
||||
|
@ -495,16 +494,6 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||
noteEdit.clearFocus();
|
||||
}));
|
||||
|
||||
// if(noteEdit.getText().toString() == null){
|
||||
// noteEditConfirm.setImageResource(R.drawable.ic_fluent_checkmark_24_regular);
|
||||
// noteEditConfirm.setClickable(false);
|
||||
// noteEditConfirm.setAlpha(.50f);
|
||||
// }else{
|
||||
// noteEditConfirm.setImageResource(R.drawable.ic_fluent_checkmark_24_filled);
|
||||
// noteEditConfirm.setClickable(true);
|
||||
// noteEditConfirm.setAlpha(1.0f);
|
||||
// }
|
||||
|
||||
followersCount.setText(UiUtils.abbreviateNumber(account.followersCount));
|
||||
followingCount.setText(UiUtils.abbreviateNumber(account.followingCount));
|
||||
postsCount.setText(UiUtils.abbreviateNumber(account.statusesCount));
|
||||
|
@ -1008,10 +997,14 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||
}
|
||||
|
||||
private void savePrivateNote(){
|
||||
currentRequest = new SetPrivateNote(profileAccountID, noteEdit.getText().toString()).setCallback(new SimpleCallback<>(this) {
|
||||
currentRequest = new SetPrivateNote(profileAccountID, noteEdit.getText().toString()).setCallback(new Callback<>() {
|
||||
@Override
|
||||
public void onSuccess(Relationship result) {
|
||||
Toast.makeText(getActivity(), "Successfully updated note", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(ErrorResponse result) {
|
||||
Toast.makeText(getActivity(), getString(R.string.sk_personal_note_update_failed), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}).exec(accountID);
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@
|
|||
<string name="sk_settings_profile">Set up profile</string>
|
||||
<string name="sk_personal_note">Add a note for this profile</string>
|
||||
<string name="sk_personal_note_confirm">Confirm edited note</string>
|
||||
<string name="sk_personal_note_update_failed">Failed to save note</string>
|
||||
<string name="sk_settings_posting">Posting preferences</string>
|
||||
<string name="sk_settings_filters">Configure filters</string>
|
||||
<string name="sk_settings_auth">Security settings</string>
|
||||
|
|
Loading…
Reference in New Issue