SwipeStack
SwipeStack copied to clipboard
cannot use with Picasso ?
my card.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_height="match_parent"
android:layout_width="match_parent"
card_view:cardCornerRadius="@dimen/card_corner_radius"
card_view:cardElevation="@dimen/elevation_large">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ivCard"
android:src="@drawable/placeholder" />
<TextView
android:id="@+id/textViewCard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:textSize="44sp"
android:text="@string/dummy_text"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
my adapter
...
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
holder = null;
if (convertView == null) {
holder = new ViewHolder();
convertView = getLayoutInflater().inflate(R.layout.card, parent, false);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.ivCard = (ImageView) convertView.findViewById(R.id.ivCard);
Picasso.with(mContext).load(mData.get(position).getUrl()).resize(480, 480).centerCrop().into(holder.ivCard);
Log.e("555",mData.get(position).getUrl());
holder.tvCard = (TextView) convertView.findViewById(R.id.textViewCard);
holder.tvCard.setText(mData.get(position).getWho());
return convertView;
}
public class ViewHolder {
ImageView ivCard;
TextView tvCard;
}
...
it only display the text (from the internet but no luck with ImageView to display image (from URL) via Picasso)
+1 Same problem here.
Strange. I'm Picasso and it works. Is the swipe stack taking the entire screen space? Along with setting wrap_content in height and width of imageview, try and set and minimum height and width in the imageview. If it displays the image (or part of it), that might mean the swipe stack hasn't inflated to the size required by the imageview.