Keep entered answer data

pull/180/head
M66B 5 years ago
parent 88722dc552
commit 77b5919bd9

@ -159,18 +159,21 @@ public class FragmentAnswer extends FragmentBase {
@Override @Override
protected void onExecuted(Bundle args, EntityAnswer answer) { protected void onExecuted(Bundle args, EntityAnswer answer) {
etName.setText(answer == null ? null : answer.name); if (savedInstanceState == null) {
cbFavorite.setChecked(answer == null ? false : answer.favorite); etName.setText(answer == null ? null : answer.name);
cbHide.setChecked(answer == null ? false : answer.hide); cbFavorite.setChecked(answer == null ? false : answer.favorite);
if (answer == null) cbHide.setChecked(answer == null ? false : answer.hide);
etText.setText(null); if (answer == null)
else etText.setText(null);
etText.setText(HtmlHelper.fromHtml(answer.text, new Html.ImageGetter() { else
@Override etText.setText(HtmlHelper.fromHtml(answer.text, new Html.ImageGetter() {
public Drawable getDrawable(String source) { @Override
return ImageHelper.decodeImage(getContext(), -1, source, true, 0, etText); public Drawable getDrawable(String source) {
} return ImageHelper.decodeImage(getContext(), -1, source, true, 0, etText);
}, null)); }
}, null));
}
bottom_navigation.findViewById(R.id.action_delete).setVisibility(answer == null ? View.GONE : View.VISIBLE); bottom_navigation.findViewById(R.id.action_delete).setVisibility(answer == null ? View.GONE : View.VISIBLE);
pbWait.setVisibility(View.GONE); pbWait.setVisibility(View.GONE);

Loading…
Cancel
Save