@@ -208,10 +208,12 @@ class CreateActionDelegate(
208208 showVolumeUi = state.showVolumeUi,
209209 volumeStream = state.volumeStream,
210210 )
211+
211212 ActionId .VOLUME_DOWN -> ActionData .Volume .Down (
212213 showVolumeUi = state.showVolumeUi,
213214 volumeStream = state.volumeStream,
214215 )
216+
215217 else -> return
216218 }
217219
@@ -405,8 +407,7 @@ class CreateActionDelegate(
405407 navigate(
406408 " choose_app_for_media_action" ,
407409 NavDestination .ChooseApp (allowHiddenApps = true ),
408- )
409- ? : return null
410+ ) ? : return null
410411
411412 val action = when (actionId) {
412413 ActionId .PAUSE_MEDIA_PACKAGE ->
@@ -494,7 +495,9 @@ class CreateActionDelegate(
494495
495496 val action = when (actionId) {
496497 ActionId .VOLUME_MUTE -> ActionData .Volume .Mute (showVolumeUi)
498+
497499 ActionId .VOLUME_UNMUTE -> ActionData .Volume .UnMute (showVolumeUi)
500+
498501 ActionId .VOLUME_TOGGLE_MUTE -> ActionData .Volume .ToggleMute (
499502 showVolumeUi,
500503 )
@@ -574,17 +577,15 @@ class CreateActionDelegate(
574577
575578 val action = when (actionId) {
576579 ActionId .TOGGLE_DND_MODE -> ActionData .DoNotDisturb .Toggle (dndMode)
577-
578580 ActionId .ENABLE_DND_MODE -> ActionData .DoNotDisturb .Enable (dndMode)
579-
580581 else -> throw Exception (" don't know how to create action for $actionId " )
581582 }
582583
583584 return action
584585 }
585586
586587 ActionId .CYCLE_ROTATIONS -> {
587- val items = Orientation .values() .map { orientation ->
588+ val items = Orientation .entries .map { orientation ->
588589 val isChecked = if (oldData is ActionData .Rotation .CycleRotations ) {
589590 oldData.orientations.contains(orientation)
590591 } else {
@@ -756,11 +757,7 @@ class CreateActionDelegate(
756757 NavDestination .PickCoordinate (oldResult),
757758 ) ? : return null
758759
759- val description = if (result.description.isEmpty()) {
760- null
761- } else {
762- result.description
763- }
760+ val description = result.description.ifEmpty { null }
764761
765762 return ActionData .TapScreen (
766763 result.x,
@@ -789,11 +786,7 @@ class CreateActionDelegate(
789786 NavDestination .PickSwipeCoordinate (oldResult),
790787 ) ? : return null
791788
792- val description = if (result.description.isEmpty()) {
793- null
794- } else {
795- result.description
796- }
789+ val description = result.description.ifEmpty { null }
797790
798791 return ActionData .SwipeScreen (
799792 result.xStart,
@@ -826,11 +819,7 @@ class CreateActionDelegate(
826819 NavDestination .PickPinchCoordinate (oldResult),
827820 ) ? : return null
828821
829- val description = if (result.description.isEmpty()) {
830- null
831- } else {
832- result.description
833- }
822+ val description = result.description.ifEmpty { null }
834823
835824 return ActionData .PinchScreen (
836825 result.x,
@@ -964,93 +953,153 @@ class CreateActionDelegate(
964953 }
965954
966955 ActionId .TOGGLE_WIFI -> return ActionData .Wifi .Toggle
956+
967957 ActionId .ENABLE_WIFI -> return ActionData .Wifi .Enable
958+
968959 ActionId .DISABLE_WIFI -> return ActionData .Wifi .Disable
969960
970961 ActionId .TOGGLE_BLUETOOTH -> return ActionData .Bluetooth .Toggle
962+
971963 ActionId .ENABLE_BLUETOOTH -> return ActionData .Bluetooth .Enable
964+
972965 ActionId .DISABLE_BLUETOOTH -> return ActionData .Bluetooth .Disable
973966
974967 ActionId .TOGGLE_MOBILE_DATA -> return ActionData .MobileData .Toggle
968+
975969 ActionId .ENABLE_MOBILE_DATA -> return ActionData .MobileData .Enable
970+
976971 ActionId .DISABLE_MOBILE_DATA -> return ActionData .MobileData .Disable
977972
978973 ActionId .TOGGLE_HOTSPOT -> return ActionData .Hotspot .Toggle
974+
979975 ActionId .ENABLE_HOTSPOT -> return ActionData .Hotspot .Enable
976+
980977 ActionId .DISABLE_HOTSPOT -> return ActionData .Hotspot .Disable
981978
982979 ActionId .TOGGLE_AUTO_BRIGHTNESS -> return ActionData .Brightness .ToggleAuto
980+
983981 ActionId .DISABLE_AUTO_BRIGHTNESS -> return ActionData .Brightness .DisableAuto
982+
984983 ActionId .ENABLE_AUTO_BRIGHTNESS -> return ActionData .Brightness .EnableAuto
984+
985985 ActionId .INCREASE_BRIGHTNESS -> return ActionData .Brightness .Increase
986+
986987 ActionId .DECREASE_BRIGHTNESS -> return ActionData .Brightness .Decrease
987988
988989 ActionId .TOGGLE_AUTO_ROTATE -> return ActionData .Rotation .ToggleAuto
990+
989991 ActionId .ENABLE_AUTO_ROTATE -> return ActionData .Rotation .EnableAuto
992+
990993 ActionId .DISABLE_AUTO_ROTATE -> return ActionData .Rotation .DisableAuto
994+
991995 ActionId .PORTRAIT_MODE -> return ActionData .Rotation .Portrait
996+
992997 ActionId .LANDSCAPE_MODE -> return ActionData .Rotation .Landscape
998+
993999 ActionId .SWITCH_ORIENTATION -> return ActionData .Rotation .SwitchOrientation
9941000
9951001 ActionId .VOLUME_SHOW_DIALOG -> return ActionData .Volume .ShowDialog
1002+
9961003 ActionId .CYCLE_RINGER_MODE -> return ActionData .Volume .CycleRingerMode
1004+
9971005 ActionId .CYCLE_VIBRATE_RING -> return ActionData .Volume .CycleVibrateRing
9981006
9991007 ActionId .EXPAND_NOTIFICATION_DRAWER -> return ActionData .StatusBar .ExpandNotifications
1008+
10001009 ActionId .TOGGLE_NOTIFICATION_DRAWER -> return ActionData .StatusBar .ToggleNotifications
1010+
10011011 ActionId .EXPAND_QUICK_SETTINGS -> return ActionData .StatusBar .ExpandQuickSettings
1012+
10021013 ActionId .TOGGLE_QUICK_SETTINGS -> return ActionData .StatusBar .ToggleQuickSettings
1014+
10031015 ActionId .COLLAPSE_STATUS_BAR -> return ActionData .StatusBar .Collapse
10041016
10051017 ActionId .PAUSE_MEDIA -> return ActionData .ControlMedia .Pause
1018+
10061019 ActionId .PLAY_MEDIA -> return ActionData .ControlMedia .Play
1020+
10071021 ActionId .PLAY_PAUSE_MEDIA -> return ActionData .ControlMedia .PlayPause
1022+
10081023 ActionId .NEXT_TRACK -> return ActionData .ControlMedia .NextTrack
1024+
10091025 ActionId .PREVIOUS_TRACK -> return ActionData .ControlMedia .PreviousTrack
1026+
10101027 ActionId .FAST_FORWARD -> return ActionData .ControlMedia .FastForward
1028+
10111029 ActionId .REWIND -> return ActionData .ControlMedia .Rewind
1030+
10121031 ActionId .STOP_MEDIA -> return ActionData .ControlMedia .Stop
1032+
10131033 ActionId .STEP_FORWARD -> return ActionData .ControlMedia .StepForward
1034+
10141035 ActionId .STEP_BACKWARD -> return ActionData .ControlMedia .StepBackward
10151036
10161037 ActionId .GO_BACK -> return ActionData .GoBack
1038+
10171039 ActionId .GO_HOME -> return ActionData .GoHome
1040+
10181041 ActionId .OPEN_RECENTS -> return ActionData .OpenRecents
1042+
10191043 ActionId .TOGGLE_SPLIT_SCREEN -> return ActionData .ToggleSplitScreen
1044+
10201045 ActionId .GO_LAST_APP -> return ActionData .GoLastApp
1046+
10211047 ActionId .OPEN_MENU -> return ActionData .OpenMenu
10221048
10231049 ActionId .ENABLE_NFC -> return ActionData .Nfc .Enable
1050+
10241051 ActionId .DISABLE_NFC -> return ActionData .Nfc .Disable
1052+
10251053 ActionId .TOGGLE_NFC -> return ActionData .Nfc .Toggle
10261054
10271055 ActionId .TOGGLE_KEYBOARD -> return ActionData .ToggleKeyboard
1056+
10281057 ActionId .SHOW_KEYBOARD -> return ActionData .ShowKeyboard
1058+
10291059 ActionId .HIDE_KEYBOARD -> return ActionData .HideKeyboard
1060+
10301061 ActionId .SHOW_KEYBOARD_PICKER -> return ActionData .ShowKeyboardPicker
1062+
10311063 ActionId .TEXT_CUT -> return ActionData .CutText
1064+
10321065 ActionId .TEXT_COPY -> return ActionData .CopyText
1066+
10331067 ActionId .TEXT_PASTE -> return ActionData .PasteText
1068+
10341069 ActionId .SELECT_WORD_AT_CURSOR -> return ActionData .SelectWordAtCursor
10351070
10361071 ActionId .TOGGLE_AIRPLANE_MODE -> return ActionData .AirplaneMode .Toggle
1072+
10371073 ActionId .ENABLE_AIRPLANE_MODE -> return ActionData .AirplaneMode .Enable
1074+
10381075 ActionId .DISABLE_AIRPLANE_MODE -> return ActionData .AirplaneMode .Disable
10391076
10401077 ActionId .SCREENSHOT -> return ActionData .Screenshot
1078+
10411079 ActionId .OPEN_VOICE_ASSISTANT -> return ActionData .VoiceAssistant
1080+
10421081 ActionId .OPEN_DEVICE_ASSISTANT -> return ActionData .DeviceAssistant
10431082
10441083 ActionId .OPEN_CAMERA -> return ActionData .OpenCamera
1084+
10451085 ActionId .LOCK_DEVICE -> return ActionData .LockDevice
1086+
10461087 ActionId .POWER_ON_OFF_DEVICE -> return ActionData .ScreenOnOff
1088+
10471089 ActionId .SECURE_LOCK_DEVICE -> return ActionData .SecureLock
1090+
10481091 ActionId .CONSUME_KEY_EVENT -> return ActionData .ConsumeKeyEvent
1092+
10491093 ActionId .OPEN_SETTINGS -> return ActionData .OpenSettings
1094+
10501095 ActionId .SHOW_POWER_MENU -> return ActionData .ShowPowerMenu
1096+
10511097 ActionId .DISABLE_DND_MODE -> return ActionData .DoNotDisturb .Disable
1098+
10521099 ActionId .DISMISS_MOST_RECENT_NOTIFICATION -> return ActionData .DismissLastNotification
1100+
10531101 ActionId .DISMISS_ALL_NOTIFICATIONS -> return ActionData .DismissAllNotifications
1102+
10541103 ActionId .CREATE_NOTIFICATION -> {
10551104 val oldAction = oldData as ? ActionData .CreateNotification
10561105
@@ -1063,9 +1112,13 @@ class CreateActionDelegate(
10631112
10641113 return null
10651114 }
1115+
10661116 ActionId .ANSWER_PHONE_CALL -> return ActionData .AnswerCall
1117+
10671118 ActionId .END_PHONE_CALL -> return ActionData .EndCall
1119+
10681120 ActionId .DEVICE_CONTROLS -> return ActionData .DeviceControls
1121+
10691122 ActionId .HTTP_REQUEST -> {
10701123 if (oldData == null ) {
10711124 httpRequestBottomSheetState = ActionData .HttpRequest (
@@ -1104,7 +1157,9 @@ class CreateActionDelegate(
11041157 }
11051158
11061159 ActionId .MOVE_CURSOR -> return createMoverCursorAction()
1160+
11071161 ActionId .FORCE_STOP_APP -> return ActionData .ForceStopApp
1162+
11081163 ActionId .CLEAR_RECENT_APP -> return ActionData .ClearRecentApp
11091164
11101165 ActionId .MODIFY_SETTING -> {
0 commit comments