How bigyanthapa/sample-sticky-header works
• Android Application Module (app)
• Main Activity (MainActivity.kt) – the entry point that initializes the UI and manages user interactions.
• Android Manifest (AndroidManifest.xml) – configuration for app components.
• Presentation/UI Layer
• Layout Files (activity_main.xml and various view layouts, e.g., view_sticky_header.xml, view_list_item.xml) – define the visual structure.
• Custom Views & Components (e.g., BookDetailsComponentView.kt, ScrollDisabledListView.kt) – these encapsulate UI logic for displaying sticky headers.
• Data Layer
• Data Model (e.g., Book.kt) – represents domain data.
• Assets (sample_data.json) – static JSON data that may simulate data feeds.
• Utility and Extensions
• Utility Classes (JsonUtils.kt, StickyHeaderDecoration.kt, ViewUtils.kt) – provide supporting functionality.
• Kotlin Extensions (RecyclerViewExtensions.kt, ListViewExtensions.kt) – enhance default behavior for UI components.
• Testing Layers
• Unit Tests (in app/src/test) – logic-level validations.
• Instrumentation Tests (in app/src/androidTest) – UI and behavior testing.
• Build and Configuration
• Gradle Build Scripts (build.gradle, settings.gradle, gradle.properties) – setup and build configurations.
• GitHub Workflows (Android-feature.yml) – continuous integration setup, particularly for Android.
Relationships and Interactions
• MainActivity (in the presentation layer) loads layouts and binds views.
• The UI components (custom views and layouts) interact with utility classes (like StickyHeaderDecoration.kt) to implement the sticky header behavior.
• Data flows from the local asset (sample_data.json) through JSON parsing by JsonUtils.kt into data models like Book.kt.
• Kotlin extension functions enhance RecyclerView/ListView functionalities, linking the data to the UI.
• Testing components validate these interactions via unit and instrumentation tests.
• The Gradle scripts and CI workflows ensure builds and automated tests, highlighting the development infrastructure.
Architectural Patterns and Design Principles
• Separation of Concerns – each package (data, view, util, extensions) clearly isolates functionality.
• Modularity – the project divides responsibilities into separate components making it easy to see where presentation logic, utility functions, and business logic reside.
• UI-Centric Layering – as a demonstration of sticky headers, emphasis is on custom view components and the decoration logic.