@Override public void onLayoutChange( View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { updateFloatingWindowLayout(); if (mShowing) { mWindowManager.updateViewLayout(mDecor, mDecorLayoutParams); } }
/** * Show the controller on screen. It will go away automatically after 'timeout' milliseconds of * inactivity. * * @param timeout The timeout in milliseconds. Use 0 to show the controller until hide() is * called. */ public void show(int timeout) { if (!mShowing && mAnchor != null) { setProgress(); if (mPauseButton != null) { mPauseButton.requestFocus(); } disableUnsupportedButtons(); updateFloatingWindowLayout(); mWindowManager.addView(mDecor, mDecorLayoutParams); mShowing = true; } updatePausePlay(); // cause the progress bar to be updated even if mShowing // was already true. This happens, for example, if we're // paused with the progress bar showing the user hits play. mHandler.sendEmptyMessage(SHOW_PROGRESS); if (timeout != 0 && !mAccessibilityManager.isTouchExplorationEnabled()) { mHandler.removeMessages(FADE_OUT); Message msg = mHandler.obtainMessage(FADE_OUT); mHandler.sendMessageDelayed(msg, timeout); } }