Make Lazy Export work harder for Android Devs
kocheck opened this issue · comments
Overview
After talking to my coworker a few small adjustments are being suggested to make this plugin work harder for Android Devs.
Feature breakdown
- The folder structure applied to the suffix is
/drawable-{density}/{UserEnteredString
for all density types. - File names defined by the user via the
UserEnteredString
are all the same each time the plugin runs. - The user can choose the file name to make sure it meets the Android requirements of having no spaces, dashes, or capital letters via the
UserEnteredString
.
Update
Adding the new suffixes works out nicely. The user entered input needs to be passed along with the msg
regardless if it is used or not.
Aditional consideration, What happens if the user does not enter anything into the input?
Long term it would be better to ask if the string field is "empty". If so pull the name of the node back into the file name.
Short term, apply a generic asset name.
No sleep tonight
My daughter won't go to sleep tonight, so both of us are going to attempt to solve this last "stretch goal to help her sleep"
Right now we have it set up so if the user enters nothing they get a default string as the label.
The goal for this stretch is to;
- Grab the name of the node
- Light Sanitization of the string for Android Studio
- Apply name to the end of the export string.
This particular enhancement will require some rewrites to the logic of the whole plugin for this to work correctly with multiple selections. making this is own separate issue for now and closing this out here.
Added Alerts to let the user know what's going on 👍 I think this enhancement is good to close and merge.
More documentation is needed but that should be its own issue
if (msg.platform === undefined) {
figma.notify("Export Settings Cleared");
} else {
figma.notify(msg.platform + " Export Settings Applied");
}