当前位置: 首页>>代码示例>>Java>>正文


Java ListView.LayoutParams方法代码示例

本文整理汇总了Java中android.widget.ListView.LayoutParams方法的典型用法代码示例。如果您正苦于以下问题:Java ListView.LayoutParams方法的具体用法?Java ListView.LayoutParams怎么用?Java ListView.LayoutParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ListView的用法示例。


在下文中一共展示了ListView.LayoutParams方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getView

import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = inflater.inflate(R.layout.view_list_playlistsrows, parent, false);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    }

    TextView textView = (TextView) convertView.findViewById(R.id.view_title);
    textView.setText(playList.get(position));

    TextView listcount = (TextView) convertView.findViewById(R.id.view_countview);
    listcount.setText("");
    return convertView;
}
 
开发者ID:icaynia,项目名称:pracler,代码行数:18,代码来源:PlayListsAdapter.java

示例2: getView

import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = inflater.inflate(R.layout.view_list_musicrows, parent, false);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    };

    ImageView album = (ImageView) convertView.findViewById(R.id.view_album);
    album.setImageDrawable(context.getResources().getDrawable(android.R.drawable.ic_menu_report_image));
    TextView title = (TextView) convertView.findViewById(R.id.view_title);
    TextView artist = (TextView) convertView.findViewById(R.id.view_artist);

    title.setText(list.getItem(position).getTitle());
    artist.setText(list.getItem(position).getArtist() + " - " + list.getItem(position).getAlbum() + " - " + global.mMusicManager.convertToTime(list.getItem(position).getLength()));

    convertView.setTag(list.getItem(position).getUid_local());
    MyAsyncTask myAsyncTask = new MyAsyncTask();
    myAsyncTask.setImgView(album);
    myAsyncTask.execute(position + "");

    return convertView;
}
 
开发者ID:icaynia,项目名称:pracler,代码行数:26,代码来源:MusicListAdapter.java

示例3: getView

import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = inflater.inflate(R.layout.view_list_musicrows, parent, false);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    };

    ImageView album = (ImageView) convertView.findViewById(R.id.view_album);
    album.setImageDrawable(context.getResources().getDrawable(android.R.drawable.ic_menu_report_image));
    TextView title = (TextView) convertView.findViewById(R.id.view_title);
    TextView artist = (TextView) convertView.findViewById(R.id.view_artist);

    title.setText(list.get(position).title);
    artist.setText(list.get(position).artist + " - " + list.get(position).album + " - " + global.mMusicManager.convertToTime(list.get(position).length));

    convertView.setTag(list.get(position).uid);
    MyAsyncTask myAsyncTask = new MyAsyncTask();
    myAsyncTask.setImgView(album);
    myAsyncTask.execute(position + "");

    return convertView;
}
 
开发者ID:icaynia,项目名称:pracler,代码行数:26,代码来源:SongListAdapter.java

示例4: getView

import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = new ProfileRow(context);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    }

    final ProfileRow v = (ProfileRow) convertView;

    v.setText(followingList.get(position).name);
    UpdateView updateView = new UpdateView();
    updateView.setImageView(v.imageView);
    updateView.execute(followingList.get(position).picture);

    convertView = v;

    return convertView;
}
 
开发者ID:icaynia,项目名称:pracler,代码行数:22,代码来源:ProfileMenuAdapter.java

示例5: measureScrapChild

import android.widget.ListView; //导入方法依赖的package包/类
private void measureScrapChild(View child, int position, int widthMeasureSpec) {
    ListView.LayoutParams p = (ListView.LayoutParams) child.getLayoutParams();
    if (p == null) {
        p = new ListView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, 0);
        child.setLayoutParams(p);
    }
    //XXX p.viewType = mAdapter.getItemViewType(position);
    //XXX p.forceAdd = true;

    int childWidthSpec = ViewGroup.getChildMeasureSpec(widthMeasureSpec,
            mDropDownList.getPaddingLeft() + mDropDownList.getPaddingRight(), p.width);
    int lpHeight = p.height;
    int childHeightSpec;
    if (lpHeight > 0) {
        childHeightSpec = MeasureSpec.makeMeasureSpec(lpHeight, MeasureSpec.EXACTLY);
    } else {
        childHeightSpec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED);
    }
    child.measure(childWidthSpec, childHeightSpec);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:22,代码来源:IcsListPopupWindow.java

示例6: getView

import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = inflater.inflate(R.layout.view_list_musicrows, parent, false);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    }

    RelativeLayout lv =  (RelativeLayout) convertView.findViewById(R.id.lv);
    ImageView album = (ImageView) convertView.findViewById(R.id.view_album);
    album.setImageDrawable(context.getResources().getDrawable(android.R.drawable.ic_menu_report_image));
    TextView title = (TextView) convertView.findViewById(R.id.view_title);
    TextView artist = (TextView) convertView.findViewById(R.id.view_artist);

    MusicDto musicDto = global.mMusicManager.getMusicDto(list.get(position).uid+"");

    title.setText(musicDto.getTitle());
    artist.setText(
            list.get(position).count + "회 재생 - " +
            musicDto.getArtist() + " - " +
            musicDto.getAlbum() + " - " +
            global.mMusicManager.convertToTime(musicDto.getLength()));

    convertView.setTag(musicDto.getUid_local());
    MyAsyncTask myAsyncTask = new MyAsyncTask();
    myAsyncTask.setImgView(album);
    myAsyncTask.execute(musicDto.getAlbumId());

    return convertView;
}
 
开发者ID:icaynia,项目名称:pracler,代码行数:33,代码来源:TopMusicAdapter.java

示例7: getView

import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = inflater.inflate(R.layout.view_list_playlistrows, parent, false);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    }

    MusicDto music = global.mMusicManager.getMusicDto(list.get(position)+"");

    ImageView album = (ImageView) convertView.findViewById(R.id.view_album);
    album.setImageDrawable(context.getResources().getDrawable(android.R.drawable.ic_menu_report_image));
    TextView title = (TextView) convertView.findViewById(R.id.view_title);
    TextView artist = (TextView) convertView.findViewById(R.id.view_artist);

    title.setText(music.getTitle());
    artist.setText(music.getTitle() + " - " + music.getAlbum() + " - " + global.mMusicManager.convertToTime(music.getLength()));

    convertView.setTag(music.getUid_local());
    MyAsyncTask myAsyncTask = new MyAsyncTask();
    myAsyncTask.setImgView(album);
    myAsyncTask.execute(position + "");


    return convertView;
}
 
开发者ID:icaynia,项目名称:pracler,代码行数:29,代码来源:PlayListAdapter.java

示例8: getView

import android.widget.ListView; //导入方法依赖的package包/类
@Override
public View getView(final int position, View convertView, ViewGroup parent)
{
    if (convertView == null)
    {
        convertView = inflater.inflate(R.layout.view_list_dialogmenu, parent, false);
        ListView.LayoutParams layoutParams = new ListView.LayoutParams(ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.MATCH_PARENT);
        convertView.setLayoutParams(layoutParams);
    }

    TextView textView = (TextView) convertView.findViewById(R.id.textview);
    textView.setText(list.get(position));
    return convertView;
}
 
开发者ID:icaynia,项目名称:pracler,代码行数:15,代码来源:MenuListAdapter.java

示例9: onAttachedToWindow

import android.widget.ListView; //导入方法依赖的package包/类
@Override
protected void onAttachedToWindow() {
    mAdapter = new ATableViewAdapter(this);

    // TODO we should handle the case last row is
    // ListView.LayoutParams.WRAP_CONTENT, to get its height.
    // setup footer for plain tables to complete its height with empty rows.
    // ATTENSION: below has a bug which cause listview dead for no move
    // except be killed.
    // so I commented it.
    // setupFooterView(mAdapter.getLastRowHeight());

    if (needPinnedHeader()) {
        // TO DO: here can remove to PinnedView class.
        View HeaderView = LayoutInflater.from(getContext()).inflate(
                R.layout.pinnedheader, this, false);
        Resources res = getResources();
        Rect padding = new Rect();
        padding.left = (int) res
                .getDimension(R.dimen.atv_plain_section_header_padding_left);
        padding.right = (int) res
                .getDimension(R.dimen.atv_plain_section_header_padding_right);

        // set background for plain style.
        // HeaderView
        // .setBackgroundResource(R.drawable.plain_header_background);
        HeaderView.setBackgroundColor(Color.argb(178, 204, 204, 204));
        TextView label = (TextView) HeaderView.findViewById(R.id.textLabel);
        label.setTextColor(Color.BLUE);
        HeaderView.setPadding(padding.left, padding.top, padding.right,
                padding.bottom);
        ListView.LayoutParams params = new ListView.LayoutParams(
                ListView.LayoutParams.MATCH_PARENT,
                mAdapter.getHeaderFooterRowHeight(0, false));
        HeaderView.setLayoutParams(params);
        HeaderView.requestLayout();

        setHeaderView(HeaderView);
    }
    // setDescendantFocusability(FOCUS_AFTER_DESCENDANTS);
    setAdapter(mAdapter);
    setOnScrollListener(mAdapter);
    setOnItemClickListener(new ATableViewCellClickListener(this));
    super.onAttachedToWindow();
}
 
开发者ID:hh-in-zhuzhou,项目名称:ShangHanLun,代码行数:46,代码来源:ATableView.java


注:本文中的android.widget.ListView.LayoutParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。