Search in sources :

Example 81 with LayoutInflater

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;
}
Also used : LayoutInflater(android.view.LayoutInflater)

Example 82 with LayoutInflater

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;
}
Also used : Bitmap(android.graphics.Bitmap) ImageLoadingListener(com.nostra13.universalimageloader.core.assist.ImageLoadingListener) LayoutInflater(android.view.LayoutInflater) RelativeLayout(android.widget.RelativeLayout) ImageView(android.widget.ImageView) FailReason(com.nostra13.universalimageloader.core.assist.FailReason) ImageView(android.widget.ImageView) View(android.view.View) ProgressBar(android.widget.ProgressBar)

Example 83 with LayoutInflater

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;
}
Also used : Bitmap(android.graphics.Bitmap) ImageLoadingListener(com.nostra13.universalimageloader.core.assist.ImageLoadingListener) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) ImageView(android.widget.ImageView) FailReason(com.nostra13.universalimageloader.core.assist.FailReason) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) Track(io.recom.howabout.category.music.model.Track)

Example 84 with LayoutInflater

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);
    }
}
Also used : LayoutInflater(android.view.LayoutInflater) View(android.view.View) AdapterView(android.widget.AdapterView)

Example 85 with LayoutInflater

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;
}
Also used : LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView)

Aggregations

LayoutInflater (android.view.LayoutInflater)1292 View (android.view.View)803 TextView (android.widget.TextView)615 ImageView (android.widget.ImageView)259 ViewGroup (android.view.ViewGroup)139 Context (android.content.Context)131 ListView (android.widget.ListView)123 LinearLayout (android.widget.LinearLayout)106 RecyclerView (android.support.v7.widget.RecyclerView)104 AdapterView (android.widget.AdapterView)100 Intent (android.content.Intent)92 AlertDialog (android.app.AlertDialog)88 DialogInterface (android.content.DialogInterface)81 Button (android.widget.Button)57 Bundle (android.os.Bundle)54 FrameLayout (android.widget.FrameLayout)49 TypedArray (android.content.res.TypedArray)43 Activity (android.app.Activity)41 AlertDialog (android.support.v7.app.AlertDialog)41 EditText (android.widget.EditText)41