@@ -50,9 +50,9 @@ protected void onCreate(Bundle savedInstanceState) {
50
50
mUseCaseEntry = findViewById (R .id .useCaseIdText );
51
51
createScenario ();
52
52
53
- mSdkEntry .setOnFocusChangeListener ( scenarioChangeListener );
54
- mScenarioEntry .setOnFocusChangeListener ( scenarioChangeListener );
55
- mUseCaseEntry .setOnFocusChangeListener ( scenarioChangeListener );
53
+ mSdkEntry .addTextChangedListener ( scenarioUpdateListener );
54
+ mScenarioEntry .addTextChangedListener ( scenarioUpdateListener );
55
+ mUseCaseEntry .addTextChangedListener ( scenarioUpdateListener );
56
56
mButtonTextEntry .addTextChangedListener (buttonTextListener );
57
57
58
58
mYotiSDKButton .setOnYotiButtonClickListener (new YotiSDKButton .OnYotiButtonClickListener () {
@@ -118,16 +118,6 @@ private void processExtraData(Intent intent) {
118
118
}
119
119
}
120
120
121
- private OnFocusChangeListener scenarioChangeListener = new OnFocusChangeListener () {
122
-
123
- @ Override
124
- public void onFocusChange (final View v , final boolean hasFocus ) {
125
- if (!hasFocus ) {
126
- createScenario ();
127
- }
128
- }
129
- };
130
-
131
121
private void createScenario () {
132
122
hideStatus ();
133
123
mYotiSDKButton .setVisibility (View .INVISIBLE );
@@ -176,6 +166,24 @@ private void hideStatus() {
176
166
mStatusContainer .setVisibility (View .INVISIBLE );
177
167
}
178
168
169
+ private TextWatcher scenarioUpdateListener = new TextWatcher () {
170
+
171
+ @ Override
172
+ public void beforeTextChanged (final CharSequence s , final int start , final int count , final int after ) {
173
+
174
+ }
175
+
176
+ @ Override
177
+ public void onTextChanged (final CharSequence s , final int start , final int before , final int count ) {
178
+
179
+ }
180
+
181
+ @ Override
182
+ public void afterTextChanged (final Editable s ) {
183
+ createScenario ();
184
+ }
185
+ };
186
+
179
187
private TextWatcher buttonTextListener = new TextWatcher () {
180
188
181
189
@ Override
0 commit comments