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

1379 widget credentials #1400

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 @@ -82,6 +82,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 @@ -314,7 +315,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 @@ -167,6 +167,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
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ protected void onNoteLoaded(Note note) {
changedText = newContent.toString();
saveNote(null);
});
contentLoaded = true;
}

protected void registerInternalNoteLinkHandler() {
Expand Down
Loading