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


Java HeaderViewListAdapter類代碼示例

本文整理匯總了Java中android.widget.HeaderViewListAdapter的典型用法代碼示例。如果您正苦於以下問題:Java HeaderViewListAdapter類的具體用法?Java HeaderViewListAdapter怎麽用?Java HeaderViewListAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: NavigationPopup

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
/**
 * Constructs a new popup with the given history information.
 *
 * @param profile The profile used for fetching favicons.
 * @param context The context used for building the popup.
 * @param navigationController The controller which takes care of page navigations.
 * @param isForward Whether to request forward navigation entries.
 */
public NavigationPopup(Profile profile, Context context,
        NavigationController navigationController, boolean isForward) {
    super(context, null, android.R.attr.popupMenuStyle);
    mProfile = profile;
    mContext = context;
    mNavigationController = navigationController;
    mHistory = mNavigationController.getDirectedNavigationHistory(
            isForward, MAXIMUM_HISTORY_ITEMS);
    mAdapter = new NavigationAdapter();

    mFaviconSize = mContext.getResources().getDimensionPixelSize(R.dimen.default_favicon_size);

    setModal(true);
    setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
    setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
    setOnItemClickListener(this);

    setAdapter(new HeaderViewListAdapter(null, null, mAdapter));

    mListItemFactory = new ListItemFactory(context);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:30,代碼來源:NavigationPopup.java

示例2: onItemClick

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
public void onItemClick(AdapterView<?> adapterView, View view, int rawPosition, long id) {
    SectionedBaseAdapter adapter;
    if (adapterView.getAdapter().getClass().equals(HeaderViewListAdapter.class)) {
        adapter = (SectionedBaseAdapter) ((HeaderViewListAdapter) adapterView.getAdapter
                ()).getWrappedAdapter();
    } else {
        adapter = (SectionedBaseAdapter) adapterView.getAdapter();
    }
    int section = adapter.getSectionForPosition(rawPosition);
    int position = adapter.getPositionInSectionForPosition(rawPosition);
    if (position == -1) {
        onSectionClick(adapterView, view, section, id);
    } else {
        onItemClick(adapterView, view, section, position, id);
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:17,代碼來源:PinnedHeaderListView.java

示例3: setListAdapter

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
public void setListAdapter(ListAdapter adapter) {
    headerInfo = list.new FixedViewInfo();
    headerInfo.view = LayoutInflater.from(getActivity()).inflate(R.layout.layout_header_project,
            null);
    headerInfo.isSelectable = false;
    ArrayList<ListView.FixedViewInfo> headers = new ArrayList<>(1);
    ArrayList<ListView.FixedViewInfo> footers = new ArrayList<>(0);
    headers.add(headerInfo);
    HeaderViewListAdapter wrapper = new HeaderViewListAdapter(headers, footers, adapter) {
        @Override
        public boolean areAllItemsEnabled() {
            return false;
        }
    };
    list.setAdapter(wrapper);
}
 
開發者ID:easyredmine,項目名稱:mobile_app_android,代碼行數:17,代碼來源:ProjectDetailFragment.java

示例4: disposeFooterView

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
private void disposeFooterView() {
    if (mFooterView == null || mAbsListView == null) {
        return;
    }
    if (canAddFooter()) {
        mFooterView.setVisibility(View.VISIBLE);
        mAbsListView.addFooterView(mFooterView);
    } else {
        if (mAbsListView.getAdapter() instanceof HeaderViewListAdapter) {
            Log.d(VIEW_LOG_TAG, "### 移除footer ");
            mFooterView.setVisibility(View.GONE);
            mAbsListView.removeFooterView(mFooterView);
        } else {
            Log.d(VIEW_LOG_TAG, "### 隱藏footer ");
            mFooterView.setVisibility(View.GONE);
        }
    }
}
 
開發者ID:umeng,項目名稱:umeng_community_android,代碼行數:19,代碼來源:RefreshLvLayout.java

示例5: setLoading

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
/**
 * @param loading
 */
public void setLoading(boolean loading) {
    isLoading = loading;
    if (isLoading && mListView.getFooterViewsCount() == 0) {
        mListView.addFooterView(mListViewFooter);
    } else {

        if (mListView.getAdapter() instanceof HeaderViewListAdapter) {
            mListView.removeFooterView(mListViewFooter);
        } else {
            mListViewFooter.setVisibility(View.GONE);
        }
        mYDown = 0;
        mLastY = 0;

    }
}
 
開發者ID:leerduo,項目名稱:oschinaframework,代碼行數:20,代碼來源:MySwipeRefreshLayout.java

示例6: d

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
final void d()
{
  ListAdapter localListAdapter = (ListAdapter)this.f.getAdapter();
  this.C = null;
  if ((localListAdapter instanceof HeaderViewListAdapter))
  {
    this.w = ((HeaderViewListAdapter)localListAdapter).getHeadersCount();
    localListAdapter = ((HeaderViewListAdapter)localListAdapter).getWrappedAdapter();
  }
  this.B = localListAdapter;
  if ((localListAdapter instanceof SectionIndexer))
  {
    this.C = ((SectionIndexer)localListAdapter);
    this.z = this.C.getSections();
    return;
  }
  this.z = new String[] { " " };
}
 
開發者ID:ChiangC,項目名稱:FMTech,代碼行數:19,代碼來源:dxb.java

示例7: setLoading

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
public void setLoading(boolean loading) {
    isLoading = loading;
    if (isLoading) {
        if (isRefreshing()) setRefreshing(false);
        if (mListView.getFooterViewsCount() == 0) {
            mListView.addFooterView(mListViewFooter);
            mListView.setSelection(mListView.getAdapter().getCount() - 1);
        } else {
            mListViewFooter.setVisibility(VISIBLE);
            //mListView.addFooterView(mListViewFooter);
        }
    } else {
        if (mListView.getAdapter() instanceof HeaderViewListAdapter) {
            mListView.removeFooterView(mListViewFooter);
        } else {
            mListViewFooter.setVisibility(View.GONE);
        }
        mYDown = 0;
        mLastY = 0;
    }
}
 
開發者ID:zhoujiangang0911,項目名稱:SwipeRefreshLayout,代碼行數:22,代碼來源:RefreshLayout.java

示例8: onScroll

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
@Override
public void onScroll(final AbsListView view,
                     final int firstVisibleItem,
                     final int visibleItemCount,
                     final int totalItemCount) {
 ListAdapter a = getAdapter();
 SectionListAdapter adapter = null; 
 if (a instanceof HeaderViewListAdapter)
  adapter = (SectionListAdapter)((HeaderViewListAdapter) a).getWrappedAdapter();
 else
  adapter = (SectionListAdapter) getAdapter();
  
  if (adapter != null) {
    adapter.makeSectionInvisibleIfFirstInList(firstVisibleItem);
  }
  // More activities will be automatically loaded if:
  // - the user has scrolled AND
  // - the user has reached the bottom of the list
  if (hasScrolled && totalItemCount > 0 && firstVisibleItem+visibleItemCount==totalItemCount) {
    autoLoadProgress.setVisibility(View.VISIBLE);
    parentFragment.onLoadMore(ExoConstants.NUMBER_OF_ACTIVITY, totalItemCount-1, firstVisibleItem);
  // set back to false to avoid multiple calls to the onLoadMore(...) method
    hasScrolled = false;
  }
}
 
開發者ID:paristote,項目名稱:mobile-android-studio,代碼行數:26,代碼來源:SectionListView.java

示例9: onItemClick

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int rawPosition, long id) {
    SectionedBaseAdapter adapter;
    if (adapterView.getAdapter().getClass().equals(HeaderViewListAdapter.class)) {
        HeaderViewListAdapter wrapperAdapter = (HeaderViewListAdapter) adapterView.getAdapter();
        adapter = (SectionedBaseAdapter) wrapperAdapter.getWrappedAdapter();
    } else {
        adapter = (SectionedBaseAdapter) adapterView.getAdapter();
    }
    int section = adapter.getSectionForPosition(rawPosition);
    int position = adapter.getPositionInSectionForPosition(rawPosition);

    if (position == -1) {
        onSectionClick(adapterView, view, section, id);
    } else {
        onItemClick(adapterView, view, section, position, id);
    }
}
 
開發者ID:bestarandyan,項目名稱:ShoppingMall,代碼行數:19,代碼來源:PinnedHeaderListView.java

示例10: updateContacts

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
public void updateContacts(MainActivity activity) {

		if (MainActivity.getContacts() == null)
			MainActivity.setContacts(readSMSContacts(getActivity()));
		if (MainActivity.getListItems() == null || MainActivity.getListItems().size() == 0)
			MainActivity.setListItems(getNames(MainActivity.getContacts(), activity));

		if (contactList != null && contactList.getAdapter() == null) {
			ContactAdapter arrayAdapter = new ContactAdapter(activity, MainActivity.getListItems(), 0);

			arrayAdapter.notifyDataSetChanged();
			contactList.setAdapter(arrayAdapter);
			contactList.setSelection(0);

		} else if (MainActivity.getListItems().size() > 0 && contactList != null) {
			((ContactAdapter) ((HeaderViewListAdapter) contactList.getAdapter()).getWrappedAdapter()).refill(
					MainActivity.getListItems(), 0);
		}

		if (swipe != null)
			swipe.setRefreshing(false);
		if (progressbar != null)
			progressbar.setVisibility(View.INVISIBLE);

	}
 
開發者ID:manuelsc,項目名稱:Raven-Messenger,代碼行數:26,代碼來源:SMSMainActivity.java

示例11: updateContacts

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
public void updateContacts(ArrayList<FacebookContact> fbcontacts) {
	if (fbcontacts == null) {
		return;
	}

	for (FacebookContact contact : fbcontacts) {
		contacts.add(new ContactModel(fb_img.get(contact.getName()), contact.getName(), contact.getLastMessage(),
				"", false).drawOnline(false));
	}

	if (contactList != null && contactList.getAdapter() == null) {
		ContactAdapter arrayAdapter = new ContactAdapter(this, contacts, 1);
		contactList.setAdapter(arrayAdapter);
		contactList.setSelection(0);

	} else {
		if (contactList != null) {
			((ContactAdapter) ((HeaderViewListAdapter) contactList.getAdapter()).getWrappedAdapter()).refill(
					contacts, 1);
		}
	}

	progressbar.setVisibility(View.INVISIBLE);
}
 
開發者ID:manuelsc,項目名稱:Raven-Messenger,代碼行數:25,代碼來源:NewFbContactActivity.java

示例12: updateContacts

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
public void updateContacts() {
	if (contacts == null)
		contacts = readSMSContacts(this);

	if (contactList != null && contactList.getAdapter() != null) {
		if (contacts.size() > 0 && contactList != null) {
			((ContactAdapter) ((HeaderViewListAdapter) contactList.getAdapter()).getWrappedAdapter()).refill(
					contacts, 0);
		}
	} else {
		if (contactList != null) {
			ContactAdapter arrayAdapter = new ContactAdapter(this, contacts, 0);
			contactList.setAdapter(arrayAdapter);
		}
	}
}
 
開發者ID:manuelsc,項目名稱:Raven-Messenger,代碼行數:17,代碼來源:NewSMSContactActivity.java

示例13: getCurrAdapter

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
/**
 * 得到當前綁定的adapter對象
 * 
 * @return
 */
private PinnedHeaderAdapter getCurrAdapter() {
	// 如果該ListView有addHeaderView()或addFooterView()時,在ListView.setAdapter()時,會將原本的adapter包裝成一個HeaderViewListAdapter對象
	ListAdapter adapter = getAdapter();
	if (adapter == null)
		return null;
	PinnedHeaderAdapter pinnedHeaderAdapter = null;
	if (adapter instanceof HeaderViewListAdapter) {
		if (((HeaderViewListAdapter) adapter).getWrappedAdapter() instanceof PinnedHeaderAdapter)
			pinnedHeaderAdapter = (PinnedHeaderAdapter) ((HeaderViewListAdapter) adapter).getWrappedAdapter();
	} else {
		if (adapter instanceof PinnedHeaderAdapter)
			pinnedHeaderAdapter = (PinnedHeaderAdapter) adapter;
	}
	return pinnedHeaderAdapter;
}
 
開發者ID:houjinyun,項目名稱:PinnedHeaderView,代碼行數:21,代碼來源:PinnedHeaderListView.java

示例14: onScroll

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
@Override
public void onScroll(AbsListView view, int firstVisibleItem,
		int visibleItemCount, int totalItemCount)
{		
	if (firstVisibleItem < this.topVisibleItem - DISTANCE_TO_HIDE_ACTIONBAR)
	{
		setActionbarVisibility(true);
		this.topVisibleItem = firstVisibleItem;
	}
	else if (firstVisibleItem > this.topVisibleItem + DISTANCE_TO_HIDE_ACTIONBAR)
	{
		setActionbarVisibility(false);
		this.topVisibleItem = firstVisibleItem;
	}
	
	ListAdapter adapter = view.getAdapter();
	if (adapter instanceof HeaderViewListAdapter)
	{
		HeaderViewListAdapter headerViewListAdapter = (HeaderViewListAdapter) adapter;
		if (headerViewListAdapter.getWrappedAdapter() instanceof FileCardAdapter)
		{
			int startPrefetch = firstVisibleItem + visibleItemCount-headerViewListAdapter.getHeadersCount();
			((FileCardAdapter) headerViewListAdapter.getWrappedAdapter()).prefetchImages(startPrefetch, visibleItemCount);
		}
	}
}
 
開發者ID:mick88,項目名稱:filemanager,代碼行數:27,代碼來源:FolderFragment.java

示例15: addHeaderView

import android.widget.HeaderViewListAdapter; //導入依賴的package包/類
/**
 * Add a fixed view to appear at the top of the list. If addHeaderView is
 * called more than once, the views will appear in the order they were
 * added. Views added using this call can take focus if they want.
 * <p/>
 * NOTE: Call this before calling setAdapter. This is so ListView can wrap the supplied cursor with one that will also account for header and footer views.
 * 
 * @param v
 *            The view to add.
 * @param data
 *            Data to associate with this view
 * @param isSelectable
 *            whether the item is selectable
 */
public void addHeaderView(View v, Object data, boolean isSelectable)
{

	if (mAdapter != null && !(mAdapter instanceof HeaderViewListAdapter))
	{
		throw new IllegalStateException("Cannot add header view to list -- setAdapter has already been called.");
	}

	FixedViewInfo info = new FixedViewInfo();
	info.view = v;
	info.data = data;
	info.isSelectable = isSelectable;
	mHeaderViewInfos.add(info);

	// in the case of re-adding a header view, or adding one later on,
	// we need to notify the observer
	if (mAdapter != null && mObserver != null)
	{
		mObserver.onChanged();
	}
}
 
開發者ID:haikuowuya,項目名稱:like_googleplus_layout,代碼行數:36,代碼來源:ExtendableListView.java


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