tree/library/ui/src/main/java/com/google/android/exoplayer2/ui/SubtitleWebView.java
private static int anchorTypeToTranslatePercent(@Cue.AnchorType int anchorType) {
    switch (anchorType) {
      case Cue.ANCHOR_TYPE_END:
        return -100;
      case Cue.ANCHOR_TYPE_MIDDLE:
        return -50;
      case Cue.ANCHOR_TYPE_START:
      case Cue.TYPE_UNSET:
      default:
        return 0;
    }
  }
/**
   * Converts a {@link Cue.AnchorType} to a percentage for use in a CSS {@code transform:
   * translate(x,y)} function.
   *
   * <p>We use {@code position: absolute} and always use the same CSS positioning property (top,
   * bottom, left, right) regardless of the anchor type. The anchor is effectively 'moved' by using
   * a CSS {@code translate(x,y)} operation on the value returned from this function.
   */
Converts a  Cue.AnchorType to a percentage for use in a CSS {@code transform:
translate(x,y)} function.

We use  position: absolute and always use the same CSS positioning property (top,
bottom, left, right) regardless of the anchor type. The anchor is effectively 'moved' by using
a CSS  translate(x,y) operation on the value returned from this function.
Converts a Cue . AnchorType to a percentage for use in a CSS { @code transform : translate ( x y ) } function . We use position : absolute and always use the same CSS positioning property ( top bottom left right ) regardless of the anchor type . The anchor is effectively ' moved ' by using a CSS translate ( x y ) operation on the value returned from this function .
private static int anchorTypeToTranslatePercent(@Cue.AnchorType int anchorType) {
    switch (anchorType) {
      case Cue.ANCHOR_TYPE_END:
        return -100;
      case Cue.ANCHOR_TYPE_MIDDLE:
        return -50;
      case Cue.ANCHOR_TYPE_START:
      case Cue.TYPE_UNSET:
      default:
        return 0;
    }
  }
private static int anchorTypeToTranslatePercent ( @ Cue . AnchorType int anchorType ) { switch ( anchorType ) { case Cue . ANCHOR_TYPE_END : return - 100 ; case Cue . ANCHOR_TYPE_MIDDLE : return - 50 ; case Cue . ANCHOR_TYPE_START : case Cue . TYPE_UNSET : default : return 0 ; } }
Converts a {@link Cue.AnchorType} to a percentage for use in a CSS {@code transform:
 translate(x,y)} function.
Converts a { @link Cue . AnchorType } to a percentage for use in a CSS { @code transform : translate ( x y ) } function .