marcisme / sketch-preview

Sketch plugin to preview mockups in Skala Preview
MIT License
610 stars 37 forks source link

Doesn't work for Android #33

Closed mjboswell closed 8 years ago

mjboswell commented 8 years ago

I haven't been able to get this to work fro Android for months. Don't really know why it took me this long to file an issue. I've asked dozens of colleagues (fellow designers at Facebook) if Preview works for them on Android, and the response has unilaterally been no. Any idea when we can expect an update? Or if our engineers can help?

marcisme commented 8 years ago

Unfortunately I no longer have any Android devices, so I don't have any way to test this myself. However I have gotten PRs from people to add larger scaling ratios, specifically to support Android design, so it at least works for some people. Can you provide some more information?

mjboswell commented 8 years ago

My artboard shows up and updates in Skala Preview, however nothing happens in Skala View on my Nexus 5X. My artboards are 720x1280 in Sketch, so they aren't very large. From console:

1/21/16 5:30:06.851 PM Preview (Sketch Plugin)[6140]: DEBUG: config loaded from: file:///Users/mboswell/Library/Caches/com.marcisme.sketch-preview/config.plist 1/21/16 5:30:06.851 PM Preview (Sketch Plugin)[6140]: DEBUG: config: { debug = 1; previewSizeIndex = 1; scalingStrategyId = 1; } 1/21/16 5:30:06.851 PM Preview (Sketch Plugin)[6140]: DEBUG: Searching for named preview slice: Preview 1/21/16 5:30:06.852 PM Preview (Sketch Plugin)[6140]: DEBUG: No named preview slice found 1/21/16 5:30:06.852 PM Preview (Sketch Plugin)[6140]: DEBUG: Searching for selected Artboard 1/21/16 5:30:06.852 PM Preview (Sketch Plugin)[6140]: DEBUG: Found selected Artboard: News Feed Copy 1/21/16 5:30:06.852 PM Preview (Sketch Plugin)[6140]: DEBUG: writing preview image to: /Users/mboswell/Library/Caches/com.marcisme.sketch-preview/preview.png 1/21/16 5:30:06.853 PM Preview (Sketch Plugin)[6140]: DEBUG: searching for scalingStrategyId: 1 1/21/16 5:30:06.853 PM Preview (Sketch Plugin)[6140]: DEBUG: found strategy: Scale to explicit size 1/21/16 5:30:06.853 PM Preview (Sketch Plugin)[6140]: DEBUG: preview scale factor: 1

marcisme commented 8 years ago

Thanks for the additional detail.

What happens if you manually export an image, then drag it onto the Skala Preview icon in the dock?

I'm trying to figure out if the issue is between Skala Preview and Skala View, or if maybe something about the way the plugin opens the file is contributing to the issue. Doing a manual export like this will take the plugin out of the equation.

mjboswell commented 8 years ago

Skala Preview updates correctly whenever you hit Command+P. However, nothing shows up on Skala View on Android.

Dragging an image that's been exported from Sketch to Skala Preview works the same as above. It shows up in Skala Preview, but nothing shows up on Skala View on Android.

marcedwards commented 8 years ago

@mjboswell Thanks for the info. I think we’re currently limited by the maximum GPU texture size on the device. For really old phones, that was 1024×1024, and on newer phones it’s often 2048×2048 or 4096×4096. We’re looking into this and will hopefully find a good solution.

Do you know if your 720×1280 artboard was being sent as 720×1280 pixels or 1440×2560 pixels? Was there some Retina scaling funkiness going on? The Skala Preview window should tell you the size of the image it’s trying to send to your Android device.

Window → Log in Skala Preview might also provide some help with what’s going on.

bfouillet commented 8 years ago

Try this : https://github.com/marcisme/sketch-preview/issues/34