From b7a32e2b7a0fd8c48044d1e23e9ab51fc734eefc Mon Sep 17 00:00:00 2001 From: wasabeef Date: Mon, 12 Jan 2015 00:51:22 +0900 Subject: [PATCH] add sample name --- .../jp/wasabeef/example/glide/MainAdapter.java | 6 ++++++ example/src/main/res/layout/layout_list_item.xml | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/example/src/main/java/jp/wasabeef/example/glide/MainAdapter.java b/example/src/main/java/jp/wasabeef/example/glide/MainAdapter.java index 1bb99d3..b4d5702 100644 --- a/example/src/main/java/jp/wasabeef/example/glide/MainAdapter.java +++ b/example/src/main/java/jp/wasabeef/example/glide/MainAdapter.java @@ -4,6 +4,8 @@ import com.bumptech.glide.Glide; import com.bumptech.glide.load.Transformation; import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool; +import org.w3c.dom.Text; + import android.content.Context; import android.graphics.Bitmap; import android.graphics.Color; @@ -12,6 +14,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; +import android.widget.TextView; import java.util.List; @@ -84,6 +87,7 @@ public class MainAdapter extends RecyclerView.Adapter { Glide.with(mContext).load(R.drawable.demo) .bitmapTransform(transformation).into(holder.image); + holder.title.setText(mDataSet.get(position).name()); } @Override @@ -94,10 +98,12 @@ public class MainAdapter extends RecyclerView.Adapter { static class ViewHolder extends RecyclerView.ViewHolder { public ImageView image; + public TextView title; ViewHolder(View itemView) { super(itemView); image = (ImageView) itemView.findViewById(R.id.image); + title = (TextView) itemView.findViewById(R.id.title); } } } diff --git a/example/src/main/res/layout/layout_list_item.xml b/example/src/main/res/layout/layout_list_item.xml index 4297dcf..0355c27 100644 --- a/example/src/main/res/layout/layout_list_item.xml +++ b/example/src/main/res/layout/layout_list_item.xml @@ -6,9 +6,19 @@ + android:layout_centerInParent="true" + android:contentDescription="@null" + android:src="@drawable/demo"/> + + \ No newline at end of file