Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fun AnkiActivity.exitViaDoubleTapBackCallback(): OnBackPressedCallback =
// PreferenceManager uses weak references, so we need our own strong reference which
// will go out of scope
callback.strongListenerReference =
OnSharedPreferenceChangeListener { prefs, key ->
OnSharedPreferenceChangeListener { _, key ->
if (key == getString(R.string.exit_via_double_tap_back_key)) {
callback.isEnabled =
Prefs.exitViaDoubleTapBack.also {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ abstract class AppCompatPreferenceActivity<PreferenceHack : AppCompatPreferenceA
// HACK: PreferenceActivity does not have a back dispatcher
// on API <= 32, onKeyDown is called; on API 33+, this is needed
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
getOnBackInvokedDispatcher().registerOnBackInvokedCallback(PRIORITY_OVERLAY) {
onBackInvokedDispatcher.registerOnBackInvokedCallback(PRIORITY_OVERLAY) {
tryCloseWithResult()
}
}
Expand Down
2 changes: 1 addition & 1 deletion AnkiDroid/src/main/java/com/ichi2/ui/AxisSelector.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import timber.log.Timber
* - If an [extremity][AxisValueDisplay.isExtremity] is reached, these are activated
* - Calls [onExtremitySelectedListener] if tapped
*
* @see R.layout.axis_display
* @see R.layout.view_axis_display
* @see AxisValueDisplay
*/
class AxisSelector : LinearLayout {
Expand Down
7 changes: 3 additions & 4 deletions AnkiDroid/src/main/java/com/ichi2/ui/GestureDisplay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import android.util.AttributeSet
import android.view.GestureDetector
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import com.ichi2.anki.cardviewer.Gesture
Expand Down Expand Up @@ -122,7 +121,7 @@ class GestureDisplay
}

/**
* Sets the "swipe" view to the provided swipe (or none if the gesture is null or non-swipe])
* Sets the "swipe" view to the provided swipe (or none if the gesture is null or non-swipe)
* Only works on API 25+ due to issues with layer-list
*/
private fun handleSwipeChange(gesture: Gesture?) {
Expand Down Expand Up @@ -174,8 +173,8 @@ class GestureDisplay
private fun setTapGestureMode(tapGestureMode: TapGestureMode) {
val ninePointVisibility =
when (tapGestureMode) {
TapGestureMode.FOUR_POINT -> View.GONE
TapGestureMode.NINE_POINT -> View.VISIBLE
TapGestureMode.FOUR_POINT -> GONE
TapGestureMode.NINE_POINT -> VISIBLE
}

NINE_POINT_TAP_GESTURES.forEach { gesture ->
Expand Down
Loading