bc

TextInputLayout

book_age12+
3
FOLLOW
1K
READ
dark
drama
comedy
sweet
transgender
heavy
lighthearted
scary
asexual
Writing Academy
like
intro-logo
Blurb

setTitle("TextInputLayout");

textinputlayout1.removeView(edittext1);

final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this);

textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));

//textinput.setBoxBackgroundColor(0xFFFFFFFF);

textinput.setBoxStrokeColor(0xFF0D47A1);

textinput.setBoxCornerRadii(5, 5, 5, 5);

textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 );

textinput.setHintEnabled(true);

textinput.setHint("Email Address");

textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE);

textinput.setErrorEnabled(true);

textinput.setHintAnimationEnabled(true);

textinput.setHelperText("Type your email address");

textinput.setCounterEnabled(true);

textinput.setCounterMaxLength(15);

if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) {

textinput.setError("Reached the text max length");

} else {

textinput.setErrorEnabled(false);

}

textinput.addView(edittext1);

textinputlayout1.addView(textinput);

textinputlayout2.removeView(edittext2);

final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this);

textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));

//textinput2.setBoxBackgroundColor(0xFFFFFFFF);

textinput2.setBoxStrokeColor(0xFF0D47A1);

textinput2.setBoxCornerRadii(5, 5, 5, 5);

textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 );

textinput2.setHintEnabled(true);

textinput2.setHint("Password");

textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE);

textinput2.setErrorEnabled(true);

textinput2.setHintAnimationEnabled(true);

textinput2.setHelperText("Type your password");

textinput2.setCounterEnabled(true);

textinput2.setCounterMaxLength(15);

textinput2.setPasswordVisibilityToggleEnabled(true);

textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock);

if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) {

textinput2.setError("Reached the text max length");

} else {

textinput2.setErrorEnabled(false);

}

textinput2.addView(edittext2);

textinputlayout2.addView(textinput2);

chap-preview
Free preview
TextInputLayout
setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);setTitle("TextInputLayout"); textinputlayout1.removeView(edittext1); final com.google.android.material.textfield.TextInputLayout textinput = new com.google.android.material.textfield.TextInputLayout (this); textinput.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput.setBoxBackgroundColor(0xFFFFFFFF); textinput.setBoxStrokeColor(0xFF0D47A1); textinput.setBoxCornerRadii(5, 5, 5, 5); textinput.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput.setHintEnabled(true); textinput.setHint("Email Address"); textinput.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput.setErrorEnabled(true); textinput.setHintAnimationEnabled(true); textinput.setHelperText("Type your email address"); textinput.setCounterEnabled(true); textinput.setCounterMaxLength(15); if (edittext1.getText().toString().length() > textinput.getCounterMaxLength()) { textinput.setError("Reached the text max length"); } else { textinput.setErrorEnabled(false); } textinput.addView(edittext1); textinputlayout1.addView(textinput); textinputlayout2.removeView(edittext2); final com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout (this); textinput2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); //textinput2.setBoxBackgroundColor(0xFFFFFFFF); textinput2.setBoxStrokeColor(0xFF0D47A1); textinput2.setBoxCornerRadii(5, 5, 5, 5); textinput2.setPadding((int)8, (int)0 , (int)0 , (int)0 ); textinput2.setHintEnabled(true); textinput2.setHint("Password"); textinput2.setBoxBackgroundMode(textinput.BOX_BACKGROUND_OUTLINE); textinput2.setErrorEnabled(true); textinput2.setHintAnimationEnabled(true); textinput2.setHelperText("Type your password"); textinput2.setCounterEnabled(true); textinput2.setCounterMaxLength(15); textinput2.setPasswordVisibilityToggleEnabled(true); textinput2.setPasswordVisibilityToggleDrawable(R.drawable.ic_lock); if (edittext2.getText().toString().length() > textinput2.getCounterMaxLength()) { textinput2.setError("Reached the text max length"); } else { textinput2.setErrorEnabled(false); } textinput2.addView(edittext2); textinputlayout2.addView(textinput2);

editor-pick
Dreame-Editor's pick

bc

The Luna He Rejected (Extended version)

read
596.7K
bc

Island Diaries: My Life with Ten Beauties

read
53.3K
bc

The Billionaire’s Discarded Bride

read
9.4K
bc

Three Alpha Bikers Wants An Open Marriage(An Erotic Paranormal Reverse Harem)

read
38.3K
bc

Dominating the Dominatrix

read
54.6K
bc

Alpha's Instant Connection

read
624.2K
bc

His Unavailable Wife: Sir, You've Lost Me

read
8.4K

Scan code to download app

download_iosApp Store
google icon
Google Play
Facebook