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
74b8c45e
authored
Sep 04, 2017
by
Oliver Woodman
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Minor cleanup to AspectRatioFrameLayout
parent
1a6a6c90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
library/ui/src/main/java/com/google/android/exoplayer2/ui/AspectRatioFrameLayout.java
library/ui/src/main/java/com/google/android/exoplayer2/ui/AspectRatioFrameLayout.java
View file @
74b8c45e
...
@@ -32,7 +32,8 @@ public final class AspectRatioFrameLayout extends FrameLayout {
...
@@ -32,7 +32,8 @@ public final class AspectRatioFrameLayout extends FrameLayout {
* Resize modes for {@link AspectRatioFrameLayout}.
* Resize modes for {@link AspectRatioFrameLayout}.
*/
*/
@Retention
(
RetentionPolicy
.
SOURCE
)
@Retention
(
RetentionPolicy
.
SOURCE
)
@IntDef
({
RESIZE_MODE_FIT
,
RESIZE_MODE_FIXED_WIDTH
,
RESIZE_MODE_FIXED_HEIGHT
,
RESIZE_MODE_FILL
,
RESIZE_MODE_ZOOM
})
@IntDef
({
RESIZE_MODE_FIT
,
RESIZE_MODE_FIXED_WIDTH
,
RESIZE_MODE_FIXED_HEIGHT
,
RESIZE_MODE_FILL
,
RESIZE_MODE_ZOOM
})
public
@interface
ResizeMode
{}
public
@interface
ResizeMode
{}
/**
/**
...
@@ -52,7 +53,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
...
@@ -52,7 +53,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
*/
*/
public
static
final
int
RESIZE_MODE_FILL
=
3
;
public
static
final
int
RESIZE_MODE_FILL
=
3
;
/**
/**
* Either
height or width
is increased to obtain the desired aspect ratio.
* Either
the width or height
is increased to obtain the desired aspect ratio.
*/
*/
public
static
final
int
RESIZE_MODE_ZOOM
=
4
;
public
static
final
int
RESIZE_MODE_ZOOM
=
4
;
...
@@ -89,7 +90,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
...
@@ -89,7 +90,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
}
}
/**
/**
* Set the aspect ratio that this view should satisfy.
* Set
s
the aspect ratio that this view should satisfy.
*
*
* @param widthHeightRatio The width to height ratio.
* @param widthHeightRatio The width to height ratio.
*/
*/
...
@@ -101,12 +102,10 @@ public final class AspectRatioFrameLayout extends FrameLayout {
...
@@ -101,12 +102,10 @@ public final class AspectRatioFrameLayout extends FrameLayout {
}
}
/**
/**
* Gets the resize mode.
* Returns the resize mode.
*
* @return The resize mode.
*/
*/
public
int
getResizeMode
()
{
public
@ResizeMode
int
getResizeMode
()
{
return
this
.
resizeMode
;
return
resizeMode
;
}
}
/**
/**
...
@@ -146,7 +145,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
...
@@ -146,7 +145,7 @@ public final class AspectRatioFrameLayout extends FrameLayout {
width
=
(
int
)
(
height
*
videoAspectRatio
);
width
=
(
int
)
(
height
*
videoAspectRatio
);
break
;
break
;
case
RESIZE_MODE_ZOOM:
case
RESIZE_MODE_ZOOM:
if
(
videoAspectRatio
>
viewAspectRatio
)
{
if
(
aspectDeformation
>
0
)
{
width
=
(
int
)
(
height
*
videoAspectRatio
);
width
=
(
int
)
(
height
*
videoAspectRatio
);
}
else
{
}
else
{
height
=
(
int
)
(
width
/
videoAspectRatio
);
height
=
(
int
)
(
width
/
videoAspectRatio
);
...
...
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