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

Commit 7e760f95 authored by Tingting Wang's avatar Tingting Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix bug on full editor note view."

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


                createEditorView(entry);
                createEditorView(entry);
            }
            }
@@ -205,20 +204,6 @@ public class KindSectionView extends LinearLayout implements EditorListener {
        return view;
        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
     * 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.
     * {@link Editor}s, so there is only max 1 empty {@link Editor} view at a time.