How to implemented gallery View used to display images repea

Tutorials concerning the OpenGL® ES cross-platform API for full-function 2D and 3D graphics on the Google-Android platform.

How to implemented gallery View used to display images repea

Postby narasimharao » Mon Aug 02, 2010 12:29 pm

Hi

I am new in android I am implementing Gallery application i am using views in 21 scrolling 1..21 last adding repeatly first image its working fine in back images scrolling 1 image not aading 21-2 images how can implemented in gallery back views repeatedly i am forward screen shots please forward some idea

backscreenshot [1]: [1]:

Image ![alt text][1] public View getView(int position, View convertView, ViewGroup parent) {

ImageView i = new ImageView(mContext);
position=checkPosition(position);
Log.v("returned Position","$$$$$$$$$$$$4"+position);
if(position>21){
position=0;
}
else
{
if(position==-1)
{
position=20;
}
}
i.setImageResource(mImageIds[position]);
i.setLayoutParams(new Gallery.LayoutParams(120, 160));
i.setScaleType(ImageView.ScaleType.FIT_XY);
i.setBackgroundResource(mGalleryItemBackground);
return i;

}
public int checkPosition(int position)
{
Log.v("Check","position--Before"+position);
if (position > mImageIds.length)
{

position = position % mImageIds.length;
}
//Log.v("Check","position"+position);

return position;
}
} i am implementing this code last image after adding images working fine in back scrolling first image not adding last images
narasimharao
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Apr 05, 2010 12:40 pm
Location: hyderabad

Top

Return to Android 2D/3D Graphics - OpenGL Tutorials

Who is online

Users browsing this forum: No registered users and 4 guests