RubySpan.Builder


public final class RubySpan.Builder


Builder class for creating RubySpan instances.

Summary

Public constructors

Public methods

final @NonNull RubySpan

Builds and returns a new RubySpan instance.

final @NonNull RubySpan.Builder
setOrientation(int orientation)

Sets the text orientation for the ruby text.

final @NonNull RubySpan.Builder
setTextScale(float textScale)

Sets the text scale for the ruby text.

Public constructors

Builder

Added in 1.0.0-alpha01
public Builder(@NonNull CharSequence text)
Parameters
@NonNull CharSequence text

The ruby text to be displayed adjacent to the base text.

Public methods

build

Added in 1.0.0-alpha01
public final @NonNull RubySpan build()

Builds and returns a new RubySpan instance.

Returns
@NonNull RubySpan

A new RubySpan instance.

setOrientation

Added in 1.0.0-alpha01
public final @NonNull RubySpan.Builder setOrientation(int orientation)

Sets the text orientation for the ruby text.

By default, TextOrientation.MIXED is used.

Parameters
int orientation

The text orientation to set.

Returns
@NonNull RubySpan.Builder

This Builder instance for method chaining.

setTextScale

Added in 1.0.0-alpha01
public final @NonNull RubySpan.Builder setTextScale(float textScale)

Sets the text scale for the ruby text.

By default, 0.5f is used, meaning the ruby text will be half the size of the base text.

Parameters
float textScale

The text scale to set.

Returns
@NonNull RubySpan.Builder

This Builder instance for method chaining.