@Override public void activeBlockChanged(Editor editor, String blockId) { activeBlock = editor.getBlockById(blockId); if (block != null && block.getId().equals(blockId)) return; // selectionChanged already changed the active block update(activeBlock, UpdateCause.EDIT); }
@Override public void contentChanged(Editor editor, String[] blockIds) { // The active block may have been removed then added again in which case // the old instance is invalid but can be restored by remapping the identifier if (activeBlock != null && !activeBlock.isValid()) { activeBlock = editor.getBlockById(activeBlock.getId()); if (activeBlock == null) { update(null, UpdateCause.EDIT); return; } } if (activeBlock != null && Arrays.asList(blockIds).contains(activeBlock.getId())) { if (block == null) block = activeBlock; update(activeBlock, UpdateCause.EDIT); } }
final ContentBlock contentBlock = (contentBlock_ != null) && !contentBlock_.getType().equals("Container") ? contentBlock_ : rootBlock; final boolean isRoot = contentBlock.getId().equals(rootBlock.getId()); dialogBuilder.setTitle(contentBlock.getType() + " (id: " + contentBlock.getId() + ")"); dialogBuilder.setItems(items.toArray(new String[items.size()]), new DialogInterface.OnClickListener()