android.view.View.removeOnLayoutChangeListener()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(205)

本文整理了Java中android.view.View.removeOnLayoutChangeListener()方法的一些代码示例,展示了View.removeOnLayoutChangeListener()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。View.removeOnLayoutChangeListener()方法的具体详情如下:
包路径:android.view.View
类名称:View
方法名:removeOnLayoutChangeListener

View.removeOnLayoutChangeListener介绍

暂无

代码示例

代码示例来源:origin: ZieIony/Carbon

private void removeListeners() {
    if (dependency == null)
      return;

    if (dependency instanceof TransformationView)
      ((TransformationView) dependency).removeOnTransformationChangedListener(transformationListener);
    dependency.removeOnLayoutChangeListener(layoutListener);
  }
}

代码示例来源:origin: stackoverflow.com

@Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
   // Inflate the layout for this fragment
   final View view = inflater.inflate(R.layout.fragment_map_list, container, false);
   if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
     view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
       @TargetApi(Build.VERSION_CODES.LOLLIPOP)
       @Override
       public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
         v.removeOnLayoutChangeListener(this);
         toggleInformationView(view);
       }
     });
   }
   return view;
 }

代码示例来源:origin: google/ExoPlayer

@Override
public void onVideoSizeChanged(
  int width, int height, int unappliedRotationDegrees, float pixelWidthHeightRatio) {
 float videoAspectRatio =
   (height == 0 || width == 0) ? 1 : (width * pixelWidthHeightRatio) / height;
 if (surfaceView instanceof TextureView) {
  // Try to apply rotation transformation when our surface is a TextureView.
  if (unappliedRotationDegrees == 90 || unappliedRotationDegrees == 270) {
   // We will apply a rotation 90/270 degree to the output texture of the TextureView.
   // In this case, the output video's width and height will be swapped.
   videoAspectRatio = 1 / videoAspectRatio;
  }
  if (textureViewRotation != 0) {
   surfaceView.removeOnLayoutChangeListener(this);
  }
  textureViewRotation = unappliedRotationDegrees;
  if (textureViewRotation != 0) {
   // The texture view's dimensions might be changed after layout step.
   // So add an OnLayoutChangeListener to apply rotation after layout step.
   surfaceView.addOnLayoutChangeListener(this);
  }
  applyTextureViewRotation((TextureView) surfaceView, textureViewRotation);
 }
 onContentAspectRatioChanged(videoAspectRatio, contentFrame, surfaceView);
}

代码示例来源:origin: Flipboard/bottomsheet

sheetView.removeOnLayoutChangeListener(sheetViewOnLayoutChangeListener);
cancelCurrentAnimation();
ObjectAnimator anim = ObjectAnimator.ofFloat(this, SHEET_TRANSLATION, 0);

代码示例来源:origin: heinrichreimer/material-intro

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom,
                int oldLeft, int oldTop, int oldRight, int oldBottom) {
    updateScrollPositions();
    v.removeOnLayoutChangeListener(this);
  }
});

代码示例来源:origin: ribot/ribot-app-android

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom,
                int oldLeft, int oldTop, int oldRight, int oldBottom) {
    v.removeOnLayoutChangeListener(this);
    revealProfileInfo();
  }
});

代码示例来源:origin: stackoverflow.com

@Override
 public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
 {
   // Inflate the layout for this fragment
   final View view = inflater.inflate(R.layout.fragment_map_list, container, false);
   if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
     view.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
       @TargetApi(Build.VERSION_CODES.LOLLIPOP)
       @Override
       public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
         v.removeOnLayoutChangeListener(this);
         revealView(view);
       }
     });
   }
   return view;
 }

代码示例来源:origin: novoda/no-player

void clear(View containerView) {
    containerView.removeOnLayoutChangeListener(preventerListener);
    preventerListener = null;
  }
}

代码示例来源:origin: PuffOpenSource/Puff-Android

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom,
                int oldLeft, int oldTop, int oldRight, int oldBottom) {
    updateViewPositions();
    v.removeOnLayoutChangeListener(this);
  }
});

代码示例来源:origin: freedom10086/Ruisi

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
    v.removeOnLayoutChangeListener(this);
    show_search_view();
  }
});

代码示例来源:origin: googlecodelabs/android-topeka

@Override
  public void onLayoutChange(View v, int left, int top,
                int right, int bottom,
                int oldLeft, int oldTop,
                int oldRight, int oldBottom) {
    v.removeOnLayoutChangeListener(this);
    setUpUserInput();
  }
});

代码示例来源:origin: james602152002/FloatingLabelSpinner

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
    if (v.getWidth() > 0) {
      startErrorAnimation();
    }
    v.removeOnLayoutChangeListener(this);
  }
});

代码示例来源:origin: cpiz/BubbleView

private void setArrowToRef(View targetView) {
  if (mArrowToViewRef != null) {
    View oldTargetView = mArrowToViewRef.get();
    if (oldTargetView != null) {
      oldTargetView.removeOnLayoutChangeListener(mOnLayoutChangeListener);
    }
  }
  mArrowToViewRef = targetView != null ? new WeakReference<>(targetView) : null;
  if (targetView != null) {
    targetView.addOnLayoutChangeListener(mOnLayoutChangeListener);
  }
}

代码示例来源:origin: googlecodelabs/android-topeka

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom,
                int oldLeft, int oldTop, int oldRight, int oldBottom) {
    v.removeOnLayoutChangeListener(this);
    setUpGridView(getView());
  }
});

代码示例来源:origin: derry/delion

@Override
  public void onLayoutChange(View v, int left, int top, int right,
      int bottom, int oldLeft, int oldTop, int oldRight,
      int oldBottom) {
    sendEmptyMessageDelayed(MSG_ID_CLEAR_LAYOUT_FULLSCREEN_FLAG,
        CLEAR_LAYOUT_FULLSCREEN_DELAY_MS);
    contentView.removeOnLayoutChangeListener(this);
  }
});

代码示例来源:origin: woxingxiao/GracefulMovies

@Override
  public void onLayoutChange(View view, int i, int i1, int i2, int i3, int i4, int i5, int i6, int i7) {
    mBinding.getRoot().removeOnLayoutChangeListener(this);
    mHandler.postDelayed(SplashActivity.this::requestPermission, 2000);
  }
});

代码示例来源:origin: rockon999/LeanbackLauncher

public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
    v.removeOnLayoutChangeListener(this);
    ((MainActivity) RowViewAdapter.this.mContext).includeInLaunchAnimation(holder.itemView);
  }
});

代码示例来源:origin: derry/delion

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom,
      int oldLeft, int oldTop, int oldRight, int oldBottom) {
    if ((bottom - top) < (oldBottom - oldTop)) {
      mDelegate.onFullscreenExited(tab);
      contentView.removeOnLayoutChangeListener(this);
    }
  }
};

代码示例来源:origin: a-voyager/WeekToDo

@Override
  public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
    v.removeOnLayoutChangeListener(this);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
      int x = (int) (mFab.getWidth() / 2 + mFab.getX());
      int y = (int) (mFab.getHeight() / 2 + mFab.getY());
      Animator animator = ViewAnimationUtils.createCircularReveal(decorView, x, y, 0, decorView.getHeight());
      animator.setDuration(400);
      animator.start();
    }
  }
});

代码示例来源:origin: AlexMofer/ProjectX

private void finish(boolean immediate) {
  mView.removeView(immediate);
  mCallback.onDestroyActionMode(mMode);
  mFinished = true;
  mTarget.removeOnAttachStateChangeListener(this);
  final View root = mTarget.getRootView();
  root.removeOnLayoutChangeListener(this);
  root.removeOnAttachStateChangeListener(this);
  mTarget = null;
}

相关文章

View类方法