Skip to main content

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.

MCBFC uses two XML layout files. 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
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/material_dynamic_neutral_variant10"
    android:clipChildren="false"
    android:clipToPadding="false"
    android:paddingLeft="16dip"
    android:paddingRight="16dip"
    android:scrollbarStyle="outsideInset">

    <ImageButton
        android:id="@+id/copyCommand"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="end"
        android:background="@android:drawable/alert_dark_frame"
        android:elevation="18dp"
        android:src="?attr/actionModeCopyDrawable" />

    <HorizontalScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:elevation="8dp">

        <TextView
            android:id="@+id/command"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center_vertical"
            android:elevation="-1dp"
            android:paddingStart="10dp"
            android:paddingTop="10dp"
            android:paddingEnd="70dp"
            android:paddingBottom="10dp"
            android:textColor="@color/design_default_color_secondary" />
    </HorizontalScrollView>

</FrameLayout>

Key elements

Root FrameLayout 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
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:padding="8dp"
    android:textSize="16sp"
    android:textColor="?android:attr/textColorPrimary"
    android:lineSpacingExtra="4dp" />
This is a single root 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

IDView typeUsed in
@+id/commandTextViewBlockCodeEntry.Holder.commandText
@+id/copyCommandImageButtonBlockCodeEntry.Holder.btnCopy
?attr/actionModeCopyDrawable is a system-provided attribute that resolves to the copy icon used in Android’s text selection action mode. For a more polished UI — especially on Material Design 3 projects — replace it with a dedicated Material icon such as @drawable/ic_content_copy_24 from the Material Symbols library. This gives you full control over size, tint, and stroke weight.

Build docs developers (and LLMs) love