name: android-platform-patterns
description: 'Android platform/helper layer guide for AniTrend. Use when working in :android:* modules or deciding whether to reuse or extend existing Android-side helpers for configuration/theme, context or fragment utilities, notification permission flows, deep links, drawer/app-shell behavior, or other platform APIs.'
Skill: Android Platform Patterns
Overview
:android:* is AniTrend's platform/helper layer. It owns reusable Android-side APIs that should
be shared across the app shell, feature modules, common presenters, and task modules instead of
being recreated inside those entry layers.
Before adding a new helper, wrapper, extension, or provider, inspect the existing platform surfaces first:
:android:corefor settings, configuration, theme, Compose primitives, controllers, helpers, and context/fragment utilities:android:navigationfor drawer and app-shell navigation content:android:deeplinkfor URI entry, parser registration, and external-intent routing:app:corefor app-shell integration points that already consume those Android helpers
Use the concrete anchors in the layer example matrix when you need a real code path to copy.
Module roles
:android:corecentralizes reusable Android-facing APIs such asSettings,ConfigurationHelper,AniTrendTheme3, notification helpers, storage/power/shortcut controllers, and fragment/context utilities.:android:navigationowns the navigation drawer shell: fragment content, drawer presenter, viewmodels, adapters, and router provider wiring.:android:deeplinkowns external URI intake:DeepLinkScreen, parser assembly, route registration, and the provider that turns a URI into a routed intent.
Reuse-first workflow
- Search
android/core,android/navigation,android/deeplink, andapp/corebefore creating anything new. - If an existing helper/controller/provider already models the behavior, extend that surface in
place instead of cloning the API in
feature,common, ortask. - If the behavior is app-shell specific, inspect
android/navigation/src/main/kotlin/co/anitrend/android/navigation/andapp/src/main/kotlin/co/anitrend/component/screen/MainScreen.kt. - If the behavior starts from an external URI, inspect
android/deeplinkbefore touching a feature module. - Only add a new internal API when reuse would break ownership boundaries or force an awkward abstraction that would require changing more than one existing public interface in the platform layer or would force a dependency that the consuming module is not allowed to take.
Decision rules
Apply the Reuse-first workflow first. The decision rules below are the constraints that govern the workflow steps.
- Do not recreate context or fragment lookup helpers if
android/core/src/main/kotlin/co/anitrend/android/core/extensions/ContextExtensions.ktorapp/core/src/main/kotlin/co/anitrend/core/ui/UiExtensions.ktalready covers the call pattern. - Do not recreate theme or configuration wiring if
ConfigurationHelper,ThemeHelper, orAniTrendTheme3already owns it. - Do not recreate notification permission or settings flows if
NotificationHelperorNotificationExtensions.ktalready models the behavior. - Do not bypass router and provider contracts with direct intent construction when
:app:navigation,:android:navigation, or:android:deeplinkalready owns the route. - Keep platform-wide helpers in
:android:*; keep feature-specific logic in the owning feature. - If an existing helper/controller/provider already covers the required behavior without changing
any existing method signatures or callers, extend that surface in place instead of cloning the
API in
feature,common, ortask.
Canonical files
android/core/src/main/kotlin/co/anitrend/android/core/koin/Modules.ktandroid/core/src/main/kotlin/co/anitrend/android/core/settings/helper/config/ConfigurationHelper.ktandroid/core/src/main/kotlin/co/anitrend/android/core/extensions/ContextExtensions.ktandroid/core/src/main/kotlin/co/anitrend/android/core/helpers/notification/NotificationExtensions.ktandroid/core/src/main/kotlin/co/anitrend/android/core/ui/theme/Theme.ktandroid/navigation/src/main/kotlin/co/anitrend/android/navigation/drawer/koin/Modules.ktandroid/navigation/src/main/kotlin/co/anitrend/android/navigation/drawer/provider/FeatureProvider.ktandroid/deeplink/src/main/kotlin/co/anitrend/android/deeplink/koin/Modules.ktandroid/deeplink/src/main/kotlin/co/anitrend/android/deeplink/component/screen/DeepLinkScreen.ktandroid/deeplink/src/main/kotlin/co/anitrend/android/deeplink/provider/FeatureProvider.ktapp/core/src/main/kotlin/co/anitrend/core/koin/Modules.ktapp/core/src/main/kotlin/co/anitrend/core/ui/UiExtensions.ktapp/src/main/kotlin/co/anitrend/component/screen/MainScreen.kt