Search in sources :

Example 1 with XListViewFooter

use of me.maxwin.view.XListViewFooter in project ABPlayer by winkstu.

the class XMultiColumnListView method initWithContext.

protected void initWithContext(Context context) {
    mScroller = new Scroller(context, new DecelerateInterpolator());
    // XListView need the scroll event, and it will dispatch the event to
    // user's listener (as a proxy).
    super.setOnScrollListener(this);
    // init header view
    mHeaderView = new XListViewHeader(context);
    mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.xlistview_header_content);
    mHeaderTimeView = (TextView) mHeaderView.findViewById(R.id.xlistview_header_time);
    addHeaderView(mHeaderView);
    // init footer view
    mFooterView = new XListViewFooter(context);
    // init header height
    mHeaderView.getViewTreeObserver().addOnGlobalLayoutListener(new OnGlobalLayoutListener() {

        @Override
        public void onGlobalLayout() {
            mHeaderViewHeight = mHeaderViewContent.getHeight();
            getViewTreeObserver().removeGlobalOnLayoutListener(this);
        }
    });
    // 默认关闭所有操作
    disablePullLoad();
    disablePullRefreash();
// setPullRefreshEnable(mEnablePullRefresh);
// setPullLoadEnable(mEnablePullLoad);
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) OnGlobalLayoutListener(android.view.ViewTreeObserver.OnGlobalLayoutListener) Scroller(android.widget.Scroller) XListViewHeader(me.maxwin.view.XListViewHeader) XListViewFooter(me.maxwin.view.XListViewFooter)

Aggregations

OnGlobalLayoutListener (android.view.ViewTreeObserver.OnGlobalLayoutListener)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 Scroller (android.widget.Scroller)1 XListViewFooter (me.maxwin.view.XListViewFooter)1 XListViewHeader (me.maxwin.view.XListViewHeader)1