docs: update api-example

This commit is contained in:
2023-09-23 22:49:35 +08:00
parent 6b4b33a804
commit a85b795a06
2 changed files with 18 additions and 18 deletions

View File

@@ -6,17 +6,17 @@
You can configure some functions of `YukiReflection` before using it.
## Get the API Version
## Get the API Tag & Version
You can get the current API version of `YukiReflection` as follows.
You can get the current tag and version of `YukiReflection` as follows.
> The following example
```kotlin
// Get the version name
val versionName = YukiReflection. API_VERSION_NAME
// Get the version code
val versionCode = YukiReflection. API_VERSION_CODE
// Get the tag
val tag = YukiReflection.TAG
// Get the version
val version = YukiReflection.VERSION
```
You can judge the difference between different versions or display it in the about information by obtaining the version.
@@ -76,10 +76,10 @@ This function is enabled by default, and disable will stop `YukiReflection` outp
```kotlin
// Via the configs method
YukiReflection.configs {
isAllowPrintingLogs = true
isEnableLogs = true
}
// Set directly
YukiReflection.Configs.isAllowPrintingLogs = true
YukiReflection.Configs.isEnableLogs = true
```
### Use the configs Method to Configure
@@ -92,7 +92,7 @@ In order to configure multiple features at once, you can directly use the `YukiR
YukiReflection.configs {
debugTag = "YourCustomTag"
isDebug = true
isAllowPrintingLogs = true
isEnableLogs = true
}
```

View File

@@ -6,17 +6,17 @@
你可以在使用之前对 `YukiReflection` 进行一些功能配置。
## 获取 API 版本
## 获取 API 标签 & 版本
你可以通过如下方式获取当前 `YukiReflection` API 版本。
你可以通过如下方式获取当前 `YukiReflection`标签和版本。
> 示例如下
```kotlin
// 获取版本名称
val versionName = YukiReflection.API_VERSION_NAME
// 获取版本
val versionCode = YukiReflection.API_VERSION_CODE
// 获取标签
val tag = YukiReflection.TAG
// 获取版本
val version = YukiReflection.VERSION
```
你可以通过获取版本进行一些不同版本差异的判断或用于显示在关于信息中。
@@ -76,10 +76,10 @@ YukiReflection.Configs.isDebug = true
```kotlin
// 通过 configs 方法
YukiReflection.configs {
isAllowPrintingLogs = true
isEnableLogs = true
}
// 直接设置
YukiReflection.Configs.isAllowPrintingLogs = true
YukiReflection.Configs.isEnableLogs = true
```
### 使用 configs 方法配置
@@ -92,7 +92,7 @@ YukiReflection.Configs.isAllowPrintingLogs = true
YukiReflection.configs {
debugTag = "YourCustomTag"
isDebug = true
isAllowPrintingLogs = true
isEnableLogs = true
}
```