[Huawei Developers] Freemind R:
HUAWEI Image Kit incorporates smart image editing and design as well as animation capabilities into your app, giving it the power of efficient image content reproduction while providing a better image editing experience for your users.

Use Cases

Image postprocessing

Provides more than 20 distinct effects for image processing, achieving high-quality image content reproduction.

Implements smart layout of images and texts for efficient content production.

Provides the sticker and text art function for image DIY.

Implements theme tagging for images and objects in images for convenient retrieval.

Implements image cropping for users to resize images.

Theme design

Applies animations to lock screens, wallpapers, and themes.

Today I will show you how to add, delete and save stickers to photos. Let’s start. First of all, please follow these steps to create an app on App Gallery.

When using Image Kit on a mobile phone where the HMS Core (APK) is installed, add the SDK dependency. When using Image Kit on a device where the HMS Core (APK) is not installed, add the fallback-SDK dependency. The service dependency configuration is as follows. Image Vision service:

SDK: com.huawei.hms:image-vision:1.0.3.301

fallback-SDK: com.huawei.hms:image-vision:1.0.3.301 , com.huawei.hms:image-vision-fallback:1.0.3.301

implementation 'com.huawei.hms:image-vision:1.0.3.301'

The implementation of all APIs of the sticker service is based on StickerLayout, which is a custom view. The imported service package is com.huawei.hms.image.vision.sticker.StickerLayout, which can be directly integrated into the XML of the layout. Now, let’s create a layout file.

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".fragments.StickerDetailFragment">

<RelativeLayout
android:id="@+id/sticker_img_layout"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.55"
android:background="@color/white"
android:gravity="center"
android:paddingLeft="30dp"
android:paddingTop="30dp"
android:paddingRight="30dp">

<ImageView
android:id="@+id/imgPhotosticker"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:srcCompat="@drawable/template" />

<com.huawei.hms.image.vision.sticker.StickerLayout
android:id="@+id/sticker_container"
android:layout_width="wrap_content"
android:layout_height="295dp" />

</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.20"
android:gravity="center"
android:paddingLeft="30dp"
android:paddingTop="30dp"
android:paddingRight="30dp">

<Button
android:id="@+id/btn_removeSticks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/fonts"
android:layout_alignParentBottom="true"
android:text="Delete All" />

</RelativeLayout>

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.25">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvListSticker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F8F8F8"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintVertical_bias="1.0" />

</RelativeLayout>

</LinearLayout>

Download the sample stickers from this link and add your project as a assets .You can change some features in theme.xml file:

<?xml version="1.0" encoding="UTF-8"?>

-<HwTheme>

<item style="sticker"/>

<stickerposition>Default</stickerposition>

<stickerscreen>w="360" h="360"</stickerscreen>

</HwTheme>

More information . you can check https://forums.developer.huawei.com/forumPortal/en/topic/0203430496621480052