Java android.widget FrameLayout fields, constructors, methods, implement or subclass

Example usage for Java android.widget FrameLayout fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for android.widget FrameLayout.

The text is from its open source code.

Subclass

android.widget.FrameLayout has subclasses.
Click this link to see all its subclasses.

Constructor

Method

voidaddView(View child)

Adds a child view.

voidaddView(View child, int index)
Adds a child view.
voidaddView(View child, int width, int height)
Adds a child view with this ViewGroup's default layout parameters and the specified width and height.
ViewPropertyAnimatoranimate()
This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View.
TfindViewById(@IdRes int id)
Finds the first descendant view with the given ID, the view itself if the ID matches #getId() , or null if the ID is invalid (< 0) or there is no matching view in the hierarchy.
TfindViewWithTag(Object tag)
Look for a child view with the given tag.
voidforceLayout()
Forces this view to be laid out during the next layout pass.
DrawablegetBackground()
Gets the background drawable
intgetBottom()
Bottom position of this view relative to its parent.
ViewgetChildAt(int index)
Returns the view at the specified position in the group.
intgetChildCount()
Returns the number of children in the group.
ContextgetContext()
Returns the context the view is running in, through which it can access the current theme, resources, etc.
ViewgetFocusedChild()
Returns the focused child of this view, if any.
DrawablegetForeground()
Returns the drawable used as the foreground of this View.
intgetHeight()
Return the height of your view.
intgetId()
Returns this view's identifier.
ViewGroup.LayoutParamsgetLayoutParams()
Get the LayoutParams associated with this view.
intgetLeft()
Left position of this view relative to its parent.
intgetMeasuredHeight()
Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ).
intgetMeasuredWidth()
Like #getMeasuredWidthAndState() , but only returns the raw width component (that is the result is masked by #MEASURED_SIZE_MASK ).
intgetPaddingBottom()
Returns the bottom padding of this view.
intgetPaddingLeft()
Returns the left padding of this view.
intgetPaddingRight()
Returns the right padding of this view.
intgetPaddingTop()
Returns the top padding of this view.
ViewParentgetParent()
Gets the parent of this view.
intgetRight()
Right position of this view relative to its parent.
intgetSystemUiVisibility()
Returns the last #setSystemUiVisibility(int) that this view has requested.
ObjectgetTag()
Returns this view's tag.
intgetTop()
Top position of this view relative to its parent.
ViewTreeObservergetViewTreeObserver()
Returns the ViewTreeObserver for this view's hierarchy.
intgetVisibility()
Returns the visibility status for this view.
intgetWidth()
Return the width of your view.
WindowInsetsonApplyWindowInsets(WindowInsets insets)
Called when the view should apply WindowInsets according to its internal policy.
voidremoveAllViews()
Call this method to remove all child views from the ViewGroup.
voidremoveView(View view)

Note: do not invoke this method from #draw(android.graphics.Canvas) , #onDraw(android.graphics.Canvas) , #dispatchDraw(android.graphics.Canvas) or any related method.

voidremoveViewAt(int index)
Removes the view at the specified position in the group.
voidrequestLayout()
Call this when something has changed which has invalidated the layout of this view.
voidrequestTransparentRegion(View child)
voidsetAnimation(Animation animation)
Sets the next animation to play for this view.
voidsetBackground(Drawable background)
Set the background to a given Drawable, or remove the background.
voidsetBackgroundColor(@ColorInt int color)
Sets the background color for this view.
voidsetBackgroundDrawable(Drawable background)
voidsetBackgroundResource(@DrawableRes int resid)
Set the background to a given resource.
voidsetClickable(boolean clickable)
Enables or disables click events for this view.
voidsetClipChildren(boolean clipChildren)
By default, children are clipped to their bounds before drawing.
voidsetClipToPadding(boolean clipToPadding)
Sets whether this ViewGroup will clip its children to its padding and resize (but not clip) any EdgeEffect to the padded region, if padding is present.
voidsetDrawingCacheBackgroundColor(@ColorInt int color)
Setting a solid background color for the drawing cache's bitmaps will improve performance and memory usage.
voidsetElevation(float elevation)
Sets the base elevation of this view, in pixels.
voidsetEnabled(boolean enabled)
Set the enabled state of this view.
voidsetFocusable(boolean focusable)
Set whether this view can receive the focus.
voidsetFocusableInTouchMode(boolean focusableInTouchMode)
Set whether this view can receive focus while in touch mode.
voidsetForeground(Drawable foreground)
Supply a Drawable that is to be rendered on top of all of the content in the view.
voidsetId(@IdRes int id)
Sets the identifier for this view.
voidsetKeepScreenOn(boolean keepScreenOn)
Controls whether the screen should remain on, modifying the value of #KEEP_SCREEN_ON .
voidsetLayoutParams(ViewGroup.LayoutParams params)
Set the layout parameters associated with this view.
voidsetLongClickable(boolean longClickable)
Enables or disables long click events for this view.
voidsetMinimumHeight(int minHeight)
Sets the minimum height of the view.
voidsetMinimumWidth(int minWidth)
Sets the minimum width of the view.
voidsetOnApplyWindowInsetsListener(OnApplyWindowInsetsListener listener)
Set an OnApplyWindowInsetsListener to take over the policy for applying window insets to this view.
voidsetOnClickListener(@Nullable OnClickListener l)
Register a callback to be invoked when this view is clicked.
voidsetOnGenericMotionListener(OnGenericMotionListener l)
Register a callback to be invoked when a generic motion event is sent to this view.
voidsetOnHoverListener(OnHoverListener l)
Register a callback to be invoked when a hover event is sent to this view.
voidsetOnKeyListener(OnKeyListener l)
Register a callback to be invoked when a hardware key is pressed in this view.
voidsetOnLongClickListener(@Nullable OnLongClickListener l)
Register a callback to be invoked when this view is clicked and held.
voidsetOnTouchListener(OnTouchListener l)
Register a callback to be invoked when a touch event is sent to this view.
voidsetPadding(int left, int top, int right, int bottom)
Sets the padding.
voidsetSystemUiVisibility(int visibility)
Request that the visibility of the status bar or other screen/window decorations be changed.
voidsetTag(final Object tag)
Sets the tag associated with this view.
voidsetTranslationX(float translationX)
Sets the horizontal location of this view relative to its #getLeft() left position.
voidsetTranslationY(float translationY)
Sets the vertical location of this view relative to its #getTop() top position.
voidsetVisibility(@Visibility int visibility)
Set the visibility state of this view.
voidsetX(float x)
Sets the visual x position of this view, in pixels.
voidsetY(float y)
Sets the visual y position of this view, in pixels.
voidstartAnimation(Animation animation)
Start the specified animation now.