Skip to content

Commit

Permalink
attempt fixing launch from widget bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nwatson3 authored and AndyScherzinger committed Apr 11, 2023
1 parent 6775a2c commit 80bb08f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public abstract class BaseNoteFragment extends BrandedFragment implements Catego
private boolean titleModified = false;

protected boolean isNew = true;
protected boolean contentLoaded = false;

@Override
public void onAttach(@NonNull Context context) {
Expand Down Expand Up @@ -308,7 +309,7 @@ public void onCloseNote() {
protected void saveNote(@Nullable ISyncCallback callback) {
Log.d(TAG, "saveData()");
if (note != null) {
final var newContent = getContent();
final var newContent = contentLoaded ? getContent() : note.getContent();
if (note.getContent().equals(newContent)) {
if (note.getScrollY() != originalScrollY) {
Log.v(TAG, "... only saving new scroll state, since content did not change");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ protected void onNoteLoaded(Note note) {

binding.editContent.setMarkdownString(note.getContent());
binding.editContent.setEnabled(true);
contentLoaded = true;

final var sp = PreferenceManager.getDefaultSharedPreferences(requireContext().getApplicationContext());
binding.editContent.setTextSize(TypedValue.COMPLEX_UNIT_PX, getFontSizeFromPreferences(requireContext(), sp));
Expand Down

0 comments on commit 80bb08f

Please sign in to comment.