diff --git a/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/PlayerControlsWrapper.java b/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/PlayerControlsWrapper.java index c248e2d6..1ed1b9e0 100644 --- a/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/PlayerControlsWrapper.java +++ b/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/PlayerControlsWrapper.java @@ -276,4 +276,8 @@ public void onStopTrackingTouch(SeekBar seekBar) { public void onNewVideo() { seekBar.setProgress(0); } + + public void showTitle(boolean show) { + videoTitle.setVisibility(show ? View.VISIBLE : View.GONE); + } } diff --git a/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/YouTubePlayerView.java b/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/YouTubePlayerView.java index 96c85153..c34ea841 100644 --- a/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/YouTubePlayerView.java +++ b/YouTubePlayer/src/main/java/com/pierfrancescosoffritti/youtubeplayer/YouTubePlayerView.java @@ -60,10 +60,9 @@ public YouTubePlayerView(Context context, AttributeSet attrs, int defStyleAttr) } @Override - protected void onLayout(boolean changed, int left, int top, int right, int bottom) { + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); adjustControlsSize(); - - super.onLayout(changed, left, top, right, bottom); } /** @@ -266,4 +265,8 @@ public void onNetworkAvailable() { public void onNetworkUnavailable() { } + + public void showTitle(boolean show) { + playerControlsWrapper.showTitle(show); + } } diff --git a/YouTubePlayer/src/main/res/layout/player_controls.xml b/YouTubePlayer/src/main/res/layout/player_controls.xml index b5313b1b..1b4e4c8d 100644 --- a/YouTubePlayer/src/main/res/layout/player_controls.xml +++ b/YouTubePlayer/src/main/res/layout/player_controls.xml @@ -2,7 +2,7 @@ + android:layout_height="match_parent" >