本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshListView.setOnRefreshListener方法的典型用法代码示例。如果您正苦于以下问题:Java PullToRefreshListView.setOnRefreshListener方法的具体用法?Java PullToRefreshListView.setOnRefreshListener怎么用?Java PullToRefreshListView.setOnRefreshListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.handmark.pulltorefresh.library.PullToRefreshListView
的用法示例。
在下文中一共展示了PullToRefreshListView.setOnRefreshListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SelectFavoriteFolderDialog
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
public SelectFavoriteFolderDialog(Context context, MQuestion question) {
super(context);
if (question == null) {
throw new IllegalArgumentException("question is null");
}
mQuestion = question;
setTitle(R.string.select_favorite_folder);
setContentView(R.layout.dialog_select_folder);
adjustHeight();
setPositiveButton(false, null, this);
mListView = (PullToRefreshListView) findViewById(R.id.list);
mListView.setOnRefreshListener(this);
View header = LayoutInflater.from(getContext()).inflate(R.layout.dialog_select_folder_header, null);
header.setOnClickListener(this);
mListView.getRefreshableView().addHeaderView(header);
mAdapter = new RequestAdapter(mLoader, mViewProvider);
mListView.setAdapter(mAdapter);
}
示例2: instantiateItem
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public View instantiateItem(ViewGroup container, int position) {
Context context = container.getContext();
PullToRefreshListView plv = (PullToRefreshListView) LayoutInflater.from(context).inflate(
R.layout.layout_listview_in_viewpager, container, false);
ListAdapter adapter = new ArrayAdapter<String>(context, android.R.layout.simple_list_item_1,
Arrays.asList(STRINGS));
plv.setAdapter(adapter);
plv.setOnRefreshListener(PullToRefreshListInViewPagerActivity.this);
// Now just add ListView to ViewPager and return it
container.addView(plv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
return plv;
}
示例3: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = initFragement(inflater, container,
R.layout.fragment_new_ats);
mAtsListView = (PullToRefreshListView) view.findViewById(R.id.at_list);
mProgressBar = ProgressBarFactory.getProgressBar(mAtsListView);
mAtsList = new LinkedList<>();
mAtsAdapter = new AtStatusAdapter(getActivity(), R.layout.item_at,
mAtsList);
mAtsListView.setAdapter(mAtsAdapter);
mAtsListView.setOnRefreshListener(getOnRefreshListener());
setAtList();
return view;
}
示例4: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view = initFragement(inflater, container);
mTimeLineControllor = new WeiboController(this);
mTimeLineView = (PullToRefreshListView) view
.findViewById(R.id.timeline);
mProgressBar = ProgressBarFactory.getProgressBar(mTimeLineView);
mWeiboItemAdapter = mTimeLineControllor.getAdapter();
Log.d(TAG, mWeiboItemAdapter.toString());
mTimeLineView.setAdapter(mWeiboItemAdapter);
mTimeLineView.setOnRefreshListener(mTimeLineControllor
.getOnRefreshListener());
mTimeLineControllor.initTimeLine();
return view;
}
示例5: initUserTimeline
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
private void initUserTimeline() {
mTimeLineControllor = new WeiboController(this,
R.layout.item_weibo_no_header);
mTimeLineView = (PullToRefreshListView) findViewById(R.id.timeline);
mTimeLineView.getRefreshableView().addHeaderView(mHomeHeader);
mProgressBar = ProgressBarFactory.getProgressBar(mTimeLineView);
WeiboItemAdapter statusAdapter = mTimeLineControllor.getAdapter();
mTimeLineView.setAdapter(statusAdapter);
mTimeLineView.setOnRefreshListener(mTimeLineControllor
.getOnRefreshListener());
/* 初始化 微博列表 */
mTimeLineControllor.initTimeLine();
}
示例6: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
/**
* Activity生成時にシステムから呼ばれる
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ptr_list);
// レイアウトからカスタムリストビューを取得
mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.pull_refresh_list);
// リストを引っ張ったときの処理を記述
mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
new GetDataTask().execute();
}
});
// リストビューにアイテム追加
mItemList = new LinkedList<String>();
mItemList.addAll(Arrays.asList(INITIAL_LIST));
mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mItemList);
ListView actualListView = mPullRefreshListView.getRefreshableView();
actualListView.setAdapter(mAdapter);
}
示例7: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.select_share);
refreshSharesListView = (PullToRefreshListView) findViewById(R.id.select_share_list);
sharesListView = refreshSharesListView.getRefreshableView();
refreshSharesListView.setOnRefreshListener(new OnRefreshListener<ListView>()
{
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView)
{
new GetDataTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
emptyTextView = findViewById(R.id.select_share_empty);
sharesListView.setOnItemClickListener(this);
registerForContextMenu(sharesListView);
View sharesMenuItem = findViewById(R.id.menu_shares);
menuDrawer.setActiveView(sharesMenuItem);
setActionBarTitle(R.string.common_appname);
setActionBarSubtitle(R.string.button_bar_shares);
load();
}
示例8: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.select_playlist);
refreshPlaylistsListView = (PullToRefreshListView) findViewById(R.id.select_playlist_list);
playlistsListView = refreshPlaylistsListView.getRefreshableView();
refreshPlaylistsListView.setOnRefreshListener(new OnRefreshListener<ListView>()
{
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView)
{
new GetDataTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
emptyTextView = findViewById(R.id.select_playlist_empty);
playlistsListView.setOnItemClickListener(this);
registerForContextMenu(playlistsListView);
View playlistsMenuItem = findViewById(R.id.menu_playlists);
menuDrawer.setActiveView(playlistsMenuItem);
setActionBarTitle(R.string.common_appname);
setActionBarSubtitle(R.string.playlist_label);
load();
}
示例9: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.select_genre);
refreshGenreListView = (PullToRefreshListView) findViewById(R.id.select_genre_list);
genreListView = refreshGenreListView.getRefreshableView();
refreshGenreListView.setOnRefreshListener(new OnRefreshListener<ListView>()
{
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView)
{
new GetDataTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
genreListView.setOnItemClickListener(this);
emptyView = findViewById(R.id.select_genre_empty);
registerForContextMenu(genreListView);
View browseMenuItem = findViewById(R.id.menu_browse);
menuDrawer.setActiveView(browseMenuItem);
setActionBarSubtitle(R.string.main_genres_title);
load();
}
示例10: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@SuppressLint("InflateParams")
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_select, null);
lv_select = (PullToRefreshListView) view.findViewById(R.id.lv_select);
lv_select.setMode(Mode.BOTH);
lv_select.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
if (refreshView.isHeaderShown()) {
lv_select.getLoadingLayoutProxy(false, true).setPullLabel("下拉可以刷新...");
lv_select.getLoadingLayoutProxy(false, true).setRefreshingLabel("正在刷新...");
lv_select.getLoadingLayoutProxy(false, true).setReleaseLabel("松开之后更新数据...");
getData();
} else {
lv_select.getLoadingLayoutProxy(false, true).setPullLabel("上拉加载更多...");
lv_select.getLoadingLayoutProxy(false, true).setRefreshingLabel("正在加载...");
lv_select.getLoadingLayoutProxy(false, true).setReleaseLabel("松开之后更新数据...");
getNextPage();
}
}
});
getData();
return view;
}
示例11: initView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
public void initView(View rootView) {
rootView.findViewById(R.id.back).setVisibility(View.GONE);
tvTitle = (TextView) rootView.findViewById(R.id.title);
tvTitle.setText("资讯中心");
emptyView = rootView.findViewById(R.id.empty);
newsList = (PullToRefreshListView) rootView.findViewById(R.id.newslist);
newsList.setOnItemClickListener(this);
newsList.setMode(Mode.BOTH);
newsList.setScrollingWhileRefreshingEnabled(false);
newsList.setOnRefreshListener(this);
newsList.setOnLastItemVisibleListener(this);
newsList.setEmptyView(emptyView);
}
示例12: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
/**
* 在onCreate之后调用
* @param inflater
* @param container
* @param savedInstanceState
* @return
*/
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fragment_main, container, false);
mPullRefreshListView = (PullToRefreshListView)view.findViewById(R.id.messageList);
// 设置刷新模式
mPullRefreshListView.setMode(PullToRefreshBase.Mode.PULL_FROM_START);
// 设置列表内容
ListView actualListView = mPullRefreshListView.getRefreshableView();
//生成动态数组,并且转入数据
itemsData = getMessages();
mAdapter= new SimpleAdapter(MainTabFragment.this.getActivity(), //没什么解释
itemsData,//数据来源
R.layout.item_list_fragment_main,//XML实现
new String[]{"Avatar", "UserName", "Message", "Time", "Number"}, //动态数据KEY
new int[]{R.id.avatar, R.id.userName, R.id.message, R.id.time, R.id.number});
actualListView.setAdapter(mAdapter);
/*定义事件*/
mPullRefreshListView.setOnItemClickListener(new CustomOnItemClickListener());
mPullRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
// 异步获取消息任务
new GetMessagesTask().execute();
}
});
return view;
}
示例13: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
listView = (PullToRefreshListView)findViewById(R.id.listView);
adapter = new SimpleCursorAdapter(this,
R.layout.tweet_view,
null,
new String[]{ Tweets.USER_NAME, Tweets.BODY },
new int[]{ R.id.user_name_text_view, R.id.body_text_view },
0);
listView.setAdapter(adapter);
listView.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
update();
}
});
getSupportLoaderManager().initLoader(LOADER_ID, null, loaderCallbacks);
requestManager = RestRequestManager.from(this);
final Button button = (Button) findViewById(R.id.buttonRequest);
final EditText edit = (EditText)findViewById(R.id.editRequest);
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
requestString = edit.getText().toString();
update();
}
});
}
示例14: onViewCreated
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
final PullToRefreshListView pullToRefreshView = getPullToRefreshListView();
pullToRefreshView.setShowIndicator(false);
pullToRefreshView.setOnRefreshListener(new OnRefreshListener() {
public void onRefresh(PullToRefreshBase refreshView) {
try {
Fetch fetch = new Fetch(FileRepositoryBuilder.create(gitDirFrom(getArguments())), DEFAULT_REMOTE_NAME);
gitAsyncTaskFactory.createTaskFor(fetch, new CasualShortTermLifetime() {
public void error(OpNotification errorNotification) {
pullToRefreshView.setLastUpdatedLabel("Last Fetch failed: " + errorNotification.getTickerText());
pullToRefreshView.onRefreshComplete();
Toast.makeText(getActivity(), errorNotification.getTickerText(), LENGTH_SHORT).show();
}
public void success(OpNotification completionNotification) {
pullToRefreshView.setLastUpdatedLabel("Last Fetch: " + formatDateTime(getActivity(), currentTimeMillis(), FORMAT_SHOW_TIME));
refresh();
}
}).execute();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
});
getListView().setFastScrollEnabled(true);
}
示例15: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View page = inflater.inflate(R.layout.fragment_userlist, container, false);
PullToRefreshListView listView = getListView(page);
UserListListAdapter adapter = getListAdapter((MainActivity) getActivity());
listView.setAdapter(adapter);
listView.setOnScrollListener(this);
listView.setOnRefreshListener(this);
listView.setMode(getRefreshMode());
ImageButton buttonUserLists = getUserListsButton(page);
buttonUserLists.setOnClickListener(this);
textListName = getTextListName(page);
textListName.setText(adapter.getListFullName());
return page;
}