Hi Guys,

I have an issue with a gallery view only on the new Motorola Xoom 2
which is running 3.2.2. The gallery has each thumb on top of each
other so you can only see one image at a time.

Here is the code:

XML looks like this:

<FrameLayout
                android:layout_width="fill_parent"
                android:layout_height="324dp"
                android:layout_alignParentBottom="true">

            <Gallery
                android:id="@+id/GalleryHorizontalListView"
                android:layout_width="fill_parent"
                android:layout_height="324dp"
                android:spacing="0dp"></Gallery>

</FrameLayout>

Adapter looks like this:

public class MoviesGalleryAdapter extends BaseAdapter
        {
            List<Movie> MovieItemObjects = new ArrayList<Movie>();

            private View currentView;
            private int currentPosition = 0;
            private int totalCount = 0;

            public void setTotalCount(int total) {
                totalCount = total;
            }

            public void setModel(List<Movie> items){
                this.MovieItemObjects = items;
                notifyDataSetChanged();
            }

            public void updateModel(List<Movie> items){
                this.MovieItemObjects.addAll(items);
                notifyDataSetChanged();
            }

            public void SetCurrentPosition(int pos) {
                currentPosition = pos;
            }

            public View getSelectedView() {
                return currentView;
            }

         //   public void setActivated(int position) {
           //   currentlySelectedItem = position;
            //}

                @Override
                public int getCount() {
                        //return count;
                        if (MovieItemObjects.size() > 0) {
                                return this.MovieItemObjects.size();
                        }
                        return 0;
                }

                @Override
                public long getItemId(int position) {
                        return position;
                }

                @Override
                public Object getItem(int idx) {
                        return (MovieItemObjects != null) ? 
MovieItemObjects.get(idx) :
null;
                }

                @Override
                public boolean hasStableIds(){
                        return true;
                }

                @Override
                public int getItemViewType(int pos){
                        return 0;
                }

                @Override
                public int getViewTypeCount(){
                        return 1;
                }

                @Override
                public View getView(int position, View convertView, final 
ViewGroup
parent)
                {
                ViewHolder holder = null;

                if (convertView == null) {
                        convertView =
LayoutInflater.from(parent.getContext()).inflate(R.layout.movieitem,
null, false);

                        holder = new ViewHolder();
                        holder.iv = (ImageView)
convertView.findViewById(R.id.image);

                        convertView.setTag(holder);
                } else {
                    holder = (ViewHolder)convertView.getTag();
                }

                if (currentPosition == position) {
                        //convertView.setActivated(true);
                        //MovieItemView = convertView;
                }

                if (MovieItemObjects.size() > 0) {
                        try {
                                Movie item = MovieItemObjects.get(position);

                                
_ImageLoader.DisplayImage(item.coverImageMedium, holder.iv,
172, 250);
                        } catch (Exception e) {}
                }

                return convertView;

                }
        };

and the xml to inflate looks like this:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android";
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <ImageView
                android:id="@+id/image"
                android:layout_width="172dip"
                android:layout_height="250dip"
                android:scaleType="fitXY"
                android:layout_gravity="center_vertical"
                android:layout_marginTop="18dp"
                android:layout_marginRight="10dip"
                android:paddingLeft="3dip"
                android:paddingRight="3dip"
                android:paddingBottom="3dip"
                android:paddingTop="3dip"/>

        <!--  <ImageView android:id="@+id/throbber"
        android:layout_width="wrap_content"
                android:layout_height="wrap_content"
        android:src="@drawable/ic_popup_sync_1"
        android:visibility="gone"/>-->

</LinearLayout>

Any help would be appreciated.

Cheers,

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to