Search in sources :

Example 1 with FooterLoadingLayout

use of org.kymjs.blog.ui.widget.listview.FooterLoadingLayout in project KJFrameForAndroid by kymjs.

the class ActiveFragment method initWidget.

@Override
protected void initWidget(View parentView) {
    super.initWidget(parentView);
    mEmptyLayout.setOnLayoutClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            mEmptyLayout.setErrorType(EmptyLayout.NETWORK_LOADING);
            refresh();
        }
    });
    mListView = mRefreshLayout.getRefreshView();
    mListView.setDivider(new ColorDrawable(android.R.color.transparent));
    mListView.setSelector(new ColorDrawable(android.R.color.transparent));
    mListView.setOnItemClickListener(this);
    mRefreshLayout.setPullLoadEnabled(true);
    ((FooterLoadingLayout) mRefreshLayout.getFooterLoadingLayout()).setNoMoreDataText("暂时还没有更多活动");
    mRefreshLayout.setOnRefreshListener(new OnRefreshListener<ListView>() {

        @Override
        public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
            refresh();
        }

        @Override
        public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
            mRefreshLayout.setHasMoreData(false);
        }
    });
    fillUI();
}
Also used : ListView(android.widget.ListView) ColorDrawable(android.graphics.drawable.ColorDrawable) OnClickListener(android.view.View.OnClickListener) View(android.view.View) BindView(org.kymjs.kjframe.ui.BindView) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) FooterLoadingLayout(org.kymjs.blog.ui.widget.listview.FooterLoadingLayout)

Example 2 with FooterLoadingLayout

use of org.kymjs.blog.ui.widget.listview.FooterLoadingLayout in project KJFrameForAndroid by kymjs.

the class BlogAuthorFragment method initWidget.

@Override
protected void initWidget(View parentView) {
    super.initWidget(parentView);
    mEmptyLayout.setOnLayoutClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            mEmptyLayout.setErrorType(EmptyLayout.NETWORK_LOADING);
            refresh();
        }
    });
    mListView = mRefreshLayout.getRefreshView();
    mListView.setDivider(new ColorDrawable(android.R.color.transparent));
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            Bundle bundle = new Bundle();
            bundle.putInt(OSCBlogListFragment.BLOGLIST_KEY, adapter.getItem(position).getId());
            bundle.putString(AUTHOR_NAME_KEY, adapter.getItem(position).getName());
            SimpleBackActivity.postShowWith(outsideAty, SimpleBackPage.OSC_BLOG_LIST, bundle);
        }
    });
    mRefreshLayout.setPullLoadEnabled(true);
    ((FooterLoadingLayout) mRefreshLayout.getFooterLoadingLayout()).setNoMoreDataText("学习不可贪多哦");
    mRefreshLayout.setOnRefreshListener(new OnRefreshListener<ListView>() {

        @Override
        public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
            refresh();
        }

        @Override
        public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
            mRefreshLayout.setHasMoreData(false);
        }
    });
    fillUI();
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) Bundle(android.os.Bundle) View(android.view.View) BindView(org.kymjs.kjframe.ui.BindView) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) FooterLoadingLayout(org.kymjs.blog.ui.widget.listview.FooterLoadingLayout) ListView(android.widget.ListView) ColorDrawable(android.graphics.drawable.ColorDrawable) OnClickListener(android.view.View.OnClickListener)

Example 3 with FooterLoadingLayout

use of org.kymjs.blog.ui.widget.listview.FooterLoadingLayout in project KJFrameForAndroid by kymjs.

the class OSCBlogListFragment method initWidget.

@Override
protected void initWidget(View parentView) {
    super.initWidget(parentView);
    mEmptyLayout.setOnLayoutClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            mEmptyLayout.setErrorType(EmptyLayout.NETWORK_LOADING);
            refresh();
        }
    });
    mListView = mRefreshLayout.getRefreshView();
    mListView.setDivider(new ColorDrawable(android.R.color.transparent));
    mListView.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            if (parent.getAdapter() instanceof OSCBlogAdapter) {
                Bundle bundle = new Bundle();
                bundle.putInt("oscblog_id", ((OSCBlog) parent.getAdapter().getItem(position)).getId());
                SimpleBackActivity.postShowWith(outsideAty, SimpleBackPage.OSC_BLOG_DETAIL, bundle);
            }
        }
    });
    mRefreshLayout.setPullLoadEnabled(true);
    ((FooterLoadingLayout) mRefreshLayout.getFooterLoadingLayout()).setNoMoreDataText("已经没有更多了~");
    mRefreshLayout.setOnRefreshListener(new OnRefreshListener<ListView>() {

        @Override
        public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
            refresh();
        }

        @Override
        public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
            refresh(mDatas.size() / 20);
        }
    });
    fillUI();
}
Also used : OnItemClickListener(android.widget.AdapterView.OnItemClickListener) Bundle(android.os.Bundle) OSCBlogAdapter(org.kymjs.blog.adapter.OSCBlogAdapter) View(android.view.View) BindView(org.kymjs.kjframe.ui.BindView) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) FooterLoadingLayout(org.kymjs.blog.ui.widget.listview.FooterLoadingLayout) ListView(android.widget.ListView) ColorDrawable(android.graphics.drawable.ColorDrawable) OnClickListener(android.view.View.OnClickListener) OSCBlog(org.kymjs.blog.domain.OSCBlog)

Example 4 with FooterLoadingLayout

use of org.kymjs.blog.ui.widget.listview.FooterLoadingLayout in project KJFrameForAndroid by kymjs.

the class BlogFragment method listViewPreference.

/**
     * 初始化ListView样式
     */
private void listViewPreference() {
    mList = mRefreshLayout.getRefreshView();
    mList.setDivider(new ColorDrawable(0x00000000));
    mList.setOverscrollFooter(null);
    mList.setOverscrollHeader(null);
    mList.setOverScrollMode(ListView.OVER_SCROLL_NEVER);
    mRefreshLayout.setPullLoadEnabled(true);
    ((FooterLoadingLayout) mRefreshLayout.getFooterLoadingLayout()).setNoMoreDataText("学习不可贪多哦~");
    mList.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            UIHelper.toBrowser(aty, adapter.getItem(position).getUrl());
        }
    });
    mRefreshLayout.setOnRefreshListener(new OnRefreshListener<ListView>() {

        @Override
        public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
            refresh();
        }

        @Override
        public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
            mRefreshLayout.setHasMoreData(false);
        }
    });
}
Also used : ListView(android.widget.ListView) ColorDrawable(android.graphics.drawable.ColorDrawable) OnItemClickListener(android.widget.AdapterView.OnItemClickListener) View(android.view.View) BindView(org.kymjs.kjframe.ui.BindView) AdapterView(android.widget.AdapterView) ListView(android.widget.ListView) FooterLoadingLayout(org.kymjs.blog.ui.widget.listview.FooterLoadingLayout)

Aggregations

ColorDrawable (android.graphics.drawable.ColorDrawable)4 View (android.view.View)4 AdapterView (android.widget.AdapterView)4 ListView (android.widget.ListView)4 FooterLoadingLayout (org.kymjs.blog.ui.widget.listview.FooterLoadingLayout)4 BindView (org.kymjs.kjframe.ui.BindView)4 OnClickListener (android.view.View.OnClickListener)3 OnItemClickListener (android.widget.AdapterView.OnItemClickListener)3 Bundle (android.os.Bundle)2 OSCBlogAdapter (org.kymjs.blog.adapter.OSCBlogAdapter)1 OSCBlog (org.kymjs.blog.domain.OSCBlog)1