@@ -9,7 +9,7 @@ import org.json.JSONArray
99import 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
0 commit comments