Skip to content
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

Add support for Mac icons #15

Open
JakeSc opened this issue Jun 26, 2017 · 3 comments
Open

Add support for Mac icons #15

JakeSc opened this issue Jun 26, 2017 · 3 comments

Comments

@JakeSc
Copy link

JakeSc commented Jun 26, 2017

I was able to add rough support for Mac icon sizes by modifying appicon/actions/appicon_action.rb to include the Mac dimensions, like this:

      def self.needed_icons
        {
          iphone: {
            '2x' => ['20x20', '29x29', '40x40', '60x60'],
            '3x' => ['20x20', '29x29', '40x40', '60x60']
          },
          ipad: {
            '1x' => ['20x20', '29x29', '40x40', '76x76'],
            '2x' => ['20x20', '29x29', '40x40', '76x76', '83.5x83.5']
          },
          mac: {
            '1x' => ['16x16', '32x32', '128x128', '256x256', '512x512'],
            '2x' => ['16x16', '32x32', '128x128', '256x256', '512x512']
          },
        }
      end

This worked for my purposes. I would submit a PR, however this isn't completely correct. Because of the double array loop where the resizing occurs, the script also writes out the iphone and ipad sizes, resulting in some Unassigned / unknown-trait-combination entries in the resulting xcassets file. A better solution would be to not export he iphone and ipad sizes for the mac device. I don't know enough about how necessary these are for the other devices to make the change myself.

@JakeSc
Copy link
Author

JakeSc commented Jun 26, 2017

image

@felipeplets
Copy link
Collaborator

@KrauseFx is there a standard way in a Fastlane Plugin to check which is the current platform?

@KrauseFx
Copy link
Member

KrauseFx commented Jul 5, 2017

Yeah,FastlaneCore::Helper.project.mac? or FastlaneCore::Helper.project.mac_app?

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

No branches or pull requests

3 participants