List of usage examples for android.widget ProgressBar requestFocus
public final boolean requestFocus()
From source file:com.android.talkback.eventprocessor.AccessibilityEventProcessorTest.java
/** * Make sure that selection-event elimination does not get rid of progress bar VIEW_SELECTED * events.//from ww w . j a v a2s . c o m */ @MediumTest public void testProgressBarSelectedEvents() { final ProgressBar progressBar = (ProgressBar) getViewForId(R.id.progress_bar); final AccessibilityNodeInfoCompat progressBarNode = getNodeForView(progressBar); mMatchEventType = AccessibilityEvent.TYPE_VIEW_SELECTED; mMatchNode = AccessibilityNodeInfoCompat.obtain(progressBarNode); getInstrumentation().runOnMainSync(new Runnable() { @Override public void run() { progressBar.requestFocus(); progressBar.setProgress(25); } }); getInstrumentation().waitForIdleSync(); waitForAccessibilityIdleSync(); assertTrue(mMatched); }