CircleAnimation icon indicating copy to clipboard operation
CircleAnimation copied to clipboard

Not working in case of listview

Open manpreetsinghsodhi opened this issue 9 years ago • 0 comments

I have a listview with each listitem shown in xml. But when i use the library there, the effect is not coming well.

Here is my xml of each list item

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content"

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginBottom="10dp"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp"
    android:layout_marginTop="10dp"
 >

    <ImageView
        android:id="@+id/icon"
        android:layout_width="fill_parent"
        android:layout_height="350dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:background="#212121"

        android:scaleType="centerCrop" />

    <ImageView
        android:id="@+id/btn_go"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:layout_marginTop="20dp"
            android:focusable="false"
        android:focusableInTouchMode="false"
        android:scaleType="centerCrop"
        android:src="@drawable/heart_detail" />

    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:layout_alignParentLeft="true"
        android:layout_marginTop="20dp"
        android:paddingLeft="20dp"
        android:textColor="#ffffff"
        android:textSize="27sp" />

    <TextView
        android:id="@+id/textview"
        android:layout_width="wrap_content"
        android:layout_height="50dp"
        android:layout_below="@+id/text"
        android:paddingBottom="20dp"
        android:paddingLeft="20dp"
        android:textColor="#ffffff"
        android:textSize="20sp" />
</RelativeLayout>

and here is my adapter on which i m calling this library private class ViewHolder { ImageView imageView, img; TextView t, t_price; }

public View getView(final int position, View convertView, ViewGroup parent) {
 holder = null;
    RowItem rowItem = getItem(position);

    Log.v("position global", position + "");
    val = position;
    LayoutInflater mInflater = (LayoutInflater) context
            .getSystemService(Activity.LAYOUT_INFLATER_SERVICE);
    if (convertView == null) {
        convertView = mInflater.inflate(R.layout.item, null);
        holder = new ViewHolder();

        holder.imageView = (ImageView) convertView.findViewById(R.id.icon);
        holder.img = (ImageView) convertView.findViewById(R.id.btn_go);
        holder.t = (TextView) convertView.findViewById(R.id.textview);
        holder.t_price = (TextView) convertView.findViewById(R.id.text);

        holder.img.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

                Log.v("pos is", position + "");
                System.out.println("position is" + position);

                //host = MainActivity.hostd.get(position).toString();
                new CircleAnimationUtil().attachActivity((Activity) context).setTargetView(holder.imageView).setDestView(holder.img).startAnimation();
                //new wishlist().execute();
            }
        });
        convertView.setTag(holder);
    } else
        holder = (ViewHolder) convertView.getTag();

    holder.t.setText(rowItem.getText());
    holder.t_price.setText("Rs. " + rowItem.getAmount());
    Picasso.with(context).load(rowItem.getImageId())

    .into(holder.imageView);
    return convertView;
}

manpreetsinghsodhi avatar Jul 20 '15 06:07 manpreetsinghsodhi