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#OnLayoutChangeListener
The following examples show how to use
android.view.View#OnLayoutChangeListener .
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: SwipableOverlayView.java From delion with Apache License 2.0 | 6 votes |
/** * Creates a listener that is used only to animate the View coming onto the screen. * @return The SimpleOnGestureListener that will monitor the View. */ private View.OnLayoutChangeListener createLayoutChangeListener() { return new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { removeOnLayoutChangeListener(mLayoutChangeListener); // Animate the View coming in from the bottom of the screen. setTranslationY(mTotalHeight); mIsBeingDisplayedForFirstTime = true; createVerticalSnapAnimation(true); mCurrentAnimation.start(); } }; }
Example 2
Source File: SwipableOverlayView.java From AndroidChromium with Apache License 2.0 | 6 votes |
/** * Creates a listener that is used only to animate the View coming onto the screen. * @return The SimpleOnGestureListener that will monitor the View. */ private View.OnLayoutChangeListener createLayoutChangeListener() { return new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { removeOnLayoutChangeListener(mLayoutChangeListener); // Animate the View coming in from the bottom of the screen. setTranslationY(mTotalHeight); mIsBeingDisplayedForFirstTime = true; createVerticalSnapAnimation(true); mCurrentAnimation.start(); } }; }
Example 3
Source File: SwipableOverlayView.java From 365browser with Apache License 2.0 | 6 votes |
/** * Creates a listener that is used only to animate the View coming onto the screen. * @return The SimpleOnGestureListener that will monitor the View. */ private View.OnLayoutChangeListener createLayoutChangeListener() { return new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { removeOnLayoutChangeListener(mLayoutChangeListener); // Animate the View coming in from the bottom of the screen. setTranslationY(mTotalHeight); mIsBeingDisplayedForFirstTime = true; createVerticalSnapAnimation(true); mCurrentAnimation.start(); } }; }
Example 4
Source File: LayoutTransition.java From android_9.0.0_r45 with Apache License 2.0 | 5 votes |
private void cleanup() { parent.getViewTreeObserver().removeOnPreDrawListener(this); parent.removeOnAttachStateChangeListener(this); int count = layoutChangeListenerMap.size(); if (count > 0) { Collection<View> views = layoutChangeListenerMap.keySet(); for (View view : views) { View.OnLayoutChangeListener listener = layoutChangeListenerMap.get(view); view.removeOnLayoutChangeListener(listener); } layoutChangeListenerMap.clear(); } }
Example 5
Source File: MainActivity.java From libvlc-android-sdk with GNU Lesser General Public License v2.1 | 5 votes |
@Override protected void onStart() { super.onStart(); final IVLCVout vlcVout = mMediaPlayer.getVLCVout(); if (mVideoSurface != null) { vlcVout.setVideoView(mVideoSurface); if (mSubtitlesSurface != null) vlcVout.setSubtitlesView(mSubtitlesSurface); } else vlcVout.setVideoView(mVideoTexture); vlcVout.attachViews(this); Media media = new Media(mLibVLC, Uri.parse(SAMPLE_URL)); mMediaPlayer.setMedia(media); media.release(); mMediaPlayer.play(); if (mOnLayoutChangeListener == null) { mOnLayoutChangeListener = new View.OnLayoutChangeListener() { private final Runnable mRunnable = new Runnable() { @Override public void run() { updateVideoSurfaces(); } }; @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { if (left != oldLeft || top != oldTop || right != oldRight || bottom != oldBottom) { mHandler.removeCallbacks(mRunnable); mHandler.post(mRunnable); } } }; } mVideoSurfaceFrame.addOnLayoutChangeListener(mOnLayoutChangeListener); }
Example 6
Source File: VideoHelper.java From libvlc-sdk-android with GNU General Public License v2.0 | 5 votes |
void attachViews() { if (mVideoSurface == null && mVideoTexture == null) return; final IVLCVout vlcVout = mMediaPlayer.getVLCVout(); if (mVideoSurface != null) { vlcVout.setVideoView(mVideoSurface); if (mSubtitlesSurface != null) vlcVout.setSubtitlesView(mSubtitlesSurface); } else if (mVideoTexture != null) vlcVout.setVideoView(mVideoTexture); else return; vlcVout.attachViews(this); if (mOnLayoutChangeListener == null) { mOnLayoutChangeListener = new View.OnLayoutChangeListener() { private final Runnable runnable = new Runnable() { @Override public void run() { if (mVideoSurfaceFrame != null && mOnLayoutChangeListener != null) updateVideoSurfaces(); } }; @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { if (left != oldLeft || top != oldTop || right != oldRight || bottom != oldBottom) { mHandler.removeCallbacks(runnable); mHandler.post(runnable); } } }; } mVideoSurfaceFrame.addOnLayoutChangeListener(mOnLayoutChangeListener); mMediaPlayer.setVideoTrackEnabled(true); }
Example 7
Source File: Emojix.java From Emojix with Apache License 2.0 | 5 votes |
public static void wrapView(View view) { if (view == null) return; if (view instanceof TextView) { TextView textView = (TextView) view; if (textView.getTag(R.id.tag_emojix_watcher) == null) { EmojixTextWatcher watcher = new EmojixTextWatcher(textView); textView.addTextChangedListener(watcher); textView.setTag(R.id.tag_emojix_watcher, watcher); } } else if (view instanceof ViewGroup) { if (view.getTag(R.id.tag_layout_listener) == null) { View.OnLayoutChangeListener listener = new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { ViewGroup parentView = (ViewGroup) v; int len = parentView.getChildCount(); for (int i = 0; i < len; i ++) { wrapView(parentView.getChildAt(i)); } } }; view.addOnLayoutChangeListener(listener); view.setTag(R.id.tag_layout_listener, listener); } } }
Example 8
Source File: LayoutTransition.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
CleanupCallback(Map<View, View.OnLayoutChangeListener> listenerMap, ViewGroup parent) { this.layoutChangeListenerMap = listenerMap; this.parent = parent; }
Example 9
Source File: VideoPlayerActivity.java From VCL-Android with Apache License 2.0 | 4 votes |
@TargetApi(Build.VERSION_CODES.HONEYCOMB) private void startPlayback() { /* start playback only when audio service and both surfaces are ready */ if (mPlaybackStarted || mService == null) return; mPlaybackStarted = true; /* Dispatch ActionBar touch events to the Activity */ mActionBarView.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { onTouchEvent(event); return true; } }); if (AndroidUtil.isICSOrLater()) getWindow().getDecorView().setOnSystemUiVisibilityChangeListener( new OnSystemUiVisibilityChangeListener() { @Override public void onSystemUiVisibilityChange(int visibility) { if (visibility == mUiVisibility) return; if (visibility == View.SYSTEM_UI_FLAG_VISIBLE && !mShowing && !isFinishing()) { showOverlay(); } mUiVisibility = visibility; } } ); if (AndroidUtil.isHoneycombOrLater()) { if (mOnLayoutChangeListener == null) { mOnLayoutChangeListener = new View.OnLayoutChangeListener() { private final Runnable mRunnable = new Runnable() { @Override public void run() { changeSurfaceLayout(); } }; @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { if (left != oldLeft || top != oldTop || right != oldRight || bottom != oldBottom) { /* changeSurfaceLayout need to be called after the layout changed */ mHandler.removeCallbacks(mRunnable); mHandler.post(mRunnable); } } }; } mSurfaceFrame.addOnLayoutChangeListener(mOnLayoutChangeListener); } changeSurfaceLayout(); /* Listen for changes to media routes. */ if (mMediaRouter != null) mediaRouterAddCallback(true); LibVLC().setOnHardwareAccelerationError(this); final IVLCVout vlcVout = mService.getVLCVout(); vlcVout.detachViews(); if (mPresentation == null) { vlcVout.setVideoView(mSurfaceView); if (mSubtitlesSurfaceView.getVisibility() != View.GONE) vlcVout.setSubtitlesView(mSubtitlesSurfaceView); } else { vlcVout.setVideoView(mPresentation.mSurfaceView); if (mSubtitlesSurfaceView.getVisibility() != View.GONE) vlcVout.setSubtitlesView(mPresentation.mSubtitlesSurfaceView); } mSurfacesAttached = true; vlcVout.addCallback(this); vlcVout.attachViews(); mSurfaceView.setKeepScreenOn(true); loadMedia(); // Add any selected subtitle file from the file picker if(mSubtitleSelectedFiles.size() > 0) { for(String file : mSubtitleSelectedFiles) { Log.i(TAG, "Adding user-selected subtitle " + file); mService.addSubtitleTrack(file); } } // Set user playback speed mService.setRate(mSettings.getFloat(PreferencesActivity.VIDEO_SPEED, 1)); }