-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filename casing and pattern issues with Android #44
Comments
@davidortinau so this is a tough one to handle elegantly given the restrictions android places on this. We ultimately generate resource drawables, and that pretty much limits us to lowercase alphanumeric characters, no number for the first character, and underscores allowed. We could try and rename files as we generate them to follow the naming rules, but there are some problems with this:
I'd like to provide a frustration free experience, but it feels like the better path here might be to go and fail fast letting developers know right away that their filename is invalid. It's a pretty quick fix if we provide a detailed error. |
+1 to the warning. I just noticed all my icons were gone in Android, because I had a couple of images not named to match Android's convention. I would have been scratching my head if I wasn't watching this repro and remembered this issue. |
As I've always used CamelCase for image names in the past , so I vote +1 for just changing the output filename to lower case. And then if it fails any other of the android naming conventions, throw a warning out. Taking a look at the code I see there is a LinkAttribute to specify a different name. If this could be expanded and made specific to the OS, then the above warning would work as you could then override the name for a particular OS. |
I've just been bitten by this issue. Took a while to figure out why my svg logo wasn't appearing until I renamed it to lowercase. |
I agree with @srqdev that it should automatically change the name to lowercase since that doesn't change the filename itself. However, I think that if it can't create the files because of a restriction, then it should fail. Resizetizer has one job and if it can't do it successfully then it should stop and inform the developer. I would rather a build error telling me that "the-cat" is invalid than it silently failing and the image just not showing up. I may have made other code changes at the same time and not even consider that Resizetizer is having an issue. Handling all of the annoyances gracefully is wonderful but all of the complications that Redth mentioned makes it not worth the trouble if you can just tell the consumer "file xyz's naming convention does not meet android restrictions. Go here to see what they are:". |
I had image filenames like
layout-StackLayout.png
which generated Android resources without error, however nothing displayed in my app for those. If I remove the dash and rename it all lowercase, it works.My initial reaction is to throw errors and warn the dev of appropriate conventions, however that feels against he value prop of a xplat solution which should handle such annoyances elegantly. We ought to do the right thing for the platform, but I wonder how that'll bite us later. :)
The text was updated successfully, but these errors were encountered: