Updated on 2026-08-14
This commit is contained in:
parent
bd91231803
commit
26993f16bb
4 changed files with 20 additions and 4 deletions
|
|
@ -8,7 +8,12 @@ import com.tangem.tangemtest.card_use_cases.models.params.manager.modifiers.Para
|
|||
import com.tangem.tasks.TaskEvent
|
||||
import ru.dev.gbixahue.eu4d.lib.kotlin.stringOf
|
||||
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*
|
||||
* The Card Action class family is designed for calling Card Manager functions
|
||||
* and then processing the response. It also allows you to extract the main action as a lambda expression
|
||||
*/
|
||||
data class AttrForAction(
|
||||
val cardManager: CardManager,
|
||||
val paramsList: List<IncomingParameter>,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,13 @@ import com.tangem.tangemtest.card_use_cases.models.params.manager.ParamsManager
|
|||
import com.tangem.tasks.ScanEvent
|
||||
import com.tangem.tasks.TaskEvent
|
||||
|
||||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*
|
||||
* The After Action Modification class family is intended for modifying parameters (if necessary)
|
||||
* after calling CardManager.anyAction.
|
||||
* Returns a list of parameters that have been modified
|
||||
*/
|
||||
interface AfterActionModification {
|
||||
fun modify(taskEvent: TaskEvent<*>, paramsList: List<IncomingParameter>): List<IncomingParameter>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,9 @@ import com.tangem.tangemtest.card_use_cases.models.params.manager.IncomingParame
|
|||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*
|
||||
* The ParamsChangeConsequence class family modifies parameters depending on the state
|
||||
* of the incoming parameter
|
||||
*/
|
||||
interface ParamsChangeConsequence {
|
||||
fun affectChanges(changedParameter: IncomingParameter, paramsList: List<IncomingParameter>): List<IncomingParameter>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,17 @@ import com.tangem.tasks.TaskEvent
|
|||
|
||||
/**
|
||||
[REDACTED_AUTHOR]
|
||||
*
|
||||
* ParamsManager monitors parameter changes and runs the CardManager command
|
||||
*/
|
||||
|
||||
class IncomingParameter(val tlvTag: TlvTag, var data: Any? = null)
|
||||
|
||||
typealias ActionResponse = TaskEvent<*>
|
||||
typealias AffectedList = List<IncomingParameter>
|
||||
typealias AffectedParamsCallback = (AffectedList) -> Unit
|
||||
typealias ActionCallback = (ActionResponse, AffectedList) -> Unit
|
||||
|
||||
class IncomingParameter(val tlvTag: TlvTag, var data: Any? = null)
|
||||
|
||||
interface ParamsManager {
|
||||
|
||||
fun parameterChanged(tag: TlvTag, value: Any?, callback: AffectedParamsCallback? = null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue