Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 611c435f authored by Tingting Wang's avatar Tingting Wang
Browse files

Fix bug on full editor note view.

ValuesDelta with empty ops should not be ignored, since
all empty editor will be process in UpdateEmptyEditors() method.

BUG 29506357

Change-Id: I734e9a104ceab17d80a113d84eae34f70ac72ac2
parent e9a90ec7
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -170,7 +170,6 @@ public class KindSectionView extends LinearLayout implements EditorListener {
            for (ValuesDelta entry : mState.getMimeEntries(mKind.mimeType)) {
                // Skip entries that aren't visible
                if (!entry.isVisible()) continue;
                if (isEmptyNoop(entry)) continue;

                createEditorView(entry);
            }
@@ -205,20 +204,6 @@ public class KindSectionView extends LinearLayout implements EditorListener {
        return view;
    }

    /**
     * Tests whether the given item has no changes (so it exists in the database) but is empty
     */
    private boolean isEmptyNoop(ValuesDelta item) {
        if (!item.isNoop()) return false;
        final int fieldCount = mKind.fieldList.size();
        for (int i = 0; i < fieldCount; i++) {
            final String column = mKind.fieldList.get(i).column;
            final String value = item.getAsString(column);
            if (!TextUtils.isEmpty(value)) return false;
        }
        return true;
    }

    /**
     * Updates the editors being displayed to the user removing extra empty
     * {@link Editor}s, so there is only max 1 empty {@link Editor} view at a time.