use of android.widget.AbsListView in project cube-sdk by liaohuqiu.
the class LoadMoreGridViewContainer method retrieveAbsListView.
@Override
protected AbsListView retrieveAbsListView() {
View view = getChildAt(0);
mGridView = (GridViewWithHeaderAndFooter) view;
return mGridView;
}
use of android.widget.AbsListView in project weiciyuan by qii.
the class JavaReflectionUtility method getValue.
public static <T> T getValue(AbsListView view, String name) {
final Field field;
try {
field = AbsListView.class.getDeclaredField(name);
field.setAccessible(true);
return (T) field.get(view);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
use of android.widget.AbsListView in project philm by chrisbanes.
the class ListFragment method ensureList.
private void ensureList() {
if (mList != null) {
return;
}
View root = getView();
if (root == null) {
throw new IllegalStateException("Content view not yet created");
}
if (root instanceof AbsListView) {
mList = (E) root;
} else {
mStandardEmptyView = (TextView) root.findViewById(INTERNAL_EMPTY_ID);
if (mStandardEmptyView == null) {
mEmptyView = root.findViewById(android.R.id.empty);
} else {
mStandardEmptyView.setVisibility(View.GONE);
}
mProgressView = root.findViewById(INTERNAL_PROGRESS_ID);
mSecondaryProgressView = root.findViewById(INTERNAL_SECONDARY_PROGRESS_ID);
mListContainer = root.findViewById(INTERNAL_LIST_CONTAINER_ID);
View rawListView = root.findViewById(android.R.id.list);
if (!(rawListView instanceof AbsListView)) {
if (rawListView == null) {
throw new RuntimeException("Your content must have a ListView whose id attribute is " + "'android.R.id.list'");
}
throw new RuntimeException("Content has view with id attribute 'android.R.id.list' " + "that is not a ListView class");
}
mList = (E) rawListView;
if (mEmptyView != null) {
mList.setEmptyView(mEmptyView);
} else if (mEmptyText != null) {
mStandardEmptyView.setText(mEmptyText);
mList.setEmptyView(mStandardEmptyView);
}
}
mListShown = true;
mList.setOnItemClickListener(mOnClickListener);
if (mAdapter != null) {
ListAdapter adapter = mAdapter;
mAdapter = null;
setListAdapter(adapter);
} else {
// have our data right away and start with the progress indicator.
if (mProgressView != null) {
setListShown(false, false);
}
}
mHandler.post(mRequestFocus);
}
use of android.widget.AbsListView in project SmartAndroidSource by jaychou2012.
the class AutoViewHelper method initAutoViewOnListView.
// for ListView
private void initAutoViewOnListView(ListView listView, final OnScrollListener onScrollListener) {
setAutoViewOnView(listView);
listView.setOnScrollListener(new OnScrollListener() {
int mScrollPosition;
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
if (onScrollListener != null) {
onScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
}
View topChild = view.getChildAt(0);
int newScrollPosition = 0;
if (topChild == null) {
newScrollPosition = 0;
} else {
newScrollPosition = -topChild.getTop() + view.getFirstVisiblePosition() * topChild.getHeight();
}
if (Math.abs(newScrollPosition - mScrollPosition) >= SCROLL_DIRECTION_CHANGE_THRESHOLD) {
onScrollPositionChanged(mScrollPosition, newScrollPosition);
}
mScrollPosition = newScrollPosition;
}
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (onScrollListener != null) {
onScrollListener.onScrollStateChanged(view, scrollState);
}
}
});
}
use of android.widget.AbsListView in project SmartAndroidSource by jaychou2012.
the class AbstractAQuery method setScrollListener.
private Common setScrollListener() {
AbsListView lv = (AbsListView) view;
Common common = (Common) lv.getTag(AQuery.TAG_SCROLL_LISTENER);
if (common == null) {
common = new Common();
lv.setOnScrollListener(common);
lv.setTag(AQuery.TAG_SCROLL_LISTENER, common);
AQUtility.debug("set scroll listenr");
}
return common;
}
Aggregations