本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshListView.getRefreshableView方法的典型用法代码示例。如果您正苦于以下问题:Java PullToRefreshListView.getRefreshableView方法的具体用法?Java PullToRefreshListView.getRefreshableView怎么用?Java PullToRefreshListView.getRefreshableView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.handmark.pulltorefresh.library.PullToRefreshListView
的用法示例。
在下文中一共展示了PullToRefreshListView.getRefreshableView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onActivityCreated
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
int type = getArguments().getInt(TAB_TYPE);
mContext = getActivity();
if (AppConstants.NEW_FORUM_ID == type) {
threadId = AppConstants.NEW_FORUM_ID;
tag =AppConstants.NEWFORUM_REQUEST_TAG;
} else {
threadId = AppConstants.SECRITY_FORUM_ID;
tag = AppConstants.SECURITY_REQUEST_TAG;
}
url = UrlUtil.getThreadUrl(threadId, 1);
mBar = (LinearLayout) getView().findViewById(R.id.id_layout_progressbar);
mBar.setVisibility(View.VISIBLE);
pullToRefreshListView = (PullToRefreshListView) getView().findViewById(R.id.id_pull_refresh_listview);
initData();
getDatas();
initEvent();
mAdapter = new ThreadAdapter(mContext,datas,type);
ListView mListView = pullToRefreshListView.getRefreshableView();
mListView.setAdapter(mAdapter);
}
示例2: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent input = getIntent();
if (input != null) {
subBean = (ForumSubBean) input.getSerializableExtra(KEY);
}
if (subBean != null) {
getSupportActionBar().setTitle(subBean.getName());
}
setContentView(R.layout.acitivity_forum_show);
pListView = (PullToRefreshListView) findViewById(R.id.id_pull_refresh_listview);
mBar = (LinearLayout) findViewById(R.id.id_layout_progressbar);
mBar.setVisibility(View.VISIBLE);
initData();
getDatas(curPage);
initEvent();
mAdapter = new ThreadAdapter(ForumShowActivity.this, datas,0);
ListView mListView = pListView.getRefreshableView();
mListView.setAdapter(mAdapter);
}
示例3: initViews
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void initViews() {
rlBack=(RelativeLayout)findViewById(R.id.rlBack);
material_back_button=(MaterialMenuView) findViewById(R.id.material_back_button);
tvTitle=(TextView) findViewById(R.id.tvTitle);
ivRight=(ImageView) findViewById(R.id.ivRight);
ivRight.setImageResource(R.mipmap.ic_menu_add);
ivRight.setVisibility(View.VISIBLE);
plAlbums=(PullToRefreshListView)findViewById(R.id.plAlbums);
lvAlbums=plAlbums.getRefreshableView();
material_back_button.setState(MaterialMenuDrawable.IconState.ARROW);
tvTitle.setText("相册");
FooterView= LayoutInflater.from(this).inflate(R.layout.list_footer,null);
ivLoading =(ImageView) FooterView.findViewById(R.id.ivLoading);
tvLoading=(TextView)FooterView.findViewById(R.id.tvLoading);
lvAlbums.addFooterView(FooterView);
loading(ivLoading);
}
示例4: 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);
}
示例5: 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();
}
示例6: 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();
}
示例7: 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();
}
示例8: 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;
}
示例9: initList
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
private void initList() {
mPtr = (PullToRefreshListView)findViewById(R.id.list);
mPtr.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
if(!isloading){
pageIndex = 1;
requestData(pageIndex,true);
}
}
});
mPtr.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
@Override
public void onLastItemVisible() {
if(hasNextPage){
if(!isloading){
requestData(++pageIndex,false);
}
} else{
mFootview.findViewById(R.id.list_footview_progress).setVisibility(View.GONE);
((TextView)mFootview.findViewById(R.id.list_footview_text)).setText(R.string.no_more);
}
}
});
mList = mPtr.getRefreshableView();
mLoadingBar = (ProgressBar) findViewById(R.id.loading);
mTimeOutText = (TextView) findViewById(R.id.time_out_text);
mTimeOutText.setText(R.string.time_out);
mTimeOutText.setOnClickListener(this);
mFootview = LayoutInflater.from(this).inflate(R.layout.list_footerview, mList, false);
mList.setVisibility(View.INVISIBLE);
mList.addFooterView(mFootview);
mFootview.setClickable(false);
mList.setFooterDividersEnabled(false);
mList.setOnItemClickListener(this);
mAdapter = new MentionsAdapter(this, contentList, data, commentIdList);
mList.setAdapter(mAdapter);
}
示例10: initP2RLvAndThread
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
void initP2RLvAndThread() {
// init p2r
p2r_lv = (PullToRefreshListView) this.findViewById(R.id.p2r_lv);
ListView listview = p2r_lv.getRefreshableView();
listview.setVerticalFadingEdgeEnabled(false);
p2r_lv.setMode(Mode.PULL_FROM_END);
p2r_lv.setShowIndicator(false);
p2r_lv.setOnItemClickListener(this);
p2r_lv.setOnRefreshListener(this);
p2r_lv.setAdapter(getAdapter());
// init msgHandler
Looper looper = Looper.myLooper();
msgHandler = new MessageHandler(looper);
}
示例11: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
// Inflate the layout for this fragment
imageloader = ConfiguratedImageLoader.getImageLoader((Activity)mListener);
Log.i("onCreateView","onCreateView");
//se come background metto un loading.. e poi lo rendo invisibile una volta caircato
View view = inflater.inflate(getFragmentViewId(), container, false);
progress = (ProgressBar)view.findViewById(R.id.progressBar3);
progress.setVisibility(View.VISIBLE);
pullListView = (PullToRefreshListView) view.findViewById(R.id.listViewCheckBoxFEATURES);
listView = pullListView.getRefreshableView();
return view;
}
示例12: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
view = inflater.inflate(R.layout.whu_zheng_wen, container,false);
refreshView = (PullToRefreshListView)view.findViewById(R.id.whu_zheng_wen_list);
refreshView.setMode(Mode.BOTH);
actuallListView = refreshView.getRefreshableView();
registerForContextMenu(actuallListView);
new MyAsyncTask().execute(0);
initListView();
setListener();
return view;
}
示例13: 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_artist);
refreshArtistListView = (PullToRefreshListView) findViewById(R.id.select_artist_list);
artistListView = refreshArtistListView.getRefreshableView();
refreshArtistListView.setOnRefreshListener(new OnRefreshListener<ListView>()
{
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView)
{
new GetDataTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
});
artistListView.setOnItemClickListener(this);
folderButton = LayoutInflater.from(this).inflate(R.layout.select_artist_header, artistListView, false);
if (folderButton != null)
{
folderName = (TextView) folderButton.findViewById(R.id.select_artist_folder_2);
}
if (!Util.isOffline(this) && !Util.getShouldUseId3Tags(this))
{
artistListView.addHeaderView(folderButton);
}
registerForContextMenu(artistListView);
String title = getIntent().getStringExtra(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TITLE);
if (title == null)
{
setActionBarSubtitle(Util.isOffline(this) ? R.string.music_library_label_offline : R.string.music_library_label);
}
else
{
setActionBarSubtitle(title);
}
View browseMenuItem = findViewById(R.id.menu_browse);
menuDrawer.setActiveView(browseMenuItem);
musicFolders = null;
load();
}
示例14: 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.activity_ptr_list);
mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.pull_refresh_list);
// Set a listener to be invoked when the list should be refreshed.
mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
String label = DateUtils.formatDateTime(getApplicationContext(), System.currentTimeMillis(),
DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL);
// Update the LastUpdatedLabel
refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label);
// Do work to refresh the list here.
new GetDataTask().execute();
}
});
// Add an end-of-list listener
mPullRefreshListView.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
@Override
public void onLastItemVisible() {
Toast.makeText(PullToRefreshListActivity.this, "End of List!", Toast.LENGTH_SHORT).show();
}
});
ListView actualListView = mPullRefreshListView.getRefreshableView();
// Need to use the Actual ListView when registering for Context Menu
registerForContextMenu(actualListView);
mListItems = new LinkedList<String>();
mListItems.addAll(Arrays.asList(mStrings));
mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, mListItems);
/**
* Add Sound Event Listener
*/
SoundPullEventListener<ListView> soundListener = new SoundPullEventListener<ListView>(this);
soundListener.addSoundEvent(State.PULL_TO_REFRESH, R.raw.pull_event);
soundListener.addSoundEvent(State.RESET, R.raw.reset_sound);
soundListener.addSoundEvent(State.REFRESHING, R.raw.refreshing_sound);
mPullRefreshListView.setOnPullEventListener(soundListener);
// You can also just use setListAdapter(mAdapter) or
// mPullRefreshListView.setAdapter(mAdapter)
actualListView.setAdapter(mAdapter);
}
示例15: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
forumDatabaseHelper = new ForumDatabaseHelper(getApplicationContext(), "v2ex_touch.db3", 1);
ArrayList<ForumPost> HotTopicsArray = new ArrayList<>();
setContentView(R.layout.activity_main_browser);
mConnectionDetector = new ConnectionDetector(getApplicationContext());
mNavigationDrawerFragment = (NavigationDrawerFragment)
getSupportFragmentManager().findFragmentById(R.id.navigation_drawer);
mTitle = getTitle();
// Set up the drawer.
mNavigationDrawerFragment.setUp(
R.id.navigation_drawer,
(DrawerLayout) findViewById(R.id.drawer_layout));
// Main View
mPullRefreshListView = (PullToRefreshListView) findViewById(R.id.pull_refresh_list);
// Set a listener to be invoked when the list should be refreshed.
mPullRefreshListView.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
String label = DateUtils.formatDateTime(getApplicationContext(), System.currentTimeMillis(),
DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL);
// Update the LastUpdatedLabel
refreshView.getLoadingLayoutProxy().setLastUpdatedLabel(label);
// Do work to refresh the list here.
if (mConnectionDetector.isConnectingToInternet()) {
RequestQueue mQueue = Volley.newRequestQueue(getApplicationContext());
JsonArrayRequest jar = new JsonArrayRequest("https://www.v2ex.com/api/topics/hot.json",
new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
Log.d("Response", response.toString());
try {
MainBrowser.this.getHotTopicsFromWeb(response);
} catch (Exception e) {
Log.e("v2ex_touch", e.toString());
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.d("Error.Response", error.toString());
}
}
);
mQueue.add(jar);
} else {
MainBrowser.this.showToast(getApplicationContext(), "无网络连接");
}
}
});
ListView actualListView = mPullRefreshListView.getRefreshableView();
// Need to use the Actual ListView when registering for Context Menu
registerForContextMenu(actualListView);
mTopicAdapter = new TopicAdapter(getApplicationContext(), HotTopicsArray);
// You can also just use setListAdapter(mAdapter) or
actualListView.setAdapter(mTopicAdapter);
}