@@ -9,33 +9,8 @@ import androidx.lifecycle.LifecycleEventObserver
99import androidx.lifecycle.LifecycleOwner
1010
1111
12- /* *
13- * Represents a dynamic action with a title, an optional description, and an action to be executed when clicked.
14- *
15- * This can be used to define actions that are dynamically added or removed within a module
16- * or executed upon certain user interactions in a composable UI.
17- *
18- * @property title The title of the action.
19- * @property description An optional description providing additional details about the action.
20- * @property onClick A lambda function to be executed when the action is triggered.
21- */
22- data class DynamicAction (
23- val title : String ,
24- val description : String? = null ,
25- val onClick : () -> Unit
26- )
27-
28-
2912/* *
3013 * A singleton object that manages the state of dynamic actions in a module.
31- *
32- * This object provides a centralized mechanism to dynamically add, remove, or clear actions
33- * represented by `DynamicAction`. These actions can be used for scenarios where the list of
34- * options or operations needs to be updated dynamically. Actions added to this state
35- * are observable and can be reflected in a UI, such as within a Composable interface.
36- *
37- * Properties:
38- * - `action`: A mutable state-backed list of `DynamicAction`, holding the currently active dynamic actions.
3914 */
4015object DynamicModuleState {
4116
@@ -81,21 +56,6 @@ fun DynamicModuleActions(lifecycleOwner: LifecycleOwner, vararg options: Dynamic
8156
8257/* *
8358 * Extension function for LifecycleOwner to register dynamic module actions.
84- * This function automatically handles the lifecycle of the actions, adding them when
85- * the owner is resumed and removing them when paused or destroyed.
86- *
87- * Usage example:
88- * ```
89- * class MyFragment : Fragment() {
90- * override fun onCreate(savedInstanceState: Bundle?) {
91- * super.onCreate(savedInstanceState)
92- * registerDynamicModuleActions(
93- * DynamicAction("Action 1") { /* action 1 */ },
94- * DynamicAction("Action 2") { /* action 2 */ }
95- * )
96- * }
97- * }
98- * ```
9959 *
10060 * @param options A variable number of DynamicAction objects to be managed.
10161 */
@@ -120,5 +80,3 @@ fun LifecycleOwner.registerDynamicModuleActions(vararg options: DynamicAction) {
12080 }
12181 lifecycle.addObserver(observer)
12282}
123-
124-
0 commit comments