Search in sources :

Example 81 with AbsListView

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

Example 82 with AbsListView

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;
}
Also used : Field(java.lang.reflect.Field) AbsListView(android.widget.AbsListView)

Example 83 with AbsListView

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);
}
Also used : AbsListView(android.widget.AbsListView) FontTextView(app.philm.in.view.FontTextView) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) View(android.view.View) AdapterView(android.widget.AdapterView) ListAdapter(android.widget.ListAdapter)

Example 84 with AbsListView

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);
            }
        }
    });
}
Also used : OnScrollListener(android.widget.AbsListView.OnScrollListener) AbsListView(android.widget.AbsListView) AbsListView(android.widget.AbsListView) ScrollView(android.widget.ScrollView) View(android.view.View) ListView(android.widget.ListView)

Example 85 with AbsListView

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

Aggregations

AbsListView (android.widget.AbsListView)223 View (android.view.View)126 ListView (android.widget.ListView)80 AdapterView (android.widget.AdapterView)54 TextView (android.widget.TextView)46 ViewGroup (android.view.ViewGroup)33 ImageView (android.widget.ImageView)29 ScrollView (android.widget.ScrollView)23 RecyclerView (android.support.v7.widget.RecyclerView)21 GridView (android.widget.GridView)21 SuppressLint (android.annotation.SuppressLint)20 OnScrollListener (android.widget.AbsListView.OnScrollListener)19 Intent (android.content.Intent)17 ArrayList (java.util.ArrayList)16 Context (android.content.Context)12 Point (android.graphics.Point)12 Handler (android.os.Handler)12 WebView (android.webkit.WebView)12 ExpandableListView (android.widget.ExpandableListView)12 ArrayListLoader (com.klinker.android.twitter.adapters.ArrayListLoader)10