background preloader

Ui

Facebook Twitter

Widget

Overlay. Animations. New Tools For Managing Screen Sizes. [This post is by Dianne Hackborn and a supporting cast of thousands; Dianne’s fingerprints can be found all over the Android Application Framework — Tim Bray] Android 3.2 includes new tools for supporting devices with a wide range of screen sizes. One important result is better support for a new size of screen; what is typically called a “7-inch” tablet. This release also offers several new APIs to simplify developers’ work in adjusting to different screen sizes. This a long post. We start by discussing the why and how of Android “dp” arithmetic, and the finer points of the screen-size buckets.

If you know all that stuff, you can skip down to “Introducing Numeric Selectors” to read about what’s new. Of course, the official write-up on Supporting Multiple Screens is also required reading for people working in this space. Understanding Screen Densities and the “dp” Screen-size Buckets The definitions are: Here are some more examples of how this works with real screens: Issues With Buckets <? Padding & margin.

Android: Screen Densities, Sizes, Configurations, and Icon Sizes. Android Button background image pressed/highlighted and disabled states without using multiple images | Shiki. In Android, if you provide custom background images for buttons, you will lose the pressed and disabled image effects. The common way to fix that is to provide additional images for those states. I’m lazy and I find this inconvenient especially during the prototyping phase of app development. To use this, just replace your original button declarations like this: To this: Here’s a sample output using this custom button: The code is also available on GitHub. Android - ViewPager PagerAdapter not updating the View.

Android - ViewPager fragments recreation, are resumed but not visible. Romain Guy. Commonsguy/cwac-endless. Le Monde Merveilleux des Images Extensibles (9-patchs) Note : malgré son indéniable application à Android, cet article traite d’un concept qui n’est pas propre à Android. En effet les images étirables sont par exemple disponibles dans des formes plus ou moins similaires sous le SDK de l’iPhone (de façon beaucoup moins avancée et intégrée – cf UIImage et son message: - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight et dans le CSS3 par le biais de la propriété border-image (j’attends avec impatience la généralisation de cette propriété car elle signe la fin des blocs imbriqués les uns dans les autres – astuce nécessaire pour obtenir une “boite” à taille variable avec des bords arrondis en développement web).

Lors d’un précédent article, j’ai décrit un moyen de définir ses propres boutons. Cette technique reposait principalement sur l’utilisation de l’objet StateListDrawable qu’on retrouve dans le package android.graphics.drawable. R.layout.fancy_toast contient le code XML suivant.