# dmytrodanylyk/circular-progress-button architecture

> Architecture diagram of the GitHub repository dmytrodanylyk/circular-progress-button, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dmytrodanylyk/circular-progress-button
- Repository: https://github.com/dmytrodanylyk/circular-progress-button

## Overview

##### Main Components
- Library Module:
- This is located under the “library” directory.
- Contains core source code (files such as CircularProgressButton.java, CircularAnimatedDrawable.java, MorphingAnimation.java, etc.) that implement the UI behavior, animations, and state management for the button.
- Sample Module:
- Stored under the “sample” directory.
- Demonstrates the usage of the library with sample Activities (MainActivity.java, Sample1Activity.java, etc.), along with sample-level Android resources (layouts, drawables, values).
- Build & CI/CD Infrastructure:
- Gradle build files at the root, in the library, and sample directories.
- GitHub workflows (found under .github/workflows) that automate CI tasks such as Android builds and updating the Gradle wrapper.
- Other build-related files like the gradlew scripts, gradle.properties, and settings.gradle.
- External Integration Points:
- Maven Central/JitPack integration for distribution.
- Configuration for ProGuard rules (as noted in both the project files and the README).

##### Relationships and Interactions
- The Library Module is the core component that is built and distributed for use by external projects.
- The Sample Module acts as a consumer of the library, demonstrating how the UI components work and interact in a full Android activity lifecycle.
- Gradle build scripts manage dependencies, compile the source code, and run tests/CI workflows.
- CI/CD pipelines (GitHub workflows) ensure that any changes are automatically built and released. These workflows interact with the repository and external services like JitPack.
- ProGuard configurations are used to maintain compatibility and optimize the library for production use.

##### Important Architectural Patterns & Design Principles
- Modularization: The project is split into at least two modules (library and sample) to separate core functionality from demonstration code.
- Separation of Concerns: Core functionality (animation, state management, and UI interactions) are contained in the library while the sample app is solely for demonstration.
- Config-driven builds and automation: Use of Gradle, GitHub Actions workflows, and structured ProGuard configurations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Library Module – Core UI Components
    subgraph "Library Module – Core UI Components"
        L_Code["Core UI Components (Java)"]:::library
        L_Res["Android Resources (XML)"]:::library
    end

    %% Sample Module – Demo Application
    subgraph "Sample Module – Demo Application"
        S_Code["Demo Activities (Java)"]:::sample
        S_Res["Sample Resources (Layouts, Drawables, Values)"]:::sample
    end

    %% Build & CI/CD Infrastructure
    subgraph "Build & CI/CD Infrastructure"
        B_Files["Root Build Files & Gradle Scripts"]:::build
        CI["GitHub Actions Workflows"]:::build
    end

    %% External Integration & Configuration
    subgraph "External Integration & Configuration"
        PG["Publishing & ProGuard Configuration"]:::external
        Maven["Maven Central/JitPack Integration"]:::external
    end

    %% Relationships and Data Flow
    L_Code -->|"provides"| S_Code
    B_Files -->|"compiles"| L_Code
    B_Files -->|"compiles"| S_Code
    CI -->|"triggers_build"| B_Files
    CI -->|"deploys_to"| PG
    CI -->|"deploys_to"| Maven

    %% Click Events for Component Mapping
    click L_Code "https://github.com/dmytrodanylyk/circular-progress-button/tree/master/library/src/main/java/com/dd"
    click L_Res "https://github.com/dmytrodanylyk/circular-progress-button/tree/master/library/src/main/res"
    click S_Code "https://github.com/dmytrodanylyk/circular-progress-button/tree/master/sample/src/main/java/com/dd/sample"
    click S_Res "https://github.com/dmytrodanylyk/circular-progress-button/tree/master/sample/src/main/res"
    click B_Files "https://github.com/dmytrodanylyk/circular-progress-button/blob/master/build.gradle"
    click CI "https://github.com/dmytrodanylyk/circular-progress-button/tree/master/.github/workflows"
    click PG "https://github.com/dmytrodanylyk/circular-progress-button/blob/master/library/proguard-rules.txt"
    click Maven "https://github.com/dmytrodanylyk/circular-progress-button/blob/master/jitpack.yml"

    %% Styles
    classDef library fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef sample fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef build fill:#FFD700,stroke:#000,stroke-width:2px;
    classDef external fill:#DDA0DD,stroke:#000,stroke-width:2px;
```
