Skip to content

Commit d0dcc8d

Browse files
committed
version 1.3 and fixbug and 优化调用逻辑
1 parent ca4a503 commit d0dcc8d

File tree

3 files changed

+17
-31
lines changed

3 files changed

+17
-31
lines changed

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ afterEvaluate {
4444
create<MavenPublication>("release") {
4545
groupId = "com.github.ghhccghk"
4646
artifactId = "HyperFocusApi"
47-
version = "1.1"
47+
version = "1.3"
4848
from(components["release"])
4949
}
5050
}

app/src/main/java/com/hyperfocus/api/FocusApi.kt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import org.json.JSONArray
99
import org.json.JSONObject
1010

1111
@Suppress("unused")
12-
class FocusApi {
12+
object FocusApi {
1313

1414
/**发送焦点通知 自定义背景必须设置颜色,否则导致崩溃后果自负
1515
* @param ticker 焦点在状态栏内容
@@ -666,37 +666,37 @@ class FocusApi {
666666
/** 按钮信息 图标和文本不要在一起用 只能分开用 自定义背景必须设置颜色,否则导致崩溃后果自负
667667
* @param actionBgColor 按钮背景颜色
668668
* @param actionBgColorDark 按钮深色背景颜色
669-
* @param actionsIcon 按钮图标
670-
* @param actionsIconDark 按钮深色图标
671-
* @param actionsIntent Intent
672-
* @param actionsIntentType Intent类型
673-
* @param actionsTitle 按钮标题
669+
* @param actionIcon 按钮图标
670+
* @param actionIconDark 按钮深色图标
671+
* @param actionIntent Intent
672+
* @param actionIntentType Intent类型
673+
* @param actionTitle 按钮标题
674674
* @param actionTitleColor 按钮标题颜色
675675
* @param actionTitleColorDark 按钮深色标题颜色
676676
* @return JSONObject */
677677
@SuppressLint("UseRequiresApi")
678678
fun actionInfo(
679679
actionBgColor: String? = null,
680680
actionBgColorDark: String? = null,
681-
actionsIcon: String? = null,
682-
actionsIconDark: String? = null,
683-
actionsIntent: Intent,
684-
actionsIntentType: String? = null,
685-
actionsTitle: String? = null,
681+
actionIcon: String? = null,
682+
actionIconDark: String? = null,
683+
actionIntent: Intent,
684+
actionIntentType: String? = null,
685+
actionTitle: String? = null,
686686
actionTitleColor: String? = null,
687687
actionTitleColorDark: String? = null,
688688
): JSONObject {
689689
val actionObject = JSONObject() // 单个 action 信息
690690

691-
actionObject.put("actionIntent", actionsIntent.toUri(Intent.URI_INTENT_SCHEME))
692-
actionObject.put("actionIntentType", actionsIntentType)
693-
actionObject.put("actionTitle", actionsTitle)
691+
actionObject.put("actionIntent", actionIntent.toUri(Intent.URI_INTENT_SCHEME))
692+
actionObject.put("actionIntentType", actionIntentType)
693+
actionObject.put("actionTitle", actionTitle)
694694
actionObject.put("actionTitleColor", actionTitleColor)
695695

696696
actionBgColor?.let { actionObject.put("actionBgColor", it) }
697697
actionBgColorDark?.let { actionObject.put("actionBgColorDark", it) }
698-
actionsIcon?.let { actionObject.put("actionIcon", "miui.focus.pic_$it") }
699-
actionsIconDark?.let { actionObject.put("actionIconDark", "miui.focus.pic_$it") }
698+
actionIcon?.let { actionObject.put("actionIcon", "miui.focus.pic_$it") }
699+
actionIconDark?.let { actionObject.put("actionIconDark", "miui.focus.pic_$it") }
700700
actionTitleColorDark?.let { actionObject.put("actionTitleColorDark", it) }
701701

702702
return actionObject

gradle/libs.versions.toml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
[versions]
2-
agp = "8.9.1"
32
gradle = "8.1.4"
43
gson = "2.12.1"
54
kotlinGradlePlugin = "1.8.22"
6-
junit = "4.13.2"
7-
junitVersion = "1.2.1"
8-
espressoCore = "3.6.1"
9-
appcompat = "1.7.0"
10-
material = "1.12.0"
115

126
[libraries]
137
gradle = { module = "com.android.tools.build:gradle", version.ref = "gradle" }
148
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
159
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinGradlePlugin" }
16-
junit = { group = "junit", name = "junit", version.ref = "junit" }
17-
ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
18-
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
19-
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
20-
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
21-
22-
[plugins]
23-
android-application = { id = "com.android.application", version.ref = "agp" }

0 commit comments

Comments
 (0)