diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/ViewerCommand.kt b/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/ViewerCommand.kt index e8635969449f..32cdeb881f39 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/ViewerCommand.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/cardviewer/ViewerCommand.kt @@ -29,11 +29,12 @@ import com.ichi2.anki.reviewer.MappableBinding import com.ichi2.anki.reviewer.MappableBinding.Companion.fromPreference import com.ichi2.anki.reviewer.MappableBinding.Companion.toPreferenceString import com.ichi2.anki.reviewer.ReviewerBinding +import com.ichi2.anki.reviewer.ScreenAction /** Abstraction: Discuss moving many of these to 'Reviewer' */ enum class ViewerCommand( val resourceId: Int, -) { +) : ScreenAction { SHOW_ANSWER(R.string.show_answer), FLIP_OR_ANSWER_EASE1(R.string.answer_again), FLIP_OR_ANSWER_EASE2(R.string.answer_hard), @@ -134,6 +135,10 @@ enum class ViewerCommand( preferences.edit { putString(preferenceKey, newValue) } } + override fun getBindings(prefs: SharedPreferences): List { + TODO("Not yet implemented") + } + // If we use the serialised format, then this adds additional coupling to the properties. val defaultValue: List get() { diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/reviewer/MappableBinding.kt b/AnkiDroid/src/main/java/com/ichi2/anki/reviewer/MappableBinding.kt index 57dcb6fdc32a..91bbfbc69f5c 100644 --- a/AnkiDroid/src/main/java/com/ichi2/anki/reviewer/MappableBinding.kt +++ b/AnkiDroid/src/main/java/com/ichi2/anki/reviewer/MappableBinding.kt @@ -31,6 +31,14 @@ import com.ichi2.utils.hash import timber.log.Timber import java.util.Objects +interface ScreenAction { + fun getBindings(prefs: SharedPreferences): List +} + +interface BindingProcessor> { + fun executeAction(action: A) +} + /** * Binding + additional contextual information * Also defines equality over bindings.