With Huawei Themes Engine, you can use specific XML syntax to develop various lock screens, and change the UI style, animation, or even interaction mode of a lock screen by changing the skin. The framework supports dynamic frame rates. Therefore, the screen will not be continuously rendered at a fixed frame rate. When no animation or update is available, the rendering stops and only a few resources are occupied. Slow animations are rendered at a low frame rate. Quick animations are rendered at the full speed. When the screen is rendered at the full speed, the frame rate can reach up to 60 frames per second in full screen mode. You can control the frame rate appropriately to make your lock screen cool and power-saving.

In this codelab, you will use the dynamic effects in Huawei Themes Engine to create interactive and dynamic lock screens with various styles. When applied to a mobile phone, the lock screens will make the theme more entertaining.

In this codelab, you will learn how to make a Huawei dynamic theme by editing .xml files.

Key Points

  1. Make the lanterns fly upward by editing .xml files.
  2. Adjust the lantern speed by editing .xml files.
  3. Learn how to package and test a theme package.

Opening the Theme Package and Finding the manifest.xml File

Path: DropPhysicalview\unlock\lockscreen

Editing the Dynamic Effects

Path: DropPhysicalview\unlock\lockscreen\manifest.xml
Edit the code from line 119.

Desired Effects

Items that need to be changed:

  1. Air resistance
  2. Initial speed of the lantern images

Packaging the Theme

Compress the files into a .zip package under the level-1 directory and change the extension to .hwt.

Testing the Theme

  1. Import the packaged theme to the Huawei\Themes folder.
  2. Tap the Themes app to open it.
  3. Go to Me > My themes. Tap the theme Grand Scenery of Old Summer Palace, and then tap Apply.
  4. Check the dynamic effect of the lock screen
Code copied