Code example for ImageView

Methods: getMeasuredHeight, getMeasuredWidth, layout

0
    timeBar.requestLayout();
 
    // play pause / next / previous buttons 
    int cx = l + w / 2; // center x
    int playbackButtonsCenterline = t + h / 2;
    bw = playPauseReplayView.getMeasuredWidth();
    bh = playPauseReplayView.getMeasuredHeight();
    playPauseReplayView.layout(
        cx - bw / 2, playbackButtonsCenterline - bh / 2, cx + bw / 2,
        playbackButtonsCenterline + bh / 2);
 
    // Space available on each side of the error message for the next and previous buttons 
    int errorMessagePadding = (int) (w * ERROR_MESSAGE_RELATIVE_PADDING);
 
    if (mainView != null) {
      layoutCenteredView(mainView, l, t, r, b);
    } 
  } 
 
  private void layoutCenteredView(View view, int l, int t, int r, int b) {
    int cw = view.getMeasuredWidth();