Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drag and Drop is not working when we use custom adapter with ImageView #145

Open
kaminiprasad opened this issue Aug 28, 2015 · 0 comments
Open

Comments

@kaminiprasad
Copy link

Hi, am trying to implement drag and drop functionality using drag-sort-listview. But when I implement with custom adapter with image and text, sorting is not done if we change the positions of the view(i.e images don't change their position). Can some help me. Below is is my getView(-,-,-) in customadapter.

Does this lib work when we try to sort of images ?
device-2015-08-28-130653

public View getView(int position, View convertView, ViewGroup parent) {

        ListViewHolder holder=null;
        if(convertView==null){

            LayoutInflater inflater = LayoutInflater.from(context);
            convertView = inflater.inflate(R.layout.pptimagelist_row_item, parent, false);
            holder = new ListViewHolder();


            holder.imageViewImageListRowItem = (ImageView) convertView.findViewById(R.id.imageViewImageListRowItem);
            holder.imageViewListRowItemView = (ImageView) convertView.findViewById(R.id.imageViewListRowItemView);
            holder.imageViewListRowItemDelete = (ImageView) convertView.findViewById(R.id.imageViewListRowItemDelete);
            holder.imageViewListRowItemDrag = (ImageView) convertView.findViewById(R.id.imageViewListRowItemDrag);

            holder.textViewImageListRowItemTitle = (TextView) convertView.findViewById(R.id.textViewImageListRowItemTitle);
            holder.textViewImageListRowItemDescription = (TextView) convertView.findViewById(R.id.textViewImageListRowItemDescription);

            holder.belowText = (TextView) convertView.findViewById(R.id.below_text);
            holder.textViewImageListRowItemDescription.setVisibility(View.GONE);


            holder.textViewImageListRowItemTitle.setText(presItems.get(position).getChapterName());   


            if(presItems.get(position).getImageUri() != null){
                holder.imageViewImageListRowItem.setImageURI(Uri.parse(presItems.get(position).getImageUri()));
            }


            convertView.setTag(holder);

        }else{
            holder=(ListViewHolder) convertView.getTag();
        }
        return convertView;
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant