热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

android.widget.ListAdapter.isEnabled()方法的使用及代码示例

本文整理了Java中android.widget.ListAdapter.isEnabled()方法的一些代码示例,展示了ListAdapter.isEna

本文整理了Java中android.widget.ListAdapter.isEnabled()方法的一些代码示例,展示了ListAdapter.isEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListAdapter.isEnabled()方法的具体详情如下:
包路径:android.widget.ListAdapter
类名称:ListAdapter
方法名:isEnabled

ListAdapter.isEnabled介绍

暂无

代码示例

代码示例来源:origin: rey5137/material

/**
* If the wrapped SpinnerAdapter is also a ListAdapter, delegate this call. Otherwise,
* return true.
*/
public boolean isEnabled(int position) {
final ListAdapter adapter = mListAdapter;
return adapter == null || adapter.isEnabled(position);
}

代码示例来源:origin: chentao0707/SimplifyReader

@Override
public boolean isEnabled(int position) {
if (mAdapter != null) {
// the cell is enabled if at least one item is enabled
boolean enabled = false;
for (int i = 0; i int p = position * mItemsPerRow + i;
if (p enabled |= mAdapter.isEnabled(p);
}
}
return enabled;
}
return true;
}

代码示例来源:origin: chentao0707/SimplifyReader

public boolean isEnabled(int position) {
// Header (negative positions will throw an ArrayIndexOutOfBoundsException)
int numHeaders = getHeadersCount();
if (position return mHeaderViewInfos.get(position).isSelectable;
}
// Adapter
final int adjPosition = position - numHeaders;
int adapterCount = 0;
if (mAdapter != null) {
adapterCount = mAdapter.getCount();
if (adjPosition return mAdapter.isEnabled(adjPosition);
}
}
// Footer (off-limits positions will throw an ArrayIndexOutOfBoundsException)
return mFooterViewInfos.get(adjPosition - adapterCount).isSelectable;
}

代码示例来源:origin: chentao0707/SimplifyReader

if (lookDown) {
position = Math.max(0, position);
while (position position++;
while (position >= 0 && !adapter.isEnabled(position)) {
position--;

代码示例来源:origin: ksoichiro/Android-ObservableScrollView

@Override
public boolean isEnabled(int position) {
// Header (negative positions will throw an IndexOutOfBoundsException)
int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns;
if (position return position % mNumColumns == 0
&& mHeaderViewInfos.get(position / mNumColumns).isSelectable;
}
// Adapter
final int adjPosition = position - numHeadersAndPlaceholders;
int adapterCount = 0;
if (mAdapter != null) {
adapterCount = getAdapterAndPlaceHolderCount();
if (adjPosition return adjPosition }
}
// Footer (off-limits positions will throw an IndexOutOfBoundsException)
final int footerPosition = adjPosition - adapterCount;
return footerPosition % mNumColumns == 0
&& mFooterViewInfos.get(footerPosition / mNumColumns).isSelectable;
}

代码示例来源:origin: liaohuqiu/android-GridViewWithHeaderAndFooter

@Override
public boolean isEnabled(int position) {
// Header (negative positions will throw an IndexOutOfBoundsException)
int numHeadersAndPlaceholders = getHeadersCount() * mNumColumns;
if (position return position % mNumColumns == 0
&& mHeaderViewInfos.get(position / mNumColumns).isSelectable;
}
// Adapter
final int adjPosition = position - numHeadersAndPlaceholders;
int adapterCount = 0;
if (mAdapter != null) {
adapterCount = getAdapterAndPlaceHolderCount();
if (adjPosition return adjPosition }
}
// Footer (off-limits positions will throw an IndexOutOfBoundsException)
final int footerPosition = adjPosition - adapterCount;
return footerPosition % mNumColumns == 0
&& mFooterViewInfos.get(footerPosition / mNumColumns).isSelectable;
}

代码示例来源:origin: rey5137/material

if (lookDown) {
position = Math.max(0, position);
while (position position++;
while (position >= 0 && !adapter.isEnabled(position)) {
position--;

代码示例来源:origin: chentao0707/SimplifyReader

/**
* {@inheritDoc}
*/
@Override
public void addTouchables(ArrayList views) {
final int count = getChildCount();
final int firstPosition = mFirstPosition;
final ListAdapter adapter = mAdapter;
if (adapter == null) {
return;
}
for (int i = 0; i final View child = getChildAt(i);
if (adapter.isEnabled(firstPosition + i)) {
views.add(child);
}
child.addTouchables(views);
}
}

代码示例来源:origin: chentao0707/SimplifyReader

@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
boolean populated = super.dispatchPopulateAccessibilityEvent(event);
// If the item count is less than 15 then subtract disabled items from the count and
// position. Otherwise ignore disabled items.
if (!populated) {
int itemCount = 0;
int currentItemIndex = getSelectedItemPosition();
ListAdapter adapter = getAdapter();
if (adapter != null) {
final int count = adapter.getCount();
if (count <15) {
for (int i = 0; i if (adapter.isEnabled(i)) {
itemCount++;
} else if (i <= currentItemIndex) {
currentItemIndex--;
}
}
} else {
itemCount = count;
}
}
event.setItemCount(itemCount);
event.setCurrentItemIndex(currentItemIndex);
}
return populated;
}

代码示例来源:origin: beworker/pinned-section-listview

private boolean performPinnedItemClick() {
if (mPinnedSection == null) return false;
OnItemClickListener listener = getOnItemClickListener();
if (listener != null && getAdapter().isEnabled(mPinnedSection.position)) {
View view = mPinnedSection.view;
playSoundEffect(SoundEffectConstants.CLICK);
if (view != null) {
view.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
}
listener.onItemClick(this, view, mPinnedSection.position, mPinnedSection.id);
return true;
}
return false;
}

代码示例来源:origin: chentao0707/SimplifyReader

(bottom if ((areAllItemsSelectable ||
(adapter.isEnabled(first + i) && (i == count - 1 ||
adapter.isEnabled(first + i + 1))))) {
bounds.top = bottom;
bounds.bottom = bottom + dividerHeight;
(adapter.isEnabled(first + i) && (i == count - 1 ||
adapter.isEnabled(first + i + 1))))) {
bounds.top = top - dividerHeight;
bounds.bottom = top;

代码示例来源:origin: UweTrottmann/SeriesGuide

@Override
public boolean isEnabled(int position) {
return mAdapter.isEnabled(position);
}

代码示例来源:origin: chentao0707/SimplifyReader

if (!adapter.isEnabled(firstPosition + i)) {
continue;

代码示例来源:origin: chentao0707/SimplifyReader

if (!mDataChanged) {
if ((mTouchMode != TOUCH_MODE_FLING) && (motionPosition >= 0)
&& (getAdapter().isEnabled(motionPosition))) {
if (!mDataChanged && mAdapter.isEnabled(motionPosition)) {
mTouchMode = TOUCH_MODE_TAP;
layoutChildren();
} else if (!mDataChanged && mAdapter.isEnabled(motionPosition)) {
post(performClick);

代码示例来源:origin: Neamar/KISS

private void updateItems() {
LinearLayout layout = getLinearLayout();
layout.removeAllViews();
int adapterCount = mAdapter.getCount();
for (int i = 0; i View view = mAdapter.getView(i, null, layout);
layout.addView(view);
if (mAdapter.isEnabled(i))
view.setOnClickListener(mClickListener);
}
}

代码示例来源:origin: stackoverflow.com

return originalAdapter.isEnabled(position);

代码示例来源:origin: com.actionbarsherlock/actionbarsherlock

/**
* If the wrapped SpinnerAdapter is also a ListAdapter, delegate this call.
* Otherwise, return true.
*/
public boolean isEnabled(int position) {
final ListAdapter adapter = mListAdapter;
if (adapter != null) {
return adapter.isEnabled(position);
} else {
return true;
}
}

代码示例来源:origin: com.willowtreeapps/oak-demos

/**
* If the wrapped SpinnerAdapter is also a ListAdapter, delegate this call.
* Otherwise, return true.
*/
public boolean isEnabled(int position) {
final ListAdapter adapter = mListAdapter;
if (adapter != null) {
return adapter.isEnabled(position);
} else {
return true;
}
}

代码示例来源:origin: vanilla-music/vanilla

@Override
public boolean isEnabled(int position) {
return mAdapter.isEnabled(position);
}

代码示例来源:origin: fire3/sailorcast

public boolean isEnabled(int position) {
// Adapter
final int adjPosition = position;
int adapterCount = 0;
if (mAdapter != null) {
adapterCount = mAdapter.getCount();
if (adjPosition return mAdapter.isEnabled(adjPosition);
}
}
// Footer (off-limits positions will throw an IndexOutOfBoundsException)
return mFooterViewInfos.get(adjPosition - adapterCount).isSelectable;
}

推荐阅读
author-avatar
小白_king
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有