mirror of
https://github.com/androidx/media.git
synced 2025-05-15 11:39:56 +08:00
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:
parent
10879e32ba
commit
205055a01f
@ -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.
|
||||||
|
@ -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 -->
|
||||||
|
Loading…
x
Reference in New Issue
Block a user