# fukusaka/function-test-201909-constraintlayout architecture

> Architecture diagram of the GitHub repository fukusaka/function-test-201909-constraintlayout, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/fukusaka/function-test-201909-constraintlayout
- Repository: https://github.com/fukusaka/function-test-201909-constraintlayout

## Overview

##### Project type and purpose
- This is a sample Android application (Kotlin) whose sole purpose is to verify that layouts built with ConstraintLayout 1.x behave identically when linked against ConstraintLayout 2.x. It exercises two build variants—oneDebug (v1.1.3) and twoDebug (v2.0.0-beta2/beta3)—to reproduce a margin/spacing issue and confirm its fix in beta3.

##### File structure
- Top-level Gradle files: settings.gradle, build.gradle, gradle.properties, Gradle wrapper.
- Single module “app” with build.gradle and proguard rules.
- Source code under app/src/main/java/jp/fukusaka/constraintlayout001/MainActivity.kt.
- Layout resource under app/src/main/res/layout/activity_main.xml.
- Test code in app/src/test (unit tests) and app/src/androidTest (instrumented tests).

##### README for additional insights
- Purpose: confirm ConstraintLayout v1 layouts still work under v2.
- Build instructions use `./gradlew assembleDebug` and switching Build Variants in Android Studio.

##### Detail
- Both build-time and run-time components.
- Test harnesses separately.
- Two build variants side by side to contrast v1 vs. v2 behavior.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build System Layer
    subgraph "Build System" 
        GW["gradlew"]:::build
        GWB["gradlew.bat"]:::build
        GWP["gradle/wrapper/gradle-wrapper.properties"]:::build
        SG["settings.gradle"]:::build
        RGB["build.gradle (root)"]:::build
        GP["gradle.properties"]:::build
        GW -->|executes| SG
        GW -->|executes| RGB
        GW -->|uses| GWP
        SG -->|includes| RGB
        RGB -->|reads| GP
    end

    %% Build Variants
    subgraph "Build Variants Injection" 
        CL1["ConstraintLayout v1.1.3"]:::app
        CL2["ConstraintLayout v2.0.0-beta3"]:::app
        SG -->|configures oneDebug| CL1
        SG -->|configures twoDebug| CL2
    end

    %% App Module Layer
    subgraph "App Module" 
        ABG["app/build.gradle"]:::app
        APR["app/proguard-rules.pro"]:::app
        AM["app/src/main/AndroidManifest.xml"]:::app
        MA["MainActivity.kt"]:::app
        XML["activity_main.xml"]:::app
        DR1["ic_launcher_background.xml"]:::app
        DR2["ic_sentiment_neutral_black_24dp.xml"]:::app
        DR3["ic_sentiment_satisfied_black_24dp.xml"]:::app
        DR4["ic_sentiment_very_dissatisfied_black_24dp.xml"]:::app
        DR5["ic_launcher_foreground.xml"]:::app
        MP1["mipmap-anydpi-v26/ic_launcher.xml"]:::app
        MP2["mipmap-anydpi-v26/ic_launcher_round.xml"]:::app
        MP3["mipmap-hdpi/"]:::app
        MP4["mipmap-mdpi/"]:::app
        MP5["mipmap-xhdpi/"]:::app
        MP6["mipmap-xxhdpi/"]:::app
        MP7["mipmap-xxxhdpi/"]:::app
        V1["colors.xml"]:::app
        V2["strings.xml"]:::app
        V3["styles.xml"]:::app
        ABG -->|compiles| MA
        ABG -->|packages| XML
        ABG -->|packages| DR1
        ABG -->|packages| DR2
        ABG -->|packages| DR3
        ABG -->|packages| DR4
        ABG -->|packages| DR5
        ABG -->|packages| MP1
        ABG -->|packages| MP2
        ABG -->|packages| MP3
        ABG -->|packages| MP4
        ABG -->|packages| MP5
        ABG -->|packages| MP6
        ABG -->|packages| MP7
        ABG -->|packages| V1
        ABG -->|packages| V2
        ABG -->|packages| V3
        ABG -->|uses| APR
        AM -->|declares| MA
    end

    %% APK Generation
    APK["APK"]:::app
    CL1 -->|linked into oneDebug| APK
    CL2 -->|linked into twoDebug| APK
    ABG -->|produces| APK

    %% Runtime Layer
    subgraph "Runtime (Device/Emulator)" 
        AF["Android Framework"]:::android
        ACT["Activity Lifecycle"]:::android
        INF["View Inflation"]:::android
        VHT["View Hierarchy Tree"]:::android
        E1["ConstraintLayout Engine v1"]:::android
        E2["ConstraintLayout Engine v2"]:::android
        SCREEN["Screen Rendering"]:::android
        APK -->|installs| AF
        AF -->|creates| ACT
        ACT -->|inflates| INF
        INF -->|parses| XML
        INF -->|builds| VHT
        VHT -->|measures/layout| E1
        VHT -->|measures/layout| E2
        E1 -->|draws| SCREEN
        E2 -->|draws| SCREEN
    end

    %% Test Harnesses Layer
    subgraph "Tests" 
        UT["ExampleUnitTest.kt (JVM)"]:::test
        IT["ExampleInstrumentedTest.kt (Device)"]:::test
        UT -->|runs on JVM| APK
        IT -->|runs on device| AF
    end

    %% Click Events
    click GW "https://github.com/fukusaka/function-test-201909-constraintlayout/tree/master/gradlew"
    click GWB "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/gradlew.bat"
    click GWP "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/gradle/wrapper/gradle-wrapper.properties"
    click SG "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/settings.gradle"
    click RGB "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/build.gradle"
    click GP "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/gradle.properties"
    click ABG "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/build.gradle"
    click APR "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/proguard-rules.pro"
    click AM "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/AndroidManifest.xml"
    click MA "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/java/jp/fukusaka/constraintlayout001/MainActivity.kt"
    click XML "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/layout/activity_main.xml"
    click DR1 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/drawable/ic_launcher_background.xml"
    click DR2 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/drawable/ic_sentiment_neutral_black_24dp.xml"
    click DR3 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/drawable/ic_sentiment_satisfied_black_24dp.xml"
    click DR4 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/drawable/ic_sentiment_very_dissatisfied_black_24dp.xml"
    click DR5 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/drawable-v24/ic_launcher_foreground.xml"
    click MP1 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml"
    click MP2 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml"
    click MP3 "https://github.com/fukusaka/function-test-201909-constraintlayout/tree/master/app/src/main/res/mipmap-hdpi/"
    click MP4 "https://github.com/fukusaka/function-test-201909-constraintlayout/tree/master/app/src/main/res/mipmap-mdpi/"
    click MP5 "https://github.com/fukusaka/function-test-201909-constraintlayout/tree/master/app/src/main/res/mipmap-xhdpi/"
    click MP6 "https://github.com/fukusaka/function-test-201909-constraintlayout/tree/master/app/src/main/res/mipmap-xxhdpi/"
    click MP7 "https://github.com/fukusaka/function-test-201909-constraintlayout/tree/master/app/src/main/res/mipmap-xxxhdpi/"
    click V1 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/values/colors.xml"
    click V2 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/values/strings.xml"
    click V3 "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/main/res/values/styles.xml"
    click UT "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/test/java/jp/fukusaka/constraintlayout001/ExampleUnitTest.kt"
    click IT "https://github.com/fukusaka/function-test-201909-constraintlayout/blob/master/app/src/androidTest/java/jp/fukusaka/constraintlayout001/ExampleInstrumentedTest.kt"

    %% Styles
    classDef build fill:#eeeeee,stroke:#333333,stroke-width:1px;
    classDef app fill:#bbdefb,stroke:#1e88e5,stroke-width:1px;
    classDef android fill:#c8e6c9,stroke:#43a047,stroke-width:1px;
    classDef device fill:#ce93d8,stroke:#8e24aa,stroke-width:1px;
    classDef test fill:#ffe082,stroke:#f9a825,stroke-width:1px;
```
