Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
GridView elements changes their place when scroll screen
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Beginner  
View profile  
 More options Oct 6 2012, 12:01 pm
From: Beginner <infoshore1...@gmail.com>
Date: Sat, 6 Oct 2012 09:01:33 -0700 (PDT)
Local: Sat, Oct 6 2012 12:01 pm
Subject: GridView elements changes their place when scroll screen

@Override
        public View getView(int position, View convertView, ViewGroup parent) {
            final ImageView imageView;
            TextView  textView  = null;
            View childView = null;

            int numTopics = mProductListDetail.getNumTopics();

            if(convertView == null) {  // if it's not recycled, initialize some attributes
               int layoutId = R.layout.prod_list_item;
               LayoutInflater li =  ((Activity) mContext).getLayoutInflater();
               childView = li.inflate (layoutId, null);
            }
            else {
                childView = convertView;
            }

            if (childView != null) {
               // Set the width and height of the child view.
                //width=110 height=90
                if(ProductListing.height < 400)
                    childView.setLayoutParams(new GridView.LayoutParams(110, 90));
                else
                    childView.setLayoutParams(new GridView.LayoutParams(mCellWidth, mCellHeight));

               int j = position + mImageOffset;

               imageView = (ImageView) childView.findViewById (R.id.image);

                try{
                        imageLoader.loadImage(mProductListDetail.getTopicImage(j), new ImageLoadedListener() {
                        public void imageLoaded(Bitmap imageBitmap)
                        {
                            imageView.setImageBitmap(imageBitmap);
                            imageView.invalidate();  
                        }
                    });
                }
                catch (Exception e) {
                    Log.d("VM", "Exceptio in "+e.getMessage());
                }

                imageView.setBackgroundResource (R.drawable.border);

                if (imageView != null) {
                Resources res = mContext.getResources ();
                int imagePadding = res.getDimensionPixelSize (R.dimen.grid_image_padding);
                imageView.setPadding (imagePadding, imagePadding, imagePadding, imagePadding);
                imageView.setTag (new Integer(j));
               }

               textView = (TextView) childView.findViewById (R.id.title);
               if (textView != null) {
                  textView.setText(mProductListDetail.getTopicTitle (j));
                  textView.setTag (new Integer (j));
               }
            }
            return childView;
        }

I am using a grid view layout and have 8 images on a screen, when i scroll
down and up images change such as first image showing second last images
showing on second last...It means when you load image they are at correct
position where i want, but when i scroll down and up the images change
position..ho![images on screen]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »