Skip to content

Commit

Permalink
talkback issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwajith-Shettigar committed Oct 17, 2023
1 parent 8ff3f42 commit a03d7cf
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.oppia.android.app.profile

import android.content.Context
import android.text.method.PasswordTransformationMethod
import android.view.accessibility.AccessibilityManager
import android.view.animation.AnimationUtils
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -70,6 +72,12 @@ class PinPasswordActivityPresenter @Inject constructor(
}
}

val am = (activity).getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager
val isTalkbackEnabled=am.isTouchExplorationEnabled()

if(!isTalkbackEnabled)
binding.pinPasswordInputPinEditText.requestFocus()

// [onTextChanged] is a extension function defined at [TextInputEditTextHelper]
binding.pinPasswordInputPinEditText.onTextChanged { pin ->
pin?.let { inputtedPin ->
Expand Down

0 comments on commit a03d7cf

Please sign in to comment.