# bitvale/pacbutton architecture

> Architecture diagram of the GitHub repository bitvale/pacbutton, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bitvale/pacbutton
- Repository: https://github.com/bitvale/pacbutton

## Overview

PacButton is an Android UI library for a configurable video/photo switch animation. An app places the custom view in its layout, supplies icons and colors, then responds to selection and animation-progress callbacks. The repository also contains bitmap-conversion and drawable/interpolation helpers; the main view implementation was not excerpted, so links to those helpers are omitted rather than inferred.

Main entry points: [`library/src/main/java/com/bitvale/pacbutton/PacButton.kt`](https://github.com/bitvale/pacbutton/blob/master/library/src/main/java/com/bitvale/pacbutton/PacButton.kt) (PacButton View)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_view["Switch View"]
  node_button["PacButton View<br/>[PacButton.kt]"]
  node_view_config["View Attributes<br/>[attrs.xml]"]
end

subgraph group_helpers["Rendering Helpers"]
  node_bitmap_util["Bitmap Conversion<br/>[BitmapUtil.kt]"]
  node_extensions["Drawable and Lerp<br/>[Extensions.kt]"]
end

node_app(("Host App"))

node_app -->|"configures and embeds"| node_button
node_app -->|"registers callbacks"| node_button
node_button -->|"emits selection and progress"| node_app

click node_button "https://github.com/bitvale/pacbutton/blob/master/library/src/main/java/com/bitvale/pacbutton/PacButton.kt"
click node_view_config "https://github.com/bitvale/pacbutton/blob/master/library/src/main/res/values/attrs.xml"
click node_bitmap_util "https://github.com/bitvale/pacbutton/blob/master/library/src/main/java/com/bitvale/pacbutton/BitmapUtil.kt"
click node_extensions "https://github.com/bitvale/pacbutton/blob/master/library/src/main/java/com/bitvale/pacbutton/Extensions.kt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_button,node_view_config toneBlue
class node_bitmap_util,node_extensions toneAmber
class node_app toneIndigo
```

## Components

### Switch View

- [PacButton View](https://github.com/bitvale/pacbutton/blob/master/library/src/main/java/com/bitvale/pacbutton/PacButton.kt): `library/src/main/java/com/bitvale/pacbutton/PacButton.kt`
- [View Attributes](https://github.com/bitvale/pacbutton/blob/master/library/src/main/res/values/attrs.xml): `library/src/main/res/values/attrs.xml`

### Rendering Helpers

- [Bitmap Conversion](https://github.com/bitvale/pacbutton/blob/master/library/src/main/java/com/bitvale/pacbutton/BitmapUtil.kt): `library/src/main/java/com/bitvale/pacbutton/BitmapUtil.kt`
- [Drawable and Lerp](https://github.com/bitvale/pacbutton/blob/master/library/src/main/java/com/bitvale/pacbutton/Extensions.kt): `library/src/main/java/com/bitvale/pacbutton/Extensions.kt`

### Other components

- **Host App**

## Connections

- Host App → PacButton View: configures and embeds (evidence: `README.md`)
- Host App → PacButton View: registers callbacks (evidence: `README.md`)
- PacButton View → Host App: emits selection and progress (evidence: `README.md`)
