• Home
Name Date Size #Lines LOC

..--

AppScope/12-May-2024-3734

entry/12-May-2024-1,000829

screenshots/devices/12-May-2024-

.gitignoreD12-May-2024121 88

README.mdD12-May-20241 KiB3015

README_zh.mdD12-May-2024976 2915

build-profile.json5D12-May-20241 KiB4241

hvigorfile.jsD12-May-2024168 21

package.jsonD12-May-2024373 1818

README.md

1#  Preferences
2
3### Introduction
4
5This sample shows how to alternate between themes using preferences. The display effect is as follows:
6
7![](screenshots/devices/default_en.png)
8
9### Concepts
10
11Preferences: provide capabilities for processing data in the form of key-value (KV) pairs and support lightweight data persistence, modification, and query. In KV pairs, the keys are of the string type, and the values can be of the number, string, Boolean, Array\<number>, Array\<string>, or Array\<boolean> type.
12
13### Required Permissions
14
15N/A.
16
17### Usage
18
191. Touch the switch button on the upper right corner of the title bar, and select the target theme from the screen displayed.
20
212. Exit the app and then access it again. The theme before the last exit is displayed.
22
23### Constraints
24
25- This sample can only be run on standard-system devices.
26
27- This sample is based on the stage model, which is supported from API version 9.
28
29- This sample requires DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022) to compile and run.
30

README_zh.md

1#  首选项
2
3### 简介
4
5本示例主要展示了首选项在主题切换方面的功能。实际效果如下:
6
7![](screenshots/devices/default.png)
8
9### 相关概念
10
11首选项:为应用提供key-value键值型的数据处理能力,支持应用持久化轻量级数据,并对其修改和查询。数据存储形式为键值对,键的类型为字符串型,值的存储数据类型包括数字型、字符型、布尔型以及这3种类型的数组类型。
12
13### 相关权限
14
15不涉及。
16
17### 使用说明
18
191.点击顶部titleBar的右侧**切换**按钮,弹出主题菜单,选择任意主题则切换相应的主题界面。
20
212.退出应用再重新进入,显示上一次退出前的主题界面。
22
23### 约束与限制
24
251.本示例仅支持在标准系统上运行。
26
272.本示例为Stage模型,从API version 9开始支持。
28
293.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。