Package com.google.ar.sceneform
Class SceneView
- java.lang.Object
-
- android.view.View
-
- android.view.ViewGroup
-
- android.widget.FrameLayout
-
- com.android.layoutlib.bridge.MockView
-
- android.view.SurfaceView
-
- com.google.ar.sceneform.SceneView
-
- All Implemented Interfaces:
android.graphics.drawable.Drawable.Callback,android.view.accessibility.AccessibilityEventSource,android.view.Choreographer.FrameCallback,android.view.KeyEvent.Callback,android.view.ViewManager,android.view.ViewParent
- Direct Known Subclasses:
ArSceneView
public class SceneView extends android.view.SurfaceView implements android.view.Choreographer.FrameCallbackA Sceneform SurfaceView that manages rendering and interaction with the scene.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSceneView.FrameRateFurther limit the maximal possible frame rate.-
Nested classes/interfaces inherited from class android.widget.FrameLayout
android.widget.FrameLayout.LayoutParams
-
Nested classes/interfaces inherited from class android.view.ViewGroup
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
-
Nested classes/interfaces inherited from class android.view.View
android.view.View.AccessibilityDelegate, android.view.View.AutofillFlags, android.view.View.AutofillImportance, android.view.View.AutofillType, android.view.View.BaseSavedState, android.view.View.ContentCaptureImportance, android.view.View.DragShadowBuilder, android.view.View.DrawingCacheQuality, android.view.View.FindViewFlags, android.view.View.Focusable, android.view.View.FocusableMode, android.view.View.FocusDirection, android.view.View.FocusRealDirection, android.view.View.LayerType, android.view.View.LayoutDir, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener, android.view.View.OnUnhandledKeyEventListener, android.view.View.ResolvedLayoutDir, android.view.View.ScrollBarStyle, android.view.View.ScrollCaptureHint, android.view.View.ScrollIndicators, android.view.View.TextAlignment, android.view.View.ViewStructureType, android.view.View.Visibility
-
-
Field Summary
Fields Modifier and Type Field Description Environment_environmentjava.lang.Integer_mainLightstatic java.lang.StringDEFAULT_IBL_LOCATIONstatic java.lang.StringDEFAULT_SKYBOX_LOCATION-
Fields inherited from class android.view.ViewGroup
FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_DEFAULT, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
-
Fields inherited from class android.view.View
ACCESSIBILITY_CURSOR_POSITION_UNDEFINED, ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DEBUG_DRAW, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, FIND_VIEWS_WITH_ACCESSIBILITY_NODE_PROVIDERS, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_CONTENT_CAPTURE_AUTO, IMPORTANT_FOR_CONTENT_CAPTURE_NO, IMPORTANT_FOR_CONTENT_CAPTURE_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_CONTENT_CAPTURE_YES, IMPORTANT_FOR_CONTENT_CAPTURE_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAST_APP_AUTOFILL_ID, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, LAYOUT_DIRECTION_UNDEFINED, mAttributes, mCachingFailed, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, mPrivateFlags, mTransformationInfo, NAVIGATION_BAR_TRANSIENT, NAVIGATION_BAR_TRANSLUCENT, NAVIGATION_BAR_TRANSPARENT, NAVIGATION_BAR_UNHIDE, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PUBLIC_STATUS_BAR_VISIBILITY_MASK, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_CAPTURE_HINT_AUTO, SCROLL_CAPTURE_HINT_EXCLUDE, SCROLL_CAPTURE_HINT_EXCLUDE_DESCENDANTS, SCROLL_CAPTURE_HINT_INCLUDE, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, sDebugViewAttributes, sDebugViewAttributesApplicationPackage, SOUND_EFFECTS_ENABLED, STATUS_BAR_DISABLE_BACK, STATUS_BAR_DISABLE_CLOCK, STATUS_BAR_DISABLE_EXPAND, STATUS_BAR_DISABLE_HOME, STATUS_BAR_DISABLE_NOTIFICATION_ALERTS, STATUS_BAR_DISABLE_NOTIFICATION_ICONS, STATUS_BAR_DISABLE_NOTIFICATION_TICKER, STATUS_BAR_DISABLE_RECENT, STATUS_BAR_DISABLE_SEARCH, STATUS_BAR_DISABLE_SYSTEM_INFO, STATUS_BAR_HIDDEN, STATUS_BAR_TRANSIENT, STATUS_BAR_TRANSLUCENT, STATUS_BAR_TRANSPARENT, STATUS_BAR_UNHIDE, STATUS_BAR_VISIBLE, SYSTEM_UI_CLEARABLE_FLAGS, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, SYSTEM_UI_TRANSPARENT, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VISIBLE, X, Y, Z
-
-
Constructor Summary
Constructors Constructor Description SceneView(android.content.Context context)Constructs a SceneView object and binds it to an Android Context.SceneView(android.content.Context context, android.util.AttributeSet attrs)Constructs a SceneView object and binds it to an Android Context.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Required to exit Sceneform.static voiddestroyAllResources()Immediately releases all rendering resources, even if in use.voiddoFrame(long frameTimeNanos)Callback that occurs for each display frame.voiddoFrameNoRepost(long frameTimeNanos)Callback that occurs for each display frame.voidenableDebug(boolean enable)If enabled, provides various visualizations for debugging.RenderergetRenderer()Returns the renderer used for this view, or null if the renderer is not setup.ScenegetScene()Returns the Sceneform Scene created by this view.booleanisDebugEnabled()Indicates whether debugging is enabled for this view.voidonLayout(boolean changed, int left, int top, int right, int bottom)booleanonTouchEvent(android.view.MotionEvent motionEvent)Implement this method to handle touch screen motion events.voidpause()Pause Sceneform, which pauses the rendering thread.static longreclaimReleasedResources()Releases rendering resources ready for garbage collectionvoidresume()Resume Sceneform, which resumes the rendering thread.voidsetBackground(android.graphics.drawable.Drawable background)Set the background to a givenDrawable, or remove the background.voidsetFrameRateFactor(SceneView.FrameRate frameRateFactor)Set this value for a finer adjustment of the upper fps value.voidsetMaxFramesPerSeconds(int maxFramesPerSeconds)Set a higher bound for the frame rate.voidsetTransparent(boolean transparent)Set the background to transparent.voidstartMirroringToSurface(android.view.Surface surface, int left, int bottom, int width, int height)To capture the contents of this view, designate aSurfaceonto which this SceneView should be mirrored.voidstopMirroringToSurface(android.view.Surface surface)When capturing is complete, call this method to stop mirroring the SceneView to the specifiedSurface.-
Methods inherited from class android.view.SurfaceView
gatherTransparentRegion, getHolder, setSecure, setZOrderMediaOverlay, setZOrderOnTop
-
Methods inherited from class com.android.layoutlib.bridge.MockView
addView, addView, addView, addView, addView, setGravity, setText
-
Methods inherited from class android.widget.FrameLayout
generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
-
Methods inherited from class android.view.ViewGroup
addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addTransientView, bringChildToFront, buildTouchDispatchChildList, captureTransitioningViews, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, createSnapshot, dispatchActivityResult, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEventInternal, dispatchProvideAutofillStructure, dispatchProvideContentCaptureStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findNamedViews, findViewByAccessibilityIdTraversal, findViewByAutofillIdTraversal, findViewsWithText, focusableViewAvailable, focusSearch, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildVisibleRect, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, getTransientView, getTransientViewCount, getTransientViewIndex, hasFocus, hasTransientState, hasWindowInsetsAnimationCallback, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isShowingContextMenuWithCoords, isTransitionGroup, jumpDrawablesToCurrentState, layout, makeFrameworkOptionalFitsSystemWindows, makeOptionalFitsSystemWindows, notifySubtreeAccessibilityStateChanged, notifySubtreeAccessibilityStateChangedIfNeeded, offsetChildrenTopAndBottom, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onDescendantInvalidated, onDescendantUnbufferedRequested, onInitializeAccessibilityNodeInfoInternal, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestSendAccessibilityEvent, onRequestSendAccessibilityEventInternal, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeTransientView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransitionStart, requestTransparentRegion, resetResolvedLayoutDirection, resetResolvedPadding, resetResolvedTextAlignment, resetResolvedTextDirection, resolveLayoutDirection, resolveLayoutParams, resolvePadding, resolveRtlPropertiesIfNeeded, resolveTextAlignment, resolveTextDirection, restoreDefaultFocus, restoreFocusInCluster, restoreFocusNotInCluster, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setTouchscreenBlocksFocus, setTransitionGroup, setWindowInsetsAnimationCallback, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, subtractObscuredTouchableRegion, suppressLayout, transformPointToViewLocal, updateViewLayout
-
Methods inherited from class android.view.View
addFocusables, addFrameMetricsListener, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, applyDrawableToTransparentRegion, autofill, autofill, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canHaveDisplayList, canNotifyAutofillEnterExitEvent, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAccessibilityFocus, clearAnimation, combineMeasuredStates, computeScroll, computeSystemWindowInsets, createAccessibilityNodeInfo, createAccessibilityNodeInfoInternal, createContextMenu, createScrollCaptureCallbackInternal, debug, destroyDrawingCache, dispatchGenericMotionEvent, dispatchInitialProvideContentCaptureStructure, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerEvent, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, encode, findViewById, findViewByPredicate, findViewByPredicateInsideOut, findViewWithTag, finishMovingTask, fitsSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilitySelectionEnd, getAccessibilitySelectionStart, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAccessibilityViewId, getAccessibilityWindowId, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getAutofillViewId, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBoundsOnScreen, getBoundsOnScreen, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFadingEdge, getFadingEdgeLength, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getHotspotBounds, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getInverseMatrix, getIterableTextForAccessibility, getIteratorForGranularity, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOnLongClickListener, getOpticalInsets, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getRawLayoutDirection, getRawTextAlignment, getRawTextDirection, getResources, getRevealOnFocusHint, getRight, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getThreadedRenderer, getTooltip, getTooltipText, getTooltipView, getTop, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewRootImpl, getViewTreeObserver, getVisibility, getWidth, getWindowDisplayFrame, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasIdentityMatrix, hasImeFocus, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasShadow, hasWindowFocus, hideAutofillHighlight, includeForAccessibility, inflate, invalidate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isAccessibilitySelectionExtendable, isActionableForAccessibility, isActivated, isAssistBlocked, isAttachedToWindow, isAutofilled, isClickable, isContextClickable, isDefaultFocusHighlightEnabled, isDefaultFocusHighlightNeeded, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isForegroundInsidePadding, isFrameworkOptionalFitsSystemWindows, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInScrollingContainer, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionInherited, isLayoutDirectionResolved, isLayoutModeOptical, isLayoutRequested, isLayoutRtl, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPressed, isRootNamespace, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentInherited, isTextAlignmentResolved, isTextDirectionInherited, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUser, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, mapRectFromViewToScreenCoords, measure, notifyEnterOrExitForAutoFillIfNeeded, notifyViewAccessibilityStateChangedIfNeeded, offsetLeftAndRight, offsetTopAndBottom, onActivityResult, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCloseSystemDialogs, onCreateInputConnection, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityEventInternal, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onMovedToDisplay, onPointerCaptureChange, onPopulateAccessibilityEvent, onPopulateAccessibilityEventInternal, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onResolveDrawables, onRtlPropertiesChanged, onScreenStateChanged, onStartTemporaryDetach, onTrackballEvent, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, outputDirtyFlags, performAccessibilityAction, performAccessibilityActionInternal, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, pointInView, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeFrameMetricsListener, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestAccessibilityFocus, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestKeyboardShortcuts, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requestUnbufferedDispatch, requireViewById, resetPaddingToInitialValues, resetPivot, resetRtlProperties, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventInternal, sendAccessibilityEventUnchecked, sendAccessibilityEventUncheckedInternal, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilitySelection, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAnimationMatrix, setAssistBlocked, setAutofilled, setAutofillHints, setAutofillId, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDisabledSystemUiVisibility, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setFocusedInCluster, setForceDarkAllowed, setForeground, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setIsRootNamespace, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setNotifyAutofillManagerOnClick, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOpticalInsets, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealClip, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setShowingLayoutBounds, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTagInternal, setTextAlignment, setTextDirection, setTooltip, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startActivityForResult, startAnimation, startDrag, startDragAndDrop, startMovingTask, startNestedScroll, stopNestedScroll, toGlobalMotionEvent, toLocalMotionEvent, toString, transformFromViewToWindowSpace, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDisplayListIfDirty, updateDragShadow, willNotCacheDrawing, willNotDraw
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface android.view.ViewParent
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayout
-
-
-
-
Field Detail
-
DEFAULT_IBL_LOCATION
public static final java.lang.String DEFAULT_IBL_LOCATION
- See Also:
- Constant Field Values
-
DEFAULT_SKYBOX_LOCATION
public static final java.lang.String DEFAULT_SKYBOX_LOCATION
- See Also:
- Constant Field Values
-
_environment
public Environment _environment
-
_mainLight
public java.lang.Integer _mainLight
-
-
Constructor Detail
-
SceneView
public SceneView(android.content.Context context)
Constructs a SceneView object and binds it to an Android Context.- Parameters:
context- the Android Context to use- See Also:
SceneView(Context, AttributeSet)
-
SceneView
public SceneView(android.content.Context context, android.util.AttributeSet attrs)Constructs a SceneView object and binds it to an Android Context.- Parameters:
context- the Android Context to useattrs- the Android AttributeSet to associate with
-
-
Method Detail
-
onTouchEvent
public boolean onTouchEvent(android.view.MotionEvent motionEvent)
Description copied from class:android.view.ViewImplement this method to handle touch screen motion events.If this method is used to detect click actions, it is recommended that the actions be performed by implementing and calling
View.performClick(). This will ensure consistent system behavior, including:- obeying click sound preferences
- dispatching OnClickListener calls
- handling
ACTION_CLICKwhen accessibility features are enabled
- Overrides:
onTouchEventin classandroid.view.View- Parameters:
motionEvent- The motion event.- Returns:
- True if the event was handled, false otherwise.
-
setBackground
public void setBackground(@Nullable android.graphics.drawable.Drawable background)Set the background to a givenDrawable, or remove the background. If the background is aColorDrawable, then the background color of theSceneis set toColorDrawable.getColor()(the alpha of the color is ignored). Otherwise, default to the behavior ofView.setBackground(Drawable).- Overrides:
setBackgroundin classandroid.view.View- Parameters:
background- The Drawable to use as the background, or null to remove the background
-
setTransparent
public void setTransparent(boolean transparent)
Set the background to transparent.
-
setMaxFramesPerSeconds
public void setMaxFramesPerSeconds(int maxFramesPerSeconds)
Set a higher bound for the frame rate. It is possible to obtain the higher bound from theSession.session.getCameraConfig().getFpsRange().getUpper();. The default value is 60.- Parameters:
maxFramesPerSeconds- int
-
setFrameRateFactor
public void setFrameRateFactor(SceneView.FrameRate frameRateFactor)
Set this value for a finer adjustment of the upper fps value. Three different modes are supported FULL, HALF, THIRD. As the names already indicate means FULL, use the value from maxFramesPerSeconds. HALF means to divide maxFramesPerSeconds by 2 and THIRD means to divide maxFramesPerSeconds by 3. The default FrameRate is set to FULL.- Parameters:
frameRateFactor-SceneView.FrameRate
-
onLayout
public void onLayout(boolean changed, int left, int top, int right, int bottom)
-
resume
public void resume() throws java.lang.ExceptionResume Sceneform, which resumes the rendering thread.Typically called from onResume().
- Throws:
java.lang.Exception
-
pause
public void pause()
Pause Sceneform, which pauses the rendering thread.Typically called from onPause().
-
destroy
public void destroy()
Required to exit Sceneform.Typically called from onDestroy().
-
destroyAllResources
public static void destroyAllResources()
Immediately releases all rendering resources, even if in use.Use this if nothing more will be rendered in this scene or any other, and the memory must be released immediately.
-
reclaimReleasedResources
public static long reclaimReleasedResources()
Releases rendering resources ready for garbage collectionCalled every frame to collect unused resources. May be called manually to release resources after rendering has stopped.
- Returns:
- Count of resources currently in use
-
enableDebug
public void enableDebug(boolean enable)
If enabled, provides various visualizations for debugging.- Parameters:
enable- True to enable debugging visualizations, false to disable it.
-
isDebugEnabled
public boolean isDebugEnabled()
Indicates whether debugging is enabled for this view.
-
getRenderer
@Nullable public Renderer getRenderer()
Returns the renderer used for this view, or null if the renderer is not setup.
-
getScene
public Scene getScene()
Returns the Sceneform Scene created by this view.
-
startMirroringToSurface
public void startMirroringToSurface(android.view.Surface surface, int left, int bottom, int width, int height)To capture the contents of this view, designate aSurfaceonto which this SceneView should be mirrored. UseMediaRecorder.getSurface(),MediaCodec.createInputSurface()orMediaCodec.createPersistentInputSurface()to obtain the input surface for recording. This will incur a rendering performance cost and should only be set when capturing this view. To stop the additional rendering, call stopMirroringToSurface.- Parameters:
surface- the Surface onto which the rendered scene should be mirrored.left- the left edge of the rectangle into which the view should be mirrored on surface.bottom- the bottom edge of the rectangle into which the view should be mirrored on surface.width- the width of the rectangle into which the SceneView should be mirrored on surface.height- the height of the rectangle into which the SceneView should be mirrored on surface.
-
stopMirroringToSurface
public void stopMirroringToSurface(android.view.Surface surface)
When capturing is complete, call this method to stop mirroring the SceneView to the specifiedSurface. If this is not called, the additional performance cost will remain.The application is responsible for calling
Surface.release()on the Surface when done.
-
doFrame
public void doFrame(long frameTimeNanos)
Callback that occurs for each display frame. Updates the scene and reposts itself to be called by the choreographer on the next frame.- Specified by:
doFramein interfaceandroid.view.Choreographer.FrameCallback- Parameters:
frameTimeNanos- The time in nanoseconds when the frame started being rendered, in theSystem.nanoTime()timebase. Divide this value by1000000to convert it to theSystemClock.uptimeMillis()time base.
-
doFrameNoRepost
public void doFrameNoRepost(long frameTimeNanos)
Callback that occurs for each display frame. Updates the scene but does not post a callback request to the choreographer for the next frame. This is used for testing where on-demand renders are needed.
-
-