Update ExoPlayer PlayerView, add zoom mode for PlayerView xml attributes

Since AspectRatioFrameLayout supports zoom mode as another resize_mode,
PlayerView's resize mode xml attribute should include this as well.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=183237663
This commit is contained in:
hoangtc 2018-01-25 07:52:17 -08:00 committed by Oliver Woodman
parent 10879e32ba
commit 205055a01f
2 changed files with 13 additions and 7 deletions

View File

@ -28,12 +28,16 @@ import java.lang.annotation.RetentionPolicy;
*/ */
public final class AspectRatioFrameLayout extends FrameLayout { public final class AspectRatioFrameLayout extends FrameLayout {
/** // LINT.IfChange
* 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, @IntDef({
RESIZE_MODE_ZOOM}) RESIZE_MODE_FIT,
RESIZE_MODE_FIXED_WIDTH,
RESIZE_MODE_FIXED_HEIGHT,
RESIZE_MODE_FILL,
RESIZE_MODE_ZOOM
})
public @interface ResizeMode {} public @interface ResizeMode {}
/** /**
@ -56,12 +60,13 @@ public final class AspectRatioFrameLayout extends FrameLayout {
* Either the width or height 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;
// LINT.ThenChange(../../../../../../res/values/attrs.xml)
/** /**
* The {@link FrameLayout} will not resize itself if the fractional difference between its natural * The {@link FrameLayout} will not resize itself if the fractional difference between its natural
* aspect ratio and the requested aspect ratio falls below this threshold. * aspect ratio and the requested aspect ratio falls below this threshold.
* <p> *
* This tolerance allows the view to occupy the whole of the screen when the requested aspect * <p>This tolerance allows the view to occupy the whole of the screen when the requested aspect
* ratio is very close, but not exactly equal to, the aspect ratio of the screen. This may reduce * ratio is very close, but not exactly equal to, the aspect ratio of the screen. This may reduce
* the number of view layers that need to be composited by the underlying system, which can help * the number of view layers that need to be composited by the underlying system, which can help
* to reduce power consumption. * to reduce power consumption.

View File

@ -21,6 +21,7 @@
<enum name="fixed_width" value="1"/> <enum name="fixed_width" value="1"/>
<enum name="fixed_height" value="2"/> <enum name="fixed_height" value="2"/>
<enum name="fill" value="3"/> <enum name="fill" value="3"/>
<enum name="zoom" value="4"/>
</attr> </attr>
<!-- Must be kept in sync with SimpleExoPlayerView --> <!-- Must be kept in sync with SimpleExoPlayerView -->