feat: integrate PvotLib design-system for light/dark theming#13
Open
sxivansx wants to merge 8 commits into
Open
feat: integrate PvotLib design-system for light/dark theming#13sxivansx wants to merge 8 commits into
sxivansx wants to merge 8 commits into
Conversation
- Remove temporary android:screenOrientation="portrait" lock from manifest
- Add orientation detection in CalculatorScreen using LocalConfiguration
- Landscape layout: Column with compact 2-line display (expression + value)
at top-right and full-width keypad below; display height is fixed so the
keyboard never shifts when expression appears or disappears
- Landscape keypad: 5-column × 4-row grid of pill-shaped (stadium) buttons
sized via BoxWithConstraints to fill available height/width exactly;
button arrangement mirrors the reference design:
Row 1: 7 8 9 ⌫ ÷
Row 2: 4 5 6 AC ×
Row 3: 1 2 3 % −
Row 4: +/− 0 . = +
- Portrait layout unchanged; refactored into PortraitKeypadLayout with
clean BoxWithConstraints sizing and fixed WideCalcButton width formula
(buttonSize×2 + spacing) that eliminates the previous 6dp row overflow
- CalculatorDisplay extracted as private composable shared by both orientations
Introduce semantic color tokens via CalculatorColors + CompositionLocal so the UI automatically switches between dark and light themes based on the system setting — no hardcoded color constants in composables. Changes: - Color.kt: add raw light-mode color values (background, buttons, text) - CalculatorColors.kt: new @immutable data class with semantic slots (background, displayText, expressionText, digitButton/Text, functionButton/Text, operatorButton/Text); DarkCalculatorColors and LightCalculatorColors instances; LocalCalculatorColors CompositionLocal - Theme.kt: detect isSystemInDarkTheme(), provide LocalCalculatorColors via CompositionLocalProvider, add LightColorScheme for Material3 - CalculatorScreen.kt: read LocalCalculatorColors.current for background, displayText and expressionText — remove CalcBlack/White/LightGray imports - CalculatorKeypad.kt: read LocalCalculatorColors.current in both LandscapeKeypadLayout and PortraitKeypadLayout; pass semantic color tokens to every button — remove all raw CalcXxx color imports - MainActivity.kt: replace hardcoded containerColor = Color.Black with Color.Unspecified so the screen's own background drives the color
- includeBuild("../PvotLib") wires the local composite build
- implementation(project(":design-system")) pulls the design-system module
Replace locally-defined raw color constants with PvotLib's semantic tokens: - Dark: PvotBackgroundDark, PvotSurfaceVariantDark, PvotSecondaryContainerDark, etc. - Light: PvotBackgroundLight, PvotSurfaceVariantLight, PvotSecondaryContainerLight, etc. - CalcOrange kept for operator buttons (no PvotLib equiv for the brand accent) Color.kt now only holds CalcOrange; all other palette values come from PvotLib.
CalculatorTheme now wraps PvotAppTheme (from PvotLib design-system) instead of constructing a raw MaterialTheme with local color schemes. PvotAppTheme owns the M3 color scheme + typography; LocalCalculatorColors is provided inside it for calc-specific semantic tokens.
CI uses PVOT-OSS/workflows android-build.yml which checks out submodules
recursively. The previous includeBuild("../PvotLib") only worked locally;
adding PvotLib as a submodule at libs/PvotLib makes the path stable on
both local machines and CI runners.
CLAUDE.md was accidentally committed — Claude context files are local only and should never be tracked. Adding .claude/ to .gitignore prevents this from happening again.
Collaborator
Author
|
@danascape this user PVOT theming but is failing build test |
Member
weird, submodule should work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #10
Replaces the hand-rolled
MaterialThemesetup with PvotLib'sPvotAppTheme, and sources all calculator color tokens directly from PvotLib's design-system palette instead of locally-defined raw hex values.What changed
settings.gradle.kts— addedincludeBuild("../PvotLib")to wire the local composite buildapp/build.gradle.kts— addedimplementation(project(":design-system"))to pull the PvotLib design-system moduleTheme.kt—CalculatorThemenow wrapsPvotAppTheme; M3 color scheme and typography are owned by PvotLib, not duplicated hereCalculatorColors.kt—DarkCalculatorColorsandLightCalculatorColorsfully sourced from PvotLib tokens (PvotBackgroundDark/Light,PvotSurfaceVariantDark/Light,PvotSecondaryContainerDark/Light, etc.)Color.kt— stripped to onlyCalcOrange(operator button accent; no warm-orange equivalent in PvotLib)Color token mapping
PvotBackgroundDark#000000PvotBackgroundLight#FFFFFFPvotOnBackgroundDark#E6E1E6PvotOnBackgroundLight#1C1B1FPvotOnSurfaceVariantDark#CAC4CFPvotOnSurfaceVariantLight#49454EPvotSurfaceVariantDark#49454EPvotSurfaceVariantLight#E7E0ECPvotOnSurfaceDark#E6E1E6PvotOnSurfaceVariantLight#49454EPvotSecondaryContainerDark#494458PvotSecondaryContainerLight#E6DFF9PvotOnSecondaryContainerDark#E6DFF9PvotOnSecondaryContainerLight#1C192BCalcOrange#FF9F0ACalcOrange#FF9F0APvotOnPrimaryLight#FFFFFFPvotOnPrimaryLight#FFFFFFTest plan