當前位置: 首頁>>代碼示例>>Java>>正文


Java PullToRefreshBase類代碼示例

本文整理匯總了Java中com.handmark.pulltorefresh.library.PullToRefreshBase的典型用法代碼示例。如果您正苦於以下問題:Java PullToRefreshBase類的具體用法?Java PullToRefreshBase怎麽用?Java PullToRefreshBase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PullToRefreshBase類屬於com.handmark.pulltorefresh.library包,在下文中一共展示了PullToRefreshBase類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: findViews

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void findViews() {
    this.mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
    this.mListView.addHeaderView(getHeaderView());
    this.mListView.setSelector(R.color.in);
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            MyTimelineActivity.this.getCurrentStatus();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (MyTimelineActivity.this.mPosts.size() > 0) {
                MyTimelineActivity.this.getPreviousStatus();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:19,代碼來源:MyTimelineActivity.java

示例2: init

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void init() {
    this.mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
    this.mEmptyView = (TextView) findViewById(R.id.empty_view);
    this.mListView.setEmptyView(this.mEmptyView);
    if (this.mType.equals(Notification.FRIENDSHIP)) {
        Drawable topDrawable = getResources().getDrawable(R.drawable.a5o);
        topDrawable.setBounds(0, 0, ViewUtils.dip2px(this.activity, 120.0f), ViewUtils.dip2px
                (this.activity, 120.0f));
        this.mEmptyView.setCompoundDrawables(null, topDrawable, null, null);
    }
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            NotificationActivity.this.getNotifications();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            NotificationActivity.this.getPreviousNotifications();
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:23,代碼來源:NotificationActivity.java

示例3: findViews

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void findViews() {
    this.mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
    this.mListView.addHeaderView(getHeaderView());
    this.mListView.setSelector(R.color.in);
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            UserTimelineActivity.this.getCurrentStatus();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!UserTimelineActivity.this.isLastVisible) {
                UserTimelineActivity.this.getPreviousStatus();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:19,代碼來源:UserTimelineActivity.java

示例4: findViews

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void findViews() {
    this.mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            RecommendTimelineActivity.this.getCurrentTopic();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!RecommendTimelineActivity.this.isLastVisible) {
                RecommendTimelineActivity.this.getNextTopic();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:RecommendTimelineActivity.java

示例5: initView

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void initView() {
    this.listview.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            BetListFragment.this.page = 1;
            BetListFragment.this.loadData();
        }
    });
    this.listview.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (BetListFragment.this.type == 1) {
                BetListFragment.this.page = BetListFragment.this.page + 1;
                BetListFragment.this.loadData();
            }
        }
    });
    this.adapter = new BetAdapter(getActivity(), this.bets);
    this.listview.setAdapter(this.adapter);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:19,代碼來源:BetListFragment.java

示例6: initViews

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void initViews() {
    this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
    View headerView = View.inflate(getActivity(), R.layout.pf, null);
    this.mListView.addHeaderView(headerView);
    OnClickListener listener = new OnClickListener() {
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.tv_hint:
                    HomeTimelineFragment.this.loadFirst();
                    return;
                case R.id.tv_my_page:
                    MyTimelineActivity.comeOnBaby(HomeTimelineFragment.this.getActivity());
                    return;
                case R.id.tv_find_friends:
                    SearchFriendsActivity.comeOnBaby(HomeTimelineFragment.this.getActivity());
                    return;
                default:
                    return;
            }
        }
    };
    headerView.findViewById(R.id.tv_my_page).setOnClickListener(listener);
    headerView.findViewById(R.id.tv_find_friends).setOnClickListener(listener);
    this.tvHint.setOnClickListener(listener);
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            HomeTimelineFragment.this.hideHint();
            HomeTimelineFragment.this.getCurrentStatus();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!HomeTimelineFragment.this.isLastVisible && HomeTimelineFragment.this
                    .getActivity() != null) {
                HomeTimelineFragment.this.getPreviousStatus();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:40,代碼來源:HomeTimelineFragment.java

示例7: addListener

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void addListener() {
    this.mPullListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            ShopMainFragment.this.requestShopHomePages();
        }
    });
    this.mPullListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (ShopMainFragment.this.mPage > ShopMainFragment.this.mCurrentPage &&
                    ShopMainFragment.this.hasMore) {
                ShopMainFragment.this.mCurrentPage = ShopMainFragment.this.mPage;
                ShopMainFragment.this.requestShopHomeMoreGoods();
            }
        }
    });
    this.mIndicator.setOnPageChangeListener(new SimpleOnPageChangeListener() {
        public void onPageSelected(int position) {
            super.onPageSelected(position);
            ShopMainFragment.this.mCurrentIndex = position;
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:23,代碼來源:ShopMainFragment.java

示例8: addListener

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
protected void addListener() {
    this.mHeaderView = new ImageView(getActivity());
    this.mHeaderView.setScaleType(ScaleType.CENTER_CROP);
    this.mHeaderView.setLayoutParams(new LayoutParams(-1, -2));
    ((ListView) this.mPullRefreshListView.getRefreshableView()).addHeaderView(this.mHeaderView);
    this.mAdapter = new HomeTimelineAdapter(getActivity(), this.mPosts);
    this.mPullRefreshListView.setAdapter(this.mAdapter);
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            GoodsPostsFragment.this.getCurrentTopic();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!GoodsPostsFragment.this.isLastVisible) {
                GoodsPostsFragment.this.getNextTopic();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:21,代碼來源:GoodsPostsFragment.java

示例9: initView

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void initView() {
    this.listView = (ListView) this.pullRefreshLayout.getRefreshableView();
    this.pullRefreshLayout.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            StatusFavoriteFragment.this.page = 1;
            StatusFavoriteFragment.this.loadData(true);
        }
    });
    this.pullRefreshLayout.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            StatusFavoriteFragment.this.loadMoreData(false);
        }
    });
    this.listView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
            Intent intent = new Intent(StatusFavoriteFragment.this.getActivity(),
                    CommentListActivity.class);
            intent.putExtra(CommentListActivity.POST_ID, ((Post) StatusFavoriteFragment.this
                    .postList.get(position - 1)).id);
            StatusFavoriteFragment.this.startActivity(intent);
        }
    });
    initAdapter();
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:25,代碼來源:StatusFavoriteFragment.java

示例10: initListView

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void initListView() {
    this.mPullToRefreshListView = (PullToRefreshListView) getView().findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullToRefreshListView.getRefreshableView();
    this.mPullToRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            FansFragment.this.page = 1;
            FansFragment.this.getFans();
        }
    });
    this.mPullToRefreshListView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> adapterView, View arg1, int arg2, long arg3) {
            Intent intent = new Intent(FansFragment.this.getActivity(), UserTimelineActivity
                    .class);
            intent.putExtra(UserTimelineActivity.NICK_NAME, FansFragment.this.mAdapter
                    .getItem(arg2 - 1).nickname);
            FansFragment.this.startActivity(intent);
        }
    });
    this.mPullToRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!FansFragment.this.isLastVisible) {
                FansFragment.this.getNextFans();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:27,代碼來源:FansFragment.java

示例11: onActivityCreated

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    if (this.mShopList != null) {
        loadAll();
    }
    this.mPullListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            ShopCategoryFragment.this.mPage = 1;
            ShopCategoryFragment.this.mCurrentPage = ShopCategoryFragment.this.mPage;
            ShopCategoryFragment.this.hasMore = true;
            ShopCategoryFragment.this.getLabelInit(true);
        }
    });
    this.mPullListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (ShopCategoryFragment.this.mPage > ShopCategoryFragment.this.mCurrentPage &&
                    ShopCategoryFragment.this.hasMore) {
                ShopCategoryFragment.this.mCurrentPage = ShopCategoryFragment.this.mPage;
                ShopCategoryFragment.this.getLabelInit(false);
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:24,代碼來源:ShopCategoryFragment.java

示例12: initListView

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void initListView() {
    this.mPullToRefreshListView = (PullToRefreshListView) getView().findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullToRefreshListView.getRefreshableView();
    this.mPullToRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            FriendFragment.this.getFriends();
        }
    });
    this.mPullToRefreshListView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> adapterView, View arg1, int arg2, long arg3) {
            Intent intent = new Intent(FriendFragment.this.getActivity(),
                    UserTimelineActivity.class);
            intent.putExtra(UserTimelineActivity.NICK_NAME, FriendFragment.this.mAdapter
                    .getItem(arg2 - 1).nickname);
            FriendFragment.this.startActivity(intent);
        }
    });
    this.mPullToRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!FriendFragment.this.isLastVisible) {
                FriendFragment.this.getNextFriends();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:26,代碼來源:FriendFragment.java

示例13: findViews

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void findViews() {
    this.fab_button = (FloatingActionButton) findViewById(R.id.fab_button);
    this.fab_button.setVisibility(8);
    this.mHeaderView = new ImageView(this);
    this.mHeaderView.setScaleType(ScaleType.CENTER_CROP);
    this.mHeaderView.setLayoutParams(new LayoutParams(-1, -2));
    this.mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.listview);
    this.mListView = (ListView) this.mPullRefreshListView.getRefreshableView();
    this.mListView.addHeaderView(this.mHeaderView);
    this.mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            ChannelPostsActivity.this.getCurrentTopic();
        }
    });
    this.mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            if (!ChannelPostsActivity.this.isLastVisible) {
                ChannelPostsActivity.this.getNextTopic();
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:23,代碼來源:ChannelPostsActivity.java

示例14: initView

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void initView() {
    View headerView = LayoutInflater.from(this.ctx).inflate(R.layout.h6, null);
    this.ivHeader = (ImageView) headerView.findViewById(R.id.iv_header);
    ViewUtils.setViewScaleHeight(this.ctx, this.ivHeader, 2, 1);
    ((ListView) this.pullToRefreshListView.getRefreshableView()).addHeaderView(headerView);
    this.pullToRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            SuccessStoryActivity.this.page = 1;
            SuccessStoryActivity.this.requestData();
        }
    });
    this.pullToRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
        public void onLastItemVisible() {
            SuccessStoryActivity.this.page = SuccessStoryActivity.this.page + 1;
            SuccessStoryActivity.this.requestData();
        }
    });
    this.pullToRefreshListView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            ItemsEntity itemsEntity = (ItemsEntity) adapterView.getAdapter().getItem(i);
            if (itemsEntity != null) {
                BooheeScheme.handleUrl(SuccessStoryActivity.this.ctx, itemsEntity.url);
            }
        }
    });
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:27,代碼來源:SuccessStoryActivity.java

示例15: initView

import com.handmark.pulltorefresh.library.PullToRefreshBase; //導入依賴的package包/類
private void initView() {
    this.pullToRefresh.setOnRefreshListener(new OnRefreshListener<ListView>() {
        public void onRefresh(PullToRefreshBase<ListView> pullToRefreshBase) {
            SpecialTrainPlanFragment.this.loadData();
        }
    });
    View footerView = LayoutInflater.from(getActivity()).inflate(R.layout.f7, null);
    ((TextView) footerView.findViewById(R.id.tv_tips)).setVisibility(8);
    ((TextView) footerView.findViewById(R.id.tv_add_sport)).setOnClickListener(new OnClickListener() {
        public void onClick(View view) {
            if (!SpecialTrainPlanFragment.this.isDetached()) {
                AddSpecialLessonActivity.comeOn(SpecialTrainPlanFragment.this.getActivity());
            }
        }
    });
    ((ListView) this.pullToRefresh.getRefreshableView()).addFooterView(footerView);
    this.pullToRefresh.setAdapter(this.adapter);
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:19,代碼來源:SpecialTrainPlanFragment.java


注:本文中的com.handmark.pulltorefresh.library.PullToRefreshBase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。