mirror of
https://github.com/HighCapable/YukiReflection.git
synced 2025-09-07 03:05:21 +08:00
docs: update api-example
This commit is contained in:
@@ -6,17 +6,17 @@
|
|||||||
|
|
||||||
You can configure some functions of `YukiReflection` before using it.
|
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
|
> The following example
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
// Get the version name
|
// Get the tag
|
||||||
val versionName = YukiReflection. API_VERSION_NAME
|
val tag = YukiReflection.TAG
|
||||||
// Get the version code
|
// Get the version
|
||||||
val versionCode = YukiReflection. API_VERSION_CODE
|
val version = YukiReflection.VERSION
|
||||||
```
|
```
|
||||||
|
|
||||||
You can judge the difference between different versions or display it in the about information by obtaining the 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
|
```kotlin
|
||||||
// Via the configs method
|
// Via the configs method
|
||||||
YukiReflection.configs {
|
YukiReflection.configs {
|
||||||
isAllowPrintingLogs = true
|
isEnableLogs = true
|
||||||
}
|
}
|
||||||
// Set directly
|
// Set directly
|
||||||
YukiReflection.Configs.isAllowPrintingLogs = true
|
YukiReflection.Configs.isEnableLogs = true
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use the configs Method to Configure
|
### 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 {
|
YukiReflection.configs {
|
||||||
debugTag = "YourCustomTag"
|
debugTag = "YourCustomTag"
|
||||||
isDebug = true
|
isDebug = true
|
||||||
isAllowPrintingLogs = true
|
isEnableLogs = true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@@ -6,17 +6,17 @@
|
|||||||
|
|
||||||
你可以在使用之前对 `YukiReflection` 进行一些功能配置。
|
你可以在使用之前对 `YukiReflection` 进行一些功能配置。
|
||||||
|
|
||||||
## 获取 API 版本
|
## 获取 API 标签 & 版本
|
||||||
|
|
||||||
你可以通过如下方式获取当前 `YukiReflection` 的 API 版本。
|
你可以通过如下方式获取当前 `YukiReflection` 的标签和版本。
|
||||||
|
|
||||||
> 示例如下
|
> 示例如下
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
// 获取版本名称
|
// 获取标签
|
||||||
val versionName = YukiReflection.API_VERSION_NAME
|
val tag = YukiReflection.TAG
|
||||||
// 获取版本号
|
// 获取版本
|
||||||
val versionCode = YukiReflection.API_VERSION_CODE
|
val version = YukiReflection.VERSION
|
||||||
```
|
```
|
||||||
|
|
||||||
你可以通过获取版本进行一些不同版本差异的判断或用于显示在关于信息中。
|
你可以通过获取版本进行一些不同版本差异的判断或用于显示在关于信息中。
|
||||||
@@ -76,10 +76,10 @@ YukiReflection.Configs.isDebug = true
|
|||||||
```kotlin
|
```kotlin
|
||||||
// 通过 configs 方法
|
// 通过 configs 方法
|
||||||
YukiReflection.configs {
|
YukiReflection.configs {
|
||||||
isAllowPrintingLogs = true
|
isEnableLogs = true
|
||||||
}
|
}
|
||||||
// 直接设置
|
// 直接设置
|
||||||
YukiReflection.Configs.isAllowPrintingLogs = true
|
YukiReflection.Configs.isEnableLogs = true
|
||||||
```
|
```
|
||||||
|
|
||||||
### 使用 configs 方法配置
|
### 使用 configs 方法配置
|
||||||
@@ -92,7 +92,7 @@ YukiReflection.Configs.isAllowPrintingLogs = true
|
|||||||
YukiReflection.configs {
|
YukiReflection.configs {
|
||||||
debugTag = "YourCustomTag"
|
debugTag = "YourCustomTag"
|
||||||
isDebug = true
|
isDebug = true
|
||||||
isAllowPrintingLogs = true
|
isEnableLogs = true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user