本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}