вторник, 29 мая 2012 г.

The curious BlinkLayout in Android

Yesterday read some post from blog (http://www.androidzeitgeist.com/) of my Google+ friend Sebastian Kaspari. On the bottom you can see repost.

While reading the source code of Android's LayoutInflater class I found a hidden gem that seems to be quite unnoticed yet. Ladies and gentlemen I present you the mighty BlinkLayout. Views that are placed inside this ViewGroup blink at a rate of 500ms.The BlinkLayout is an inner class of the LayoutInflater and can therefore only be used in a XML layout that will be parsed by a LayoutInflater instance. Due to the implementation it's only possible to use it as root node using the <blink> tag inside a XML layout. It seems like the BlinkLayout is available since Android 4.0 and isn't used in the Android source code I observed. Maybe it was added for debugging reasons and was forgotten later.

The video above shows the BlinkLayout in action using the following layout XML:


The following snippet was used to inflate the layout and pass it to the activity:
package com.androidzeitgeist.blinklayout;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;

public class BlinkLayoutActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {

        View view = LayoutInflater.from(this).inflate(R.layout.main_layout, null);

четверг, 29 марта 2012 г.

Mobile UI Design Patterns

User interface design patterns are solutions to common design challenges, such as navigating around an app, listing data or providing feedback to users.

Mobile apps and sites have unique UI design requirements because, compared to their desktop counterparts, they’re used in smaller screens and, at least with today’s modern mobile devices, rely on fingers instead of a keyboard and mouse as input mechanisms.

Whether you’re designing a mobile app UI for the first time or in need of specific design solutions, these mobile UI design pattern resources will surely help!