Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

public void onDragPositionsChanged() no getting called #69

Open
sjayadeep opened this issue Jun 27, 2015 · 0 comments
Open

public void onDragPositionsChanged() no getting called #69

sjayadeep opened this issue Jun 27, 2015 · 0 comments

Comments

@sjayadeep
Copy link

I used Dynamic grid library

but onDragPositsionCHanged library not getting called and the positions are not changing the.
I can drag and onDragStarted is also working.
But when i drop item moves to first location and then back to its original position. no changes literally.

MyAdapter Class.

public class DynamicDrawerAdapter extends BaseDynamicGridAdapter {

Context mContext;
Pac[] pacsForAdapter;
String mSource;

public DynamicDrawerAdapter(Context context,Pac[] pacs, int columnCount) {
    super(context,columnCount);
    pacsForAdapter = pacs;
    mContext = context;
    mSource = "mini";
}

@Override
public int getCount() {
    // TODO Auto-generated method stub

    return pacsForAdapter.length;
}

@Override
public Object getItem(int arg0) {
    // TODO Auto-generated method stub
    return null;
}


static class ViewHolder{
    TextView text;
    ImageView icon;
}

@Override
public View getView(int pos, View convertView, ViewGroup arg2) {
    // TODO Auto-generated method stub

    ViewHolder viewHolder;
    LayoutInflater layoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

    if (convertView == null){
        convertView = layoutInflater.inflate(R.layout.drawer_item, null);
        viewHolder = new ViewHolder();
        viewHolder.text = (TextView)convertView.findViewById(R.id.icon_text);
        viewHolder.icon = (ImageView)convertView.findViewById(R.id.icon_image);
        convertView.setTag(viewHolder);

    }else{
        viewHolder = (ViewHolder) convertView.getTag();

    }


    viewHolder.icon.setImageDrawable(pacsForAdapter[pos].icon);

    if (mSource.equals("mini")){
        viewHolder.text.setVisibility(View.GONE);
    }else {
        viewHolder.text.setText(pacsForAdapter[pos].label);
    }

    return convertView;
}

}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant