Skip to content

feature: add ZdsChip with selectable and filter variants - #9

Open
sohankshirsagar wants to merge 1 commit into
mainfrom
devin/1789071661-zds-chip
Open

sohankshirsagar wants to merge 1 commit into
mainfrom
devin/1789071661-zds-chip

Conversation

@sohankshirsagar

Copy link
Copy Markdown

Summary

Adds a chip component to the library. ZdsChip extends Material's Chip (defStyleAttr chipStyle) and exposes a chip_style enum attr with two variants; both are checkable, and the variant only controls whether the checked icon is shown:

enum class Style { SELECTABLE, FILTER }
isCheckable = true
isCheckedIconVisible = style == Style.FILTER

Colors follow the existing selector pattern (chip_background_selector, chip_stroke_selector, chip_text_selector) so unselected/selected/disabled states resolve from the ZDS palette and pick up the night-mode overrides automatically. Styles Zds.Chip.Selectable / Zds.Chip.Filter inherit from Zds.Chip.

Demo app gets a "Chips" screen (nav graph + drawer entry) showing a single-selection selectable group and a multi-selection filter group, each with a disabled chip.

Note: assembleDebug fails on main for unrelated reasons — the two ic_currency_north_america_$_*.xml drawables have $ in their filenames, which AAPT rejects. I verified the build and :app:lintDebug pass with those two pre-existing files temporarily moved aside; they are untouched in this PR.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/0d9fe7f127704f84abe81ad81a55f123
Open in Devin Desktop: https://app.devin.ai/desktop/session/0d9fe7f127704f84abe81ad81a55f123?variant=devin
Requested by: @sohankshirsagar

Co-Authored-By: Sohan Kshirsagar <sohan.kshirsagar@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration

Copy link
Copy Markdown

Completed end-to-end UI testing of ZdsChip in the local demo on Android 14/API 34.

Verified chip behavior and appearance
  • Drawer navigation opens Chips with the expected initial states.
  • Selectable chips enforce one required selection, use blue/tinted selected styling, and never show check icons.
  • Filters support simultaneous selection and independent deselection, with check icons only when checked.
  • Disabled Archived/Tablets remain grey and ignore taps.
  • Light/dark switching retains selections; interactions work in both themes.
Light theme — Active and both filters selected Dark theme — All and both filters selected
Light chip states Dark chip states
Environment notes and scope

Built with the documented temporary workaround for the two pre-existing $-named drawables; both were restored. An early install required waiting for emulator boot completion. One initial automated theme tap required retry; subsequent switching worked. No reproducible feature defect found.

Coverage is the demo's XML-configured variants on one emulator, not other devices or programmatic construction.

Devin testing session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant