Code formatting cleanups for controls

This commit is contained in:
Hampton Maxwell 2019-02-10 18:15:30 -08:00 committed by GitHub
parent c361b795fc
commit 40803496f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -320,9 +320,9 @@ class ReactExoplayerView extends FrameLayout implements
/** /**
* Update the layout * Update the layout
* @param view view needs to update layout
* *
* This is a workaround for the open bug in react-native: https://github.com/facebook/react-native/issues/17968 * This is a workaround for the open bug in react-native: https://github.com/facebook/react-native/issues/17968
* @param view view needs to update layout
*/ */
private void reLayout(View view) { private void reLayout(View view) {
if (view == null) return; if (view == null) return;
@ -1141,16 +1141,13 @@ class ReactExoplayerView extends FrameLayout implements
/** /**
* Handling controls prop * Handling controls prop
* *
* @param controls value of the controls prop passed from react-native * @param controls Controls prop, if true enable controls, if false disable them
*/ */
public void setControls(boolean controls) { public void setControls(boolean controls) {
if(controls && (exoPlayerView != null)) { if (controls && exoPlayerView != null) {
//adding the playerControlView
addPlayerControl(); addPlayerControl();
} else { } else if (getChildAt(1) instanceof PlayerControlView && exoPlayerView != null) {
if(getChildAt(1) instanceof PlayerControlView && (exoPlayerView != null)){
removeViewAt(1); removeViewAt(1);
} }
} }
} }
}