ListAdapter isEnabled - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ListAdapter isEnabled method.

This code example shows how to use the following methods:isEnabled
  public boolean areAllItemsEnabled() { 
    return(delegate.areAllItemsEnabled());
  } 
   
  public boolean isEnabled(int position) {
    return(delegate.isEnabled(position));
  } 
} 
7
CodeRank
This code example shows how to use the following methods:isEnabled
		return wrapped.areAllItemsEnabled();
	} 
 
	@Override 
	public boolean isEnabled(int i) {
		return wrapped.isEnabled(i);
	} 
 
	@Override 
	public void registerDataSetObserver(DataSetObserver dataSetObserver) {
		wrapped.registerDataSetObserver(dataSetObserver);
	} 
 
	@Override 
	public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
		wrapped.unregisterDataSetObserver(dataSetObserver);
	} 
 
	@Override 
	public int getCount() { 
6
CodeRank
This code example shows how to use the following methods:getCount, isEnabled
		if (isLoadingMore) return false;
		return baseAdapter.areAllItemsEnabled();
	} 
 
	public boolean isEnabled(int position) {
		if (position < baseAdapter.getCount()) {
			return baseAdapter.isEnabled(position);
		} else { 
			if (isLoadingMore) return false;
			return true; 
		} 
	} 
	 
	private class SimpleObserver extends DataSetObserver {
		 
		private LoadMoreAdapter adapter;
		 
		public SimpleObserver(LoadMoreAdapter adapter) {
			this.adapter = adapter;
		} 
5
CodeRank
This code example shows how to use the following methods:isEnabled
     * Otherwise, return true. 
     */ 
    public boolean isEnabled(int position) {
        final ListAdapter adapter = mListAdapter;
        if (adapter != null) {
            return adapter.isEnabled(position);
        } else { 
            return true; 
        } 
    } 
 
    public int getItemViewType(int position) {
        return 0; 
    } 
 
    public int getViewTypeCount() { 
        return 1; 
    } 
     
    public boolean isEmpty() { 
4
CodeRank
This code example shows how to use the following methods:isEnabled
            return wrapped.areAllItemsEnabled();
        } 
 
        @Override 
        public boolean isEnabled(int position) {
            return wrapped.isEnabled(position);
        } 
    } 
 
    public boolean performItemLongClick(final View child,
            final int longPressPosition, final long longPressId) {
        if (mChoiceMode == CHOICE_MODE_MULTIPLE_MODAL) {
            if (mChoiceActionMode == null &&
                    (mChoiceActionMode = startActionMode(mMultiChoiceModeCallback)) != null) {
                setItemChecked(longPressPosition, true);
                performHapticFeedback(HapticFeedbackConstants.LONG_PRESS);
            } 
            return true; 
        } 
        boolean handled = false;
3
CodeRank
This code example shows how to use the following methods:isEnabled
 
		@Override 
		public boolean isEnabled(int position) {
			final ListAdapter adapter = mListAdapter;
			if (adapter != null) {
				return adapter.isEnabled(position);
			} else { 
				return true; 
			} 
		} 
 
		@Override 
		public void registerDataSetObserver(DataSetObserver observer) {
			if (mAdapter != null) {
				mAdapter.registerDataSetObserver(observer);
			} 
		} 
 
		@Override 
		public void unregisterDataSetObserver(DataSetObserver observer) {
3
CodeRank
This code example shows how to use the following methods:getCount, isEnabled
    public int getViewTypeCount() { 
        return mAdapter.getViewTypeCount();
    } 
 
    private boolean isItem(int position) {
        return position < mAdapter.getCount();
    } 
 
    /** {@inheritDoc} */ 
    public View getView(int position, View convertView, ViewGroup parent) {
        if (isItem(position)) {
            return mAdapter.getView(position, convertView, parent);
        } else if (hasError()) { 
            LayoutInflater inflater = getLayoutInflater(parent);
            return newErrorView(inflater, parent);
        } else if (hasMore()) { 
            LayoutInflater inflater = getLayoutInflater(parent);
            return newLoadingView(inflater, parent);
        } else { 
            throw new IndexOutOfBoundsException();

5
CodeRank
This code example shows how to use the following methods:isEnabled
 
	public boolean isEnabled(int position) {
		if (position == 0)
			return false; 
		else 
			return this.contentAdapter.isEnabled(position-1);
	} 
 
	public int getCount() { 
		return 1+this.contentAdapter.getCount();
	} 
 
	public Object getItem(int position) {
		if (position == 0)
			return null; 
		else 
			return this.contentAdapter.getItem(position-1);
	} 
 
	public long getItemId(int position) {
4
CodeRank
This code example shows how to use the following methods:isEnabled
        return delegate.isEmpty();
    } 
 
    @Override 
    public boolean isEnabled(int i) {
        return delegate.isEnabled(i);
    } 
 
    @Override 
    public void registerDataSetObserver(DataSetObserver dataSetObserver) {
        delegate.registerDataSetObserver(dataSetObserver);
    } 
 
    @Override 
    public void unregisterDataSetObserver(DataSetObserver dataSetObserver) {
        delegate.unregisterDataSetObserver(dataSetObserver);
    } 
} 
4
CodeRank
This code example shows how to use the following methods:getCount, isEnabled
            return true; 
        } 
 
        int adjPosition = position - headerSize;
        if (mAdapter != null) {
            if (adjPosition < mAdapter.getCount()) {
                return mAdapter.isEnabled(adjPosition);
            } 
        } 
 
        return false; 
    } 
 
    @Override 
    public void registerDataSetObserver(DataSetObserver observer) {
        if (mAdapter != null) {
            mAdapter.registerDataSetObserver(observer);
        } 
    } 
 
4
CodeRank

Related ListAdapter isEnabled Questions & Answers:

isEnabled Method Overview
Returns true if the item at the specified position is not a separator.
See Code Examples for other Android ListAdapter Methods: