Package org.robolectric.shadows
Class AccessibilityWindowInfoBuilder
java.lang.Object
org.robolectric.shadows.AccessibilityWindowInfoBuilder
Builder for
AccessibilityWindowInfo.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds theAccessibilityWindowInfoinstance.setBoundsInScreen(Rect bounds) Sets the bounds of the window in the screen.setFocused(boolean focused) Sets the focused state of the window.setId(int id) Sets the ID of the window.setRegionInScreen(Region region) Sets the touchable region of the window in the screen.setTitle(CharSequence title) Sets the title of the window.setType(int type) Sets the type of the window.
-
Method Details
-
newBuilder
-
setBoundsInScreen
Sets the bounds of the window in the screen.This corresponds to the hidden
setBoundsInScreen(Rect)method inAccessibilityWindowInfo. This method is only available on pre-R devices.- Parameters:
bounds- The bounds to set.- Returns:
- This builder.
-
setRegionInScreen
@CanIgnoreReturnValue public AccessibilityWindowInfoBuilder setRegionInScreen(@Nonnull Region region) Sets the touchable region of the window in the screen.This corresponds to the hidden
setRegionInScreen(Region)method inAccessibilityWindowInfo. This method is available on R+ devices.- Parameters:
region- The region to set.- Returns:
- This builder.
-
setFocused
Sets the focused state of the window.This corresponds to the hidden
setFocused(boolean)method inAccessibilityWindowInfo.- Parameters:
focused- The focused state.- Returns:
- This builder.
-
setId
Sets the ID of the window.This corresponds to the private
mIdfield inAccessibilityWindowInfo.- Parameters:
id- The ID.- Returns:
- This builder.
-
setTitle
Sets the title of the window.This corresponds to the private
mTitlefield inAccessibilityWindowInfo. This method is only available on N+ devices.- Parameters:
title- The title.- Returns:
- This builder.
-
setType
Sets the type of the window.This corresponds to the hidden
setType(int)method inAccessibilityWindowInfo.- Parameters:
type- The type.- Returns:
- This builder.
-
build
Builds theAccessibilityWindowInfoinstance.- Returns:
- The constructed
AccessibilityWindowInfo.
-