use of android.view.LayoutInflater in project JieCaoVideoPlayer by lipangit.
the class VideoListAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder viewHolder;
if (null == convertView) {
viewHolder = new ViewHolder();
LayoutInflater mInflater = LayoutInflater.from(context);
convertView = mInflater.inflate(R.layout.item_videoview, null);
convertView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) convertView.getTag();
}
viewHolder.jcVideoPlayer = (JCVideoPlayerStandard) convertView.findViewById(R.id.videoplayer);
if (pager == -1) {
viewHolder.jcVideoPlayer.setUp(VideoConstant.videoUrls[0][position], JCVideoPlayer.SCREEN_LAYOUT_LIST, VideoConstant.videoTitles[0][position]);
System.out.println("fdsfdsfdsfdsfa setup " + position);
Picasso.with(convertView.getContext()).load(VideoConstant.videoThumbs[0][position]).into(viewHolder.jcVideoPlayer.thumbImageView);
} else {
viewHolder.jcVideoPlayer.setUp(VideoConstant.videoUrls[pager][position], JCVideoPlayer.SCREEN_LAYOUT_LIST, VideoConstant.videoTitles[pager][position]);
Picasso.with(convertView.getContext()).load(VideoConstant.videoThumbs[pager][position]).into(viewHolder.jcVideoPlayer.thumbImageView);
}
return convertView;
}
use of android.view.LayoutInflater in project howabout-android by recomio.
the class ShowImageListAdapter method getView.
@Override
public View getView(int position, View convertView, final ViewGroup parent) {
final View showImageListItemView;
if (convertView == null) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
showImageListItemView = inflater.inflate(R.layout.show_image_item, parent, false);
} else {
showImageListItemView = convertView;
}
final ImageView imageView = (ImageView) showImageListItemView.findViewById(R.id.image);
final ProgressBar progressBar = (ProgressBar) showImageListItemView.findViewById(R.id.load);
String imageUrl = imageList.get(position).getBasicUrl();
imageLoader.displayImage(imageUrl, imageView, new ImageLoadingListener() {
@Override
public void onLoadingStarted(String imageUri, View view) {
progressBar.setVisibility(View.VISIBLE);
imageView.setVisibility(View.GONE);
}
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
progressBar.setVisibility(View.GONE);
}
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
// 스크린 width에 꽉 차게 view 리사이징.
float ratio = (float) parent.getWidth() / (float) loadedImage.getWidth();
RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(parent.getWidth(), (int) ((float) loadedImage.getHeight() * ratio));
imageView.setLayoutParams(lp);
// margin.
lp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
lp.setMargins(1, 1, 1, 1);
imageView.setLayoutParams(lp);
imageView.setVisibility(View.VISIBLE);
progressBar.setVisibility(View.GONE);
}
@Override
public void onLoadingCancelled(String imageUri, View view) {
progressBar.setVisibility(View.GONE);
}
});
return showImageListItemView;
}
use of android.view.LayoutInflater in project howabout-android by recomio.
the class MusicPlaylistAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final View playlistItemView;
if (convertView == null) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
playlistItemView = inflater.inflate(R.layout.music_playlist_item, parent, false);
} else {
playlistItemView = convertView;
}
final ImageView imageView = (ImageView) playlistItemView.findViewById(R.id.image);
final TextView trackTitle = (TextView) playlistItemView.findViewById(R.id.trackTitle);
final TextView artistName = (TextView) playlistItemView.findViewById(R.id.artistName);
final ImageView isCurrentItem = (ImageView) playlistItemView.findViewById(R.id.isCurrentItem);
if (position == currentPosition) {
isCurrentItem.setVisibility(View.VISIBLE);
} else {
isCurrentItem.setVisibility(View.GONE);
}
final Track track = trackList.get(position);
trackTitle.setText(track.getTrackTitle());
artistName.setText(track.getArtistName());
String thumbnailUrl = track.getThumbnailUrl();
imageLoader.displayImage(thumbnailUrl, imageView, new ImageLoadingListener() {
@Override
public void onLoadingStarted(String imageUri, View view) {
// imageView.setVisibility(View.INVISIBLE);
}
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
}
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
imageView.setVisibility(View.VISIBLE);
}
@Override
public void onLoadingCancelled(String imageUri, View view) {
}
});
return playlistItemView;
}
use of android.view.LayoutInflater in project xabber-android by redsolution.
the class ContactAddFragment method setUpListView.
private void setUpListView() {
View headerView = ((LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.contact_add_header, null, false);
getListView().addHeaderView(headerView);
accountSelectorPanel.setVisibility(View.GONE);
setUpAccountView((Spinner) headerView.findViewById(R.id.contact_account));
userView = (EditText) headerView.findViewById(R.id.contact_user);
nameView = (EditText) headerView.findViewById(R.id.contact_name);
if (getUser() != null) {
userView.setText(getUser());
}
if (name != null) {
nameView.setText(name);
}
}
use of android.view.LayoutInflater in project android-topeka by googlesamples.
the class OptionsQuizAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = LayoutInflater.from(parent.getContext());
convertView = inflater.inflate(mLayoutId, parent, false);
}
String text = getText(position);
((TextView) convertView).setText(text);
return convertView;
}
Aggregations