目录

StickerLayout

Class Info

public class StickerLayout extends View

贴纸花字功能实现类。

Public Constructor Summary

Constructor Name

StickerLayout(android.content.Context context)

构造函数。

Public Method Summary

Qualifier and Type

Method Name and Description

int

addSticker(java.lang.String rootPath, java.lang.String fileName)

添加水印花字贴纸。

void

setStickerLayoutListener(StickerLayout.StickerLayoutListener stickerLayoutListener)

设置用户对贴纸花字的一些操作的回调。

void

updateStickerText(com.huawei.hms.image.vision.sticker.item.TextEditInfo textEditInfo)

更新花字的文本。

void

removeAllSticker()

移除所有贴纸花字。

Public Constructors

[h2]StickerLayout

Constructor

public StickerLayout(android.content.Context context)

默认的构造方法。

Parameters

Name

Description

context

上下文。

Public Methods

[h2]addSticker

Method

public int addSticker(java.lang.String rootPath, java.lang.String fileName)

添加水印花字贴纸。

Parameters

Name

Description

rootPath

资源文件根目录。

fileName

如果是贴纸,需要指定的文件名,其他可以传null。

Returns

Type

Description

int

返回码,参见ResultCode。

[h2]setStickerLayoutListener

Method

public void setStickerLayoutListener(StickerLayout.StickerLayoutListener stickerLayoutListener)

设置用户对贴纸花字的一些操作的回调。

Parameters

Name

Description

stickerLayoutListener

回调对象。

[h2]updateStickerText

Method

public void updateStickerText(com.huawei.hms.image.vision.sticker.item.TextEditInfo textEditInfo)

更新花字的文本。

Parameters

Name

Description

textEditInfo

花字的文本相关信息。

[h2]removeAllSticker

Method

public void removeAllSticker()

移除所有贴纸花字。

Methods Inherited from Class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait