热门标签 | 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;
}

推荐阅读
  • 本文整理了Java中org.gwtbootstrap3.client.ui.Icon.addDomHandler()方法的一些代码示例,展示了Icon.ad ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • 标题: ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • 基于Socket的多个客户端之间的聊天功能实现方法
    本文介绍了基于Socket的多个客户端之间实现聊天功能的方法,包括服务器端的实现和客户端的实现。服务器端通过每个用户的输出流向特定用户发送消息,而客户端通过输入流接收消息。同时,还介绍了相关的实体类和Socket的基本概念。 ... [详细]
  • 本文详细介绍了Android中的坐标系以及与View相关的方法。首先介绍了Android坐标系和视图坐标系的概念,并通过图示进行了解释。接着提到了View的大小可以超过手机屏幕,并且只有在手机屏幕内才能看到。最后,作者表示将在后续文章中继续探讨与View相关的内容。 ... [详细]
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 在Android开发中,使用Picasso库可以实现对网络图片的等比例缩放。本文介绍了使用Picasso库进行图片缩放的方法,并提供了具体的代码实现。通过获取图片的宽高,计算目标宽度和高度,并创建新图实现等比例缩放。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • 先看官方文档TheJavaTutorialshavebeenwrittenforJDK8.Examplesandpracticesdescribedinthispagedontta ... [详细]
  • 重入锁(ReentrantLock)学习及实现原理
    本文介绍了重入锁(ReentrantLock)的学习及实现原理。在学习synchronized的基础上,重入锁提供了更多的灵活性和功能。文章详细介绍了重入锁的特性、使用方法和实现原理,并提供了类图和测试代码供读者参考。重入锁支持重入和公平与非公平两种实现方式,通过对比和分析,读者可以更好地理解和应用重入锁。 ... [详细]
  • 使用圣杯布局模式实现网站首页的内容布局
    本文介绍了使用圣杯布局模式实现网站首页的内容布局的方法,包括HTML部分代码和实例。同时还提供了公司新闻、最新产品、关于我们、联系我们等页面的布局示例。商品展示区包括了车里子和农家生态土鸡蛋等产品的价格信息。 ... [详细]
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社区 版权所有