Available Methods
- findViewById ( )
- getId ( )
- getLayoutParams ( )
- getTag ( )
- setTag ( )
- VISIBLE
- setVisibility ( )
- setOnClickListener ( )
- OnClickListener ( )
- getLeft ( )
- getHeight ( )
- getWidth ( )
- getTop ( )
- getVisibility ( )
- GONE
- setLayoutParams ( )
- getMeasuredHeight ( )
- inflate ( )
- getBottom ( )
- getMeasuredWidth ( )
- setBackgroundColor ( )
- getRight ( )
- measure ( )
- getParent ( )
- layout ( )
- getContext ( )
- setAlpha ( )
- setTranslationX ( )
- startAnimation ( )
- setScaleX ( )
- setScaleY ( )
- setPadding ( )
- setBackgroundResource ( )
- requestFocus ( )
- getLocationOnScreen ( )
- setTranslationY ( )
- setDrawingCacheEnabled ( )
- setPivotY ( )
- setOnLongClickListener ( )
- setPivotX ( )
- setBackground ( )
- INVISIBLE
- draw ( )
- setSystemUiVisibility ( )
- setBackgroundDrawable ( )
- equals ( )
- NO_ID
- getScrollY ( )
- OnLongClickListener ( )
- getBackground ( )
- postDelayed ( )
- setEnabled ( )
- setSelected ( )
- getY ( )
- requestLayout ( )
- getScrollX ( )
- setClickable ( )
- post ( )
- getDrawingCache ( )
- getTranslationY ( )
- setOnTouchListener ( )
- SYSTEM_UI_FLAG_FULLSCREEN
- destroyDrawingCache ( )
- SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- OnTouchListener ( )
- setRotation ( )
- getHitRect ( )
- getPaddingRight ( )
- setRotationY ( )
- invalidate ( )
- getPaddingBottom ( )
- buildDrawingCache ( )
- SYSTEM_UI_FLAG_HIDE_NAVIGATION
- LAYOUT_DIRECTION_RTL
- setId ( )
- setPressed ( )
- getLocationInWindow ( )
- clearAnimation ( )
- SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- SYSTEM_UI_FLAG_LAYOUT_STABLE
- getPaddingLeft ( )
- getX ( )
- getTranslationX ( )
- getDrawingRect ( )
- FOCUS_UP
- getPaddingTop ( )
- SYSTEM_UI_FLAG_IMMERSIVE_STICKY
- setLayerType ( )
- getGlobalVisibleRect ( )
- setFocusable ( )
- setRotationX ( )
- FOCUS_RIGHT
- clearFocus ( )
- getViewTreeObserver ( )
- SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
- canScrollVertically ( )
- getRootView ( )
- dispatchPopulateAccessibilityEvent ( )
- postOnAnimation ( )
- isShown ( )
- setY ( )
- FOCUS_LEFT
- getSystemUiVisibility ( )
- offsetLeftAndRight ( )
- getWindowVisibleDisplayFrame ( )
- getResources ( )
- getScaleX ( )
- addTouchables ( )
- bringToFront ( )
- isEnabled ( )
- performClick ( )
- FOCUS_DOWN
- FOCUS_BACKWARD
- setX ( )
- setFitsSystemWindows ( )
- FOCUS_FORWARD
- SYSTEM_UI_FLAG_LOW_PROFILE
- getWindowToken ( )
- setAnimation ( )
- offsetTopAndBottom ( )
- setFocusableInTouchMode ( )
- generateViewId ( )
- isSelected ( )
- sendAccessibilityEvent ( )
- setOnCreateContextMenuListener ( )
- removeCallbacks ( )
- scrollTo ( )
- setMinimumWidth ( )
- isClickable ( )
- getLayerType ( )
- getAlpha ( )
- setOnSystemUiVisibilityChangeListener ( )
- addFocusables ( )
- isFocusable ( )
- getClass ( )
- setDrawingCacheBackgroundColor ( )
- dispatchTouchEvent ( )
- setActivated ( )
- SYSTEM_UI_FLAG_IMMERSIVE
- LAYER_TYPE_HARDWARE
- hashCode ( )
- setElevation ( )
- addOnLayoutChangeListener ( )
- setAccessibilityDelegate ( )
- OnFocusChangeListener ( )
- LAYER_TYPE_NONE
- isLayoutRequested ( )
- setCameraDistance ( )
- isPressed ( )
- getAnimation ( )
- getScaleY ( )
- getRotationY ( )
- setMinimumHeight ( )
- animate ( )
- getOverScrollMode ( )
- getRotationX ( )
- onTouchEvent ( )
- setContentDescription ( )
- getRotation ( )
- SYSTEM_UI_FLAG_VISIBLE
- setLongClickable ( )
- canScrollHorizontally ( )
- performHapticFeedback ( )
- hasFocus ( )
- removeOnAttachStateChangeListener ( )
- cancelLongPress ( )
- LAYOUT_DIRECTION_LTR
- OVER_SCROLL_NEVER
- isInEditMode ( )
- getLayoutDirection ( )
- playSoundEffect ( )
- getDrawingCacheBackgroundColor ( )
- setOutlineProvider ( )
- getDefaultSize ( )
- isAttachedToWindow ( )
- SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
- setOnKeyListener ( )
- setWillNotCacheDrawing ( )
- hasTransientState ( )
- getLocalVisibleRect ( )
- startDrag ( )
- getPivotY ( )
- willNotCacheDrawing ( )
- LAYER_TYPE_SOFTWARE
- saveHierarchyState ( )
- findViewWithTag ( )
- performLongClick ( )
- requestFocusFromTouch ( )
- setOnApplyWindowInsetsListener ( )
- postInvalidateOnAnimation ( )
- isLongClickable ( )
- setTranslationZ ( )
- setOnFocusChangeListener ( )
- hasFocusable ( )
- setTop ( )
- addOnAttachStateChangeListener ( )
- postInvalidate ( )
- postInvalidateDelayed ( )
- onStartTemporaryDetach ( )
- removeOnLayoutChangeListener ( )
- getAccessibilityViewId ( )
- restoreHierarchyState ( )
- isHardwareAccelerated ( )
- setHasTransientState ( )
- getImportantForAccessibility ( )
- setBottom ( )
- setLeft ( )
- DragShadowBuilder ( )
- getBaseline ( )
- SCROLL_AXIS_VERTICAL
- setScrollX ( )
- isFocusableInTouchMode ( )
- forceLayout ( )
- setPaddingRelative ( )
- SCROLLBAR_POSITION_RIGHT
- setImportantForAccessibility ( )
- getPivotX ( )
- getContentDescription ( )
- announceForAccessibility ( )
- isDrawingCacheEnabled ( )
- showContextMenu ( )
- setDrawingCacheQuality ( )
- setRight ( )
- OnKeyListener ( )
- getFitsSystemWindows ( )
- OnLayoutChangeListener ( )
- getTransitionName ( )
- addView ( )
- dispatchApplyWindowInsets ( )
- onCheckIsTextEditor ( )
- setLayoutDirection ( )
- onFinishTemporaryDetach ( )
- setTransitionName ( )
- isFocused ( )
- getRootWindowInsets ( )
- jumpDrawablesToCurrentState ( )
- setClipToOutline ( )
- getWindowVisibility ( )
- getFocusedRect ( )
- IMPORTANT_FOR_ACCESSIBILITY_AUTO
- setScrollY ( )
- isActivated ( )
- STATUS_BAR_HIDDEN
- setOverScrollMode ( )
- setLabelFor ( )
- getMatrix ( )
- setHorizontalScrollBarEnabled ( )
- isOpaque ( )
- getParentForAccessibility ( )
- setLayerPaint ( )
- startDragAndDrop ( )
- setStateListAnimator ( )
- postOnAnimationDelayed ( )
- getPaddingStart ( )
- hasWindowFocus ( )
- getMinimumHeight ( )
- resolveSize ( )
- findFocus ( )
- AUTOFILL_TYPE_DATE
- setKeepScreenOn ( )
- focusSearch ( )
- getPaddingEnd ( )
- onInitializeAccessibilityNodeInfo ( )
- getViewRootImpl ( )
- isInTouchMode ( )
- getKeyDispatcherState ( )
- isLaidOut ( )
- scrollBy ( )
- AUTOFILL_TYPE_TEXT
- getTranslationZ ( )
- getWindowSystemUiVisibility ( )
- OVER_SCROLL_ALWAYS
- getMeasuredWidthAndState ( )
- performAccessibilityAction ( )
- AccessibilityDelegate ( )
- STATUS_BAR_TRANSLUCENT
- callOnClick ( )
- getAccessibilityLiveRegion ( )
- resolveSizeAndState ( )
- isImportantForAccessibility ( )
- getLabelFor ( )
- OnAttachStateChangeListener ( )
- getMeasuredHeightAndState ( )
- TEXT_ALIGNMENT_GRAVITY
- drawableHotspotChanged ( )
- getAccessibilityNodeProvider ( )
- onInitializeAccessibilityEvent ( )
- getZ ( )
- refreshDrawableState ( )
- IMPORTANT_FOR_ACCESSIBILITY_YES
- AUTOFILL_HINT_USERNAME
- setTagInternal ( )
- getHandler ( )
- getOnFocusChangeListener ( )
- isScrollContainer ( )
- getNextFocusRightId ( )
- IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
- getWindowId ( )
- TEXT_ALIGNMENT_VIEW_START
- onPopulateAccessibilityEvent ( )
- TRANSLATION_Y
- setWillNotDraw ( )
- setTextAlignment ( )
Related Classes
- java.io.File
- android.os.Bundle
- android.content.Context
- android.util.Log
- android.widget.TextView
- android.content.Intent
- android.view.ViewGroup
- android.app.Activity
- android.view.LayoutInflater
- android.os.Build
- android.widget.Toast
- android.widget.ImageView
- android.graphics.Color
- android.os.Handler
- android.net.Uri
- android.widget.Button
- android.graphics.Bitmap
- android.text.TextUtils
- android.view.MotionEvent
- android.graphics.drawable.Drawable
- android.widget.LinearLayout
- android.support.annotation.Nullable
- android.widget.EditText
- android.content.SharedPreferences
- android.support.annotation.NonNull
Java Code Examples for android.view.View#setTop()
The following examples show how to use
android.view.View#setTop() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ViewOverlayPreJellybean.java From Transitions-Everywhere with Apache License 2.0 | 6 votes |
@NonNull private LayoutParams initParams(@NonNull View view, int left, int top) { int[] loc = new int[2]; getLocationOnScreen(loc); final LayoutParams layoutParams = new LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); left -= loc[0]; top -= loc[1]; layoutParams.leftMargin = left; layoutParams.topMargin = top; view.setLeft(left); view.setTop(top); if (view.getMeasuredWidth() != 0) { layoutParams.width = view.getMeasuredWidth(); view.setRight(left + layoutParams.width); } if (view.getMeasuredHeight() != 0) { layoutParams.height = view.getMeasuredHeight(); view.setBottom(top + layoutParams.height); } return layoutParams; }
Example 2
Source File: SceneViewCompatUtilsApi21.java From scene with Apache License 2.0 | 5 votes |
@Override public void setLeftTopRightBottom(View v, int left, int top, int right, int bottom) { v.setLeft(left); v.setTop(top); v.setRight(right); v.setBottom(bottom); }
Example 3
Source File: ViewOtherAnimationBuilder.java From scene with Apache License 2.0 | 5 votes |
@Override public void set(View object, final Rect value) { //todo 优化,用setLeftTopRightBottom反射 // ViewUtils.setLeftTopRightBottom(object, mLeft, mTop, mRight, mBottom); object.setLeft(value.left); object.setTop(value.top); object.setRight(value.right); object.setBottom(value.bottom); }
Example 4
Source File: StickHeaderDecoration.java From ItemDecorationDemo with Apache License 2.0 | 5 votes |
private void layout(View header, RecyclerView parent) { RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) header.getLayoutParams(); int left = parent.getPaddingLeft() + params.leftMargin; int top = parent.getPaddingTop() + params.topMargin; header.setLeft(left); header.setRight(left + header.getMeasuredWidth()); header.setTop(top); header.setBottom(top + header.getMeasuredHeight()); }
Example 5
Source File: AnimatorUtils.java From FancyAccordionView with Apache License 2.0 | 5 votes |
/** * Returns an animator that animates the bounds of a single view. */ public static Animator getBoundsAnimator(View view, int fromLeft, int fromTop, int fromRight, int fromBottom, int toLeft, int toTop, int toRight, int toBottom) { view.setLeft(fromLeft); view.setTop(fromTop); view.setRight(fromRight); view.setBottom(fromBottom); return ObjectAnimator.ofPropertyValuesHolder(view, PropertyValuesHolder.ofInt(VIEW_LEFT, toLeft), PropertyValuesHolder.ofInt(VIEW_TOP, toTop), PropertyValuesHolder.ofInt(VIEW_RIGHT, toRight), PropertyValuesHolder.ofInt(VIEW_BOTTOM, toBottom)); }
Example 6
Source File: MyFrameLayout.java From AndroidUI with MIT License | 5 votes |
private void TopAndBottomOffset(View v, int offset) { int top = v.getTop() + offset; int bottom = v.getBottom(); v.setTop(top); v.setBottom(bottom); }
Example 7
Source File: FastScroller.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
@Override public void setValue(View object, int value) { object.setTop(value); }
Example 8
Source File: StickHeaderDecoration.java From ItemDecorationDemo with Apache License 2.0 | 4 votes |
private void translate(View view, int offset) { view.setTop(view.getTop() + offset); view.setBottom(view.getBottom() + offset); }
Example 9
Source File: AnimatorUtils.java From FancyAccordionView with Apache License 2.0 | 4 votes |
@Override public void set(View view, Integer top) { view.setTop(top); }
Example 10
Source File: AnimatedLinearLayout.java From MVPAndroidBootstrap with Apache License 2.0 | 4 votes |
private Animator prepareBoundsAnimator(View child, ChildBounds bounds) { int startLeft = bounds.start.left; int startTop = bounds.start.top; int startRight = bounds.start.right; int startBottom = bounds.start.bottom; int endLeft = bounds.end.left; int endTop = bounds.end.top; int endRight = bounds.end.right; int endBottom = bounds.end.bottom; int changeCount = 0; if (startLeft != endLeft) { child.setLeft(startLeft); changeCount++; } if (startTop != endTop) { child.setTop(startTop); changeCount++; } if (startRight != endRight) { child.setRight(startRight); changeCount++; } if (startBottom != endBottom) { child.setBottom(startBottom); changeCount++; } if (changeCount == 0) { return null; } PropertyValuesHolder pvh[] = new PropertyValuesHolder[changeCount]; int pvhIndex = -1; if (startLeft != endLeft) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("left", startLeft, endLeft); } if (startTop != endTop) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("top", startTop, endTop); } if (startRight != endRight) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("right", startRight, endRight); } if (startBottom != endBottom) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("bottom", startBottom, endBottom); } return ObjectAnimator.ofPropertyValuesHolder(child, pvh); }
Example 11
Source File: AnimatedLinearLayout.java From RxAndroidBootstrap with Apache License 2.0 | 4 votes |
private Animator prepareBoundsAnimator(View child, ChildBounds bounds) { int startLeft = bounds.start.left; int startTop = bounds.start.top; int startRight = bounds.start.right; int startBottom = bounds.start.bottom; int endLeft = bounds.end.left; int endTop = bounds.end.top; int endRight = bounds.end.right; int endBottom = bounds.end.bottom; int changeCount = 0; if (startLeft != endLeft) { child.setLeft(startLeft); changeCount++; } if (startTop != endTop) { child.setTop(startTop); changeCount++; } if (startRight != endRight) { child.setRight(startRight); changeCount++; } if (startBottom != endBottom) { child.setBottom(startBottom); changeCount++; } if (changeCount == 0) { return null; } PropertyValuesHolder pvh[] = new PropertyValuesHolder[changeCount]; int pvhIndex = -1; if (startLeft != endLeft) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("left", startLeft, endLeft); } if (startTop != endTop) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("top", startTop, endTop); } if (startRight != endRight) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("right", startRight, endRight); } if (startBottom != endBottom) { pvh[++pvhIndex] = PropertyValuesHolder.ofInt("bottom", startBottom, endBottom); } return ObjectAnimator.ofPropertyValuesHolder(child, pvh); }
Example 12
Source File: ViewUtils.java From fontster with Apache License 2.0 | 4 votes |
public static void reveal(Activity activity, View view, View sourceView, int colorRes) { if (activity == null || view == null || sourceView == null) return; if (isLollipop()) { final ViewGroupOverlay groupOverlay = (ViewGroupOverlay) activity.getWindow().getDecorView().getOverlay(); final Rect displayRect = new Rect(); view.getGlobalVisibleRect(displayRect); // Make reveal cover the display and status bar. final View revealView = new View(activity); revealView.setTop(displayRect.top); revealView.setBottom(displayRect.bottom); revealView.setLeft(displayRect.left); revealView.setRight(displayRect.right); revealView.setBackgroundColor(ContextCompat.getColor(activity, colorRes)); groupOverlay.add(revealView); final int[] clearLocation = new int[2]; sourceView.getLocationInWindow(clearLocation); clearLocation[0] += sourceView.getWidth() / 2; clearLocation[1] += sourceView.getHeight() / 2; final int revealCenterX = clearLocation[0] - revealView.getLeft(); final int revealCenterY = clearLocation[1] - revealView.getTop(); final double x1_2 = Math.pow(revealView.getLeft() - revealCenterX, 2); final double x2_2 = Math.pow(revealView.getRight() - revealCenterX, 2); final double y_2 = Math.pow(revealView.getTop() - revealCenterY, 2); final float revealRadius = (float) Math.max(Math.sqrt(x1_2 + y_2), Math.sqrt(x2_2 + y_2)); try { final Animator revealAnimator = ViewAnimationUtils.createCircularReveal(revealView, revealCenterX, revealCenterY, 0.0f, revealRadius); revealAnimator.setDuration( activity.getResources().getInteger(android.R.integer.config_mediumAnimTime)); final Animator alphaAnimator = ObjectAnimator.ofFloat(revealView, View.ALPHA, 0.0f); alphaAnimator.setDuration( activity.getResources().getInteger(android.R.integer.config_shortAnimTime)); alphaAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); view.startAnimation(AnimationUtils.loadAnimation(activity, R.anim.abc_fade_in)); view.setVisibility(View.VISIBLE); } }); final AnimatorSet animatorSet = new AnimatorSet(); animatorSet.play(revealAnimator).before(alphaAnimator); animatorSet.setInterpolator(new AccelerateDecelerateInterpolator()); animatorSet.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animator) { groupOverlay.remove(revealView); } }); animatorSet.start(); } catch (IllegalStateException e) { Timber.i("View is detached - not animating"); } } else { view.setVisibility(View.VISIBLE); } }