Better scaling (ZW) widgets when applying templates with widgets.

Better scaling (ZW) widgets when applying templates with widgets.

Since after restoring an LL template with Zooper Widgets those in many cases need adjustments, I did some investigations how to improve this issue. If this could be applied, Pierre Hébert , LL would be REALLY the BEST (well, it already is… but anyway) template-able launcher.

I exported a template on my Nexus 4 (768×1280), imported on my tablet (800×1280), fixed some widgets, re-exported and compared.

Findings:

File “*manifest*”:

screenDensity 320 >> 213 >> Ratio 0,6656

screenWidth: 768 >> 800 >> Ratio 1,0417 >> Ratio*dpi 1,5649

screenHeight 1184 >> 1216 >> Ratio 1,0270 >> Ratio*dpi 1,5430

If those ratios would be applied to the values (verified, worked great!!) in Zooper Widgets’ preset.json (inside widgets_data settings file) as followed, the ZW widgets would look quite perfect immediatelly after the applying the template.

preset_widgetwidth >> x screenWidth ratio

preset_widgetheight >> x screenHeight ratio

pref_widget_scale >> x Max(Ratio W*dpi,Ratio DpiH*dpi)

preset_dpiwidth >> x Max(Ratio W*dpi,Ratio DpiH*dpi)

preset_dpiheight >> x Max(Ratio W*dpi,Ratio DpiH*dpi)

I’m not pretty sure about that “Max(…)” since the only difference between my devices’ screens is dpi and width (768×1280 and 800×1280), but according to calculations and tests it works.

Here’s a sheet with my calculations for those interested:

https://app.box.com/s/ed5lpo9walfry4cb088x

https://app.box.com/s/ed5lpo9walfry4cb088x
]]>
« (Previous Post)

7 Commentsto Better scaling (ZW) widgets when applying templates with widgets.

  1. Anonymous says:

    < ![CDATA[

    That would be a really awful hack, but that’s worth a try.


    But doesn’t Zooper already does some sort of scaling already ?


    If I understand correctly, this modification would benefit existing themes, not destroy them, so checking the theme version to ensure compatibility is not needed, right ?


    Also would you have some reference template with a few widgets that could be loaded on as most devices as possible to proof the formulas ?

    ]]>

  2. Anonymous says:

    < ![CDATA[

    Yes, Zooper does an amazingly good adjust scaling of widgets, even when x/y-ratio changes. However, these adjustments are only applied when manually loading widgets from SD or skin.



    When applying an LL template, you restore the ZWs’ data (this works great!), but ZW does not fix scaling. Upon entering a widgets configuration, ZW does partially adjust the scaling, but not to full extend; mainly not the main scaling (I need to multiply by ~1.5x when moving from phone to tablet).



    But this has to be done manually for each and every widget, not a convenient way, especially if widgets are used as backgrounds.



    I can create a prepare a simple template this evening, placing a few widgets of different size (like 4×1, 2×2, 1×4).



    Request to all:


    To verify my calculations I’d be willing to also create some pre-patched versions for various devices. Please state your device, screen size and dpi here. Thanks!

    ]]>

  3. Anonymous says:

    < ![CDATA[

    Lutz LinkeDude awesome work! Seriously.

    ]]>

  4. Anonymous says:

    < ![CDATA[

    I still wonder why Nexus 4’s screen is 1280 768 and not exactly 720p. It’s is a developer device and I dont know why LG/Google went with this ratio which at the moment is rare.

    ]]>

  5. Anonymous says:

    < ![CDATA[

    1280×752 TOSHIBA AT300 tablet

    ]]>

  6. Anonymous says:

    < ![CDATA[

    Curtis Sylvester Jr. Thanks. Will create a patched demo (see other post) and inform you.

    ]]>

  7. Anonymous says:

    < ![CDATA[

    Curtis Sylvester Jr. Added template, see post https://plus.google.com/u/0/+LutzLinke/posts/gstzd6C2dGS

    ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *