@Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mItem = mValues.get(position); holder.mContentView.setText(mValues.get(position).text); holder.mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (mListener != null) { mListener.onClick(holder.mItem); } } }); holder.mView.setOnLongClickListener( new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { if (mListener != null) { mListener.onLongClick(holder.mItem); return true; } return false; } }); }
@Override public void onBindViewHolder(final ViewHolder holder, final int position) { holder.mItem = mValues.get(position); holder.mIdView.setText(mValues.get(position).getId().toString()); holder.mContentView.setText(mValues.get(position).getName()); holder.mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (mTwoPane) { Bundle arguments = new Bundle(); arguments.putString( PlayerDetailFragment.ARG_ITEM_ID, holder.mItem.getId().toString()); PlayerDetailFragment fragment = new PlayerDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager() .beginTransaction() .replace(R.id.player_detail_container, fragment) .commit(); } else { Context context = v.getContext(); Intent intent = new Intent(context, PlayerDetailActivity.class); intent.putExtra(PlayerDetailFragment.ARG_ITEM_ID, holder.mItem.getId().toString()); context.startActivity(intent); } } }); }
@Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mItem = mValues.get(position); holder.mTitleView.setText(mValues.get(position).getName()); holder.mDetailView.setText( mValues.get(position).getAmount() + mValues.get(position).getCurrency()); }
@Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mItem = mValues.get(position); holder.mIdView.setText(mValues.get(position).getName()); // holder.mTexttimeView.setText("test"); // holder.mContentView.setText(mValues.get(position).getTimezone().getDisplayName()); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { // TimeZone tz = mValues.get(position).getTimezone(); Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT")); SimpleDateFormat formatter_ = new SimpleDateFormat("MMMM dd yyyy HH:mm:ss z"); TimeZone tzo = mValues.get(position).getTimezone(); formatter_.setTimeZone(tzo); date = calendar.getTime(); String newtime = formatter_.format(date); Log.i(tzo.getDisplayName(), newtime); // holder.mTexttimeView.setText(newtime); // holder.mTextClockView.setTimeZone(tzo.toString()); // CharSequence hora = holder.mTextClockView.getText(); // holder.mTextClockView. // Log.i("hora",hora.toString()); // holder.mTextclockView.setText(currentDate.toString()); // holder.mTextclockView.setTextAppearance(3); // holder.mTextclockView.setTimeZone(mValues.get(position).getTimezone().toString()); // String tz=holder.mTextclockView.getTimeZone(); // Log.i("czc","_"+tz+"_"+mValues.get(position).getTimezone().toString()); } holder.mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (mTwoPane) { Bundle arguments = new Bundle(); arguments.putString(ItemDetailFragment.ARG_ITEM_ID, holder.mItem.getName()); ItemDetailFragment fragment = new ItemDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager() .beginTransaction() .replace(R.id.item_detail_container, fragment) .commit(); } else { Context context = v.getContext(); Intent intent = new Intent(context, ItemDetailActivity.class); intent.putExtra(ItemDetailFragment.ARG_ITEM_ID, holder.mItem.getName()); context.startActivity(intent); } } }); }
@Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mItem = mValues.get(position); holder.mIdView.setText(mValues.get(position).id); holder.mContentView.setText(mValues.get(position).content); holder.mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (null != mListener) { // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. mListener.onListFragmentInteraction(holder.mItem); } } }); }
@Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mItem = mValues.get(position); // holder.mContentView.setText(mValues.get(position).id); int drawableId = getDrawableId(mContext, holder.mItem.cardName); Bitmap bitmap = BitmapFactory.decodeResource(mContext.getResources(), drawableId); holder.mImageView.setImageBitmap(bitmap); holder.mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { if (null != mListener) { // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. mListener.onListFragmentInteraction(holder.mItem); } } }); }
@Override public void onBindViewHolder(final ViewHolder holder, final int position) { FolderItem folderItem = mValues.get(position); holder.mItem = folderItem; holder.folderName.setText(folderItem.name); holder.folderPath.setText(folderItem.path); holder.folderSize.setText(folderItem.getNumOfImages()); if (position == FolderListContent.selectedFolderIndex) { holder.folderIndicator.setVisibility(View.VISIBLE); } else { holder.folderIndicator.setVisibility(View.GONE); } Glide.with(mActivity) .load(folderItem.coverImagePath) .crossFade() .centerCrop() .into(holder.folderCover); // DraweeUtils.showThumb(Uri.fromFile(new File(folderItem.coverImagePath)), // holder.folderCover); holder.mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { // Log.d(TAG, "onClick: " + holder.mItem.toString()); // pass the selected result to FolderListContent int previousSelectedIndex = FolderListContent.selectedFolderIndex; FolderListContent.setSelectedFolder(holder.mItem, position); // we should notify previous item and current time to change notifyItemChanged(previousSelectedIndex); notifyItemChanged(position); if (null != mListener) { // Notify the active callbacks interface (the activity, if the // fragment is attached to one) that an item has been selected. mListener.onFolderItemInteraction(holder.mItem); } } }); }
@Override public void onBindViewHolder(RecyclerView.ViewHolder holderr, final int position) { if (holderr instanceof ViewHolder) { final ViewHolder holder = (ViewHolder) holderr; holder.mItem = mValues.get(position); holder.mTextView.setText(mValues.get(position).getName()); holder.mView.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Context context = v.getContext(); Intent intent = new Intent(context, ItemDetail.class); intent.putExtra("item", holder.mItem); context.startActivity(intent); } }); byte[] decodedString = Base64.decode(category.getIcon().getBlack(), Base64.DEFAULT); Glide.with(holder.mImageView.getContext()) .load(decodedString) .asBitmap() .into(holder.mImageView); } else if (holderr instanceof Description) { byte[] decodedString = Base64.decode(category.getIcon().getWhite(), Base64.DEFAULT); final Description holder = (Description) holderr; Glide.with(holder.mImageView.getContext()) .load(decodedString) .asBitmap() .into(holder.mImageView); holder.mTextView.setText(description); } }
@Override public void onBindViewHolder(final ViewHolder holder, int position) { holder.mItem = mValues.get(position); holder.mIdView.setText(mValues.get(position).id); holder.mContentView.setText(mValues.get(position).content); }