Add an intent to import a brush directly to Brush Graph#79
Add an intent to import a brush directly to Brush Graph#79maxmmitchell wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to import custom brushes from a URI via a new intent filter. It updates MainActivity to handle the import intent, decode and save the brush, and navigate to the Brush Graph screen. The review feedback highlights a bug where configuration changes trigger duplicate imports, a potential OutOfMemoryError vulnerability when reading unlimited stream bytes, and an ignored return value when loading the imported brush family.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Adds the
com.example.cahier.intent.action.IMPORT_BRUSHintent, which takes a uri as an input, and:BrushFamilyBrushFamilyinto the active brush slot and the__autosave__slot in the custom brush storeThis is useful for workstation custom brush creation, to enable quickly sending a
.brushfamilyfile created in a developer's workstation over to Cahier for rapid iteration. As we explore new flows for brush design, this intent is a helpful utility.Note that the 10 MB limit for
.brushfamilyfiles is arbitrary, but should be more than enough (Shading Pencil is our largest annotated brush, and is 373 KB -- most are under 1 KB).