MCBFC uses two XML layout files.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tutosrive/mcbfc/llms.txt
Use this file to discover all available pages before exploring further.
fenced_code_view.xml drives every fenced code block — providing a horizontally scrollable TextView overlaid with a floating copy ImageButton. adapter_default_entry.xml serves as the root TextView for all other markdown nodes (paragraphs, headings, lists, blockquotes, and so on) and is registered as the TextViewIsRoot default in MarkwonAdapter.
fenced_code_view.xml
fenced_code_view.xml
Key elements
RootFrameLayout
layout_width="match_parent" and layout_height="wrap_content" ensure the block spans the full recycler width and grows to fit its content. android:background="@color/material_dynamic_neutral_variant10" applies a dark neutral surface colour. android:paddingLeft="16dip" and android:paddingRight="16dip" provide 16 dp horizontal insets. clipChildren="false" and clipToPadding="false" allow the elevated ImageButton to render visually outside the padding boundary without clipping.
ImageButton (@+id/copyCommand)
android:elevation="18dp" places the button above the HorizontalScrollView (elevation 8dp) in the z-stack, so it is always tappable regardless of scroll position. android:layout_gravity="end" pins it to the trailing edge of the FrameLayout. android:src="?attr/actionModeCopyDrawable" uses the theme-provided copy icon from the action mode attribute. The alert_dark_frame background gives it a subtle dark container.
HorizontalScrollView
layout_width="match_parent" and layout_height="match_parent" fill the entire FrameLayout. android:elevation="8dp" ensures it renders above the default z-order but below the ImageButton.
TextView (@+id/command)
Sits inside the HorizontalScrollView. android:paddingStart="10dp", android:paddingTop="10dp", and android:paddingBottom="10dp" provide uniform insets; android:paddingEnd="70dp" adds extra trailing space so long code lines never scroll behind the copy button. android:textColor="@color/design_default_color_secondary" renders the code text in the theme’s secondary colour. android:elevation="-1dp" keeps it below the scroll view’s own elevation layer.
adapter_default_entry.xml
adapter_default_entry.xml
TextView used for every non-fenced-code AST node — paragraphs, headings, lists, blockquotes, inline code, and any other node that MarkwonAdapter does not have a dedicated Entry for. It is registered via MarkwonAdapter.builderTextViewIsRoot(R.layout.adapter_default_entry).
android:layout_width="match_parent"— spans the full recycler width so Markwon’s span rendering has the correct measure pass.android:padding="8dp"— uniform padding on all sides for comfortable reading margins.android:textSize="16sp"— scales with the user’s font-size preference.android:textColor="?android:attr/textColorPrimary"— adopts the primary text colour from the active theme (light or dark), giving good contrast without a hardcoded colour.android:lineSpacingExtra="4dp"— adds 4 dp of extra spacing between lines, improving readability for multi-line paragraphs and list items.
View IDs used in code
| ID | View type | Used in |
|---|---|---|
@+id/command | TextView | BlockCodeEntry.Holder.commandText |
@+id/copyCommand | ImageButton | BlockCodeEntry.Holder.btnCopy |