当前位置: 首页>>代码示例>>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;未经允许,请勿转载。