Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
591bd6e4
authored
Aug 06, 2019
by
tonihei
Committed by
Toni
Aug 06, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fix UI module API nullability annotations and make non-null-by-default.
PiperOrigin-RevId: 261872025
parent
346f8e67
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
12 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/package-info.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/spherical/package-info.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
View file @
591bd6e4
...
...
@@ -285,7 +285,7 @@ public class PlayerControlView extends FrameLayout {
}
public
PlayerControlView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
this
(
context
,
attrs
,
/* defStyleAttr= */
0
);
}
public
PlayerControlView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
...
...
@@ -494,9 +494,10 @@ public class PlayerControlView extends FrameLayout {
/**
* Sets the {@link VisibilityListener}.
*
* @param listener The listener to be notified about visibility changes.
* @param listener The listener to be notified about visibility changes, or null to remove the
* current listener.
*/
public
void
setVisibilityListener
(
VisibilityListener
listener
)
{
public
void
setVisibilityListener
(
@Nullable
VisibilityListener
listener
)
{
this
.
visibilityListener
=
listener
;
}
...
...
@@ -512,7 +513,8 @@ public class PlayerControlView extends FrameLayout {
/**
* Sets the {@link PlaybackPreparer}.
*
* @param playbackPreparer The {@link PlaybackPreparer}.
* @param playbackPreparer The {@link PlaybackPreparer}, or null to remove the current playback
* preparer.
*/
public
void
setPlaybackPreparer
(
@Nullable
PlaybackPreparer
playbackPreparer
)
{
this
.
playbackPreparer
=
playbackPreparer
;
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerView.java
View file @
591bd6e4
...
...
@@ -308,14 +308,14 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
private
static
final
int
PICTURE_TYPE_NOT_SET
=
-
1
;
public
PlayerView
(
Context
context
)
{
this
(
context
,
null
);
this
(
context
,
/* attrs= */
null
);
}
public
PlayerView
(
Context
context
,
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
public
PlayerView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
/* defStyleAttr= */
0
);
}
public
PlayerView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
public
PlayerView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
if
(
isInEditMode
())
{
...
...
@@ -505,6 +505,7 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
}
/** Returns the player currently set on this view, or null if no player is set. */
@Nullable
public
Player
getPlayer
()
{
return
player
;
}
...
...
@@ -904,9 +905,11 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
/**
* Set the {@link PlayerControlView.VisibilityListener}.
*
* @param listener The listener to be notified about visibility changes.
* @param listener The listener to be notified about visibility changes, or null to remove the
* current listener.
*/
public
void
setControllerVisibilityListener
(
PlayerControlView
.
VisibilityListener
listener
)
{
public
void
setControllerVisibilityListener
(
@Nullable
PlayerControlView
.
VisibilityListener
listener
)
{
Assertions
.
checkState
(
controller
!=
null
);
controller
.
setVisibilityListener
(
listener
);
}
...
...
@@ -914,7 +917,8 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
/**
* Sets the {@link PlaybackPreparer}.
*
* @param playbackPreparer The {@link PlaybackPreparer}.
* @param playbackPreparer The {@link PlaybackPreparer}, or null to remove the current playback
* preparer.
*/
public
void
setPlaybackPreparer
(
@Nullable
PlaybackPreparer
playbackPreparer
)
{
Assertions
.
checkState
(
controller
!=
null
);
...
...
@@ -1006,7 +1010,8 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
* @param listener The listener to be notified about aspect ratios changes of the video content or
* the content frame.
*/
public
void
setAspectRatioListener
(
AspectRatioFrameLayout
.
AspectRatioListener
listener
)
{
public
void
setAspectRatioListener
(
@Nullable
AspectRatioFrameLayout
.
AspectRatioListener
listener
)
{
Assertions
.
checkState
(
contentFrame
!=
null
);
contentFrame
.
setAspectRatioListener
(
listener
);
}
...
...
@@ -1025,6 +1030,7 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
* @return The {@link SurfaceView}, {@link TextureView}, {@link SphericalSurfaceView} or {@code
* null}.
*/
@Nullable
public
View
getVideoSurfaceView
()
{
return
surfaceView
;
}
...
...
@@ -1047,6 +1053,7 @@ public class PlayerView extends FrameLayout implements AdsLoader.AdViewProvider
* @return The {@link SubtitleView}, or {@code null} if the layout has been customized and the
* subtitle view is not present.
*/
@Nullable
public
SubtitleView
getSubtitleView
()
{
return
subtitleView
;
}
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/package-info.java
0 → 100644
View file @
591bd6e4
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@NonNullApi
package
com
.
google
.
android
.
exoplayer2
.
ui
;
import
com.google.android.exoplayer2.util.NonNullApi
;
library/ui/src/main/java/com/google/android/exoplayer2/ui/spherical/package-info.java
0 → 100644
View file @
591bd6e4
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@NonNullApi
package
com
.
google
.
android
.
exoplayer2
.
ui
.
spherical
;
import
com.google.android.exoplayer2.util.NonNullApi
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment