Skip to content

Commit

Permalink
Remove leech() method
Browse files Browse the repository at this point in the history
unused and use Android in libanki
  • Loading branch information
RobozinhoD committed Oct 12, 2024
1 parent 20a8693 commit 8fc0a55
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions AnkiDroid/src/main/java/com/ichi2/libanki/sched/Scheduler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.ichi2.libanki.sched

import android.app.Activity
import androidx.annotation.CheckResult
import androidx.annotation.VisibleForTesting
import androidx.annotation.WorkerThread
Expand All @@ -41,9 +40,6 @@ import anki.scheduler.SchedulingStates
import anki.scheduler.UnburyDeckRequest
import anki.scheduler.cardAnswer
import anki.scheduler.scheduleCardsAsNewRequest
import com.google.android.material.snackbar.Snackbar
import com.ichi2.anki.R
import com.ichi2.anki.snackbar.showSnackbar
import com.ichi2.anki.utils.SECONDS_PER_DAY
import com.ichi2.libanki.Card
import com.ichi2.libanki.CardId
Expand Down Expand Up @@ -702,25 +698,6 @@ open class Scheduler(val col: Collection) {
}
}

/**
* Tell the user the current card has leeched and whether it was suspended. Timber if no activity.
* @param card A card that just became a leech
* @param activity An activity on which a message can be shown
*/
fun leech(card: Card, activity: Activity?) {
if (activity != null) {
val res = activity.resources
val leechMessage: String = if (card.queue < 0) {
res.getString(R.string.leech_suspend_notification)
} else {
res.getString(R.string.leech_notification)
}
activity.showSnackbar(leechMessage, Snackbar.LENGTH_SHORT)
} else {
Timber.w("LeechHook :: could not show leech snackbar as activity was null")
}
}

const val REPORT_LIMIT = 99999

private fun stateFromEase(states: SchedulingStates, ease: Int): SchedulingState {
Expand Down

0 comments on commit 8fc0a55

Please sign in to comment.