当前位置: 首页>>代码示例>>Java>>正文


Java PullToRefreshListView.setAdapter方法代码示例

本文整理汇总了Java中com.handmark.pulltorefresh.library.PullToRefreshListView.setAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java PullToRefreshListView.setAdapter方法的具体用法?Java PullToRefreshListView.setAdapter怎么用?Java PullToRefreshListView.setAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.handmark.pulltorefresh.library.PullToRefreshListView的用法示例。


在下文中一共展示了PullToRefreshListView.setAdapter方法的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);
}
 
开发者ID:fengyanjava,项目名称:msb-android,代码行数:25,代码来源:SelectFavoriteFolderDialog.java

示例2: onCreate

import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_post_detail);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    threadBean = (ThreadBean) getIntent().getSerializableExtra(ACTIVITY_KEY);
    getSupportActionBar().setTitle(R.string.post_comments);
    threadBean = (ThreadBean) getIntent().getSerializableExtra(ACTIVITY_KEY);
    getDatas();
    mListView = (PullToRefreshListView) findViewById(R.id.id_pullListView);
    progressbar = (LinearLayout) findViewById(R.id.id_layout_progressbar);
    progressbar.setVisibility(View.VISIBLE);
    initPullListView();
    initEvent();
    mAdapter = new PostReplyAdapter(this, datas);
    mListView.setAdapter(mAdapter);
}
 
开发者ID:bianwl,项目名称:kanxue,代码行数:18,代码来源:PostActivity.java

示例3: 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;
}
 
开发者ID:chongbo2013,项目名称:OverPulltorefresh,代码行数:19,代码来源:PullToRefreshListInViewPagerActivity.java

示例4: 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;
}
 
开发者ID:minixalpha,项目名称:Webo,代码行数:18,代码来源:ViewAtFragment.java

示例5: 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;
}
 
开发者ID:minixalpha,项目名称:Webo,代码行数:23,代码来源:ViewWeiboFragment.java

示例6: 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();

}
 
开发者ID:minixalpha,项目名称:Webo,代码行数:19,代码来源:HomePageActivity.java

示例7: 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();
    }
  });
}
 
开发者ID:lehinevych,项目名称:PatternAndroid,代码行数:35,代码来源:MainActivity.java

示例8: 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;
}
 
开发者ID:lacolaco,项目名称:SmileEssence,代码行数:16,代码来源:UserListFragment.java

示例9: 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_list, container, false);
    Bundle args = getArguments();
    int fragmentIndex = args.getInt(ADAPTER_INDEX);
    PullToRefreshListView listView = getListView(page);
    ListAdapter adapter = getListAdapter(fragmentIndex);
    listView.setAdapter(adapter);
    listView.setOnScrollListener(this);
    listView.setOnRefreshListener(this);
    listView.setMode(getRefreshMode());
    return page;
}
 
开发者ID:lacolaco,项目名称:SmileEssence,代码行数:14,代码来源:CustomListFragment.java

示例10: 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);
	}
}
 
开发者ID:447491480,项目名称:ima_intellj,代码行数:40,代码来源:BaseListFragment.java

示例11: 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);
}
 
开发者ID:447491480,项目名称:ima_intellj,代码行数:31,代码来源:SoftwareCataglogFragment.java

示例12: onCreate

import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle bundle) {
    super.onCreate(bundle);

    setContentView(R.layout.activity_fav);

    mBottomPanelHeight = getResources().getDimensionPixelSize(R.dimen.bottom_panel_height);

    mFooterView = new View(this);
    mFooterView.setLayoutParams(new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,
            mBottomPanelHeight));

    mFavList = (PullToRefreshListView) findViewById(R.id.fav_list);
    mFavList.setMode(Mode.DISABLED);

    mFavAdapter = new FavAdapter();
    mFavList.setAdapter(mFavAdapter);

    mBottomPanel = findViewById(R.id.bottom_panel);

    mSelectAll = findViewById(R.id.select_all);
    mSelectAll.setOnClickListener(mSelectAllClickListener);
    mConfirmDelete = findViewById(R.id.confirm_delete);
    mConfirmDelete.setOnClickListener(mConfirmDeleteClickListener);

    getFav();
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:28,代码来源:FavActivity.java

示例13: onCreate

import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_android_pull_to_refresh_sample);
    final PullToRefreshListView listView = (PullToRefreshListView) findViewById(R.id.list_view);
    listView.setMode(Mode.PULL_FROM_START);
    final List<String> items = new ArrayList<String>() {
        private static final long serialVersionUID = 1L;
        {
            this.add("red");
            this.add("yellow");
            this.add("green");
        }
    };
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_list_item_1, android.R.id.text1, items);
    listView.setOnRefreshListener(new OnRefreshListener<ListView>() {
        @Override
        public void onRefresh(final PullToRefreshBase<ListView> refreshView) {
            // リスト更新処理。一般的には通信処理や、データベースアクセスをする為別スレッドで実行する。
            // ここではHandlerを使って1秒後にリストを更新する様にしている。
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    items.add("No." + (items.size() + 1));
                    refreshView.onRefreshComplete();
                }
            }, 1000);
        }
    });
    listView.setAdapter(adapter);
}
 
开发者ID:android-opensource-library-56,项目名称:android-opensource-library-56,代码行数:33,代码来源:AndroidPullToRefreshSampleActivity.java

示例14: initUIConfig

import com.handmark.pulltorefresh.library.PullToRefreshListView; //导入方法依赖的package包/类
/**
 * A method which initializes all of our members pointing to layout {@link android.view.View View}s.
 * @param viewGroup  The {@link android.view.ViewGroup ViewGroup} representing this {@link android.support.v4.app.Fragment Fragment}'s screen.
 */
private void initUIConfig(ViewGroup viewGroup) {
   mUsername = (TextView)viewGroup.findViewById(R.id.myNewsFeedFragment_userName);
   mUserProfilePicture = (ProfilePictureView) viewGroup.findViewById(R.id.com_dhsoftware_android_myNewsfeedFragment_userProfilePicture);
   mUserLoginButton = (LoginButton) viewGroup.findViewById(R.id.com_dhsoftware_android_myNewsFeedFragment_userLoginButton);
   // we need this permission to access the user's Newsfeed
   mUserLoginButton.setReadPermissions(Arrays.asList("read_stream"));
   mUserNewsfeed = (PullToRefreshListView) viewGroup.findViewById(R.id.myNewsfeedFragment_userNewsfeed);
   mUserNewsfeed.setAdapter(mAdapter);
   mUserNewsfeed.setOnRefreshListener(mRefreshListener);
}
 
开发者ID:the7thgoldrunner,项目名称:FacebookNewsfeedSample-Android,代码行数:15,代码来源:MyNewsfeedFragment.java

示例15: 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);
}
 
开发者ID:wugian,项目名称:doubanbook4android,代码行数:16,代码来源:BaseP2RActivity.java


注:本文中的com.handmark.pulltorefresh.library.PullToRefreshListView.setAdapter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。