当前位置: 首页>>代码示例>>Java>>正文


Java AccessibilityEvent.setItemCount方法代码示例

本文整理汇总了Java中android.view.accessibility.AccessibilityEvent.setItemCount方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityEvent.setItemCount方法的具体用法?Java AccessibilityEvent.setItemCount怎么用?Java AccessibilityEvent.setItemCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.accessibility.AccessibilityEvent的用法示例。


在下文中一共展示了AccessibilityEvent.setItemCount方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: dispatchPopulateAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    boolean populated = false;
    if (event.getEventType() == 8) {
        event.setEventType(4);
    }
    View selectedView = getSelectedView();
    if (selectedView != null) {
        populated = selectedView.dispatchPopulateAccessibilityEvent(event);
    }
    if (!populated) {
        if (selectedView != null) {
            event.setEnabled(selectedView.isEnabled());
        }
        event.setItemCount(getCount());
        event.setCurrentItemIndex(getSelectedItemPosition());
    }
    return populated;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:19,代码来源:PLA_AdapterView.java

示例2: dispatchPopulateAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
    boolean populated = super.dispatchPopulateAccessibilityEvent(event);
    if (!populated) {
        int itemCount = 0;
        int currentItemIndex = getSelectedItemPosition();
        ListAdapter adapter = getAdapter();
        if (adapter != null) {
            int count = adapter.getCount();
            if (count < 15) {
                for (int i = 0; i < count; i++) {
                    if (adapter.isEnabled(i)) {
                        itemCount++;
                    } else if (i <= currentItemIndex) {
                        currentItemIndex--;
                    }
                }
            } else {
                itemCount = count;
            }
        }
        event.setItemCount(itemCount);
        event.setCurrentItemIndex(currentItemIndex);
    }
    return populated;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:26,代码来源:PLA_ListView.java

示例3: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
/**
 */
@Override
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
	super.onInitializeAccessibilityEvent(event);
	event.setClassName(BaseProgressBar.class.getName());
	event.setItemCount(mMax);
	event.setCurrentItemIndex(mProgress);
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:11,代码来源:BaseProgressBar.java

示例4: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setScrollable(isScrollableForAccessibility());
    View selectedView = getSelectedView();
    if (selectedView != null) {
        event.setEnabled(selectedView.isEnabled());
    }
    event.setCurrentItemIndex(getSelectedItemPosition());
    event.setFromIndex(getFirstVisiblePosition());
    event.setToIndex(getLastVisiblePosition());
    event.setItemCount(getCount());
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:14,代码来源:IcsAdapterView.java

示例5: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@TargetApi(14)
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setClassName(AdapterView.class.getName());
    event.setScrollable(isScrollableForAccessibility());
    View selectedView = getSelectedView();
    if (selectedView != null) {
        event.setEnabled(selectedView.isEnabled());
    }
    event.setCurrentItemIndex(getSelectedItemPosition());
    event.setFromIndex(getFirstVisiblePosition());
    event.setToIndex(getLastVisiblePosition());
    event.setItemCount(getCount());
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:15,代码来源:AdapterView.java

示例6: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@TargetApi(14)
@Override
public void onInitializeAccessibilityEvent( AccessibilityEvent event ) {
	super.onInitializeAccessibilityEvent( event );
	event.setClassName( AdapterView.class.getName() );
	event.setScrollable( isScrollableForAccessibility() );
	View selectedView = getSelectedView();
	if ( selectedView != null ) {
		event.setEnabled( selectedView.isEnabled() );
	}
	event.setCurrentItemIndex( getSelectedItemPosition() );
	event.setFromIndex( getFirstVisiblePosition() );
	event.setToIndex( getLastVisiblePosition() );
	event.setItemCount( getCount() );
}
 
开发者ID:junchenChow,项目名称:exciting-app,代码行数:16,代码来源:AdapterView.java

示例7: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public void onInitializeAccessibilityEvent(AccessibilityEvent paramAccessibilityEvent) {
	super.onInitializeAccessibilityEvent(paramAccessibilityEvent);
	paramAccessibilityEvent.setScrollable(isScrollableForAccessibility());
	View localView = getSelectedView();
	if (localView != null)
		paramAccessibilityEvent.setEnabled(localView.isEnabled());
	paramAccessibilityEvent.setCurrentItemIndex(getSelectedItemPosition());
	paramAccessibilityEvent.setFromIndex(getFirstVisiblePosition());
	paramAccessibilityEvent.setToIndex(getLastVisiblePosition());
	paramAccessibilityEvent.setItemCount(getCount());
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:12,代码来源:AdapterView.java

示例8: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);

    // Decoration-only headers should not count as an item for accessibility, adjust the
    // accessibility event to account for that.
    final int numberOfHeaders = mSticky != null ? 1 : 0;
    event.setItemCount(event.getItemCount() - numberOfHeaders);
    event.setFromIndex(Math.max(event.getFromIndex() - numberOfHeaders, 0));
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        event.setToIndex(Math.max(event.getToIndex() - numberOfHeaders, 0));
    }
}
 
开发者ID:Trumeet,项目名称:SetupWizardLibCompat,代码行数:14,代码来源:StickyHeaderListView.java

示例9: dispatchPopulateAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@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 < count; i++) {
                    if (adapter.isEnabled(i)) {
                        itemCount++;
                    } else if (i <= currentItemIndex) {
                        currentItemIndex--;
                    }
                }
            } else {
                itemCount = count;
            }
        }

        event.setItemCount(itemCount);
        event.setCurrentItemIndex(currentItemIndex);
    }

    return populated;
}
 
开发者ID:Shmilyz,项目名称:Swap,代码行数:33,代码来源:PLA_ListView.java

示例10: dispatchPopulateAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
	boolean populated = false;
	// This is an exceptional case which occurs when a window gets the
	// focus and sends a focus event via its focused child to announce
	// current focus/selection. AdapterView fires selection but not focus
	// events so we change the event type here.
	if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
		event.setEventType(AccessibilityEvent.TYPE_VIEW_SELECTED);
	}
       
	// we send selection events only from AdapterView to avoid
	// generation of such event for each child
	View selectedView = getSelectedView();
	if (selectedView != null) {
		populated = selectedView.dispatchPopulateAccessibilityEvent(event);
	}
       
	if (!populated) {
		if (selectedView != null) {
			event.setEnabled(selectedView.isEnabled());
		}
		event.setItemCount(getCount());
		event.setCurrentItemIndex(getSelectedItemPosition());
	}
       
	return populated;
}
 
开发者ID:Shmilyz,项目名称:Swap,代码行数:29,代码来源:PLA_AdapterView.java

示例11: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
 public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
     super.onInitializeAccessibilityEvent(event);
     event.setItemCount(-1);
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:6,代码来源:DayPickerView.java

示例12: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setItemCount(mMax);
    event.setCurrentItemIndex(mProgress);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:7,代码来源:IcsProgressBar.java

示例13: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setCurrentItemIndex((int) (mTargetProgress * 100));
    event.setItemCount(100);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:ToolbarProgressBar.java

示例14: onInitializeAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public void onInitializeAccessibilityEvent(@NonNull AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    event.setItemCount(-1);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:5,代码来源:DayPickerView.java


注:本文中的android.view.accessibility.AccessibilityEvent.setItemCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。