Featured post
graphics - How to create crisp background image for 1x1 Android widget? -
i'm creating 1x1 widget, , no matter try, can't background image looking nice , crisp. i've read resource can find, yet still can't win.
i'm designing htc desire/nexus 1, , love tell me when creating background in photoshop, dpi/height/width use (currently using 72/100/80). i'll worry other devices resolutions once can looking nice on test device first.
also, if there's special need putting in @layout/main.xml , widget_provider.xml files. can't find examples 1x1 gadgets, have following:
main.xml
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="fill_parent" android:orientation="vertical" android:background="@drawable/background" android:layout_gravity="center" android:layout_height="wrap_content">
widget_provider.xml
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minwidth="72dip" android:minheight="72dip" android:updateperiodmillis="6000000" android:initiallayout="@layout/main" />
any appreciated.
you may want have @ google's supporting multiple screen sizes document. happening here screens on android devices have different pixel densities. these categorized low, medium, high (ldpi, mdpi, hdpi). if asset isn't large enough larger density screen, blown proper size - happening you.
the nexus 1 has dpi somewhere around 250 puts hdpi class. using google formula of (number of cells * 74) - 2 calculate dp 1x1 widget make widget dimensions 72x72 dp.
the conversion dp pixels is:
pixels = dp * (density / 160)
so 72x72 dp image, corresponding image sizes based on density be:
ldpi (120 dpi) = 72 * (120 / 160) == 54 x 54 pixels mdpi (160 dpi) = 72 * (160 / 160) == 72 x 72 pixels hdpi (240 dpi) = 72 * (240 / 160) == 108 x 108 pixels xhdpi (320 dpi) = 72 * (320 / 160) == 144 x 144 pixels
use these formulas create assets , should crisp images.
- Get link
- X
- Other Apps
Comments
Post a Comment