Example usage for Java android.widget LinearLayout fields, constructors, methods, implement or subclass
The text is from its open source code.
int | HORIZONTAL |
int | VERTICAL |
int | SHOW_DIVIDER_NONE Don't show any dividers. |
int | SHOW_DIVIDER_BEGINNING Show a divider at the beginning of the group. |
int | SHOW_DIVIDER_MIDDLE Show dividers between each item in the group. |
int | SHOW_DIVIDER_END Show a divider at the end of the group. |
void | addView(View child) Adds a child view. |
void | addView(View child, int index) Adds a child view. |
void | addView(View child, int width, int height) Adds a child view with this ViewGroup's default layout parameters and the specified width and height. |
ViewPropertyAnimator | animate() This method returns a ViewPropertyAnimator object, which can be used to animate specific properties on this View. |
void | bringToFront() Change the view's z order in the tree, so it's on top of other sibling views. |
void | buildDrawingCache() Calling this method is equivalent to calling |
void | draw(Canvas canvas) Manually render this view (and all of its children) to the given Canvas. |
T | findViewById(@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. |
T | findViewWithTag(Object tag) Look for a child view with the given tag. |
Drawable | getBackground() Gets the background drawable |
int | getBottom() Bottom position of this view relative to its parent. |
View | getChildAt(int index) Returns the view at the specified position in the group. |
int | getChildCount() Returns the number of children in the group. |
Context | getContext() Returns the context the view is running in, through which it can access the current theme, resources, etc. |
int | getDividerPadding() Get the padding size used to inset dividers in pixels |
Bitmap | getDrawingCache() Calling this method is equivalent to calling |
int | getHeight() Return the height of your view. |
int | getId() Returns this view's identifier. |
ViewGroup.LayoutParams | getLayoutParams() Get the LayoutParams associated with this view. |
int | getLeft() Left position of this view relative to its parent. |
int | getMeasuredHeight() Like #getMeasuredHeightAndState() , but only returns the raw height component (that is the result is masked by #MEASURED_SIZE_MASK ). |
int | getMeasuredWidth() Like #getMeasuredWidthAndState() , but only returns the raw width component (that is the result is masked by #MEASURED_SIZE_MASK ). |
int | getMinimumWidth() Returns the minimum width of the view. |
int | getOrientation() Returns the current orientation. |
int | getPaddingBottom() Returns the bottom padding of this view. |
int | getPaddingLeft() Returns the left padding of this view. |
int | getPaddingRight() Returns the right padding of this view. |
int | getPaddingTop() Returns the top padding of this view. |
ViewParent | getParent() Gets the parent of this view. |
Resources | getResources() Returns the resources associated with this view. |
int | getRight() Right position of this view relative to its parent. |
View | getRootView() Finds the topmost view in the current view hierarchy. |
Object | getTag() Returns this view's tag. |
int | getTop() Top position of this view relative to its parent. |
float | getTranslationY() The vertical location of this view relative to its #getTop() top position. |
ViewTreeObserver | getViewTreeObserver() Returns the ViewTreeObserver for this view's hierarchy. |
int | getVisibility() Returns the visibility status for this view. |
int | getWidth() Return the width of your view. |
float | getY() The visual y position of this view, in pixels. |
int | indexOfChild(View child) Returns the position in the group of the specified child view. |
void | invalidate() Invalidate the whole view. |
boolean | isEnabled() Returns the enabled status for this view. |
void | layout(int l, int t, int r, int b) |
void | measure(int widthMeasureSpec, int heightMeasureSpec) This is called to find out how big a view should be. |
boolean | performClick() Call this view's OnClickListener, if it is defined. |
boolean | post(Runnable action) Causes the Runnable to be added to the message queue. |
void | removeAllViews() Call this method to remove all child views from the ViewGroup. |
void | removeAllViewsInLayout() Called by a ViewGroup subclass to remove child views from itself, when it must first know its size on screen before it can calculate how many child views it will render. |
void | removeView(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. |
void | removeViewAt(int index) Removes the view at the specified position in the group. |
void | removeViews(int start, int count) Removes the specified range of views from the group. |
boolean | requestFocus() Call this to try to give focus to a specific view or to one of its descendants. |
void | requestLayout() Call this when something has changed which has invalidated the layout of this view. |
void | setAlpha(@FloatRange(from = 0.0, to = 1.0) float alpha) Sets the opacity of the view to a value from 0 to 1, where 0 means the view is completely transparent and 1 means the view is completely opaque. |
void | setAnimation(Animation animation) Sets the next animation to play for this view. |
void | setBackground(Drawable background) Set the background to a given Drawable, or remove the background. |
void | setBackgroundColor(@ColorInt int color) Sets the background color for this view. |
void | setBackgroundDrawable(Drawable background) |
void | setBackgroundResource(@DrawableRes int resid) Set the background to a given resource. |
void | setBaselineAligned(boolean baselineAligned) Defines whether widgets contained in this layout are baseline-aligned or not. |
void | setClickable(boolean clickable) Enables or disables click events for this view. |
void | setClipChildren(boolean clipChildren) By default, children are clipped to their bounds before drawing. |
void | setClipToPadding(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. |
void | setDescendantFocusability(int focusability) Set the descendant focusability of this view group. |
void | setDividerDrawable(Drawable divider) Set a drawable to be used as a divider between items. |
void | setDrawingCacheEnabled(boolean enabled) Enables or disables the drawing cache. |
void | setElevation(float elevation) Sets the base elevation of this view, in pixels. |
void | setEnabled(boolean enabled) Set the enabled state of this view. |
void | setFocusable(boolean focusable) Set whether this view can receive the focus. |
void | setFocusableInTouchMode(boolean focusableInTouchMode) Set whether this view can receive focus while in touch mode. |
void | setGravity(int gravity) Describes how the child views are positioned. |
void | setId(@IdRes int id) Sets the identifier for this view. |
void | setLayoutParams(ViewGroup.LayoutParams params) Set the layout parameters associated with this view. |
void | setMeasureWithLargestChildEnabled(boolean enabled) When set to true, all children with a weight will be considered having the minimum size of the largest child. |
void | setMinimumHeight(int minHeight) Sets the minimum height of the view. |
void | setMinimumWidth(int minWidth) Sets the minimum width of the view. |
void | setMotionEventSplittingEnabled(boolean split) Enable or disable the splitting of MotionEvents to multiple children during touch event dispatch. |
void | setNestedScrollingEnabled(boolean enabled) Enable or disable nested scrolling for this view. |
void | setNextFocusUpId(int nextFocusUpId) Sets the id of the view to use when the next focus is #FOCUS_UP . |
void | setOnClickListener(@Nullable OnClickListener l) Register a callback to be invoked when this view is clicked. |
void | setOnDragListener(OnDragListener l) Register a drag event listener callback object for this View. |
void | setOnFocusChangeListener(OnFocusChangeListener l) Register a callback to be invoked when focus of this view changed. |
void | setOnGenericMotionListener(OnGenericMotionListener l) Register a callback to be invoked when a generic motion event is sent to this view. |
void | setOnHoverListener(OnHoverListener l) Register a callback to be invoked when a hover event is sent to this view. |
void | setOnKeyListener(OnKeyListener l) Register a callback to be invoked when a hardware key is pressed in this view. |
void | setOnLongClickListener(@Nullable OnLongClickListener l) Register a callback to be invoked when this view is clicked and held. |
void | setOnTouchListener(OnTouchListener l) Register a callback to be invoked when a touch event is sent to this view. |
void | setOrientation(@OrientationMode int orientation) Should the layout be a column or a row. |
void | setPadding(int left, int top, int right, int bottom) Sets the padding. |
void | setPressed(boolean pressed) Sets the pressed state for this view. |
void | setShowDividers(@DividerMode int showDividers) Set how dividers should be shown between items in this layout |
void | setTag(final Object tag) Sets the tag associated with this view. |
void | setTranslationY(float translationY) Sets the vertical location of this view relative to its #getTop() top position. |
void | setVerticalGravity(int verticalGravity) |
void | setVerticalScrollBarEnabled(boolean verticalScrollBarEnabled) Define whether the vertical scrollbar should be drawn or not. |
void | setVisibility(@Visibility int visibility) Set the visibility state of this view. |
void | setWeightSum(float weightSum) Defines the desired weights sum. |
void | setX(float x) Sets the visual x position of this view, in pixels. |
void | setY(float y) Sets the visual y position of this view, in pixels. |
void | startAnimation(Animation animation) Start the specified animation now. |
boolean | startDrag(ClipData data, DragShadowBuilder shadowBuilder, Object myLocalState, int flags) |