-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/DORIS-2023-migrate-media-1.2
- Loading branch information
Showing
7 changed files
with
215 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
libraries/common/src/main/java/androidx/media3/common/text/TextShadow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package androidx.media3.common.text; | ||
|
||
import androidx.annotation.NonNull; | ||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
public class TextShadow implements Serializable { | ||
|
||
@NonNull | ||
private final List<Component> components; | ||
|
||
public TextShadow(@NonNull List<Component> components) { | ||
this.components = components; | ||
} | ||
|
||
public List<Component> getComponents() { | ||
return components; | ||
} | ||
|
||
public static class Component implements Serializable { | ||
|
||
public final int dx; | ||
public final int dy; | ||
public final int radius; | ||
public final int color; | ||
|
||
public Component(int dx, int dy, int radius, int color) { | ||
this.dx = dx; | ||
this.dy = dy; | ||
this.radius = radius; | ||
this.color = color; | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
libraries/common/src/main/java/androidx/media3/common/text/TextShadowSpan.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package androidx.media3.common.text; | ||
|
||
import android.text.TextPaint; | ||
import android.text.style.CharacterStyle; | ||
import androidx.annotation.Nullable; | ||
|
||
/** | ||
* A span that contains the text shadow but does not modifies the text as we can't apply multiple | ||
* shadows with span, instead the {@link TextShadow} will be applied in the {@link SubtitlePainter}. | ||
*/ | ||
public class TextShadowSpan extends CharacterStyle { | ||
|
||
@Nullable | ||
private TextShadow textShadow; | ||
|
||
public TextShadowSpan(@Nullable TextShadow textShadow) { | ||
super(); | ||
this.textShadow = textShadow; | ||
} | ||
|
||
@Nullable | ||
public TextShadow getTextShadow() { | ||
return textShadow; | ||
} | ||
|
||
@Override | ||
public void updateDrawState(TextPaint tp) { | ||
// Do nothing. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.