SampleContactsAdapter(Context context) { super(context, null, 0); inflater = LayoutInflater.from(context); }
PicassoSampleAdapter(Context context) { inflater = LayoutInflater.from(context); }
/** * Sets the layout resource for a custom MarkerView. * * @param layoutResource */ private void setupLayoutResource(int layoutResource) { View inflated = LayoutInflater.from(getContext()).inflate(layoutResource, this); inflated.setLayoutParams(new LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT)); inflated.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); // measure(getWidth(), getHeight()); inflated.layout(0, 0, inflated.getMeasuredWidth(), inflated.getMeasuredHeight()); }
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new ViewHolder(LayoutInflater.from(parent.getContext()) .inflate(R.layout.image_card, parent, false)); }
FlickrPhotoListAdapter() { this.inflater = LayoutInflater.from(getActivity()); }
PhotoAdapter() { this.inflater = LayoutInflater.from(getActivity()); }
public static ItemViewHolder newInstance(ViewGroup parent) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_sample, parent, false); return new ItemViewHolder(view); }
public static ImageViewHolder inflate(ViewGroup parent) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_image, parent, false); return new ImageViewHolder(view); }
ItemAdapter(Context context) { mInflater = LayoutInflater.from(context); dateFormat = SimpleDateFormat.getDateInstance(DateFormat.DEFAULT, Locale.ENGLISH); }
@Override public SmartViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new SmartViewHolder(LayoutInflater.from(parent.getContext()).inflate(mLayoutId, parent, false),mListener); }
@Override public QueueItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { TextView v = (TextView) LayoutInflater.from(parent.getContext()) .inflate(android.R.layout.simple_list_item_1, parent, false); return new QueueItemViewHolder(v); }
@Override public NotesAdapter.NoteViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_note, parent, false); return new NoteViewHolder(view, clickListener); }
@Override public SimpleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.recyclerview_item, parent, false); return new SimpleViewHolder(view); }
@Override public NotesAdapter.NoteViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_note, parent, false); return new NoteViewHolder(view, clickListener); }
/** * This method returns the ViewHolder for our item, using the provided View. * * @param parent * @return the ViewHolder for this Item */ @Override public VH getViewHolder(ViewGroup parent) { return getViewHolder(LayoutInflater.from(parent.getContext()).inflate(getLayoutRes(), parent, false)); }
/** * generates a view by the defined LayoutRes * * @param ctx * @return */ @Override public View generateView(Context ctx) { VH viewHolder = getViewHolder(LayoutInflater.from(ctx).inflate(getLayoutRes(), null, false)); bindView(viewHolder, Collections.emptyList()); return viewHolder.itemView; }
ImageAdapter(Context context) { inflater = LayoutInflater.from(context); options = new DisplayImageOptions.Builder() .showImageOnLoading(R.drawable.ic_stub) .showImageForEmptyUri(R.drawable.ic_empty) .showImageOnFail(R.drawable.ic_error) .cacheInMemory(true) .cacheOnDisk(true) .considerExifParams(true) .bitmapConfig(Bitmap.Config.RGB_565) .build(); }
ImageAdapter(Context context) { inflater = LayoutInflater.from(context); options = new DisplayImageOptions.Builder() .showImageOnLoading(R.drawable.ic_stub) .showImageForEmptyUri(R.drawable.ic_empty) .showImageOnFail(R.drawable.ic_error) .cacheInMemory(true) .cacheOnDisk(true) .considerExifParams(true) .displayer(new CircleBitmapDisplayer(Color.WHITE, 5)) .build(); }
ImageAdapter(Context context) { inflater = LayoutInflater.from(context); options = new DisplayImageOptions.Builder() .showImageForEmptyUri(R.drawable.ic_empty) .showImageOnFail(R.drawable.ic_error) .resetViewBeforeLoading(true) .cacheOnDisk(true) .imageScaleType(ImageScaleType.EXACTLY) .bitmapConfig(Bitmap.Config.RGB_565) .considerExifParams(true) .displayer(new FadeInBitmapDisplayer(300)) .build(); }
ImageAdapter(Context context) { inflater = LayoutInflater.from(context); options = new DisplayImageOptions.Builder() .showImageOnLoading(R.drawable.ic_stub) .showImageForEmptyUri(R.drawable.ic_empty) .showImageOnFail(R.drawable.ic_error) .cacheInMemory(true) .cacheOnDisk(true) .considerExifParams(true) .bitmapConfig(Bitmap.Config.RGB_565) .displayer(new RoundedBitmapDisplayer(20)) .build(); }