android_generate_bottom_sheet
Create Android bottom sheet components in Compose for DHIS2 mobile apps. Specify component name and persistent sheet options to generate UI elements for data display and user interactions.
Instructions
Generate Android bottom sheet component (Compose)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| componentName | No | Composable name | |
| persistent | No | Generate persistent bottom sheet alternative |
Implementation Reference
- src/index.ts:1122-1125 (handler)The MCP tool handler for 'android_generate_bottom_sheet'. It extracts arguments, calls the generateAndroidBottomSheet helper function, and returns the generated Kotlin code as text content.case 'android_generate_bottom_sheet': const aSheetArgs = args as any; const aSheet = generateAndroidBottomSheet(aSheetArgs); return { content: [{ type: 'text', text: aSheet }] };
- src/webapp-generators.ts:1847-1863 (helper)The supporting utility function that generates a markdown document containing Kotlin Jetpack Compose code for a customizable ModalBottomSheet component.export function generateAndroidBottomSheet(args: any): string { const { componentName = 'DetailsBottomSheet' } = args; return `# Android Bottom Sheet (Compose): ${componentName} ## Implementation \`\`\`kotlin @OptIn(ExperimentalMaterial3Api::class) @Composable fun ${componentName}(open: Boolean, onDismiss: () -> Unit, content: @Composable () -> Unit) { if (!open) return ModalBottomSheet(onDismissRequest = onDismiss) { content() } } \`\`\` `;
- src/permission-system.ts:177-178 (registration)The tool is registered in the TOOL_PERMISSIONS map, requiring 'canUseMobileFeatures' permission for access control.['android_generate_bottom_sheet', 'canUseMobileFeatures'], ]);
- src/index.ts:34-35 (helper)Import statement in index.ts that brings the generateAndroidBottomSheet function into scope for use by the tool handler.generateTestSetup } from './webapp-generators.js';