本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshListView.setOnItemClickListener方法的典型用法代码示例。如果您正苦于以下问题:Java PullToRefreshListView.setOnItemClickListener方法的具体用法?Java PullToRefreshListView.setOnItemClickListener怎么用?Java PullToRefreshListView.setOnItemClickListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.handmark.pulltorefresh.library.PullToRefreshListView
的用法示例。
在下文中一共展示了PullToRefreshListView.setOnItemClickListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initTitleBar
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
protected void initTitleBar() {
ptrListView = (PullToRefreshListView) this
.findViewById(R.id.book_source_list);
tv_current_booksource = (TextView) this
.findViewById(R.id.tv_current_booksource);
booksource_line = (View) this.findViewById(R.id.booksource_line);
tv_other_booksource = (TextView) this
.findViewById(R.id.tv_other_booksource);
ptrListView.setMode(Mode.DISABLED);
ptrListView.setOnItemClickListener(this);
mTitleBar = (BookTitleBar) this.findViewById(R.id.book_titleBar);
mTitleBar.setBackgroundColor(BookTheme.THEME_COLOR);
mTitleBar.setTitle("书籍换源");
mTitleBar.setRightLogoGone();
mTitleBar.setLeftDrawable(R.drawable.book_details_close);
mTitleBar.getLeftTextView().setOnClickListener(this);
}
示例2: 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);
}
示例3: 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;
}
示例4: initViews
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
protected void initViews(View view) {
mErrorLayout = (EmptyLayout) view.findViewById(R.id.error_layout);
mErrorLayout.setOnLayoutClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mCurrentPage = 0;
mState = STATE_REFRESH;
mErrorLayout.setErrorType(EmptyLayout.NETWORK_LOADING);
requestData(true);
}
});
mListView = (PullToRefreshListView) view.findViewById(R.id.listview);
mListView.setOnItemClickListener(this);
mListView.setOnRefreshListener(this);
mListView.setOnLastItemVisibleListener(this);
if (mAdapter != null) {
mListView.setAdapter(mAdapter);
mErrorLayout.setErrorType(EmptyLayout.HIDE_LAYOUT);
} else {
mAdapter = getListAdapter();
// mListView.setRefreshing();
mListView.setAdapter(mAdapter);
if (requestDataIfViewCreated()) {
mCurrentPage = 0;
mState = STATE_REFRESH;
mErrorLayout.setErrorType(EmptyLayout.NETWORK_LOADING);
requestData(false);
} else {
mErrorLayout.setErrorType(EmptyLayout.HIDE_LAYOUT);
}
}
if (mStoreEmptyState != -1) {
mErrorLayout.setErrorType(mStoreEmptyState);
}
}
示例5: initViews
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
private void initViews(View view) {
mScrollLayout = (ScrollLayout) view.findViewById(R.id.scrolllayout);
mScrollLayout.setIsScroll(false);
mEmptyView = (EmptyLayout) view.findViewById(R.id.error_layout);
mLvCatalog = (ListView) view.findViewById(R.id.lv_catalog);
mLvCatalog.setOnItemClickListener(mCatalogOnItemClick);
mLvTag = (ListView) view.findViewById(R.id.lv_tag);
mLvTag.setOnItemClickListener(mTagOnItemClick);
mLvSoftware = (PullToRefreshListView) view
.findViewById(R.id.lv_software);
mLvSoftware.setOnRefreshListener(this);
mLvSoftware.setOnLastItemVisibleListener(this);
mLvSoftware.setOnItemClickListener(this);
if (mCatalogAdapter == null) {
mCatalogAdapter = new SoftwareCatalogAdapter();
sendRequestCatalogData(mCatalogHandler);
}
mLvCatalog.setAdapter(mCatalogAdapter);
if (mTagAdapter == null) {
mTagAdapter = new SoftwareCatalogAdapter();
}
mLvTag.setAdapter(mTagAdapter);
if (mSoftwareAdapter == null) {
mSoftwareAdapter = new SoftwareAdapter();
}
mLvSoftware.setAdapter(mSoftwareAdapter);
}
示例6: 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);
}
示例7: refreshList
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
public void refreshList() {
myList = (PullToRefreshListView) findViewById(R.id.events_list);
adapter = new EventsAdapter(this, R.layout.events_row, events);
myList.setAdapter(adapter);
myList.setOnItemClickListener(listener);
setSupportProgressBarIndeterminateVisibility(Boolean.FALSE);
}
示例8: refreshList
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
public void refreshList() {
myList = (PullToRefreshListView) findViewById(R.id.announcements_list);
adapter = new NewsAdapter(this, R.layout.news_row, listContent);
myList.setAdapter(adapter);
myList.setOnItemClickListener(listener);
setSupportProgressBarIndeterminateVisibility(Boolean.FALSE);
}
示例9: refreshList
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
public void refreshList() {
View view = getView();
if(view != null) {
listView = (PullToRefreshListView) getView().findViewById(R.id.listView1);
adapter = new GradeAdapter(getActivity(), R.layout.grade_item_row, isSemesterOne ? semesterList1 : semesterList2); // was mainlist
listView.setAdapter(adapter);
listView.setOnItemClickListener(listener);
}
}
示例10: refreshList
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
public void refreshList() {
myList = (PullToRefreshListView) findViewById(R.id.news_list);
adapter = new NewsAdapter(this, R.layout.news_row, listContent);
myList.setAdapter(adapter);
myList.setOnItemClickListener(listener);
setSupportProgressBarIndeterminateVisibility(Boolean.FALSE);
}
示例11: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.camera_list);
mUserInfo = UserInfo.getUserInfo(this);
mLayoutInflater = LayoutInflater.from(this);
mUserLayout = (DrawerLayout) findViewById(R.id.user_layout);
mCameraListView = (PullToRefreshListView) findViewById(R.id.cameraList);
mCameraListView.setOnRefreshListener(this);
findViewById(R.id.help).setOnClickListener(this);
findViewById(R.id.feedback).setOnClickListener(this);
findViewById(R.id.about).setOnClickListener(this);
findViewById(R.id.disclaimer).setOnClickListener(this);
findViewById(R.id.business).setOnClickListener(this);
Button logout = (Button) findViewById(R.id.logout);
logout.setOnClickListener(this);
if(!mUserInfo.isLogin) logout.setVisibility(View.INVISIBLE);
TextView userNameView = (TextView) findViewById(R.id.user_name);
String name = getResources().getString(R.string.not_login);
userNameView.setText(StringUtils.isEmpty(mUserInfo.name) ? name : mUserInfo.name);
// mToolbar = (Toolbar) findViewById(R.id.toolbar);
// mToolbar.setTitle(R.string.app_name);
// setSupportActionBar(mToolbar);
// mToolbar.setOnMenuItemClickListener(this);
// mToolbar.setNavigationIcon(R.drawable.navigation_icon);
// mToolbar.setNavigationOnClickListener(new OnClickListener() {
//
// @Override
// public void onClick(View v) {
// if(!mUserLayout.isDrawerOpen(Gravity.LEFT))
// mUserLayout.openDrawer(Gravity.LEFT);
// }
// });
mViewer = Viewer.getViewer();
mMyViewerHelper = MyViewerHelper.getInstance(getApplicationContext());
mMyViewerHelper.addCameraStateListener(this);
mCameraDefaulThumb = BitmapFactory.decodeResource(getResources(), R.drawable.avs_type_android);
mCameraInfoManager = new CameraInfoManager(this);
mCameraInfos = mMyViewerHelper.getAllCameraInfos();
for (CameraInfo info : mCameraInfos) {
addStreamer(info.getCid(), info.getCameraUser(), info.getCameraPwd());
}
mCameraListAdapter = new CameraListAdapter(this, mCameraInfos);
mCameraListView.setAdapter(mCameraListAdapter);
mCameraListView.setOnItemClickListener(this);
// mCameraListView.setOnScrollChangeListener(new OnScrollChangeListener() {
//
// @Override
// public void onScrollChange(View v, int scrollX, int scrollY,
// int oldScrollX, int oldScrollY) {
// mCameraListAdapter.closeAllItems();
// }
// });
mShowChinese = "zh".equals(Locale.getDefault().getLanguage().toLowerCase());
mCameraListHandler = new CameraListHandler(this, mHandler);
mCameraListHandler.doThing(CameraListHandler.SYNC_CID_REQUEST);
mAddCidHandler = new AddCidHandler(this, mHandler);
mEditCidHandler = new EditCidHandler(this, mHandler);
//update
UmengUpdateAgent.setUpdateOnlyWifi(false);
UmengUpdateAgent.update(this);
findViewById(R.id.back_linlayout).setOnClickListener(this);
findViewById(R.id.titlebar_back_image).setBackgroundResource(R.drawable.navigation_icon);
titlebar_back_text = (TextView) findViewById(R.id.titlebar_back_text);
titlebar_back_text.setText(R.string.app_name);
titlebar_opt_image = (ImageView) findViewById(R.id.titlebar_opt_image);
titlebar_opt_image.setBackgroundResource(R.drawable.add_icon);//(getResources().getDrawable(R.drawable.add_icon));
findViewById(R.id.opt_linlayout).setOnClickListener(this);
add_layout = (LinearLayout) findViewById(R.id.add_layout);
// findViewById(R.id.add_cid).setOnClickListener(this);
// findViewById(R.id.add_cid_by_qr).setOnClickListener(this);
}
示例12: onCreateView
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
this.inflater = inflater;
View rootView = inflater.inflate(R.layout.fragment_main_dummy, container, false);
list = (PullToRefreshListView) rootView.findViewById(R.id.list);
timeOut = rootView.findViewById(R.id.time_out_text);
loadding = rootView.findViewById(R.id.loading);
footView = inflater.inflate(R.layout.list_footerview, list.getRefreshableView(),false);
list.getRefreshableView().addFooterView(footView, null, false);
loadingLayout = list.getLoadingLayoutProxy(true, false);
list.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
// Do work to refresh the list here.
if(BuildConfig.DEBUG)
Log.d(TAG, String.format("[%d] on refresh ",section));
isLoading = true;
String label = DateUtils.formatDateTime(getActivity() != null ? getActivity() : AcApp.context(),
System.currentTimeMillis(),
DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_ABBREV_ALL);
loadingLayout.setLastUpdatedLabel(label);
loadData(true,false);
}
});
list.setOnLastItemVisibleListener(new OnLastItemVisibleListener() {
@Override
public void onLastItemVisible() {
if(!isLoading){
if(hasNextPage()){
if(BuildConfig.DEBUG)
Log.d(TAG, String.format("[%d] 加载下一页, mode=%d",section,listMode));
loadData(false,false);
}else{
timeOut.setVisibility(View.GONE);
TextView text = (TextView) footView.findViewById(R.id.list_footview_text);
text.setText(R.string.no_more);
footView.findViewById(R.id.list_footview_progress).setVisibility(View.GONE);
footView.setOnClickListener(null);
}
}
}
});
list.setOnItemClickListener(this);
return rootView;
}
示例13: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NotificationService.resetNotificationInfo();
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_calendar);
setTitle("Calendar");
setBehindContentView(R.layout.menu_frame);
Calendar c = Calendar.getInstance();
month = c.get(Calendar.MONTH) + 1; // January -> 0, December -> 11 ... this corrects it
year = c.get(Calendar.YEAR);
dayOfMonth = c.get(Calendar.DATE);
calUrl1 += month + "/1/" + year + CALENDAR_MODULE;
if(month == 12) {
calUrl2 += "1/1/" + (year + 1) + CALENDAR_MODULE;
}
else {
calUrl2 += (month + 1) + "/1/" + year + CALENDAR_MODULE;
}
listener = new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
String url = calUrl2;
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
}
};
if (savedInstanceState == null) {
mFrag = new MenuListFragment();
getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, mFrag).commit();
} else {
mFrag = (MenuListFragment)this.getSupportFragmentManager().findFragmentById(R.id.menu_frame);
}
sm = getSlidingMenu();
sm.setShadowWidthRes(R.dimen.shadow_width);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
sm.setFadeDegree(0.35f);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE); // fullscreen is bad
getActionBar().setDisplayHomeAsUpEnabled(true);
myList = (PullToRefreshListView) findViewById(R.id.events_list);
adapter = new EventsAdapter(this, R.layout.events_row, events);
myList.setAdapter(adapter);
myList.setOnItemClickListener(listener);
setSupportProgressBarIndeterminateVisibility(Boolean.TRUE);
myList.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
new DownloadEventsTask().execute("");
}
});
new DownloadEventsTask().execute("");
}
示例14: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NotificationService.resetNotificationInfo();
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_announcements);
setTitle("Announcements");
setBehindContentView(R.layout.menu_frame);
if (savedInstanceState == null) {
mFrag = new MenuListFragment();
getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, mFrag).commit();
} else {
mFrag = (MenuListFragment)this.getSupportFragmentManager().findFragmentById(R.id.menu_frame);
}
sm = getSlidingMenu();
sm.setShadowWidthRes(R.dimen.shadow_width);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
sm.setFadeDegree(0.35f);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE); // fullscreen is bad
getActionBar().setDisplayHomeAsUpEnabled(true);
myList = (PullToRefreshListView) findViewById(R.id.announcements_list);
adapter = new NewsAdapter(this, R.layout.news_row, listContent);
myList.setAdapter(adapter);
myList.setOnItemClickListener(listener);
setSupportProgressBarIndeterminateVisibility(Boolean.TRUE);
myList.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
new DownloadAnnouncementsTask().execute("");
}
});
new DownloadAnnouncementsTask().execute("");
}
示例15: onCreate
import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
NotificationService.resetNotificationInfo();
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
setContentView(R.layout.activity_news_rss);
setTitle("News");
setBehindContentView(R.layout.menu_frame);
if (savedInstanceState == null) {
mFrag = new MenuListFragment();
getSupportFragmentManager().beginTransaction().replace(R.id.menu_frame, mFrag).commit();
} else {
mFrag = (MenuListFragment)this.getSupportFragmentManager().findFragmentById(R.id.menu_frame);
}
sm = getSlidingMenu();
sm.setShadowWidthRes(R.dimen.shadow_width);
sm.setShadowDrawable(R.drawable.shadow);
sm.setBehindOffsetRes(R.dimen.slidingmenu_offset);
sm.setFadeDegree(0.35f);
sm.setTouchModeAbove(SlidingMenu.TOUCHMODE_NONE);
getActionBar().setDisplayHomeAsUpEnabled(true);
myList = (PullToRefreshListView) findViewById(R.id.news_list);
adapter = new NewsAdapter(this, R.layout.news_row, listContent);
myList.setAdapter(adapter);
myList.setOnItemClickListener(listener);
setSupportProgressBarIndeterminateVisibility(Boolean.TRUE);
myList.setOnRefreshListener(new OnRefreshListener<ListView>() {
@Override
public void onRefresh(PullToRefreshBase<ListView> refreshView) {
new DownloadNewsTask().execute("http://www.bcp.org/news/rss.aspx?ModuleID=191");
}
});
new DownloadNewsTask().execute(NEWS_RSS_FEED);
}