本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshGridView.setOnLastItemVisibleListener方法的典型用法代码示例。如果您正苦于以下问题:Java PullToRefreshGridView.setOnLastItemVisibleListener方法的具体用法?Java PullToRefreshGridView.setOnLastItemVisibleListener怎么用?Java PullToRefreshGridView.setOnLastItemVisibleListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.handmark.pulltorefresh.library.PullToRefreshGridView
的用法示例。
在下文中一共展示了PullToRefreshGridView.setOnLastItemVisibleListener方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshGridView; //导入方法依赖的package包/类
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mChannelList = (PullToRefreshGridView) inflater.inflate(R.layout.fragment_live,
container,
false);
// mChannelList = (PullToRefreshGridView) view.findViewById(R.id.channel_list);
mChannelList.setMode(Mode.DISABLED);
mChannelList.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
@Override
public void onLastItemVisible() {
if (mHasMore) {
getNextPage();
}
}
});
mChannelList.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
// TODO Auto-generated method stub
// Intent intent;
// intent = new Intent(getActivity(), VideoDetailPages.class);
// intent.putExtra("gameurl", "rtmp://192.168.41.234/live/hello");
// startActivity(intent);
}
});
mAdapter = new LiveChannelAdapter();
mChannelList.setAdapter(mAdapter);
getNextPage();
Log.d(TAG, "FragmentLive: onCreateView");
return mChannelList;
}
示例2: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshGridView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
Intent intent = getIntent();
mGameId = intent.getIntExtra(GAME_ID, 0);
if (mGameId == 0) {
finish();
return;
}
setContentView(R.layout.fragment_live);
mGameName = intent.getStringExtra(GAME_NAME);
setTitle(getResources().getString(R.string.live_channel_title,
mGameName));
Log.d(TAG, "live channel: game id=" + mGameId);
Log.d(TAG, "live channel: game name=" + mGameName);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
mAdapter = new LiveChannelAdapter();
mLiveChannels = (PullToRefreshGridView) findViewById(R.id.channel_list);
mLiveChannels.setAdapter(mAdapter);
mLiveChannels.setMode(Mode.DISABLED);
mLiveChannels.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
@Override
public void onLastItemVisible() {
getNextPage();
}
});
getNextPage();
}