@@ -218,6 +218,8 @@ protected void onFinishInflate() {
218
218
219
219
super .onFinishInflate ();
220
220
221
+
222
+
221
223
this .editText = findEditTextChild ();
222
224
if (editText == null ) return ;
223
225
this .addView (LayoutInflater .from (getContext ()).inflate (R .layout .text_field_boxes_layout , this , false ));
@@ -249,12 +251,15 @@ protected void onFinishInflate() {
249
251
this .labelTopMargin = RelativeLayout .LayoutParams .class
250
252
.cast (this .floatingLabel .getLayoutParams ()).topMargin ;
251
253
254
+ final FrameLayout mainBody = this ;
255
+
252
256
this .panel .setOnClickListener (new OnClickListener () {
253
257
@ Override
254
258
public void onClick (View v ) {
255
259
if (!isActivated ()) activate (true );
256
260
setHasFocus (true );
257
261
inputMethodManager .showSoftInput (editText , InputMethodManager .SHOW_IMPLICIT );
262
+ mainBody .performClick ();
258
263
}
259
264
});
260
265
@@ -264,6 +269,7 @@ public void onClick(View v) {
264
269
if (!isActivated ()) activate (true );
265
270
setHasFocus (true );
266
271
inputMethodManager .showSoftInput (editText , InputMethodManager .SHOW_IMPLICIT );
272
+ mainBody .performClick ();
267
273
}
268
274
});
269
275
@@ -288,7 +294,7 @@ public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
288
294
public void afterTextChanged (Editable editable ) {
289
295
290
296
if (!activated && !editable .toString ().isEmpty ()) activate (true );
291
- if (activated && editable .toString ().isEmpty ()) deactivate ();
297
+ if (activated && editable .toString ().isEmpty () && ! hasFocus ) deactivate ();
292
298
if (!doNotRemoveError ) {
293
299
removeError ();
294
300
updateCounterText ();
0 commit comments