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
b6777e03
authored
Jul 06, 2019
by
olly
Committed by
Oliver Woodman
Jul 26, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove some UI classes from nullness blacklist
PiperOrigin-RevId: 256751627
parent
b5e3ae45
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
15 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/AspectRatioFrameLayout.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleView.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/AspectRatioFrameLayout.java
View file @
b6777e03
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.ui;
...
@@ -18,6 +18,7 @@ package com.google.android.exoplayer2.ui;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.content.res.TypedArray
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.IntDef
;
import
androidx.annotation.Nullable
;
import
android.util.AttributeSet
;
import
android.util.AttributeSet
;
import
android.widget.FrameLayout
;
import
android.widget.FrameLayout
;
import
java.lang.annotation.Documented
;
import
java.lang.annotation.Documented
;
...
@@ -97,16 +98,16 @@ public final class AspectRatioFrameLayout extends FrameLayout {
...
@@ -97,16 +98,16 @@ public final class AspectRatioFrameLayout extends FrameLayout {
private
final
AspectRatioUpdateDispatcher
aspectRatioUpdateDispatcher
;
private
final
AspectRatioUpdateDispatcher
aspectRatioUpdateDispatcher
;
private
AspectRatioListener
aspectRatioListener
;
@Nullable
private
AspectRatioListener
aspectRatioListener
;
private
float
videoAspectRatio
;
private
float
videoAspectRatio
;
private
@ResizeMod
e
int
resizeMode
;
@ResizeMode
privat
e
int
resizeMode
;
public
AspectRatioFrameLayout
(
Context
context
)
{
public
AspectRatioFrameLayout
(
Context
context
)
{
this
(
context
,
null
);
this
(
context
,
/* attrs= */
null
);
}
}
public
AspectRatioFrameLayout
(
Context
context
,
AttributeSet
attrs
)
{
public
AspectRatioFrameLayout
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
super
(
context
,
attrs
);
resizeMode
=
RESIZE_MODE_FIT
;
resizeMode
=
RESIZE_MODE_FIT
;
if
(
attrs
!=
null
)
{
if
(
attrs
!=
null
)
{
...
@@ -136,9 +137,10 @@ public final class AspectRatioFrameLayout extends FrameLayout {
...
@@ -136,9 +137,10 @@ public final class AspectRatioFrameLayout extends FrameLayout {
/**
/**
* Sets the {@link AspectRatioListener}.
* Sets the {@link AspectRatioListener}.
*
*
* @param listener The listener to be notified about aspect ratios changes.
* @param listener The listener to be notified about aspect ratios changes, or null to clear a
* listener that was previously set.
*/
*/
public
void
setAspectRatioListener
(
AspectRatioListener
listener
)
{
public
void
setAspectRatioListener
(
@Nullable
AspectRatioListener
listener
)
{
this
.
aspectRatioListener
=
listener
;
this
.
aspectRatioListener
=
listener
;
}
}
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/PlayerControlView.java
View file @
b6777e03
...
@@ -281,19 +281,22 @@ public class PlayerControlView extends FrameLayout {
...
@@ -281,19 +281,22 @@ public class PlayerControlView extends FrameLayout {
private
long
currentWindowOffset
;
private
long
currentWindowOffset
;
public
PlayerControlView
(
Context
context
)
{
public
PlayerControlView
(
Context
context
)
{
this
(
context
,
null
);
this
(
context
,
/* attrs= */
null
);
}
}
public
PlayerControlView
(
Context
context
,
AttributeSet
attrs
)
{
public
PlayerControlView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
this
(
context
,
attrs
,
0
);
}
}
public
PlayerControlView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
public
PlayerControlView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
this
(
context
,
attrs
,
defStyleAttr
,
attrs
);
this
(
context
,
attrs
,
defStyleAttr
,
attrs
);
}
}
public
PlayerControlView
(
public
PlayerControlView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
AttributeSet
playbackAttrs
)
{
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
,
@Nullable
AttributeSet
playbackAttrs
)
{
super
(
context
,
attrs
,
defStyleAttr
);
super
(
context
,
attrs
,
defStyleAttr
);
int
controllerLayoutId
=
R
.
layout
.
exo_player_control_view
;
int
controllerLayoutId
=
R
.
layout
.
exo_player_control_view
;
rewindMs
=
DEFAULT_REWIND_MS
;
rewindMs
=
DEFAULT_REWIND_MS
;
...
...
library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleView.java
View file @
b6777e03
...
@@ -53,8 +53,8 @@ public final class SubtitleView extends View implements TextOutput {
...
@@ -53,8 +53,8 @@ public final class SubtitleView extends View implements TextOutput {
private
final
List
<
SubtitlePainter
>
painters
;
private
final
List
<
SubtitlePainter
>
painters
;
private
List
<
Cue
>
cues
;
@Nullable
private
List
<
Cue
>
cues
;
private
@Cue
.
TextSizeTyp
e
int
textSizeType
;
@Cue
.
TextSizeType
privat
e
int
textSizeType
;
private
float
textSize
;
private
float
textSize
;
private
boolean
applyEmbeddedStyles
;
private
boolean
applyEmbeddedStyles
;
private
boolean
applyEmbeddedFontSizes
;
private
boolean
applyEmbeddedFontSizes
;
...
@@ -62,10 +62,10 @@ public final class SubtitleView extends View implements TextOutput {
...
@@ -62,10 +62,10 @@ public final class SubtitleView extends View implements TextOutput {
private
float
bottomPaddingFraction
;
private
float
bottomPaddingFraction
;
public
SubtitleView
(
Context
context
)
{
public
SubtitleView
(
Context
context
)
{
this
(
context
,
null
);
this
(
context
,
/* attrs= */
null
);
}
}
public
SubtitleView
(
Context
context
,
AttributeSet
attrs
)
{
public
SubtitleView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
super
(
context
,
attrs
);
painters
=
new
ArrayList
<>();
painters
=
new
ArrayList
<>();
textSizeType
=
Cue
.
TEXT_SIZE_TYPE_FRACTIONAL
;
textSizeType
=
Cue
.
TEXT_SIZE_TYPE_FRACTIONAL
;
...
@@ -246,7 +246,11 @@ public final class SubtitleView extends View implements TextOutput {
...
@@ -246,7 +246,11 @@ public final class SubtitleView extends View implements TextOutput {
@Override
@Override
public
void
dispatchDraw
(
Canvas
canvas
)
{
public
void
dispatchDraw
(
Canvas
canvas
)
{
int
cueCount
=
(
cues
==
null
)
?
0
:
cues
.
size
();
List
<
Cue
>
cues
=
this
.
cues
;
if
(
cues
==
null
||
cues
.
isEmpty
())
{
return
;
}
int
rawViewHeight
=
getHeight
();
int
rawViewHeight
=
getHeight
();
// Calculate the cue box bounds relative to the canvas after padding is taken into account.
// Calculate the cue box bounds relative to the canvas after padding is taken into account.
...
@@ -267,6 +271,7 @@ public final class SubtitleView extends View implements TextOutput {
...
@@ -267,6 +271,7 @@ public final class SubtitleView extends View implements TextOutput {
return
;
return
;
}
}
int
cueCount
=
cues
.
size
();
for
(
int
i
=
0
;
i
<
cueCount
;
i
++)
{
for
(
int
i
=
0
;
i
<
cueCount
;
i
++)
{
Cue
cue
=
cues
.
get
(
i
);
Cue
cue
=
cues
.
get
(
i
);
float
cueTextSizePx
=
resolveCueTextSize
(
cue
,
rawViewHeight
,
viewHeightMinusPadding
);
float
cueTextSizePx
=
resolveCueTextSize
(
cue
,
rawViewHeight
,
viewHeightMinusPadding
);
...
...
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