本文整理了Java中android.widget.ListView.getId()
方法的一些代码示例,展示了ListView.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.getId()
方法的具体详情如下:
包路径:android.widget.ListView
类名称:ListView
方法名:getId
暂无
代码示例来源:origin: stackoverflow.com
setOnScrollListener(new OnScrollListener(){
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
// TODO Auto-generated method stub
}
public void onScrollStateChanged(AbsListView view, int scrollState) {
// TODO Auto-generated method stub
final ListView lw = getListView();
if(scrollState == 0)
Log.i("a", "scrolling stopped...");
if (view.getId() == lw.getId()) {
final int currentFirstVisibleItem = lw.getFirstVisiblePosition();
if (currentFirstVisibleItem > mLastFirstVisibleItem) {
mIsScrollingUp = false;
Log.i("a", "scrolling down...");
} else if (currentFirstVisibleItem < mLastFirstVisibleItem) {
mIsScrollingUp = true;
Log.i("a", "scrolling up...");
}
mLastFirstVisibleItem = currentFirstVisibleItem;
}
}
});
代码示例来源:origin: stackoverflow.com
private int mLastFirstVisibleItem;
private boolean mIsScrollingUp;
public void onScrollStateChanged(AbsListView view, int scrollState) {
final ListView lw = getListView();
if (view.getId() == lw.getId()) {
final int currentFirstVisibleItem = lw.getFirstVisiblePosition();
if (currentFirstVisibleItem > mLastFirstVisibleItem) {
mIsScrollingUp = false;
} else if (currentFirstVisibleItem < mLastFirstVisibleItem) {
mIsScrollingUp = true;
}
mLastFirstVisibleItem = currentFirstVisibleItem;
}
}
代码示例来源:origin: stackoverflow.com
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
switch(l.getId())
{
case R.id.list:
{
// do list A stuff
break;
}
case R.id.list2:
{
// do list B stuff
break;
}
}
}
代码示例来源:origin: stackoverflow.com
private int mLastFirstVisibleItem;
private ListView listView;
listView.setOnScrollListener(new AbsListView.OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (view.getId() == listView.getId()) {
final int currentFirstVisibleItem = listView.getFirstVisiblePosition();
if (currentFirstVisibleItem > mLastFirstVisibleItem) {
cardView.setVisibility(View.GONE);
} else if (currentFirstVisibleItem < mLastFirstVisibleItem) {
cardView.setVisibility(View.VISIBLE);
}
mLastFirstVisibleItem = currentFirstVisibleItem;
}
}
代码示例来源:origin: z3896823/PanelList
Log.d(TAG, "reorganizeViewGroup: " + onRefreshListener.toString());
RelativeLayout.LayoutParams lp_srl = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
lp_srl.addRule(RelativeLayout.RIGHT_OF, lv_column.getId());
lp_srl.addRule(RelativeLayout.BELOW, tv_title.getId());
pl_root.addView(swipeRefreshLayout, lp_srl);
内容来源于网络,如有侵权,请联系作者删除!