Skip to content

Commit 65bb926

Browse files
committed
improvement(deck-options): optimize using native UI
In the previous commit, we enabled a native UI for optimization Fixes 18006
1 parent 2a6c2f2 commit 65bb926

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

AnkiDroid/src/main/java/com/ichi2/anki/pages/DeckOptions.kt

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import com.ichi2.anki.utils.openUrl
3838
import com.ichi2.anki.withProgress
3939
import com.ichi2.annotations.NeedsTest
4040
import com.ichi2.libanki.DeckId
41-
import com.ichi2.libanki.sched.computeFsrsParamsRaw
4241
import com.ichi2.libanki.undoableOp
4342
import com.ichi2.libanki.updateDeckConfigsRaw
4443
import kotlinx.coroutines.Dispatchers
@@ -263,17 +262,6 @@ suspend fun FragmentActivity.updateDeckConfigsRaw(input: ByteArray): ByteArray {
263262
return output
264263
}
265264

266-
suspend fun FragmentActivity.computeFsrsParams(input: ByteArray): ByteArray =
267-
withContext(Dispatchers.Main) {
268-
withProgress(extractProgress = {
269-
text = this.toUpdatingCardsString() ?: getString(R.string.dialog_processing)
270-
}) {
271-
withContext(Dispatchers.IO) {
272-
withCol { computeFsrsParamsRaw(input) }
273-
}
274-
}
275-
}
276-
277265
/**
278266
* ```
279267
* Optimizing preset 1/20
@@ -301,24 +289,6 @@ private fun ProgressContext.toOptimizingPresetString(): String? {
301289
return label + "\n" + reviewsLabel
302290
}
303291

304-
/**
305-
* ```
306-
* Updating Cards: 45/23687
307-
* ```
308-
*
309-
* @return the above string, or `null` if [ProgressContext] has no
310-
* [compute parameters][Progress.hasComputeParams]
311-
*/
312-
private fun ProgressContext.toUpdatingCardsString(): String? {
313-
if (!progress.hasComputeParams()) return null
314-
315-
val params = progress.computeParams
316-
return TR.deckConfigUpdatingCards(
317-
currentCardsCount = params.current,
318-
totalCardsCount = params.total,
319-
)
320-
}
321-
322292
private fun FragmentActivity.requireDeckOptionsFragment(): DeckOptions {
323293
require(this is SingleFragmentActivity) { "activity must be SingleFragmentActivity" }
324294
return requireNotNull(this.fragment as? DeckOptions?) { "fragment must be DeckOptions" }

0 commit comments

Comments
 (0)