当前位置: 首页>>代码示例>>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;未经允许,请勿转载。