<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CoderzHeaven</title>
	<atom:link href="http://www.coderzheaven.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coderzheaven.com</link>
	<description>Heaven of all working Codes</description>
	<lastBuildDate>Sat, 25 May 2013 18:17:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>How to create a beautiful wheel animation in android?</title>
		<link>http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/</link>
		<comments>http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/#comments</comments>
		<pubDate>Sat, 18 May 2013 16:40:12 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[addAnimation]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[Animation Class]]></category>
		<category><![CDATA[Animation Gallery]]></category>
		<category><![CDATA[Animation.INFINITE]]></category>
		<category><![CDATA[Animation.RELATIVE_TO_SELF]]></category>
		<category><![CDATA[Animation.REVERSE]]></category>
		<category><![CDATA[AnimationSet]]></category>
		<category><![CDATA[ArrayAdapter]]></category>
		<category><![CDATA[Attrs]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[BitmapDrawable]]></category>
		<category><![CDATA[Blink]]></category>
		<category><![CDATA[Blinking Text]]></category>
		<category><![CDATA[Centre Image]]></category>
		<category><![CDATA[Color Graphics]]></category>
		<category><![CDATA[Coverflow]]></category>
		<category><![CDATA[CoverFlow in Android - Complete implementation with source code.]]></category>
		<category><![CDATA[createBitmap]]></category>
		<category><![CDATA[createReflectedImages]]></category>
		<category><![CDATA[Deprecation]]></category>
		<category><![CDATA[Gallery Graphics]]></category>
		<category><![CDATA[Gallery Java]]></category>
		<category><![CDATA[getPackageManager]]></category>
		<category><![CDATA[getScale]]></category>
		<category><![CDATA[GridView RandomFade animation in Android]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[Hello Everyone]]></category>
		<category><![CDATA[How to create a blinking text in Android?]]></category>
		<category><![CDATA[ImageAdapter]]></category>
		<category><![CDATA[Implementation]]></category>
		<category><![CDATA[INVISIBLE]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Java Download]]></category>
		<category><![CDATA[Java Package]]></category>
		<category><![CDATA[LinearGradient]]></category>
		<category><![CDATA[Listview]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[Maximum Angle]]></category>
		<category><![CDATA[Menu Menu]]></category>
		<category><![CDATA[Menu Return]]></category>
		<category><![CDATA[Mytext]]></category>
		<category><![CDATA[New Camera]]></category>
		<category><![CDATA[PorterDuffXfermode]]></category>
		<category><![CDATA[Public Int]]></category>
		<category><![CDATA[Public Void]]></category>
		<category><![CDATA[Runnable]]></category>
		<category><![CDATA[setAdapter]]></category>
		<category><![CDATA[setAnimationDuration]]></category>
		<category><![CDATA[setAntiAlias]]></category>
		<category><![CDATA[setContentView]]></category>
		<category><![CDATA[setDuration]]></category>
		<category><![CDATA[setImageBitmap]]></category>
		<category><![CDATA[setImageResource]]></category>
		<category><![CDATA[setLayoutParams]]></category>
		<category><![CDATA[setRepeatCount]]></category>
		<category><![CDATA[setRepeatMode]]></category>
		<category><![CDATA[setScaleType]]></category>
		<category><![CDATA[setSelection]]></category>
		<category><![CDATA[setShader]]></category>
		<category><![CDATA[setStartOffset]]></category>
		<category><![CDATA[setVisibility]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[startAnimation]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[Transformation]]></category>
		<category><![CDATA[TranslateAnimation]]></category>
		<category><![CDATA[Tv Animation]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Zoom]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5452</guid>
		<description><![CDATA[Today&#8217;s post is about animation, a beautiful animation, exploring capabilities of android. You can click on the link to download the code. Here we will have three java classes and no XML files. 1. GraphicsActivity.java 2. PictureLayout.java 3. Sweep.java At first we start with PictureLayout.java Now our second java file, GraphicsActivity.java No need to declare [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/01/10/draw-arcs-android-canvas/"     class="crp_title">How to draw Arcs in Android using canvas?</a></li><li><a href="http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/"     class="crp_title">Creating a Drawable animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2012/12/17/coverflow-android-complete-implementation-source-code/"     class="crp_title">CoverFlow in Android &#8211; Complete implementation with&hellip;</a></li><li><a href="http://www.coderzheaven.com/2011/08/06/how-to-align-a-text-in-android-programatically/"     class="crp_title">How to align a text in Android Programatically?</a></li><li><a href="http://www.coderzheaven.com/2011/02/12/draw-primitive-shapes-such-as-rectangle-circle-etc-in-android-a-simple-example/"     class="crp_title">Draw primitive shapes such as rectangle, circle etc in&hellip;</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>Today&#8217;s post is about animation, a beautiful animation, exploring capabilities of android.</p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/CoderzHeaven%20images/device-2013-05-16-223702.png" alt="Animation"  border="1"/></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/CoderzHeaven%20images/device-2013-05-16-223709.png" alt="Animation"  border="1"/></p>
<p>You can click on the link to download the code.</p>
<p>Here we will have three java classes and no XML files.<br />
1. GraphicsActivity.java<br />
2. PictureLayout.java<br />
3. Sweep.java</p>
<p>At first we start with PictureLayout.java</p>
<pre class="brush: java; title: ; notranslate">
package com.example.sweep;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Picture;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;

public class PictureLayout extends ViewGroup {
    private final Picture mPicture = new Picture();

    public PictureLayout(Context context) {
        super(context);
    }

    public PictureLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void addView(View child) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child);
    }

    @Override
    public void addView(View child, int index) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child, index);
    }

    @Override
    public void addView(View child, LayoutParams params) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child, params);
    }

    @Override
    public void addView(View child, int index, LayoutParams params) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child, index, params);
    }

    @Override
    protected LayoutParams generateDefaultLayoutParams() {
        return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int count = getChildCount();

        int maxHeight = 0;
        int maxWidth = 0;

        for (int i = 0; i &lt; count; i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() != GONE) {
                measureChild(child, widthMeasureSpec, heightMeasureSpec);
            }
        }

        maxWidth += getPaddingLeft() + getPaddingRight();
        maxHeight += getPaddingTop() + getPaddingBottom();

        Drawable drawable = getBackground();
        if (drawable != null) {
            maxHeight = Math.max(maxHeight, drawable.getMinimumHeight());
            maxWidth = Math.max(maxWidth, drawable.getMinimumWidth());
        }

        setMeasuredDimension(resolveSize(maxWidth, widthMeasureSpec),
                resolveSize(maxHeight, heightMeasureSpec));
    }

    private void drawPict(Canvas canvas, int x, int y, int w, int h,
                          float sx, float sy) {
        canvas.save();
        canvas.translate(x, y);
        canvas.clipRect(0, 0, w, h);
        canvas.scale(0.5f, 0.5f);
        canvas.scale(sx, sy, w, h);
        canvas.drawPicture(mPicture);
        canvas.restore();
    }

    @SuppressWarnings(&quot;unused&quot;)
	@Override
    protected void dispatchDraw(Canvas canvas) {
        super.dispatchDraw(mPicture.beginRecording(getWidth(), getHeight()));
        mPicture.endRecording();

        int x = getWidth()/2;
        int y = getHeight()/2;

        if (false) {
            canvas.drawPicture(mPicture);
        } else {
            drawPict(canvas, 0, 0, x, y,  1,  1);
            drawPict(canvas, x, 0, x, y, -1,  1);
            drawPict(canvas, 0, y, x, y,  1, -1);
            drawPict(canvas, x, y, x, y, -1, -1);
        }
    }

    @Override
    public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
        location[0] = getLeft();
        location[1] = getTop();
        dirty.set(0, 0, getWidth(), getHeight());
        return getParent();
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        final int count = super.getChildCount();

        for (int i = 0; i &lt; count; i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() != GONE) {
                final int childLeft = getPaddingLeft();
                final int childTop = getPaddingTop();
                child.layout(childLeft, childTop,
                        childLeft + child.getMeasuredWidth(),
                        childTop + child.getMeasuredHeight());

            }
        }
    }
}
</pre>
<p>Now our second java file, GraphicsActivity.java<br />
No need to declare this activity in the Manifest since you are only extending it.</p>
<pre class="brush: java; title: ; notranslate">
package com.example.sweep;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;

class GraphicsActivity extends Activity {
    // set to true to test Picture
    private static final boolean TEST_PICTURE = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void setContentView(View view) {
        if (TEST_PICTURE) {
            ViewGroup vg = new PictureLayout(this);
            vg.addView(view);
            view = vg;
        }

        super.setContentView(view);
    }
}
</pre>
<p>Now the last java class that extends the GraphicsActivity and creates the animation.<br />
Sweep.java</p>
<pre class="brush: java; title: ; notranslate">
package com.example.sweep;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Shader;
import android.graphics.SweepGradient;
import android.os.Bundle;
import android.view.View;

public class Sweep extends GraphicsActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new SampleView(this));
    }

    private static class SampleView extends View {
        private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
        private float mRotate;
        private Matrix mMatrix = new Matrix();
        private Shader mShader;
        private boolean mDoTiming;

        public SampleView(Context context) {
            super(context);
            setFocusable(true);
            setFocusableInTouchMode(true);

            float x = 160;
            float y = 100;
            mShader = new SweepGradient(x, y, new int[] { Color.GREEN,
                                                  Color.RED,
                                                  Color.BLUE,
                                                  Color.GREEN }, null);
            mPaint.setShader(mShader);
        }

        @Override protected void onDraw(Canvas canvas) {
            Paint paint = mPaint;
            float x = 160;
            float y = 100;

            canvas.drawColor(Color.WHITE);

            mMatrix.setRotate(mRotate, x, y);
            mShader.setLocalMatrix(mMatrix);
            mRotate += 3;
            if (mRotate &gt;= 360) {
                mRotate = 0;
            }
            invalidate();

            if (mDoTiming) {
                long now = System.currentTimeMillis();
                for (int i = 0; i &lt; 20; i++) {
                    canvas.drawCircle(x, y, 80, paint);
                }
                now = System.currentTimeMillis() - now;
                android.util.Log.d(&quot;skia&quot;, &quot;sweep ms = &quot; + (now/20.));
            }
            else {
                canvas.drawCircle(x, y, 80, paint);
            }
        }

       
    }
}
</pre>
<p>Please leave your valuable comments on this post.</p>
<p>You can download the source code for the above post from <a href="https://dl.dropboxusercontent.com/u/91846918/CoderzHeaven%20images/Sweep.zip" title="Download source code" target="_blank">here</a>.</p>
<div class="su-linkbox" id="post-5452-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/&quot;&gt;How to create a beautiful wheel animation in android?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/01/10/draw-arcs-android-canvas/"     class="crp_title">How to draw Arcs in Android using canvas?</a></li><li><a href="http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/"     class="crp_title">Creating a Drawable animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2012/12/17/coverflow-android-complete-implementation-source-code/"     class="crp_title">CoverFlow in Android &#8211; Complete implementation with&hellip;</a></li><li><a href="http://www.coderzheaven.com/2011/08/06/how-to-align-a-text-in-android-programatically/"     class="crp_title">How to align a text in Android Programatically?</a></li><li><a href="http://www.coderzheaven.com/2011/02/12/draw-primitive-shapes-such-as-rectangle-circle-etc-in-android-a-simple-example/"     class="crp_title">Draw primitive shapes such as rectangle, circle etc in&hellip;</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>900 million Android activations</title>
		<link>http://www.coderzheaven.com/2013/05/15/900-million-android-activations/</link>
		<comments>http://www.coderzheaven.com/2013/05/15/900-million-android-activations/#comments</comments>
		<pubDate>Wed, 15 May 2013 18:45:14 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Activations]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5442</guid>
		<description><![CDATA[Google&#8217;s Android OS has more than 900 million users, the company said Wednesday at its I/O event began in San Francisco. Google also announced several APIs that will let developers add more capabilities to their Android apps, including in the areas of location and improving battery life. &#8220;It&#8217;s been an amazing year for Android developers,&#8221; [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2012/05/23/google-chrome-overtaking-internet-explorer/"     class="crp_title">Google Chrome overtaking Internet Explorer.</a></li><li><a href="http://www.coderzheaven.com/2012/06/11/android-hits-900k-activations-day/"     class="crp_title">Android hits 900k activations per day</a></li><li><a href="http://www.coderzheaven.com/2013/02/21/touchscreen-google-chrome-os-coming-soon/"     class="crp_title">TouchScreen with Google Chrome OS coming soon&#8230;.</a></li><li><a href="http://www.coderzheaven.com/2012/12/30/samsung-year-review-galaxy-triumphs-apple-losses/"     class="crp_title">Samsung Year in Review: Galaxy Triumphs, Apple Losses</a></li><li><a href="http://www.coderzheaven.com/2012/03/06/now-you-can-upload-apks-up-to-4-gb/"     class="crp_title">Now you can upload APK&#039;s up to 4 GB.</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>Google&#8217;s Android OS has more than 900 million users, the company said Wednesday at its I/O event began in San Francisco.</p>
<p>Google also announced several APIs that will let developers add more capabilities to their Android apps, including in the areas of location and improving battery life.</p>
<p>&#8220;It&#8217;s been an amazing year for Android developers,&#8221; said Android and Chrome vice president Sundar Piachai.</p>
<p>Read More from here.<br />
<a href="http://www.pcworld.com/article/2038798/google-says-it-has-900-million-android-activations.html" title="Google Android">http://www.pcworld.com/article/2038798/google-says-it-has-900-million-android-activations.html</a></p>
<div class="su-linkbox" id="post-5442-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/15/900-million-android-activations/&quot;&gt;900 million Android activations&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2012/05/23/google-chrome-overtaking-internet-explorer/"     class="crp_title">Google Chrome overtaking Internet Explorer.</a></li><li><a href="http://www.coderzheaven.com/2012/06/11/android-hits-900k-activations-day/"     class="crp_title">Android hits 900k activations per day</a></li><li><a href="http://www.coderzheaven.com/2013/02/21/touchscreen-google-chrome-os-coming-soon/"     class="crp_title">TouchScreen with Google Chrome OS coming soon&#8230;.</a></li><li><a href="http://www.coderzheaven.com/2012/12/30/samsung-year-review-galaxy-triumphs-apple-losses/"     class="crp_title">Samsung Year in Review: Galaxy Triumphs, Apple Losses</a></li><li><a href="http://www.coderzheaven.com/2012/03/06/now-you-can-upload-apks-up-to-4-gb/"     class="crp_title">Now you can upload APK&#039;s up to 4 GB.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/15/900-million-android-activations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to create a List with Alphabet Overlay in Android</title>
		<link>http://www.coderzheaven.com/2013/05/14/create-list-alphabet-overlay-android/</link>
		<comments>http://www.coderzheaven.com/2013/05/14/create-list-alphabet-overlay-android/#comments</comments>
		<pubDate>Tue, 14 May 2013 15:13:06 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[Character]]></category>
		<category><![CDATA[charAt]]></category>
		<category><![CDATA[FLAG_NOT_FOCUSABLE]]></category>
		<category><![CDATA[FLAG_NOT_TOUCHABLE]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[How to create a List with Alphabet Overlay in Android]]></category>
		<category><![CDATA[LayoutParams]]></category>
		<category><![CDATA[onDestroy]]></category>
		<category><![CDATA[PixelFormat]]></category>
		<category><![CDATA[postDelayed]]></category>
		<category><![CDATA[RemoveWindow]]></category>
		<category><![CDATA[setOnScrollListener]]></category>
		<category><![CDATA[setVisibility]]></category>
		<category><![CDATA[TextView]]></category>
		<category><![CDATA[TRANSLUCENT]]></category>
		<category><![CDATA[TYPE_APPLICATION]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5416</guid>
		<description><![CDATA[Hello everyone&#8230; Today&#8217;s post is about simply loading the ListView with some alphabetically sorted data BUT with the first alphabet overlay over them when you scroll. It&#8217;s same as the overlay you see when a user scrolls through the contacts application. SO Let&#8217;s start with the code. At first I will create a class that [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/04/26/multiple-selection-listview-android/"     class="crp_title">Multiple Selection GridView in Android</a></li><li><a href="http://www.coderzheaven.com/2011/02/23/programmatically-change-background-in-adobe-airflex/"     class="crp_title">Programmatically change background in Adobe AIR/FLEX.</a></li><li><a href="http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/"     class="crp_title">How to create a beautiful wheel animation in android?</a></li><li><a href="http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/"     class="crp_title">ListView Bottom to Top Animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/"     class="crp_title">Cascade animation in a ListView in Android.</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>Hello everyone&#8230;</p>
<p>Today&#8217;s post is about simply loading the <a href="http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/" title="ListView Bottom to Top Animation in Android." target="_blank">ListView</a> with some alphabetically sorted data BUT with the first alphabet overlay over them when you scroll.<br />
It&#8217;s same as the overlay you see when a user scrolls through the contacts application.</p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/Android%20ListOverlay/device-2013-05-12-205559.png" alt="List Overlay" width="320" height="480" border="1" /></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/Android%20ListOverlay/device-2013-05-12-205609.png" alt="List Overlay" width="320" height="480" border="1" /></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/Android%20ListOverlay/device-2013-05-12-205621.png" alt="List Overlay" width="320" height="480" border="1" /></p>
<p>SO Let&#8217;s start with the code.</p>
<p>At first I will create a class that holds the array for the ListView. This is a little big class.<br />
So Create a java class named Cheeses.java and copy this code into it.</p>
<pre class="brush: java; title: ; notranslate">

package com.coderzheaven.alphabetprojectionlistview;


public class Cheeses {

    public static final String[] sCheeseStrings = {
            &quot;Abbaye de Belloc&quot;, &quot;Abbaye du Mont des Cats&quot;, &quot;Abertam&quot;, &quot;Abondance&quot;, &quot;Ackawi&quot;,
            &quot;Acorn&quot;, &quot;Adelost&quot;, &quot;Affidelice au Chablis&quot;, &quot;Afuega'l Pitu&quot;, &quot;Airag&quot;, &quot;Airedale&quot;,
            &quot;Aisy Cendre&quot;, &quot;Allgauer Emmentaler&quot;, &quot;Alverca&quot;, &quot;Ambert&quot;, &quot;American Cheese&quot;,
            &quot;Ami du Chambertin&quot;, &quot;Anejo Enchilado&quot;, &quot;Anneau du Vic-Bilh&quot;, &quot;Anthoriro&quot;, &quot;Appenzell&quot;,
            &quot;Aragon&quot;, &quot;Ardi Gasna&quot;, &quot;Ardrahan&quot;, &quot;Armenian String&quot;, &quot;Aromes au Gene de Marc&quot;,
            &quot;Asadero&quot;, &quot;Asiago&quot;, &quot;Aubisque Pyrenees&quot;, &quot;Autun&quot;, &quot;Avaxtskyr&quot;, &quot;Baby Swiss&quot;,
            &quot;Babybel&quot;, &quot;Baguette Laonnaise&quot;, &quot;Bakers&quot;, &quot;Baladi&quot;, &quot;Balaton&quot;, &quot;Bandal&quot;, &quot;Banon&quot;,
            &quot;Barry's Bay Cheddar&quot;, &quot;Basing&quot;, &quot;Basket Cheese&quot;, &quot;Bath Cheese&quot;, &quot;Bavarian Bergkase&quot;,
            &quot;Baylough&quot;, &quot;Beaufort&quot;, &quot;Beauvoorde&quot;, &quot;Beenleigh Blue&quot;, &quot;Beer Cheese&quot;, &quot;Bel Paese&quot;,
            &quot;Bergader&quot;, &quot;Bergere Bleue&quot;, &quot;Berkswell&quot;, &quot;Beyaz Peynir&quot;, &quot;Bierkase&quot;, &quot;Bishop Kennedy&quot;,
            &quot;Blarney&quot;, &quot;Bleu d'Auvergne&quot;, &quot;Bleu de Gex&quot;, &quot;Bleu de Laqueuille&quot;,
            &quot;Bleu de Septmoncel&quot;, &quot;Bleu Des Causses&quot;, &quot;Blue&quot;, &quot;Blue Castello&quot;, &quot;Blue Rathgore&quot;,
            &quot;Blue Vein (Australian)&quot;, &quot;Blue Vein Cheeses&quot;, &quot;Bocconcini&quot;, &quot;Bocconcini (Australian)&quot;,
            &quot;Boeren Leidenkaas&quot;, &quot;Bonchester&quot;, &quot;Bosworth&quot;, &quot;Bougon&quot;, &quot;Boule Du Roves&quot;,
            &quot;Boulette d'Avesnes&quot;, &quot;Boursault&quot;, &quot;Boursin&quot;, &quot;Bouyssou&quot;, &quot;Bra&quot;, &quot;Braudostur&quot;,
            &quot;Breakfast Cheese&quot;, &quot;Brebis du Lavort&quot;, &quot;Brebis du Lochois&quot;, &quot;Brebis du Puyfaucon&quot;,
            &quot;Bresse Bleu&quot;, &quot;Brick&quot;, &quot;Brie&quot;, &quot;Brie de Meaux&quot;, &quot;Brie de Melun&quot;, &quot;Brillat-Savarin&quot;,
            &quot;Brin&quot;, &quot;Brin d' Amour&quot;, &quot;Brin d'Amour&quot;, &quot;Brinza (Burduf Brinza)&quot;,
            &quot;Briquette de Brebis&quot;, &quot;Briquette du Forez&quot;, &quot;Broccio&quot;, &quot;Broccio Demi-Affine&quot;,
            &quot;Brousse du Rove&quot;, &quot;Bruder Basil&quot;, &quot;Brusselae Kaas (Fromage de Bruxelles)&quot;, &quot;Bryndza&quot;,
            &quot;Buchette d'Anjou&quot;, &quot;Buffalo&quot;, &quot;Burgos&quot;, &quot;Butte&quot;, &quot;Butterkase&quot;, &quot;Button (Innes)&quot;,
            &quot;Buxton Blue&quot;, &quot;Cabecou&quot;, &quot;Caboc&quot;, &quot;Cabrales&quot;, &quot;Cachaille&quot;, &quot;Caciocavallo&quot;, &quot;Caciotta&quot;,
            &quot;Caerphilly&quot;, &quot;Cairnsmore&quot;, &quot;Calenzana&quot;, &quot;Cambazola&quot;, &quot;Camembert de Normandie&quot;,
            &quot;Canadian Cheddar&quot;, &quot;Canestrato&quot;, &quot;Cantal&quot;, &quot;Caprice des Dieux&quot;, &quot;Capricorn Goat&quot;,
            &quot;Capriole Banon&quot;, &quot;Carre de l'Est&quot;, &quot;Casciotta di Urbino&quot;, &quot;Cashel Blue&quot;, &quot;Castellano&quot;,
            &quot;Castelleno&quot;, &quot;Castelmagno&quot;, &quot;Castelo Branco&quot;, &quot;Castigliano&quot;, &quot;Cathelain&quot;,
            &quot;Celtic Promise&quot;, &quot;Cendre d'Olivet&quot;, &quot;Cerney&quot;, &quot;Chabichou&quot;, &quot;Chabichou du Poitou&quot;,
            &quot;Chabis de Gatine&quot;, &quot;Chaource&quot;, &quot;Charolais&quot;, &quot;Chaumes&quot;, &quot;Cheddar&quot;,
            &quot;Cheddar Clothbound&quot;, &quot;Cheshire&quot;, &quot;Chevres&quot;, &quot;Chevrotin des Aravis&quot;, &quot;Chontaleno&quot;,
            &quot;Civray&quot;, &quot;Coeur de Camembert au Calvados&quot;, &quot;Coeur de Chevre&quot;, &quot;Colby&quot;, &quot;Cold Pack&quot;,
            &quot;Comte&quot;, &quot;Coolea&quot;, &quot;Cooleney&quot;, &quot;Coquetdale&quot;, &quot;Corleggy&quot;, &quot;Cornish Pepper&quot;,
            &quot;Cotherstone&quot;, &quot;Cotija&quot;, &quot;Cottage Cheese&quot;, &quot;Cottage Cheese (Australian)&quot;,
            &quot;Cougar Gold&quot;, &quot;Coulommiers&quot;, &quot;Coverdale&quot;, &quot;Crayeux de Roncq&quot;, &quot;Cream Cheese&quot;,
            &quot;Cream Havarti&quot;, &quot;Crema Agria&quot;, &quot;Crema Mexicana&quot;, &quot;Creme Fraiche&quot;, &quot;Crescenza&quot;,
            &quot;Croghan&quot;, &quot;Crottin de Chavignol&quot;, &quot;Crottin du Chavignol&quot;, &quot;Crowdie&quot;, &quot;Crowley&quot;,
            &quot;Cuajada&quot;, &quot;Curd&quot;, &quot;Cure Nantais&quot;, &quot;Curworthy&quot;, &quot;Cwmtawe Pecorino&quot;,
            &quot;Cypress Grove Chevre&quot;, &quot;Danablu (Danish Blue)&quot;, &quot;Danbo&quot;, &quot;Danish Fontina&quot;,
            &quot;Daralagjazsky&quot;, &quot;Dauphin&quot;, &quot;Delice des Fiouves&quot;, &quot;Denhany Dorset Drum&quot;, &quot;Derby&quot;,
            &quot;Dessertnyj Belyj&quot;, &quot;Devon Blue&quot;, &quot;Devon Garland&quot;, &quot;Dolcelatte&quot;, &quot;Doolin&quot;,
            &quot;Doppelrhamstufel&quot;, &quot;Dorset Blue Vinney&quot;, &quot;Double Gloucester&quot;, &quot;Double Worcester&quot;,
            &quot;Dreux a la Feuille&quot;, &quot;Dry Jack&quot;, &quot;Duddleswell&quot;, &quot;Dunbarra&quot;, &quot;Dunlop&quot;, &quot;Dunsyre Blue&quot;,
            &quot;Duroblando&quot;, &quot;Durrus&quot;, &quot;Dutch Mimolette (Commissiekaas)&quot;, &quot;Edam&quot;, &quot;Edelpilz&quot;,
            &quot;Emental Grand Cru&quot;, &quot;Emlett&quot;, &quot;Emmental&quot;, &quot;Epoisses de Bourgogne&quot;, &quot;Esbareich&quot;,
            &quot;Esrom&quot;, &quot;Etorki&quot;, &quot;Evansdale Farmhouse Brie&quot;, &quot;Evora De L'Alentejo&quot;, &quot;Exmoor Blue&quot;,
            &quot;Explorateur&quot;, &quot;Feta&quot;, &quot;Feta (Australian)&quot;, &quot;Figue&quot;, &quot;Filetta&quot;, &quot;Fin-de-Siecle&quot;,
            &quot;Finlandia Swiss&quot;, &quot;Finn&quot;, &quot;Fiore Sardo&quot;, &quot;Fleur du Maquis&quot;, &quot;Flor de Guia&quot;,
            &quot;Flower Marie&quot;, &quot;Folded&quot;, &quot;Folded cheese with mint&quot;, &quot;Fondant de Brebis&quot;,
            &quot;Fontainebleau&quot;, &quot;Fontal&quot;, &quot;Fontina Val d'Aosta&quot;, &quot;Formaggio di capra&quot;, &quot;Fougerus&quot;,
            &quot;Four Herb Gouda&quot;, &quot;Fourme d' Ambert&quot;, &quot;Fourme de Haute Loire&quot;, &quot;Fourme de Montbrison&quot;,
            &quot;Fresh Jack&quot;, &quot;Fresh Mozzarella&quot;, &quot;Fresh Ricotta&quot;, &quot;Fresh Truffles&quot;, &quot;Fribourgeois&quot;,
            &quot;Friesekaas&quot;, &quot;Friesian&quot;, &quot;Friesla&quot;, &quot;Frinault&quot;, &quot;Fromage a Raclette&quot;, &quot;Fromage Corse&quot;,
            &quot;Fromage de Montagne de Savoie&quot;, &quot;Fromage Frais&quot;, &quot;Fruit Cream Cheese&quot;,
            &quot;Frying Cheese&quot;, &quot;Fynbo&quot;, &quot;Gabriel&quot;, &quot;Galette du Paludier&quot;, &quot;Galette Lyonnaise&quot;,
            &quot;Galloway Goat's Milk Gems&quot;, &quot;Gammelost&quot;, &quot;Gaperon a l'Ail&quot;, &quot;Garrotxa&quot;, &quot;Gastanberra&quot;,
            &quot;Geitost&quot;, &quot;Gippsland Blue&quot;, &quot;Gjetost&quot;, &quot;Gloucester&quot;, &quot;Golden Cross&quot;, &quot;Gorgonzola&quot;,
            &quot;Gornyaltajski&quot;, &quot;Gospel Green&quot;, &quot;Gouda&quot;, &quot;Goutu&quot;, &quot;Gowrie&quot;, &quot;Grabetto&quot;, &quot;Graddost&quot;,
            &quot;Grafton Village Cheddar&quot;, &quot;Grana&quot;, &quot;Grana Padano&quot;, &quot;Grand Vatel&quot;,
            &quot;Grataron d' Areches&quot;, &quot;Gratte-Paille&quot;, &quot;Graviera&quot;, &quot;Greuilh&quot;, &quot;Greve&quot;,
            &quot;Gris de Lille&quot;, &quot;Gruyere&quot;, &quot;Gubbeen&quot;, &quot;Guerbigny&quot;, &quot;Halloumi&quot;,
            &quot;Halloumy (Australian)&quot;, &quot;Haloumi-Style Cheese&quot;, &quot;Harbourne Blue&quot;, &quot;Havarti&quot;,
            &quot;Heidi Gruyere&quot;, &quot;Hereford Hop&quot;, &quot;Herrgardsost&quot;, &quot;Herriot Farmhouse&quot;, &quot;Herve&quot;,
            &quot;Hipi Iti&quot;, &quot;Hubbardston Blue Cow&quot;, &quot;Hushallsost&quot;, &quot;Iberico&quot;, &quot;Idaho Goatster&quot;,
            &quot;Idiazabal&quot;, &quot;Il Boschetto al Tartufo&quot;, &quot;Ile d'Yeu&quot;, &quot;Isle of Mull&quot;, &quot;Jarlsberg&quot;,
            &quot;Jermi Tortes&quot;, &quot;Jibneh Arabieh&quot;, &quot;Jindi Brie&quot;, &quot;Jubilee Blue&quot;, &quot;Juustoleipa&quot;,
            &quot;Kadchgall&quot;, &quot;Kaseri&quot;, &quot;Kashta&quot;, &quot;Kefalotyri&quot;, &quot;Kenafa&quot;, &quot;Kernhem&quot;, &quot;Kervella Affine&quot;,
            &quot;Kikorangi&quot;, &quot;King Island Cape Wickham Brie&quot;, &quot;King River Gold&quot;, &quot;Klosterkaese&quot;,
            &quot;Knockalara&quot;, &quot;Kugelkase&quot;, &quot;L'Aveyronnais&quot;, &quot;L'Ecir de l'Aubrac&quot;, &quot;La Taupiniere&quot;,
            &quot;La Vache Qui Rit&quot;, &quot;Laguiole&quot;, &quot;Lairobell&quot;, &quot;Lajta&quot;, &quot;Lanark Blue&quot;, &quot;Lancashire&quot;,
            &quot;Langres&quot;, &quot;Lappi&quot;, &quot;Laruns&quot;, &quot;Lavistown&quot;, &quot;Le Brin&quot;, &quot;Le Fium Orbo&quot;, &quot;Le Lacandou&quot;,
            &quot;Le Roule&quot;, &quot;Leafield&quot;, &quot;Lebbene&quot;, &quot;Leerdammer&quot;, &quot;Leicester&quot;, &quot;Leyden&quot;, &quot;Limburger&quot;,
            &quot;Lincolnshire Poacher&quot;, &quot;Lingot Saint Bousquet d'Orb&quot;, &quot;Liptauer&quot;, &quot;Little Rydings&quot;,
            &quot;Livarot&quot;, &quot;Llanboidy&quot;, &quot;Llanglofan Farmhouse&quot;, &quot;Loch Arthur Farmhouse&quot;,
            &quot;Loddiswell Avondale&quot;, &quot;Longhorn&quot;, &quot;Lou Palou&quot;, &quot;Lou Pevre&quot;, &quot;Lyonnais&quot;, &quot;Maasdam&quot;,
            &quot;Macconais&quot;, &quot;Mahoe Aged Gouda&quot;, &quot;Mahon&quot;, &quot;Malvern&quot;, &quot;Mamirolle&quot;, &quot;Manchego&quot;,
            &quot;Manouri&quot;, &quot;Manur&quot;, &quot;Marble Cheddar&quot;, &quot;Marbled Cheeses&quot;, &quot;Maredsous&quot;, &quot;Margotin&quot;,
            &quot;Maribo&quot;, &quot;Maroilles&quot;, &quot;Mascares&quot;, &quot;Mascarpone&quot;, &quot;Mascarpone (Australian)&quot;,
            &quot;Mascarpone Torta&quot;, &quot;Matocq&quot;, &quot;Maytag Blue&quot;, &quot;Meira&quot;, &quot;Menallack Farmhouse&quot;,
            &quot;Menonita&quot;, &quot;Meredith Blue&quot;, &quot;Mesost&quot;, &quot;Metton (Cancoillotte)&quot;, &quot;Meyer Vintage Gouda&quot;,
            &quot;Mihalic Peynir&quot;, &quot;Milleens&quot;, &quot;Mimolette&quot;, &quot;Mine-Gabhar&quot;, &quot;Mini Baby Bells&quot;, &quot;Mixte&quot;,
            &quot;Molbo&quot;, &quot;Monastery Cheeses&quot;, &quot;Mondseer&quot;, &quot;Mont D'or Lyonnais&quot;, &quot;Montasio&quot;,
            &quot;Monterey Jack&quot;, &quot;Monterey Jack Dry&quot;, &quot;Morbier&quot;, &quot;Morbier Cru de Montagne&quot;,
            &quot;Mothais a la Feuille&quot;, &quot;Mozzarella&quot;, &quot;Mozzarella (Australian)&quot;,
            &quot;Mozzarella di Bufala&quot;, &quot;Mozzarella Fresh, in water&quot;, &quot;Mozzarella Rolls&quot;, &quot;Munster&quot;,
            &quot;Murol&quot;, &quot;Mycella&quot;, &quot;Myzithra&quot;, &quot;Naboulsi&quot;, &quot;Nantais&quot;, &quot;Neufchatel&quot;,
            &quot;Neufchatel (Australian)&quot;, &quot;Niolo&quot;, &quot;Nokkelost&quot;, &quot;Northumberland&quot;, &quot;Oaxaca&quot;,
            &quot;Olde York&quot;, &quot;Olivet au Foin&quot;, &quot;Olivet Bleu&quot;, &quot;Olivet Cendre&quot;,
            &quot;Orkney Extra Mature Cheddar&quot;, &quot;Orla&quot;, &quot;Oschtjepka&quot;, &quot;Ossau Fermier&quot;, &quot;Ossau-Iraty&quot;,
            &quot;Oszczypek&quot;, &quot;Oxford Blue&quot;, &quot;P'tit Berrichon&quot;, &quot;Palet de Babligny&quot;, &quot;Paneer&quot;, &quot;Panela&quot;,
            &quot;Pannerone&quot;, &quot;Pant ys Gawn&quot;, &quot;Parmesan (Parmigiano)&quot;, &quot;Parmigiano Reggiano&quot;,
            &quot;Pas de l'Escalette&quot;, &quot;Passendale&quot;, &quot;Pasteurized Processed&quot;, &quot;Pate de Fromage&quot;,
            &quot;Patefine Fort&quot;, &quot;Pave d'Affinois&quot;, &quot;Pave d'Auge&quot;, &quot;Pave de Chirac&quot;, &quot;Pave du Berry&quot;,
            &quot;Pecorino&quot;, &quot;Pecorino in Walnut Leaves&quot;, &quot;Pecorino Romano&quot;, &quot;Peekskill Pyramid&quot;,
            &quot;Pelardon des Cevennes&quot;, &quot;Pelardon des Corbieres&quot;, &quot;Penamellera&quot;, &quot;Penbryn&quot;,
            &quot;Pencarreg&quot;, &quot;Perail de Brebis&quot;, &quot;Petit Morin&quot;, &quot;Petit Pardou&quot;, &quot;Petit-Suisse&quot;,
            &quot;Picodon de Chevre&quot;, &quot;Picos de Europa&quot;, &quot;Piora&quot;, &quot;Pithtviers au Foin&quot;,
            &quot;Plateau de Herve&quot;, &quot;Plymouth Cheese&quot;, &quot;Podhalanski&quot;, &quot;Poivre d'Ane&quot;, &quot;Polkolbin&quot;,
            &quot;Pont l'Eveque&quot;, &quot;Port Nicholson&quot;, &quot;Port-Salut&quot;, &quot;Postel&quot;, &quot;Pouligny-Saint-Pierre&quot;,
            &quot;Pourly&quot;, &quot;Prastost&quot;, &quot;Pressato&quot;, &quot;Prince-Jean&quot;, &quot;Processed Cheddar&quot;, &quot;Provolone&quot;,
            &quot;Provolone (Australian)&quot;, &quot;Pyengana Cheddar&quot;, &quot;Pyramide&quot;, &quot;Quark&quot;,
            &quot;Quark (Australian)&quot;, &quot;Quartirolo Lombardo&quot;, &quot;Quatre-Vents&quot;, &quot;Quercy Petit&quot;,
            &quot;Queso Blanco&quot;, &quot;Queso Blanco con Frutas --Pina y Mango&quot;, &quot;Queso de Murcia&quot;,
            &quot;Queso del Montsec&quot;, &quot;Queso del Tietar&quot;, &quot;Queso Fresco&quot;, &quot;Queso Fresco (Adobera)&quot;,
            &quot;Queso Iberico&quot;, &quot;Queso Jalapeno&quot;, &quot;Queso Majorero&quot;, &quot;Queso Media Luna&quot;,
            &quot;Queso Para Frier&quot;, &quot;Queso Quesadilla&quot;, &quot;Rabacal&quot;, &quot;Raclette&quot;, &quot;Ragusano&quot;, &quot;Raschera&quot;,
            &quot;Reblochon&quot;, &quot;Red Leicester&quot;, &quot;Regal de la Dombes&quot;, &quot;Reggianito&quot;, &quot;Remedou&quot;,
            &quot;Requeson&quot;, &quot;Richelieu&quot;, &quot;Ricotta&quot;, &quot;Ricotta (Australian)&quot;, &quot;Ricotta Salata&quot;, &quot;Ridder&quot;,
            &quot;Rigotte&quot;, &quot;Rocamadour&quot;, &quot;Rollot&quot;, &quot;Romano&quot;, &quot;Romans Part Dieu&quot;, &quot;Roncal&quot;, &quot;Roquefort&quot;,
            &quot;Roule&quot;, &quot;Rouleau De Beaulieu&quot;, &quot;Royalp Tilsit&quot;, &quot;Rubens&quot;, &quot;Rustinu&quot;, &quot;Saaland Pfarr&quot;,
            &quot;Saanenkaese&quot;, &quot;Saga&quot;, &quot;Sage Derby&quot;, &quot;Sainte Maure&quot;, &quot;Saint-Marcellin&quot;,
            &quot;Saint-Nectaire&quot;, &quot;Saint-Paulin&quot;, &quot;Salers&quot;, &quot;Samso&quot;, &quot;San Simon&quot;, &quot;Sancerre&quot;,
            &quot;Sap Sago&quot;, &quot;Sardo&quot;, &quot;Sardo Egyptian&quot;, &quot;Sbrinz&quot;, &quot;Scamorza&quot;, &quot;Schabzieger&quot;, &quot;Schloss&quot;,
            &quot;Selles sur Cher&quot;, &quot;Selva&quot;, &quot;Serat&quot;, &quot;Seriously Strong Cheddar&quot;, &quot;Serra da Estrela&quot;,
            &quot;Sharpam&quot;, &quot;Shelburne Cheddar&quot;, &quot;Shropshire Blue&quot;, &quot;Siraz&quot;, &quot;Sirene&quot;, &quot;Smoked Gouda&quot;,
            &quot;Somerset Brie&quot;, &quot;Sonoma Jack&quot;, &quot;Sottocenare al Tartufo&quot;, &quot;Soumaintrain&quot;,
            &quot;Sourire Lozerien&quot;, &quot;Spenwood&quot;, &quot;Sraffordshire Organic&quot;, &quot;St. Agur Blue Cheese&quot;,
            &quot;Stilton&quot;, &quot;Stinking Bishop&quot;, &quot;String&quot;, &quot;Sussex Slipcote&quot;, &quot;Sveciaost&quot;, &quot;Swaledale&quot;,
            &quot;Sweet Style Swiss&quot;, &quot;Swiss&quot;, &quot;Syrian (Armenian String)&quot;, &quot;Tala&quot;, &quot;Taleggio&quot;, &quot;Tamie&quot;,
            &quot;Tasmania Highland Chevre Log&quot;, &quot;Taupiniere&quot;, &quot;Teifi&quot;, &quot;Telemea&quot;, &quot;Testouri&quot;,
            &quot;Tete de Moine&quot;, &quot;Tetilla&quot;, &quot;Texas Goat Cheese&quot;, &quot;Tibet&quot;, &quot;Tillamook Cheddar&quot;,
            &quot;Tilsit&quot;, &quot;Timboon Brie&quot;, &quot;Toma&quot;, &quot;Tomme Brulee&quot;, &quot;Tomme d'Abondance&quot;,
            &quot;Tomme de Chevre&quot;, &quot;Tomme de Romans&quot;, &quot;Tomme de Savoie&quot;, &quot;Tomme des Chouans&quot;, &quot;Tommes&quot;,
            &quot;Torta del Casar&quot;, &quot;Toscanello&quot;, &quot;Touree de L'Aubier&quot;, &quot;Tourmalet&quot;,
            &quot;Trappe (Veritable)&quot;, &quot;Trois Cornes De Vendee&quot;, &quot;Tronchon&quot;, &quot;Trou du Cru&quot;, &quot;Truffe&quot;,
            &quot;Tupi&quot;, &quot;Turunmaa&quot;, &quot;Tymsboro&quot;, &quot;Tyn Grug&quot;, &quot;Tyning&quot;, &quot;Ubriaco&quot;, &quot;Ulloa&quot;,
            &quot;Vacherin-Fribourgeois&quot;, &quot;Valencay&quot;, &quot;Vasterbottenost&quot;, &quot;Venaco&quot;, &quot;Vendomois&quot;,
            &quot;Vieux Corse&quot;, &quot;Vignotte&quot;, &quot;Vulscombe&quot;, &quot;Waimata Farmhouse Blue&quot;,
            &quot;Washed Rind Cheese (Australian)&quot;, &quot;Waterloo&quot;, &quot;Weichkaese&quot;, &quot;Wellington&quot;,
            &quot;Wensleydale&quot;, &quot;White Stilton&quot;, &quot;Whitestone Farmhouse&quot;, &quot;Wigmore&quot;, &quot;Woodside Cabecou&quot;,
            &quot;Xanadu&quot;, &quot;Xynotyro&quot;, &quot;Yarg Cornish&quot;, &quot;Yarra Valley Pyramid&quot;, &quot;Yorkshire Blue&quot;,
            &quot;Zamorano&quot;, &quot;Zanetti Grana Padano&quot;, &quot;Zanetti Parmigiano Reggiano&quot;
    };

}

</pre>
<p>Ok Now we will create an XML for the overlay in the ListView that holds only a TextView.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;TextView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:textSize=&quot;50sp&quot;
    android:textColor=&quot;#99FFFFFF&quot;
    android:background=&quot;#BB000000&quot;
    android:minWidth=&quot;70dip&quot;
    android:maxWidth=&quot;70dip&quot;
    android:padding=&quot;10dip&quot;
    android:gravity=&quot;center&quot;
/&gt;
</pre>
<p>Ok Now we will create the ListView and populate the Data.<br />
Create a java class that extends ListActivity and implements the Scroll Listener.</p>
<p>This is how it is going to be.</p>
<p>ListOverlay.java</p>
<pre class="brush: java; title: ; notranslate">
package com.coderzheaven.alphabetprojectionlistview;

import android.app.ListActivity;
import android.content.Context;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManager.LayoutParams;
import android.widget.AbsListView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class ListOverlay extends ListActivity implements ListView.OnScrollListener {

    private final class RemoveWindow implements Runnable {
        public void run() {
            removeWindow();
        }
    }

    private RemoveWindow mRemoveWindow = new RemoveWindow();
    Handler mHandler = new Handler();
    private WindowManager mWindowManager;
    private TextView mDialogText;
    private boolean mShowing;
    private boolean mReady;
    private char mPrevLetter = Character.MIN_VALUE;
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mWindowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
        
        // Use an existing ListAdapter that will map an array
        // of strings to TextViews
        setListAdapter(new ArrayAdapter&lt;String&gt;(this,
                android.R.layout.simple_list_item_1, mStrings));
        
        getListView().setOnScrollListener(this);
        
        LayoutInflater inflate = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        
        mDialogText = (TextView) inflate.inflate(R.layout.list_position, null);
        mDialogText.setVisibility(View.INVISIBLE);
        
        mHandler.post(new Runnable() {

            public void run() {
                mReady = true;
                WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
                        LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
                        WindowManager.LayoutParams.TYPE_APPLICATION,
                        WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
                                | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE,
                        PixelFormat.TRANSLUCENT);
                mWindowManager.addView(mDialogText, lp);
            }});
    }
    
    @Override
    protected void onResume() {
        super.onResume();
        mReady = true;
    }

    
    @Override
    protected void onPause() {
        super.onPause();
        removeWindow();
        mReady = false;
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mWindowManager.removeView(mDialogText);
        mReady = false;
    }

    
   
    
    public void onScroll(AbsListView view, int firstVisibleItem,
            int visibleItemCount, int totalItemCount) {
        if (mReady) {
            char firstLetter = mStrings[firstVisibleItem].charAt(0);
            
            if (!mShowing &amp;&amp; firstLetter != mPrevLetter) {

                mShowing = true;
                mDialogText.setVisibility(View.VISIBLE);
            }
            mDialogText.setText(((Character)firstLetter).toString());
            mHandler.removeCallbacks(mRemoveWindow);
            mHandler.postDelayed(mRemoveWindow, 3000);
            mPrevLetter = firstLetter;
        }
    }
    

    public void onScrollStateChanged(AbsListView view, int scrollState) {
    }
    
    
    private void removeWindow() {
        if (mShowing) {
            mShowing = false;
            mDialogText.setVisibility(View.INVISIBLE);
        }
    }

    private String[] mStrings = Cheeses.sCheeseStrings;
}
</pre>
<p>Hooray it&#8217;s done and it&#8217;s that simple.Go on and run the project and see the result.</p>
<p>You can download the java source code from <a href="https://dl.dropboxusercontent.com/u/91846918/Android%20ListOverlay/AlphabetProjectionListView.zip" title="Download source code" target="_blank">here</a>.</p>
<div class="su-linkbox" id="post-5416-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/14/create-list-alphabet-overlay-android/&quot;&gt;How to create a List with Alphabet Overlay in Android&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/04/26/multiple-selection-listview-android/"     class="crp_title">Multiple Selection GridView in Android</a></li><li><a href="http://www.coderzheaven.com/2011/02/23/programmatically-change-background-in-adobe-airflex/"     class="crp_title">Programmatically change background in Adobe AIR/FLEX.</a></li><li><a href="http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/"     class="crp_title">How to create a beautiful wheel animation in android?</a></li><li><a href="http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/"     class="crp_title">ListView Bottom to Top Animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/"     class="crp_title">Cascade animation in a ListView in Android.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/14/create-list-alphabet-overlay-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to start with Android &#8211; Basics and Fundementals.</title>
		<link>http://www.coderzheaven.com/2013/05/13/start-android-basics-fundmentals/</link>
		<comments>http://www.coderzheaven.com/2013/05/13/start-android-basics-fundmentals/#comments</comments>
		<pubDate>Mon, 13 May 2013 03:36:23 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[Android Application Fundamental Components]]></category>
		<category><![CDATA[Android Architecture]]></category>
		<category><![CDATA[Dalvik Virtual Machine]]></category>
		<category><![CDATA[How to start with Android - Basics and Fundementals]]></category>
		<category><![CDATA[Introducion to Android]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5434</guid>
		<description><![CDATA[Hello all This post for everyone who like to start with android and know the basics. It includes Introduction to Android Android Architecture Dalvik Virtual Machine Android Application Fundamental Components The above links will be going by another android blog which also teaches you the basics of Android. Check out these links and start coding [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2011/02/19/how-to-add-categories-labels-in-your-blogger/"     class="crp_title">How to add categories / labels in your blogger?</a></li><li><a href="http://www.coderzheaven.com/2012/12/18/google-news-experience-tablets/"     class="crp_title">A better Google News experience on tablets</a></li><li><a href="http://www.coderzheaven.com/2011/04/24/showing-twitter-updates-on-bloggerblogspot/"     class="crp_title">Showing Twitter updates on Blogger/Blogspot</a></li><li><a href="http://www.coderzheaven.com/2011/04/18/sqlitemanager-plugin-for-eclipse/"     class="crp_title">SQLiteManager plugin for eclipse</a></li><li><a href="http://www.coderzheaven.com/2013/04/08/buy-micromax-91-ninja-online-rs-8499/"     class="crp_title">Buy Micromax A 91 Ninja online for Rs 8,499.</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>Hello all</p>
<p> This post for everyone who like to start with android and know the basics.</p>
<p><img src="http://1.bp.blogspot.com/-9ija71JK99s/UQIK2Dl5nBI/AAAAAAAAAMU/8CpmJ7K9nsY/s1600/android-tethering.png" alt="Android" width="500" height="300" /></p>
<p>It includes</p>
<p><a href="http://eazyprogramming.blogspot.in/2013/05/introducion-to-android.html" title="Introduction to Android" target="_blank">Introduction to Android</a><br />
<a href="http://eazyprogramming.blogspot.in/2013/05/android-architecture.html" title="Android Architecture" target="_blank">Android Architecture</a><br />
<a href="http://eazyprogramming.blogspot.in/2013/05/what-is-dalvik-virtual-machine.html" title="Dalvik Virtual Machine" target="_blank">Dalvik Virtual Machine  </a><br />
<a href="http://eazyprogramming.blogspot.in/2013/05/android-application-fundamentals-or.html" title="Android application fundementals." target="_blank">Android Application Fundamental Components</a></p>
<p>The above links will be going by another android blog which also teaches you the basics of Android.</p>
<p>Check out these links and start coding in android.<br />
You are on the right path because Android is the future.</p>
<p>Happy coding..</p>
<div class="su-linkbox" id="post-5434-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/13/start-android-basics-fundmentals/&quot;&gt;How to start with Android &#8211; Basics and Fundementals.&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2011/02/19/how-to-add-categories-labels-in-your-blogger/"     class="crp_title">How to add categories / labels in your blogger?</a></li><li><a href="http://www.coderzheaven.com/2012/12/18/google-news-experience-tablets/"     class="crp_title">A better Google News experience on tablets</a></li><li><a href="http://www.coderzheaven.com/2011/04/24/showing-twitter-updates-on-bloggerblogspot/"     class="crp_title">Showing Twitter updates on Blogger/Blogspot</a></li><li><a href="http://www.coderzheaven.com/2011/04/18/sqlitemanager-plugin-for-eclipse/"     class="crp_title">SQLiteManager plugin for eclipse</a></li><li><a href="http://www.coderzheaven.com/2013/04/08/buy-micromax-91-ninja-online-rs-8499/"     class="crp_title">Buy Micromax A 91 Ninja online for Rs 8,499.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/13/start-android-basics-fundmentals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use ImageSwitcher in Android?</title>
		<link>http://www.coderzheaven.com/2013/05/12/imageswitcher-android/</link>
		<comments>http://www.coderzheaven.com/2013/05/12/imageswitcher-android/#comments</comments>
		<pubDate>Sun, 12 May 2013 18:53:20 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[addAnimation]]></category>
		<category><![CDATA[Animation Class]]></category>
		<category><![CDATA[Animation Gallery]]></category>
		<category><![CDATA[Animation.INFINITE]]></category>
		<category><![CDATA[Animation.RELATIVE_TO_SELF]]></category>
		<category><![CDATA[Animation.REVERSE]]></category>
		<category><![CDATA[AnimationSet]]></category>
		<category><![CDATA[ArrayAdapter]]></category>
		<category><![CDATA[Attrs]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[BitmapDrawable]]></category>
		<category><![CDATA[Blink]]></category>
		<category><![CDATA[Blinking Text]]></category>
		<category><![CDATA[Centre Image]]></category>
		<category><![CDATA[Color Graphics]]></category>
		<category><![CDATA[Coverflow]]></category>
		<category><![CDATA[CoverFlow in Android - Complete implementation with source code.]]></category>
		<category><![CDATA[createBitmap]]></category>
		<category><![CDATA[createReflectedImages]]></category>
		<category><![CDATA[Deprecation]]></category>
		<category><![CDATA[Gallery Graphics]]></category>
		<category><![CDATA[Gallery Java]]></category>
		<category><![CDATA[getPackageManager]]></category>
		<category><![CDATA[getScale]]></category>
		<category><![CDATA[GridView RandomFade animation in Android]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[Hello Everyone]]></category>
		<category><![CDATA[How to create a blinking text in Android?]]></category>
		<category><![CDATA[ImageAdapter]]></category>
		<category><![CDATA[ImageSwitcher]]></category>
		<category><![CDATA[Implementation]]></category>
		<category><![CDATA[INVISIBLE]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Java Download]]></category>
		<category><![CDATA[Java Package]]></category>
		<category><![CDATA[LinearGradient]]></category>
		<category><![CDATA[Listview]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[Maximum Angle]]></category>
		<category><![CDATA[Menu Menu]]></category>
		<category><![CDATA[Menu Return]]></category>
		<category><![CDATA[Mytext]]></category>
		<category><![CDATA[New Camera]]></category>
		<category><![CDATA[PorterDuffXfermode]]></category>
		<category><![CDATA[Public Int]]></category>
		<category><![CDATA[Public Void]]></category>
		<category><![CDATA[Runnable]]></category>
		<category><![CDATA[setAdapter]]></category>
		<category><![CDATA[setAnimationDuration]]></category>
		<category><![CDATA[setAntiAlias]]></category>
		<category><![CDATA[setContentView]]></category>
		<category><![CDATA[setDuration]]></category>
		<category><![CDATA[setImageBitmap]]></category>
		<category><![CDATA[setImageResource]]></category>
		<category><![CDATA[setLayoutParams]]></category>
		<category><![CDATA[setRepeatCount]]></category>
		<category><![CDATA[setRepeatMode]]></category>
		<category><![CDATA[setScaleType]]></category>
		<category><![CDATA[setSelection]]></category>
		<category><![CDATA[setShader]]></category>
		<category><![CDATA[setStartOffset]]></category>
		<category><![CDATA[setVisibility]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[startAnimation]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[Transformation]]></category>
		<category><![CDATA[TranslateAnimation]]></category>
		<category><![CDATA[Tv Animation]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Zoom]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5393</guid>
		<description><![CDATA[You can read more about ImageSwitcher here http://developer.android.com/reference/android/widget/ImageSwitcher.html Click on the link below to download the code. This is the layout that contains the ImageSwitcher What we will do is we will load some images into the Gallery and then load each image into the ImageSwitcher on clicking on each item in the Gallery. Here [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2011/03/09/using-gridview-in-android-2/"     class="crp_title">Using GridView in ANDROID&#8230;.</a></li><li><a href="http://www.coderzheaven.com/2012/06/28/creating-custom-sliding-galleryview-paging-android/"     class="crp_title">Creating a custom Sliding GalleryView with Paging in android</a></li><li><a href="http://www.coderzheaven.com/2012/12/17/coverflow-android-complete-implementation-source-code/"     class="crp_title">CoverFlow in Android &#8211; Complete implementation with&hellip;</a></li><li><a href="http://www.coderzheaven.com/2012/02/29/custom-gridview-in-android-a-simple-example/"     class="crp_title">Custom GridView in android. A simple example.</a></li><li><a href="http://www.coderzheaven.com/2013/04/26/multiple-selection-listview-android/"     class="crp_title">Multiple Selection GridView in Android</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>You can read more about <a href="http://www.coderzheaven.com/2012/12/17/coverflow-android-complete-implementation-source-code/" title="CoverFlow in Android – Complete implementation with source code." target="_blank">ImageSwitcher </a>here</p>
<p><a href="http://developer.android.com/reference/android/widget/ImageSwitcher.html" title="imageSwitcher" target="_blank">http://developer.android.com/reference/android/widget/ImageSwitcher.html</a></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/ImageSwitcher/device-2013-05-09-223008.png" width="320" height="480" alt="ImageSwitcher1" /></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/ImageSwitcher/device-2013-05-09-223030.png" width="320" height="480" alt="ImageSwitcher1" /></p>
<p>Click on the link below to download the code.</p>
<p>This is the layout that contains the ImageSwitcher</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot; &gt;

    &lt;ImageSwitcher
        android:id=&quot;@+id/switcher&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;match_parent&quot;
        android:layout_alignParentLeft=&quot;true&quot;
        android:layout_alignParentTop=&quot;true&quot; /&gt;

    &lt;Gallery
        android:id=&quot;@+id/gallery&quot;
        android:layout_width=&quot;match_parent&quot;
        android:layout_height=&quot;60dp&quot;
        android:layout_alignParentBottom=&quot;true&quot;
        android:layout_alignParentLeft=&quot;true&quot;
        android:background=&quot;#55000000&quot;
        android:gravity=&quot;center_vertical&quot;
        android:spacing=&quot;16dp&quot; /&gt;

&lt;/RelativeLayout&gt;
</pre>
<p>What we will do is we will load some images into the Gallery and then load each image into the ImageSwitcher on clicking on each item in the Gallery.<br />
Here is the java class that does it.</p>
<pre class="brush: java; title: ; notranslate">
package com.example.imageswitcherdemo;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.AnimationUtils;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.Gallery.LayoutParams;
import android.widget.ImageSwitcher;
import android.widget.ImageView;
import android.widget.ViewSwitcher;

@SuppressWarnings(&quot;deprecation&quot;)
public class MainActivity extends Activity implements
		AdapterView.OnItemSelectedListener, ViewSwitcher.ViewFactory {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);

		setContentView(R.layout.activity_main);

		mSwitcher = (ImageSwitcher) findViewById(R.id.switcher);
		mSwitcher.setFactory(this);
		mSwitcher.setInAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_in));
		mSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this,
				android.R.anim.fade_out));

		Gallery g = (Gallery) findViewById(R.id.gallery);
		g.setAdapter(new ImageAdapter(this));
		g.setOnItemSelectedListener(this);
	}

	public void onItemSelected(AdapterView&lt;?&gt; parent, View v, int position,
			long id) {
		mSwitcher.setImageResource(mImageIds[position]);
	}

	public void onNothingSelected(AdapterView&lt;?&gt; parent) {
	}

	public View makeView() {
		ImageView i = new ImageView(this);
		i.setBackgroundColor(0xFF000000);
		i.setScaleType(ImageView.ScaleType.FIT_CENTER);
		i.setLayoutParams(new ImageSwitcher.LayoutParams(
				LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
		return i;
	}

	private ImageSwitcher mSwitcher;

	public class ImageAdapter extends BaseAdapter {
		public ImageAdapter(Context c) {
			mContext = c;
		}

		public int getCount() {
			return mThumbIds.length;
		}

		public Object getItem(int position) {
			return position;
		}

		public long getItemId(int position) {
			return position;
		}

		public View getView(int position, View convertView, ViewGroup parent) {
			ImageView i = new ImageView(mContext);

			i.setImageResource(mThumbIds[position]);
			i.setAdjustViewBounds(true);
			i.setLayoutParams(new Gallery.LayoutParams(
					LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
			i.setBackgroundResource(R.drawable.picture_frame);
			return i;
		}

		private Context mContext;

	}

	private Integer[] mThumbIds = { R.drawable.sample_thumb_0,
			R.drawable.sample_thumb_1, R.drawable.sample_thumb_2,
			R.drawable.sample_thumb_3, R.drawable.sample_thumb_4,
			R.drawable.sample_thumb_5, R.drawable.sample_thumb_6,
			R.drawable.sample_thumb_7 };

	private Integer[] mImageIds = { R.drawable.sample_0, R.drawable.sample_1,
			R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4,
			R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7 };

}
</pre>
<p>Make sure you have all these resources in the drawable folder</p>
<pre class="brush: java; title: ; notranslate">
private Integer[] mThumbIds = { R.drawable.sample_thumb_0,
			R.drawable.sample_thumb_1, R.drawable.sample_thumb_2,
			R.drawable.sample_thumb_3, R.drawable.sample_thumb_4,
			R.drawable.sample_thumb_5, R.drawable.sample_thumb_6,
			R.drawable.sample_thumb_7 };

	private Integer[] mImageIds = { R.drawable.sample_0, R.drawable.sample_1,
			R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4,
			R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7 };
</pre>
<p>You can download the complete java source code from <a href="https://dl.dropboxusercontent.com/u/91846918/ImageSwitcher/ImageSwitcherDemo.zip" title="Download Source Code" target="_blank">here</a></p>
<div class="su-linkbox" id="post-5393-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/12/imageswitcher-android/&quot;&gt;How to use ImageSwitcher in Android?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2011/03/09/using-gridview-in-android-2/"     class="crp_title">Using GridView in ANDROID&#8230;.</a></li><li><a href="http://www.coderzheaven.com/2012/06/28/creating-custom-sliding-galleryview-paging-android/"     class="crp_title">Creating a custom Sliding GalleryView with Paging in android</a></li><li><a href="http://www.coderzheaven.com/2012/12/17/coverflow-android-complete-implementation-source-code/"     class="crp_title">CoverFlow in Android &#8211; Complete implementation with&hellip;</a></li><li><a href="http://www.coderzheaven.com/2012/02/29/custom-gridview-in-android-a-simple-example/"     class="crp_title">Custom GridView in android. A simple example.</a></li><li><a href="http://www.coderzheaven.com/2013/04/26/multiple-selection-listview-android/"     class="crp_title">Multiple Selection GridView in Android</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/12/imageswitcher-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to shutdown a computer using a C program?</title>
		<link>http://www.coderzheaven.com/2013/05/12/shutdown-computer-program/</link>
		<comments>http://www.coderzheaven.com/2013/05/12/shutdown-computer-program/#comments</comments>
		<pubDate>Sun, 12 May 2013 05:27:08 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[shutdown]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[System32]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5410</guid>
		<description><![CDATA[Hello all I have been posting Android posts for months, now there is a slight change, Here is a simple C program to shutdown your computer. Let&#8217;s start. If you are using Windows XP then use this code. For Windows 7 In ubuntu Login as a root user for this to work otherwise you will [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2011/02/24/difference-between-and-operator-in-c-2/"     class="crp_title">Difference between &amp; and * operator in C</a></li><li><a href="http://www.coderzheaven.com/2012/04/28/include-multiple-files-compile-android-ndk/"     class="crp_title">How to include multiple c files to compile in android NDK?</a></li><li><a href="http://www.coderzheaven.com/2011/02/23/string-functions-in-c/"     class="crp_title">String Functions in C</a></li><li><a href="http://www.coderzheaven.com/2011/07/13/binary-search-in-c-arrays-an-example/"     class="crp_title">Binary Search in C Arrays &#8211; An Example</a></li><li><a href="http://www.coderzheaven.com/2011/07/11/how-to-search-for-a-particular-character-in-a-c-string/"     class="crp_title">How to search for a particular character in a C++ string ?</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>Hello all</p>
<p> I have been posting Android posts for months, now there is a slight change, Here is a simple C program to shutdown your computer.</p>
<p>Let&#8217;s start.</p>
<p>If you are using Windows XP then use this code.</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
 
main()
{
   char ch;
 
   printf(&quot;Do you want to shutdown your computer now (y/n)\n&quot;);
   scanf(&quot;%c&quot;,&amp;ch);
 
   if (ch == 'y' || ch == 'Y')
      system(&quot;C:\\WINDOWS\\System32\\shutdown -s&quot;);
 
   return 0;
}
</pre>
<p>For Windows 7</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
 
main()
{
   char ch;
 
   printf(&quot;Do you want to shutdown your computer now (y/n)\n&quot;);
   scanf(&quot;%c&quot;,&amp;ch);
 
   if (ch == 'y' || ch == 'Y')
      system(&quot;C:\\WINDOWS\\System32\\shutdown /s&quot;);
 
   return 0;
}
</pre>
<p> In ubuntu</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;stdio.h&gt;
 
int main() {
  system(&quot;shutdown -P now&quot;);
  return 0;
}
</pre>
<p>Login as a root user for this to work otherwise you will get the message shutdown: Need to be root, now specifies that you want to shutdown immediately. &#8216;-P&#8217; option specifies you want to power off your machine. </p>
<p>You can specify minutes as:<br />
shutdown -P &#8220;number of minutes&#8221;.</p>
<div class="su-linkbox" id="post-5410-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/12/shutdown-computer-program/&quot;&gt;How to shutdown a computer using a C program?&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2011/02/24/difference-between-and-operator-in-c-2/"     class="crp_title">Difference between &amp; and * operator in C</a></li><li><a href="http://www.coderzheaven.com/2012/04/28/include-multiple-files-compile-android-ndk/"     class="crp_title">How to include multiple c files to compile in android NDK?</a></li><li><a href="http://www.coderzheaven.com/2011/02/23/string-functions-in-c/"     class="crp_title">String Functions in C</a></li><li><a href="http://www.coderzheaven.com/2011/07/13/binary-search-in-c-arrays-an-example/"     class="crp_title">Binary Search in C Arrays &#8211; An Example</a></li><li><a href="http://www.coderzheaven.com/2011/07/11/how-to-search-for-a-particular-character-in-a-c-string/"     class="crp_title">How to search for a particular character in a C++ string ?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/12/shutdown-computer-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ListView Bottom to Top Animation in Android.</title>
		<link>http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/</link>
		<comments>http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/#comments</comments>
		<pubDate>Fri, 10 May 2013 07:34:49 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[GirdView]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[addAnimation]]></category>
		<category><![CDATA[Animation Class]]></category>
		<category><![CDATA[Animation Gallery]]></category>
		<category><![CDATA[Animation.INFINITE]]></category>
		<category><![CDATA[Animation.RELATIVE_TO_SELF]]></category>
		<category><![CDATA[Animation.REVERSE]]></category>
		<category><![CDATA[AnimationSet]]></category>
		<category><![CDATA[ArrayAdapter]]></category>
		<category><![CDATA[Attrs]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[BitmapDrawable]]></category>
		<category><![CDATA[Blink]]></category>
		<category><![CDATA[Blinking Text]]></category>
		<category><![CDATA[Centre Image]]></category>
		<category><![CDATA[Color Graphics]]></category>
		<category><![CDATA[Coverflow]]></category>
		<category><![CDATA[CoverFlow in Android - Complete implementation with source code.]]></category>
		<category><![CDATA[createBitmap]]></category>
		<category><![CDATA[createReflectedImages]]></category>
		<category><![CDATA[Deprecation]]></category>
		<category><![CDATA[Gallery Graphics]]></category>
		<category><![CDATA[Gallery Java]]></category>
		<category><![CDATA[getPackageManager]]></category>
		<category><![CDATA[getScale]]></category>
		<category><![CDATA[GridView RandomFade animation in Android]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[Hello Everyone]]></category>
		<category><![CDATA[How to create a blinking text in Android?]]></category>
		<category><![CDATA[ImageAdapter]]></category>
		<category><![CDATA[Implementation]]></category>
		<category><![CDATA[INVISIBLE]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Java Download]]></category>
		<category><![CDATA[Java Package]]></category>
		<category><![CDATA[LinearGradient]]></category>
		<category><![CDATA[Listview]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[Maximum Angle]]></category>
		<category><![CDATA[Menu Menu]]></category>
		<category><![CDATA[Menu Return]]></category>
		<category><![CDATA[Mytext]]></category>
		<category><![CDATA[New Camera]]></category>
		<category><![CDATA[PorterDuffXfermode]]></category>
		<category><![CDATA[Public Int]]></category>
		<category><![CDATA[Public Void]]></category>
		<category><![CDATA[Runnable]]></category>
		<category><![CDATA[setAdapter]]></category>
		<category><![CDATA[setAnimationDuration]]></category>
		<category><![CDATA[setAntiAlias]]></category>
		<category><![CDATA[setContentView]]></category>
		<category><![CDATA[setDuration]]></category>
		<category><![CDATA[setImageBitmap]]></category>
		<category><![CDATA[setImageResource]]></category>
		<category><![CDATA[setLayoutParams]]></category>
		<category><![CDATA[setRepeatCount]]></category>
		<category><![CDATA[setRepeatMode]]></category>
		<category><![CDATA[setScaleType]]></category>
		<category><![CDATA[setSelection]]></category>
		<category><![CDATA[setShader]]></category>
		<category><![CDATA[setStartOffset]]></category>
		<category><![CDATA[setVisibility]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[startAnimation]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[Transformation]]></category>
		<category><![CDATA[TranslateAnimation]]></category>
		<category><![CDATA[Tv Animation]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Zoom]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5362</guid>
		<description><![CDATA[Like my previous posts animation chapter is again continued. This time the animation in on a ListView from Bottom to Top. You have already seen animations from Top to Bottom in my previous posts. See some of my posts here. All animation posts from CoderzHeaven is here Click on the download link at the bottom [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/"     class="crp_title">Cascade animation in a ListView in Android.</a></li><li><a href="http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/"     class="crp_title">GridView RandomFade animation in Android</a></li><li><a href="http://www.coderzheaven.com/2013/04/21/create-rotate-3d-animation-listview-imageview-android/"     class="crp_title">How to create a rotate 3D Animation between a ListView and&hellip;</a></li><li><a href="http://www.coderzheaven.com/2013/04/22/types-animation-push-in-push-out-push-left-in-push-left-out-hyperspace-in-hyperspace-viewflipper-android/"     class="crp_title">Different types of Animation &#8211; Push Up in, Push Up&hellip;</a></li><li><a href="http://www.coderzheaven.com/2011/06/11/simple-view-animation-in-android/"     class="crp_title">Simple View Animation in ANDROID?</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>Like my previous posts animation chapter is again continued. This time the animation in on a ListView from Bottom to Top.<br />
You have already seen animations from Top to Bottom in my previous posts.<br />
See some of my posts here.</p>
<p><a href="http://www.coderzheaven.com/?s=animation" title="Animation" target="_blank">All animation posts from CoderzHeaven is here</a></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/ListView%20Bottom%20Top%20animation/list_bottom_top_animation.png" width="700" height="400" alt="Bottom Top animation"  /></p>
<p>Click on the download link at the bottom to download the source code.</p>
<p>So We will start</p>
<p>Like my other examples for this animation also we need two XML files one which extends the &#8220;layoutAnimation&#8221; class<br />
Here is how it looks<br />
<strong>layout_bottom_to_top_slide.xml</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;layoutAnimation xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
        android:delay=&quot;30%&quot;
        android:animationOrder=&quot;reverse&quot;
        android:animation=&quot;@anim/slide_right&quot; /&gt;
</pre>
<p>Now the animation for Sliding to right.<br />
<strong>slide_right.xml</strong><br />
After applying this animation the View will slide from right side of the screen.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;set xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:interpolator=&quot;@android:anim/accelerate_interpolator&quot; &gt;

    &lt;translate
        android:duration=&quot;@android:integer/config_shortAnimTime&quot;
        android:fromXDelta=&quot;-100%p&quot;
        android:toXDelta=&quot;0&quot; /&gt;

&lt;/set&gt;
</pre>
<p>Our animation XML files are complete.<br />
Now we will  apply this in the layout.<br />
<strong>activity_main.xml</strong></p>
<pre class="brush: xml; title: ; notranslate">
&lt;ListView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    android:id=&quot;@android:id/list&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;match_parent&quot;
    android:layoutAnimation=&quot;@anim/layout_bottom_to_top_slide&quot; /&gt;
</pre>
<p>Now just set this layout as the content of your activity. You can see the animation.<br />
Just like this</p>
<pre class="brush: java; title: ; notranslate">
package com.example.reverseanimationlistviews;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class MainActivity extends ListActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		setListAdapter(new ArrayAdapter&lt;String&gt;(this,
				android.R.layout.simple_list_item_1, mStrings));
	}

	private String[] mStrings = { &quot;CoderzHeaven&quot;, &quot;Android&quot;, &quot;Google&quot;, &quot;iPhone&quot;,
			&quot;Windows Phone&quot;, &quot;Samsung&quot;, &quot;Sony&quot; };
}
</pre>
<p>Note : Changing the delay in the XML, you can change the speed of the animation.</p>
<p>Download the complete Android source code from <a href="https://dl.dropboxusercontent.com/u/91846918/ListView%20Bottom%20Top%20animation/ReverseAnimationListViews.zip" title="Source Code" target="_blank">here</a>.</p>
<div class="su-linkbox" id="post-5362-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/&quot;&gt;ListView Bottom to Top Animation in Android.&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/"     class="crp_title">Cascade animation in a ListView in Android.</a></li><li><a href="http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/"     class="crp_title">GridView RandomFade animation in Android</a></li><li><a href="http://www.coderzheaven.com/2013/04/21/create-rotate-3d-animation-listview-imageview-android/"     class="crp_title">How to create a rotate 3D Animation between a ListView and&hellip;</a></li><li><a href="http://www.coderzheaven.com/2013/04/22/types-animation-push-in-push-out-push-left-in-push-left-out-hyperspace-in-hyperspace-viewflipper-android/"     class="crp_title">Different types of Animation &#8211; Push Up in, Push Up&hellip;</a></li><li><a href="http://www.coderzheaven.com/2011/06/11/simple-view-animation-in-android/"     class="crp_title">Simple View Animation in ANDROID?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a Drawable animation in Android.</title>
		<link>http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/</link>
		<comments>http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/#comments</comments>
		<pubDate>Fri, 03 May 2013 16:47:07 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[addAnimation]]></category>
		<category><![CDATA[Animation Class]]></category>
		<category><![CDATA[Animation Gallery]]></category>
		<category><![CDATA[Animation.INFINITE]]></category>
		<category><![CDATA[Animation.RELATIVE_TO_SELF]]></category>
		<category><![CDATA[Animation.REVERSE]]></category>
		<category><![CDATA[AnimationSet]]></category>
		<category><![CDATA[ArrayAdapter]]></category>
		<category><![CDATA[Attrs]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[BitmapDrawable]]></category>
		<category><![CDATA[Blink]]></category>
		<category><![CDATA[Blinking Text]]></category>
		<category><![CDATA[Centre Image]]></category>
		<category><![CDATA[Color Graphics]]></category>
		<category><![CDATA[Coverflow]]></category>
		<category><![CDATA[CoverFlow in Android - Complete implementation with source code.]]></category>
		<category><![CDATA[createBitmap]]></category>
		<category><![CDATA[createReflectedImages]]></category>
		<category><![CDATA[Deprecation]]></category>
		<category><![CDATA[Gallery Graphics]]></category>
		<category><![CDATA[Gallery Java]]></category>
		<category><![CDATA[getPackageManager]]></category>
		<category><![CDATA[getScale]]></category>
		<category><![CDATA[GridView RandomFade animation in Android]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[Hello Everyone]]></category>
		<category><![CDATA[How to create a blinking text in Android?]]></category>
		<category><![CDATA[ImageAdapter]]></category>
		<category><![CDATA[Implementation]]></category>
		<category><![CDATA[INVISIBLE]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Java Download]]></category>
		<category><![CDATA[Java Package]]></category>
		<category><![CDATA[LinearGradient]]></category>
		<category><![CDATA[Listview]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[Maximum Angle]]></category>
		<category><![CDATA[Menu Menu]]></category>
		<category><![CDATA[Menu Return]]></category>
		<category><![CDATA[Mytext]]></category>
		<category><![CDATA[New Camera]]></category>
		<category><![CDATA[PorterDuffXfermode]]></category>
		<category><![CDATA[Public Int]]></category>
		<category><![CDATA[Public Void]]></category>
		<category><![CDATA[Runnable]]></category>
		<category><![CDATA[setAdapter]]></category>
		<category><![CDATA[setAnimationDuration]]></category>
		<category><![CDATA[setAntiAlias]]></category>
		<category><![CDATA[setContentView]]></category>
		<category><![CDATA[setDuration]]></category>
		<category><![CDATA[setImageBitmap]]></category>
		<category><![CDATA[setImageResource]]></category>
		<category><![CDATA[setLayoutParams]]></category>
		<category><![CDATA[setRepeatCount]]></category>
		<category><![CDATA[setRepeatMode]]></category>
		<category><![CDATA[setScaleType]]></category>
		<category><![CDATA[setSelection]]></category>
		<category><![CDATA[setShader]]></category>
		<category><![CDATA[setStartOffset]]></category>
		<category><![CDATA[setVisibility]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[startAnimation]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[Transformation]]></category>
		<category><![CDATA[TranslateAnimation]]></category>
		<category><![CDATA[Tv Animation]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Zoom]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5352</guid>
		<description><![CDATA[This is a simple example of how to animate a drawable in Android. This example is from the official android demo applications. Here we have 5 java classes. AnimateDrawable.java AnimateDrawables.java GraphicsActivity.java PictureLayout.java ProxyDrawable.java AnimateDrawable.java AnimateDrawables.java GraphicsActivity.java PictureLayout.java ProxyDrawable.java Download the complete source code from here Join the Forum discussion on this post Link to this [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/"     class="crp_title">How to create a beautiful wheel animation in android?</a></li><li><a href="http://www.coderzheaven.com/2013/01/10/draw-arcs-android-canvas/"     class="crp_title">How to draw Arcs in Android using canvas?</a></li><li><a href="http://www.coderzheaven.com/2012/12/17/coverflow-android-complete-implementation-source-code/"     class="crp_title">CoverFlow in Android &#8211; Complete implementation with&hellip;</a></li><li><a href="http://www.coderzheaven.com/2012/01/08/create-image-reflection-android/"     class="crp_title">How to create Image Reflection in Android?</a></li><li><a href="http://www.coderzheaven.com/2011/02/12/draw-primitive-shapes-such-as-rectangle-circle-etc-in-android-a-simple-example/"     class="crp_title">Draw primitive shapes such as rectangle, circle etc in&hellip;</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>This is a simple example of how to animate a drawable in Android.<br />
This example is from the official android demo applications.</p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/Animate%20Drawable/device-2013-05-03-221210.png" alt="Animate Drawable" width='320' height='480' border='2'/></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/Animate%20Drawable/device-2013-05-03-221219.png" alt="Animate Drawable" width='320' height='480' border='2'/></p>
<p>Here we have 5 java classes.<br />
AnimateDrawable.java<br />
AnimateDrawables.java<br />
GraphicsActivity.java<br />
PictureLayout.java<br />
ProxyDrawable.java</p>
<p>AnimateDrawable.java</p>
<pre class="brush: java; title: ; notranslate">
package com.coderzheaven.animatedrawable;

import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Transformation;

public class AnimateDrawable extends ProxyDrawable {

    private Animation mAnimation;
    private Transformation mTransformation = new Transformation();

    public AnimateDrawable(Drawable target) {
        super(target);
    }

    public AnimateDrawable(Drawable target, Animation animation) {
        super(target);
        mAnimation = animation;
    }

    public Animation getAnimation() {
        return mAnimation;
    }

    public void setAnimation(Animation anim) {
        mAnimation = anim;
    }

    public boolean hasStarted() {
        return mAnimation != null &amp;&amp; mAnimation.hasStarted();
    }

    public boolean hasEnded() {
        return mAnimation == null || mAnimation.hasEnded();
    }

    @Override
    public void draw(Canvas canvas) {
        Drawable dr = getProxy();
        if (dr != null) {
            int sc = canvas.save();
            Animation anim = mAnimation;
            if (anim != null) {
                anim.getTransformation(
                                    AnimationUtils.currentAnimationTimeMillis(),
                                    mTransformation);
                canvas.concat(mTransformation.getMatrix());
            }
            dr.draw(canvas);
            canvas.restoreToCount(sc);
        }
    }
}
</pre>
<p>AnimateDrawables.java</p>
<pre class="brush: java; title: ; notranslate">

package com.coderzheaven.animatedrawable;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;

public class AnimateDrawables extends GraphicsActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(new SampleView(this));
    }

    private static class SampleView extends View {
        private AnimateDrawable mDrawable;

        public SampleView(Context context) {
            super(context);
            setFocusable(true);
            setFocusableInTouchMode(true);

            Drawable dr = context.getResources().getDrawable(R.drawable.ic_launcher);
            dr.setBounds(0, 0, dr.getIntrinsicWidth(), dr.getIntrinsicHeight());

            Animation an = new TranslateAnimation(0, 100, 0, 200);
            an.setDuration(2000);
            an.setRepeatCount(-1);
            an.initialize(10, 10, 10, 10);

            mDrawable = new AnimateDrawable(dr, an);
            an.startNow();
        }

        @Override
        protected void onDraw(Canvas canvas) {
            canvas.drawColor(Color.WHITE);

            mDrawable.draw(canvas);
            invalidate();
        }
    }
}
</pre>
<p>GraphicsActivity.java</p>
<pre class="brush: java; title: ; notranslate">
package com.coderzheaven.animatedrawable;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;

class GraphicsActivity extends Activity {
    // set to true to test Picture
    private static final boolean TEST_PICTURE = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public void setContentView(View view) {
        if (TEST_PICTURE) {
            ViewGroup vg = new PictureLayout(this);
            vg.addView(view);
            view = vg;
        }

        super.setContentView(view);
    }
}
</pre>
<p>PictureLayout.java</p>
<pre class="brush: java; title: ; notranslate">

package com.coderzheaven.animatedrawable;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Picture;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;

public class PictureLayout extends ViewGroup {
    private final Picture mPicture = new Picture();

    public PictureLayout(Context context) {
        super(context);
    }

    public PictureLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void addView(View child) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child);
    }

    @Override
    public void addView(View child, int index) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child, index);
    }

    @Override
    public void addView(View child, LayoutParams params) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child, params);
    }

    @Override
    public void addView(View child, int index, LayoutParams params) {
        if (getChildCount() &gt; 1) {
            throw new IllegalStateException(&quot;PictureLayout can host only one direct child&quot;);
        }

        super.addView(child, index, params);
    }

    @Override
    protected LayoutParams generateDefaultLayoutParams() {
        return new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int count = getChildCount();

        int maxHeight = 0;
        int maxWidth = 0;

        for (int i = 0; i &lt; count; i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() != GONE) {
                measureChild(child, widthMeasureSpec, heightMeasureSpec);
            }
        }

        maxWidth += getPaddingLeft() + getPaddingRight();
        maxHeight += getPaddingTop() + getPaddingBottom();

        Drawable drawable = getBackground();
        if (drawable != null) {
            maxHeight = Math.max(maxHeight, drawable.getMinimumHeight());
            maxWidth = Math.max(maxWidth, drawable.getMinimumWidth());
        }

        setMeasuredDimension(resolveSize(maxWidth, widthMeasureSpec),
                resolveSize(maxHeight, heightMeasureSpec));
    }

    private void drawPict(Canvas canvas, int x, int y, int w, int h,
                          float sx, float sy) {
        canvas.save();
        canvas.translate(x, y);
        canvas.clipRect(0, 0, w, h);
        canvas.scale(0.5f, 0.5f);
        canvas.scale(sx, sy, w, h);
        canvas.drawPicture(mPicture);
        canvas.restore();
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        super.dispatchDraw(mPicture.beginRecording(getWidth(), getHeight()));
        mPicture.endRecording();

        int x = getWidth()/2;
        int y = getHeight()/2;

        drawPict(canvas, 0, 0, x, y,  1,  1);
		drawPict(canvas, x, 0, x, y, -1,  1);
		drawPict(canvas, 0, y, x, y,  1, -1);
		drawPict(canvas, x, y, x, y, -1, -1);
    }

    @Override
    public ViewParent invalidateChildInParent(int[] location, Rect dirty) {
        location[0] = getLeft();
        location[1] = getTop();
        dirty.set(0, 0, getWidth(), getHeight());
        return getParent();
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        final int count = super.getChildCount();

        for (int i = 0; i &lt; count; i++) {
            final View child = getChildAt(i);
            if (child.getVisibility() != GONE) {
                final int childLeft = getPaddingLeft();
                final int childTop = getPaddingTop();
                child.layout(childLeft, childTop,
                        childLeft + child.getMeasuredWidth(),
                        childTop + child.getMeasuredHeight());

            }
        }
    }
}
</pre>
<p>ProxyDrawable.java</p>
<pre class="brush: java; title: ; notranslate">
package com.coderzheaven.animatedrawable;

import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.drawable.Drawable;

public class ProxyDrawable extends Drawable {

    private Drawable mProxy;
    private boolean mMutated;

    public ProxyDrawable(Drawable target) {
        mProxy = target;
    }

    public Drawable getProxy() {
        return mProxy;
    }

    public void setProxy(Drawable proxy) {
        if (proxy != this) {
            mProxy = proxy;
        }
    }

    @Override
    public void draw(Canvas canvas) {
        if (mProxy != null) {
            mProxy.draw(canvas);
        }
    }

    @Override
    public int getIntrinsicWidth() {
        return mProxy != null ? mProxy.getIntrinsicWidth() : -1;
    }

    @Override
    public int getIntrinsicHeight() {
        return mProxy != null ? mProxy.getIntrinsicHeight() : -1;
    }

    @Override
    public int getOpacity() {
        return mProxy != null ? mProxy.getOpacity() : PixelFormat.TRANSPARENT;
    }

    @Override
    public void setFilterBitmap(boolean filter) {
        if (mProxy != null) {
            mProxy.setFilterBitmap(filter);
        }
    }

    @Override
    public void setDither(boolean dither) {
        if (mProxy != null) {
            mProxy.setDither(dither);
        }
    }

    @Override
    public void setColorFilter(ColorFilter colorFilter) {
        if (mProxy != null) {
            mProxy.setColorFilter(colorFilter);
        }
    }

    @Override
    public void setAlpha(int alpha) {
        if (mProxy != null) {
            mProxy.setAlpha(alpha);
        }
    }

    @Override
    public Drawable mutate() {
        if (mProxy != null &amp;&amp; !mMutated &amp;&amp; super.mutate() == this) {
            mProxy.mutate();
            mMutated = true;
        }
        return this;
    }
}
</pre>
<p>Download the complete source code from <a href="https://dl.dropboxusercontent.com/u/91846918/Animate%20Drawable/AnimateDrawable.zip" title="Download source code" target="_blank">here</a></p>
<p><a href="http://www.coderzheaven.com/forums/?mingleforumaction=viewtopic&#038;t=19">Join the Forum discussion on this post</a></p>
<div class="su-linkbox" id="post-5352-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/&quot;&gt;Creating a Drawable animation in Android.&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/05/18/create-beautiful-wheel-animation-android/"     class="crp_title">How to create a beautiful wheel animation in android?</a></li><li><a href="http://www.coderzheaven.com/2013/01/10/draw-arcs-android-canvas/"     class="crp_title">How to draw Arcs in Android using canvas?</a></li><li><a href="http://www.coderzheaven.com/2012/12/17/coverflow-android-complete-implementation-source-code/"     class="crp_title">CoverFlow in Android &#8211; Complete implementation with&hellip;</a></li><li><a href="http://www.coderzheaven.com/2012/01/08/create-image-reflection-android/"     class="crp_title">How to create Image Reflection in Android?</a></li><li><a href="http://www.coderzheaven.com/2011/02/12/draw-primitive-shapes-such-as-rectangle-circle-etc-in-android-a-simple-example/"     class="crp_title">Draw primitive shapes such as rectangle, circle etc in&hellip;</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GridView RandomFade animation in Android</title>
		<link>http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/</link>
		<comments>http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/#comments</comments>
		<pubDate>Wed, 01 May 2013 15:47:30 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[GirdView]]></category>
		<category><![CDATA[addAnimation]]></category>
		<category><![CDATA[Animation Class]]></category>
		<category><![CDATA[Animation Gallery]]></category>
		<category><![CDATA[Animation.INFINITE]]></category>
		<category><![CDATA[Animation.RELATIVE_TO_SELF]]></category>
		<category><![CDATA[Animation.REVERSE]]></category>
		<category><![CDATA[AnimationSet]]></category>
		<category><![CDATA[ArrayAdapter]]></category>
		<category><![CDATA[Attrs]]></category>
		<category><![CDATA[Bitmap]]></category>
		<category><![CDATA[BitmapDrawable]]></category>
		<category><![CDATA[Blink]]></category>
		<category><![CDATA[Blinking Text]]></category>
		<category><![CDATA[Centre Image]]></category>
		<category><![CDATA[Color Graphics]]></category>
		<category><![CDATA[Coverflow]]></category>
		<category><![CDATA[CoverFlow in Android - Complete implementation with source code.]]></category>
		<category><![CDATA[createBitmap]]></category>
		<category><![CDATA[createReflectedImages]]></category>
		<category><![CDATA[Deprecation]]></category>
		<category><![CDATA[Gallery Graphics]]></category>
		<category><![CDATA[Gallery Java]]></category>
		<category><![CDATA[getPackageManager]]></category>
		<category><![CDATA[getScale]]></category>
		<category><![CDATA[GridView RandomFade animation in Android]]></category>
		<category><![CDATA[Handler]]></category>
		<category><![CDATA[Hello Everyone]]></category>
		<category><![CDATA[How to create a blinking text in Android?]]></category>
		<category><![CDATA[ImageAdapter]]></category>
		<category><![CDATA[Implementation]]></category>
		<category><![CDATA[INVISIBLE]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[Java Download]]></category>
		<category><![CDATA[Java Package]]></category>
		<category><![CDATA[LinearGradient]]></category>
		<category><![CDATA[Listview]]></category>
		<category><![CDATA[Logic]]></category>
		<category><![CDATA[Matrix]]></category>
		<category><![CDATA[Maximum Angle]]></category>
		<category><![CDATA[Menu Menu]]></category>
		<category><![CDATA[Menu Return]]></category>
		<category><![CDATA[Mytext]]></category>
		<category><![CDATA[New Camera]]></category>
		<category><![CDATA[PorterDuffXfermode]]></category>
		<category><![CDATA[Public Int]]></category>
		<category><![CDATA[Public Void]]></category>
		<category><![CDATA[Runnable]]></category>
		<category><![CDATA[setAdapter]]></category>
		<category><![CDATA[setAnimationDuration]]></category>
		<category><![CDATA[setAntiAlias]]></category>
		<category><![CDATA[setContentView]]></category>
		<category><![CDATA[setDuration]]></category>
		<category><![CDATA[setImageBitmap]]></category>
		<category><![CDATA[setImageResource]]></category>
		<category><![CDATA[setLayoutParams]]></category>
		<category><![CDATA[setRepeatCount]]></category>
		<category><![CDATA[setRepeatMode]]></category>
		<category><![CDATA[setScaleType]]></category>
		<category><![CDATA[setSelection]]></category>
		<category><![CDATA[setShader]]></category>
		<category><![CDATA[setStartOffset]]></category>
		<category><![CDATA[setVisibility]]></category>
		<category><![CDATA[Sleep]]></category>
		<category><![CDATA[Source Code]]></category>
		<category><![CDATA[startAnimation]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[Transformation]]></category>
		<category><![CDATA[TranslateAnimation]]></category>
		<category><![CDATA[Tv Animation]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[Zoom]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5318</guid>
		<description><![CDATA[In some of my older posts I have already showed a lot of animations on ListView and GridViews. Search coderzheaven for ListView and GridView animations if you want to see the articles and posts. This is also yet another post on animation. Here what I will do is create an animation in a GridView such [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/04/26/multiple-selection-listview-android/"     class="crp_title">Multiple Selection GridView in Android</a></li><li><a href="http://www.coderzheaven.com/2013/03/22/create-simple-app-launcher-android/"     class="crp_title">How to create a simple App Launcher in Android?</a></li><li><a href="http://www.coderzheaven.com/2011/03/09/using-gridview-in-android-2/"     class="crp_title">Using GridView in ANDROID&#8230;.</a></li><li><a href="http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/"     class="crp_title">ListView Bottom to Top Animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2012/02/29/custom-gridview-in-android-a-simple-example/"     class="crp_title">Custom GridView in android. A simple example.</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>In some of my older posts I have already showed a lot of animations on <a href="http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/" title="Cascade animation in a ListView in Android.">ListView</a> and GridViews. Search coderzheaven for ListView and GridView animations if you want to see the articles and posts.</p>
<p>This is also yet another post on animation. Here what I will do is create an animation in a <a href="http://www.coderzheaven.com/2013/04/26/multiple-selection-listview-android/" title="Multiple Selection GridView in Android">GridView</a> such that all cells will appear &#8220;RANDOM&#8221; with a fade animation.</p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/GridView%20Random%20Animation/device-2013-05-01-211132.png" alt="GridView Random Animation" width='320' height='480' border='1' /><br />
<img src="https://dl.dropboxusercontent.com/u/91846918/GridView%20Random%20Animation/device-2013-05-01-211139.png" alt="GridView Random Animation" width='320' height='480' border='1' /></p>
<p>So we will start</p>
<p>Click on the download link to download the code.</p>
<p>We will start with the animation XML first.</p>
<p>First create a folder named &#8220;anim&#8221; inside the &#8220;res&#8221; folder of your <a href="http://www.coderzheaven.com/2013/04/07/create-simple-popup-menu-android/" title="How to create a simple PopUp Menu in Android?">project</a>.<br />
Inside it create fade.xml and copy this code into it.</p>
<p>fade.xml</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;alpha xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
       android:interpolator=&quot;@android:anim/accelerate_interpolator&quot;
       android:fromAlpha=&quot;0.0&quot; android:toAlpha=&quot;1.0&quot;
       android:duration=&quot;@android:integer/config_longAnimTime&quot; /&gt;
</pre>
<p>Then create anotther xml file named &#8220;layout_random_fade.xml&#8221; and copy this code into it.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;layoutAnimation xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
        android:delay=&quot;0.5&quot;
        android:animationOrder=&quot;random&quot;
        android:animation=&quot;@anim/fade&quot; /&gt;
</pre>
<p>This is the factor that creates the random animation.<br />
 android:animationOrder=&#8221;random&#8221;</p>
<p> And this one creates the fade animation.<br />
  android:animation=&#8221;@anim/fade&#8221; </p>
<p>Now we will write the activity that uses the gridview to create the animation.</p>
<pre class="brush: java; title: ; notranslate">
package com.coderzheaven.gridviewrandomfadeanimation;

import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;

public class MainActivity extends Activity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		loadApps();

		setContentView(R.layout.activity_main);
		GridView grid = (GridView) findViewById(R.id.grid);
		grid.setAdapter(new AppsAdapter());

	}

	private List&lt;ResolveInfo&gt; mApps;

	private void loadApps() {
		Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
		mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);

		mApps = getPackageManager().queryIntentActivities(mainIntent, 0);
	}

	public class AppsAdapter extends BaseAdapter {
		public View getView(int position, View convertView, ViewGroup parent) {
			ImageView i = new ImageView(MainActivity.this);

			ResolveInfo info = mApps.get(position % mApps.size());

			i.setImageDrawable(info.activityInfo.loadIcon(getPackageManager()));
			i.setScaleType(ImageView.ScaleType.FIT_CENTER);
			final int w = (int) (36 * getResources().getDisplayMetrics().density + 0.5f);
			i.setLayoutParams(new GridView.LayoutParams(w, w));
			return i;
		}

		public final int getCount() {
			return Math.min(32, mApps.size());
		}

		public final Object getItem(int position) {
			return mApps.get(position % mApps.size());
		}

		public final long getItemId(int position) {
			return position;
		}
	}
}

</pre>
<p>Ok Now it&#8217;s done. Run the project and see the result.</p>
<p>You can download the complete java android sample code from <a href="https://dl.dropboxusercontent.com/u/91846918/GridView%20Random%20Animation/GridViewRandomFadeAnimation.zip" title="Sample Android Code" target="_blank">here</a>.</p>
<div class="su-linkbox" id="post-5318-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/&quot;&gt;GridView RandomFade animation in Android&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/04/26/multiple-selection-listview-android/"     class="crp_title">Multiple Selection GridView in Android</a></li><li><a href="http://www.coderzheaven.com/2013/03/22/create-simple-app-launcher-android/"     class="crp_title">How to create a simple App Launcher in Android?</a></li><li><a href="http://www.coderzheaven.com/2011/03/09/using-gridview-in-android-2/"     class="crp_title">Using GridView in ANDROID&#8230;.</a></li><li><a href="http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/"     class="crp_title">ListView Bottom to Top Animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2012/02/29/custom-gridview-in-android-a-simple-example/"     class="crp_title">Custom GridView in android. A simple example.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cascade animation in a ListView in Android.</title>
		<link>http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/</link>
		<comments>http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/#comments</comments>
		<pubDate>Tue, 30 Apr 2013 18:00:33 +0000</pubDate>
		<dc:creator>James</dc:creator>
				<category><![CDATA[ANDROID]]></category>
		<category><![CDATA[Animation]]></category>
		<category><![CDATA[ListView]]></category>
		<category><![CDATA[addAnimation]]></category>
		<category><![CDATA[Animation.RELATIVE_TO_SELF]]></category>
		<category><![CDATA[AnimationSet]]></category>
		<category><![CDATA[ArrayAdapter]]></category>
		<category><![CDATA[Listview]]></category>
		<category><![CDATA[setDuration]]></category>
		<category><![CDATA[TranslateAnimation]]></category>

		<guid isPermaLink="false">http://www.coderzheaven.com/?p=5311</guid>
		<description><![CDATA[Here is a simple example for cascade animation of a listview in android. We use these classes for achieving this. 1. AnimationSet Represents a group of Animations that should be played together. The transformation of each individual animation are composed together into a single transform. If AnimationSet sets any properties that its children also set [...]<div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/"     class="crp_title">ListView Bottom to Top Animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/"     class="crp_title">GridView RandomFade animation in Android</a></li><li><a href="http://www.coderzheaven.com/2012/04/07/sprite-animations-without-sprite-sheets/"     class="crp_title">Sprite Animations Without Sprite Sheets</a></li><li><a href="http://www.coderzheaven.com/2011/06/11/simple-view-animation-in-android/"     class="crp_title">Simple View Animation in ANDROID?</a></li><li><a href="http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/"     class="crp_title">Creating a Drawable animation in Android.</a></li></ul></div>]]></description>
				<content:encoded><![CDATA[<p>Here is a simple example for cascade animation of a listview in android.</p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/device-2013-04-30-232640.png" alt="ListView cascade" width='320' height='480' border='1'/></p>
<p><img src="https://dl.dropboxusercontent.com/u/91846918/device-2013-04-30-232654.png" alt="ListView cascade" width='320' height='480' border='1' /></p>
<p>We use these classes for achieving this.</p>
<p>1. <strong><a href="http://developer.android.com/reference/android/view/animation/AnimationSet.html" title="http://developer.android.com/reference/android/view/animation/AnimationSet.html" target="_blank">AnimationSet </a></strong><br />
Represents a group of Animations that should be played together. The transformation of each individual animation are composed together into a single transform. If AnimationSet sets any properties that its children also set (for example, duration or fillBefore), the values of AnimationSet override the child values.</p>
<p>The way that AnimationSet inherits behavior from Animation is important to understand. Some of the Animation attributes applied to AnimationSet affect the AnimationSet itself, some are pushed down to the children, and some are ignored, as follows:</p>
<p>duration, repeatMode, fillBefore, fillAfter: These properties, when set on an AnimationSet object, will be pushed down to all child animations.<br />
repeatCount, fillEnabled: These properties are ignored for AnimationSet.<br />
startOffset, shareInterpolator: These properties apply to the AnimationSet itself.</p>
<p>2. <strong>TranslateAnimation</strong></p>
<p>Read about TranslateAnimation classes <a href="http://developer.android.com/reference/android/view/animation/TranslateAnimation.html" title="http://developer.android.com/reference/android/view/animation/TranslateAnimation.html" target="_blank">here</a>.</p>
<p><strong><a href="http://developer.android.com/reference/android/view/animation/LayoutAnimationController.html" title="http://developer.android.com/reference/android/view/animation/LayoutAnimationController.html" target="_blank">LayoutAnimationController</a></strong><br />
A layout animation controller is used to animated a layout&#8217;s, or a view group&#8217;s, children. Each child uses the same animation but for every one of them, the animation starts at a different time. A layout animation controller is used by ViewGroup to compute the delay by which each child&#8217;s animation start must be offset. The delay is computed by using characteristics of each child, like its index in the view group. This standard implementation computes the delay by multiplying a fixed amount of miliseconds by the index of the child in its parent view group. Subclasses are supposed to override getDelayForView(android.view.View) to implement a different way of computing the delay. For instance, a GridLayoutAnimationController will compute the delay based on the column and row indices of the child in its parent view group. Information used to compute the animation delay of each child are stored in an instance of LayoutAnimationController.AnimationParameters, itself stored in the ViewGroup.LayoutParams of the view.</p>
<p>Just copy this simple code to your activity and see the cascading animation in the ListView.</p>
<pre class="brush: java; title: ; notranslate">
package com.coderzheaven.listcascadeanimation;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.LayoutAnimationController;
import android.view.animation.TranslateAnimation;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MainActivity extends ListActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setListAdapter(new ArrayAdapter&lt;String&gt;(this,
                android.R.layout.simple_list_item_1, mStrings));

        AnimationSet set = new AnimationSet(true);

        Animation animation = new AlphaAnimation(0.0f, 1.0f); 
        animation.setDuration(500);
        set.addAnimation(animation);

        animation = new TranslateAnimation(
            Animation.RELATIVE_TO_SELF, 0.0f,Animation.RELATIVE_TO_SELF, 0.0f,
            Animation.RELATIVE_TO_SELF, -1.0f,Animation.RELATIVE_TO_SELF, 0.0f
        );
        animation.setDuration(100);
        set.addAnimation(animation);

        LayoutAnimationController controller = new LayoutAnimationController(set, 0.5f);
        ListView listView = getListView();        
        listView.setLayoutAnimation(controller);
    }

    private String[] mStrings = {
        &quot;Bordeaux&quot;,
        &quot;Lyon&quot;,
        &quot;Marseille&quot;,
        &quot;Nancy&quot;,
        &quot;Paris&quot;,
        &quot;Toulouse&quot;,
        &quot;Strasbourg&quot;
    };
}
</pre>
<div class="su-linkbox" id="post-5311-linkbox"><div class="su-linkbox-label">Link to this post!</div><div class="su-linkbox-field"><input type="text" value="&lt;a href=&quot;http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/&quot;&gt;Cascade animation in a ListView in Android.&lt;/a&gt;" onclick="javascript:this.select()" readonly="readonly" style="width: 100%;" /></div></div><div class="crp_related"><h3><font color="#FF0000">More Similar Posts </font></h3><ul><li><a href="http://www.coderzheaven.com/2013/05/10/listview-bottom-top-animation-android/"     class="crp_title">ListView Bottom to Top Animation in Android.</a></li><li><a href="http://www.coderzheaven.com/2013/05/01/gridview-randomfade-animation-android/"     class="crp_title">GridView RandomFade animation in Android</a></li><li><a href="http://www.coderzheaven.com/2012/04/07/sprite-animations-without-sprite-sheets/"     class="crp_title">Sprite Animations Without Sprite Sheets</a></li><li><a href="http://www.coderzheaven.com/2011/06/11/simple-view-animation-in-android/"     class="crp_title">Simple View Animation in ANDROID?</a></li><li><a href="http://www.coderzheaven.com/2013/05/03/creating-drawable-animation-android/"     class="crp_title">Creating a Drawable animation in Android.</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.coderzheaven.com/2013/04/30/cascade-animation-listview-android/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 1.385 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-26 01:43:55 -->
