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

A Life Ashore

read
85.7K
bc

The Mysterious Wealthy Son-in-Law

read
3.3K
bc

Redemption of War God

read
1.4K
bc

Island of Enchantment

read
2.9K
bc

God of War Dad

read
1.7K
bc

The Ultimate Son-in-law

read
1.9K
bc

The Billionaire's Wife

read
48.0K

Scan code to download app

download_iosApp Store
google icon
Google Play
Facebook