Package org.robolectric.shadows
Class ShadowViewRootImpl
java.lang.Object
org.robolectric.shadows.ShadowViewRootImpl
@Implements(value=android.view.ViewRootImpl.class,
isInAndroidSdk=false)
public class ShadowViewRootImpl
extends Object
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceReflector interface forViewRootImpl's internals. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcallWindowFocusChanged(boolean hasFocus) protected static voidClears the last known state ofisNavigationBarVisible.protected static voidClears the last known state ofisStatusBarVisible.protected Displayprotected WindowInsetsgetWindowInsets(boolean forceConstruct) On Android R+WindowInsetssupports checking visibility of specific inset types.voidplaySoundEffect(int effectId) protected intrelayoutWindow(WindowManager.LayoutParams params, int viewVisibility, boolean insetsPending) static voidreset()protected static voidsetIsNavigationBarVisible(boolean isNavigationBarVisible) Allows other shadows to set the state ofisNavigationBarVisible.protected static voidsetIsStatusBarVisible(boolean isStatusBarVisible) Allows other shadows to set the state ofisStatusBarVisible.protected voidsetView(View view, WindowManager.LayoutParams attrs, View panelParentView) protected voidsetView(View view, WindowManager.LayoutParams attrs, View panelParentView, int userId)
-
Field Details
-
realObject
-
-
Constructor Details
-
ShadowViewRootImpl
public ShadowViewRootImpl()
-
-
Method Details
-
setIsStatusBarVisible
protected static void setIsStatusBarVisible(boolean isStatusBarVisible) Allows other shadows to set the state ofisStatusBarVisible. -
clearIsStatusBarVisible
protected static void clearIsStatusBarVisible()Clears the last known state ofisStatusBarVisible. -
playSoundEffect
-
relayoutWindow
@Implementation protected int relayoutWindow(WindowManager.LayoutParams params, int viewVisibility, boolean insetsPending) throws RemoteException - Throws:
RemoteException
-
callDispatchResized
public void callDispatchResized() -
getDisplay
-
setView
@Implementation protected void setView(View view, WindowManager.LayoutParams attrs, View panelParentView) -
setView
@Implementation(minSdk=30) protected void setView(View view, WindowManager.LayoutParams attrs, View panelParentView, int userId) -
getWindowInsets
On Android R+WindowInsetssupports checking visibility of specific inset types.For those SDK levels, override the real
WindowInsetswith the tracked system bar visibility status (isStatusBarVisible/isNavigationBarVisible), if set.NOTE: We use state tracking in place of a longer term solution of implementing the insets calculations and broadcast (via listeners) for now. Once we have insets calculations working we should remove this mechanism.
-
reset
-
callWindowFocusChanged
public void callWindowFocusChanged(boolean hasFocus)
-