Skip to content

Fallback to displayAlign from style for TTML regions#3094

Open
FineFindus wants to merge 1 commit intoandroidx:mainfrom
FineFindus:fix/display-align-fallback
Open

Fallback to displayAlign from style for TTML regions#3094
FineFindus wants to merge 1 commit intoandroidx:mainfrom
FineFindus:fix/display-align-fallback

Conversation

@FineFindus
Copy link

Adds support for using the displayAlign from the style of a region, if it has no explicit displayAlign set.

Closes: #2559

@google-cla
Copy link

google-cla bot commented Feb 28, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

if (styleId != null) {
TtmlStyle style = globalStyles.get(styleId);
if (style != null) {
displayAlign = style.getDisplayAlign();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for consistency with the way we handle other attributes, this 'inheritance' logic should be implemented as part of TtmlStyle.chain which is invoked here:

See my comment here: #2559 (comment)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, should I also add a test for inheriting displayAlign from another style?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can probably tweak your existing test file to exercise this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@FineFindus FineFindus force-pushed the fix/display-align-fallback branch from 73b6e9c to be7890f Compare March 9, 2026 13:52
Adds support for using the `displayAlign` from the `style` of a region, if it
has no explicit `displayAlign` set.

Closes: androidx#2559
@FineFindus FineFindus force-pushed the fix/display-align-fallback branch from be7890f to 7750885 Compare March 9, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants