!13666 【收编】【Text】跑马灯渐隐——添加跑马灯渐隐API

Merge pull request !13666 from zhangwenbin00001/text_marquee_fade
This commit is contained in:
openharmony_ci 2024-08-30 01:31:26 +00:00 committed by Gitee
commit ea0cdb5b1f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1105,6 +1105,28 @@ declare class TextAttribute extends CommonMethod<TextAttribute> {
*/
fontFeature(value: string): TextAttribute;
/**
* Set the marquee options.
*
* @param { Optional<MarqueeOptions> } value
* @returns { TextAttribute }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
marqueeOptions(value: Optional<MarqueeOptions>): TextAttribute;
/**
* Called when the text marquee state changes.
*
* @param { Callback<MarqueeState> } callback - callback of the marquee state change event.
* @returns { TextAttribute } returns the instance of the TextAttribute.
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
onMarqueeStateChange(callback: Callback<MarqueeState>): TextAttribute;
/**
* Whether to support sensitive privacy information
*
@ -1358,6 +1380,71 @@ declare enum TextResponseType {
SELECT = 2,
}
/**
* Defines marquee state.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
declare enum MarqueeState {
/**
* The marquee started.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
START = 0,
/**
* The marquee a round finished and start next round.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
BOUNCE = 1,
/**
* The marquee all finished.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
FINISH = 2,
}
/**
* Defines marquee start policy.
*
* @enum { number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
declare enum MarqueeStartPolicy {
/**
* Start marquee in any case. This is the default policy.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
DEFAULT = 0,
/**
* Start marquee only when get focus.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
ON_FOCUS = 1,
}
/**
* Defines the options of Text.
*
@ -1396,6 +1483,86 @@ declare interface TextOptions {
controller: TextController;
}
/**
* Defines the marquee options.
*
* @interface MarqueeOptions
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
declare interface MarqueeOptions {
/**
* Is need start marquee.
*
* @type { boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
start: boolean;
/**
* The step size of the marquee.
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
step?: number;
/**
* The rounds of the marquee.
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
loop?: number;
/**
* The running direction of the marquee.
*
* @type { ?boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
fromStart?: boolean;
/**
* The waiting time between each round of the marquee.
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
delay?: number;
/**
* Set whether the text is faded out.
*
* @type { ?boolean }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
fadeout?: boolean;
/**
* The start policy for marquee.
*
* @type { ?MarqueeStartPolicy }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @crossplatform
* @since 12
*/
marqueeStartPolicy?: MarqueeStartPolicy;
}
/**
* Defines the controller of Text.
*