當前位置: 首頁>>代碼示例>>Java>>正文


Java StickyListHeadersListView.addHeaderView方法代碼示例

本文整理匯總了Java中se.emilsjolander.stickylistheaders.StickyListHeadersListView.addHeaderView方法的典型用法代碼示例。如果您正苦於以下問題:Java StickyListHeadersListView.addHeaderView方法的具體用法?Java StickyListHeadersListView.addHeaderView怎麽用?Java StickyListHeadersListView.addHeaderView使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在se.emilsjolander.stickylistheaders.StickyListHeadersListView的用法示例。


在下文中一共展示了StickyListHeadersListView.addHeaderView方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initViews

import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //導入方法依賴的package包/類
@SuppressLint("InflateParams")
private void initViews(View view) {
    mEmptyView = (EmptyLayout) view.findViewById(R.id.error_layout);
    mListView = (StickyListHeadersListView) view
            .findViewById(R.id.listview);
    mListView.setOnScrollListener(mScrollListener);
    mListView.setOnItemClickListener(this);
    View header = LayoutInflater.from(getActivity()).inflate(
            R.layout.v2_list_header_user_center, null);
    mIvAvatar = (ImageView) header.findViewById(R.id.iv_avatar);
    mTvName = (TextView) header.findViewById(R.id.tv_name);
    mTvFollowing = (TextView) header.findViewById(R.id.tv_following_count);
    mTvFollower = (TextView) header.findViewById(R.id.tv_follower_count);
    mTvLastestLoginTime = (TextView) header
            .findViewById(R.id.tv_latest_login_time);

    mBtnPrivateMsg = (TextView) header
            .findViewById(R.id.tv_private_message);
    mBtnPrivateMsg.setOnClickListener(this);
    mBtnFollowUser = (TextView) header.findViewById(R.id.tv_follow_user);
    mBtnFollowUser.setOnClickListener(this);

    mListView.addHeaderView(header);

    if (mAdapter == null) {
        mAdapter = new UserCenterAdapter(this);

        mState = STATE_REFRESH;
        mEmptyView.setErrorType(EmptyLayout.NETWORK_LOADING);
        sendGetUserInfomation();
    }
    mListView.setAdapter(mAdapter);
}
 
開發者ID:blueelwang,項目名稱:oschina-app,代碼行數:34,代碼來源:UserCenterFragment.java

示例2: initViews

import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //導入方法依賴的package包/類
@SuppressLint("InflateParams")
private void initViews(View view) {
	mEmptyView = (EmptyLayout) view.findViewById(R.id.error_layout);
	mListView = (StickyListHeadersListView) view
			.findViewById(R.id.listview);
	mListView.setOnScrollListener(mScrollListener);
	mListView.setOnItemClickListener(this);
	View header = LayoutInflater.from(getActivity()).inflate(
			R.layout.v2_list_header_user_center, null);
	mIvAvatar = (ImageView) header.findViewById(R.id.iv_avatar);
	mTvName = (TextView) header.findViewById(R.id.tv_name);
	mTvFollowing = (TextView) header.findViewById(R.id.tv_following_count);
	mTvFollower = (TextView) header.findViewById(R.id.tv_follower_count);
	mTvLastestLoginTime = (TextView) header
			.findViewById(R.id.tv_latest_login_time);

	mBtnPrivateMsg = (TextView) header
			.findViewById(R.id.tv_private_message);
	mBtnPrivateMsg.setOnClickListener(this);
	mBtnFollowUser = (TextView) header.findViewById(R.id.tv_follow_user);
	mBtnFollowUser.setOnClickListener(this);

	mListView.addHeaderView(header);

	if (mAdapter == null) {
		mAdapter = new UserCenterAdapter(this);

		mState = STATE_REFRESH;
		mEmptyView.setErrorType(EmptyLayout.NETWORK_LOADING);
		sendGetUserInfomation();
	}
	mListView.setAdapter(mAdapter);
}
 
開發者ID:447491480,項目名稱:ima_intellj,代碼行數:34,代碼來源:UserCenterFragment.java

示例3: onCreate

import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_sign_log);
	toolbar = (Toolbar) findViewById(R.id.toolbar_sign_log);
	stickyList = (StickyListHeadersListView) findViewById(R.id.list);
	toolbar.setTitle("簽到記錄");
	toolbar.setNavigationIcon(R.mipmap.button_back);
	toolbar.setNavigationOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View view) {
			finish();
		}
	});
	toolbar.inflateMenu(R.menu.sign_log_toobar_menu);
	toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {
		@Override
		public boolean onMenuItemClick(MenuItem item) {
			switch (item.getItemId()){
				case R.id.action_only_signed:
					mAdapter.only_signed();
					break;
				case R.id.action_only_no_signed:
					mAdapter.only_no_signed();
					break;
				case R.id.action_all_people:
					mAdapter.all_signed();
					break;
				case R.id.action_about:

					break;
				default:
					break;

			}
			return false;
		}
	});
	stickyList.setOnItemClickListener(this);
	stickyList.setOnHeaderClickListener(this);
	stickyList.setOnStickyHeaderChangedListener(this);
	stickyList.setOnStickyHeaderOffsetChangedListener(this);
	stickyList.addHeaderView(getLayoutInflater().inflate(R.layout.list_header, null));
	stickyList.addFooterView(getLayoutInflater().inflate(R.layout.list_footer, null));
	TextView textView = new TextView(this);
	textView.setText("當前簽到內容為空!");
	stickyList.setEmptyView(textView);
	stickyList.setDrawingListUnderStickyHeader(true);
	stickyList.setAreHeadersSticky(true);

	refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh_layout);
	refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
		@Override
		public void onRefresh() {
			new Handler().postDelayed(new Runnable() {
				@Override
				public void run() {
					refreshLayout.setRefreshing(false);
				}
			}, 1000);
		}
	});
	AlertDialog.Builder builder = new AlertDialog.Builder(this);
	builder.setCancelable(false);
	builder.setTitle("溫馨提示");
	builder.setMessage("正在加載,請稍後......");
	builder.setView(new ProgressBar(this));
	dialog = builder.show();
	loadData();
}
 
開發者ID:tony-Shx,項目名稱:Swface,代碼行數:71,代碼來源:SignLogActivity.java

示例4: onCreate

import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //導入方法依賴的package包/類
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    refreshLayout = (SwipeRefreshLayout) findViewById(R.id.refresh_layout);
    refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    refreshLayout.setRefreshing(false);
                }
            }, 1000);
        }
    });

    mAdapter = new TestBaseAdapter(this);

    stickyList = (StickyListHeadersListView) findViewById(R.id.list);
    stickyList.setOnItemClickListener(this);
    stickyList.setOnHeaderClickListener(this);
    stickyList.setOnStickyHeaderChangedListener(this);
    stickyList.setOnStickyHeaderOffsetChangedListener(this);
    stickyList.addHeaderView(getLayoutInflater().inflate(R.layout.list_header, null));
    stickyList.addFooterView(getLayoutInflater().inflate(R.layout.list_footer, null));
    stickyList.setEmptyView(findViewById(R.id.empty));
    stickyList.setDrawingListUnderStickyHeader(true);
    stickyList.setAreHeadersSticky(true);
    stickyList.setAdapter(mAdapter);

    mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    mDrawerToggle = new ActionBarDrawerToggle(
            this,                  /* host Activity */
            mDrawerLayout,         /* DrawerLayout object */
            R.drawable.ic_drawer,  /* nav drawer icon to replace 'Up' caret */
            R.string.drawer_open,  /* "open drawer" description */
            R.string.drawer_close  /* "close drawer" description */
    );

    // Set the drawer toggle as the DrawerListener
    mDrawerLayout.setDrawerListener(mDrawerToggle);

    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(true);

    restoreButton = (Button) findViewById(R.id.restore_button);
    restoreButton.setOnClickListener(buttonListener);
    openExpandableListButton = (Button) findViewById(R.id.open_expandable_list_button);
    openExpandableListButton.setOnClickListener(buttonListener);
    updateButton = (Button) findViewById(R.id.update_button);
    updateButton.setOnClickListener(buttonListener);
    clearButton = (Button) findViewById(R.id.clear_button);
    clearButton.setOnClickListener(buttonListener);

    stickyCheckBox = (CheckBox) findViewById(R.id.sticky_checkBox);
    stickyCheckBox.setOnCheckedChangeListener(checkBoxListener);
    fadeCheckBox = (CheckBox) findViewById(R.id.fade_checkBox);
    fadeCheckBox.setOnCheckedChangeListener(checkBoxListener);
    drawBehindCheckBox = (CheckBox) findViewById(R.id.draw_behind_checkBox);
    drawBehindCheckBox.setOnCheckedChangeListener(checkBoxListener);
    fastScrollCheckBox = (CheckBox) findViewById(R.id.fast_scroll_checkBox);
    fastScrollCheckBox.setOnCheckedChangeListener(checkBoxListener);

    stickyList.setStickyHeaderTopOffset(-20);
}
 
開發者ID:soulrelay,項目名稱:StickyListHeadersWithRefreshAndLoadMore,代碼行數:68,代碼來源:TestActivity.java

示例5: setUpLicenseListView

import se.emilsjolander.stickylistheaders.StickyListHeadersListView; //導入方法依賴的package包/類
public void setUpLicenseListView() {
    StickyListHeadersListView list = findViewById(R.id.list_license);
    list.addHeaderView(LayoutInflater.from(getContext()).inflate(R.layout.list_header_license, null, false));
    list.setAdapter(new LicenseListAdapter(getContext()));
    list.setOnItemClickListener(this);
}
 
開發者ID:KeithYokoma,項目名稱:LGTMCamera,代碼行數:7,代碼來源:LicenseListHelper.java


注:本文中的se.emilsjolander.stickylistheaders.StickyListHeadersListView.addHeaderView方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。