Home | History | Annotate | Download | only in articles
      1 page.title=UI Framework Changes in Android 1.5
      2 parent.title=Articles
      3 parent.link=../browser.html?tag=article
      4 @jd:body
      5 
      6 
      7 <p>Android 1.5 offers a different default look for
      8 the Android UI framework, in relation to Android 1.0 and 1.1. The
      9 screenshots below show the same activity (creating a new contact) on
     10 Android 1.1 and Android 1.5:</p>
     11 
     12 <img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 277px;" src="images/android.png" alt="" id="BLOGGER_PHOTO_ID_5323141124169754690" border="0">
     13 
     14 <p>You
     15 can see in this example that the buttons and checkboxes have a new
     16 appearance. Even though these changes do not affect binary nor source
     17 compatibility, they might still break the UI of your apps. As part of
     18 the UI refresh, the minimum size of some of the widgets has changed.
     19 For instance, Android 1.1 buttons have a minimum size of 44x48 pixels
     20 whereas Android 1.5 buttons now have a minimum size of 24x48 pixels.
     21 The image below compares the sizes of Android 1.1 buttons with Android
     22 1.5 buttons:</p>
     23 
     24 <img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 100px; height: 130px;" src="images/buttons.png" alt="" border="0">
     25 
     26 <p>If you rely on the button's minimum size, then the layout of your application
     27 may not be the same in Android 1.5 as it was in Android 1.1 because of this
     28 change. This would happen for instance if you created a grid of buttons using
     29 <code>LinearLayout</code> and relying on the minimum size yielded by
     30 <code>wrap_content</code> to align the buttons properly:</p>
     31 
     32 <img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 277px;" src="images/grid.png" alt="" id="BLOGGER_PHOTO_ID_5323147943613255250" border="0">
     33 
     34 <p>This layout could easily be fixed by using the
     35 <code>android:layout_weight</code> attribute or by replacing the
     36 <code>LinearLayout</code> containers with a <code>TableLayout</code>.</p>
     37 
     38 <p>This example is probably the worst-case UI issue you may encounter when
     39 running your application on Android 1.5. Other changes introduced in Android
     40 1.5, especially bug fixes in the layout views, may also impact your
     41 applicationespecially if it is relying on faulty/buggy behavior of the UI
     42 framework.</p>
     43 
     44 <p>If you encounter issues when running your application on Android 1.5, please
     45 join us on the <a href="{@docRoot}resources/community-groups.html">Android
     46 developer groups</a> or <a
     47 href="{@docRoot}resources/community-more.html">IRC</a> so that we and the
     48 Android community can help you fix your application.</p>
     49 
     50 <p>Happy coding!</p>
     51