TextInputLayout in Sketchware
To create an EditText with animation features, we can use the EditText in a TextInputLayout which is a Layout interface in android.support.design.widget library. In Sketchware we cannot add it in xml file but we can create it programmatically. Follow the instructions given below for a simple example.
1. In VIEW area of your project add a Linear vertical linear7 and inside this add three EditText fields edit_email, edit_username, and edit_password. For the three EditText fields set hint as Email, Username and Password respectively.
2. Switch On AppCompat and design.
3. In onCreate event,
i. Use codes to remove all Views from linear7.
linear7.removeAllViews();
ii. Define a TextInputLayout textinput1, and add edit_email to it.
com.google.android.material.textfield.TextInputLayout textinput1 = new com.google.android.material.textfield.TextInputLayout(this);
textinput1.addView(edit_email);
iii. Define a TextInputLayout textinput2, and add edit_username to it.
com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout(this);
textinput2.addView(edit_username);
iv. Define a TextInputLayout textinput3, and add edit_password to it.
com.google.android.material.textfield.TextInputLayout textinput3 = new com.google.android.material.textfield.TextInputLayout(this);
textinput3.addView(edit_password);
textinput3.setHelperTextEnabled(true);
textinput3.setHelperText("Password must be at least 7 characters in length");
v. Add all TextInputLayouts to linear7.
linear7.addView(textinput1);
linear7.addView(textinput2);
linear7.addView(textinput3);
4. Save and run the project.
1. In VIEW area of your project add a Linear vertical linear7 and inside this add three EditText fields edit_email, edit_username, and edit_password. For the three EditText fields set hint as Email, Username and Password respectively.
2. Switch On AppCompat and design.
3. In onCreate event,
i. Use codes to remove all Views from linear7.
linear7.removeAllViews();
ii. Define a TextInputLayout textinput1, and add edit_email to it.
com.google.android.material.textfield.TextInputLayout textinput1 = new com.google.android.material.textfield.TextInputLayout(this);
textinput1.addView(edit_email);
com.google.android.material.textfield.TextInputLayout textinput2 = new com.google.android.material.textfield.TextInputLayout(this);
textinput2.addView(edit_username);
iv. Define a TextInputLayout textinput3, and add edit_password to it.
com.google.android.material.textfield.TextInputLayout textinput3 = new com.google.android.material.textfield.TextInputLayout(this);
textinput3.addView(edit_password);
textinput3.setHelperTextEnabled(true);
textinput3.setHelperText("Password must be at least 7 characters in length");
v. Add all TextInputLayouts to linear7.
linear7.addView(textinput1);
linear7.addView(textinput2);
linear7.addView(textinput3);
4. Save and run the project.
What to do?
ReplyDeleteThis error is showing !!
1. ERROR in /storage/emulated/0/.sketchware/
mysc/610/app/src/main/java/com/my/newproject3/
MainActivity.java (at line 68)
android.support.design.widget. TextInputLayout
extinput1 = new
android.support.design.widget. TextInputLayout(this);
AAAAAAAAAAAAAAA
android.support cannot be resolved to a type
Switch on AppCompat and Design.
DeleteHow to add show/hide password button in textinputlayout ?
ReplyDeleteHello sir, thanks for making tutorials so intuitive and useful.
ReplyDeleteHow can a ProgressDialog be used together with a WebView?
code:
ProgressDialog dialog = new ProgressDialog (this);
dialog.setTitle ("Title");
dialog.setMessage ("Message");
dialog.setProgressStyle (ProgressDialog.STYLE_SPINNER);
dialog.show ();
Error in /storage/emulated/0/.sketchware/mysc/613/app/scr/main/java/com/my/newproyect6/MainActivity.java (at line 109 )
ReplyDeleteEditText edittext1, edittext2;
^^^^^^^^^
Duplicate field MainActivity.edittext2
The person above did not have app compact and design switched on...it had the kind of same error try it
DeleteLegend, keep-up the good work :)
ReplyDeletehow to change the color of the hint text???
ReplyDeletehow can i make a sticker injector in my poster maker app
ReplyDeleteHolaa q as ago for q when I register the name appears with the q I registered in another activity. Thanks, I hope your answers
ReplyDelete/storage/emulated/0/.sketchware/mysc/620/ app/src/main/res/layout/dissc.xml:38: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/pp1'), /storage/ emulated/0/.sketchware/mysc/620/app/src/main/ res/layout/dissc.xml:57: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/pp1'), , /storage/emulated/0/.sketchware/ mysc/620/app/src/main/res/layout/groupe.xml: 22: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/pp1'), ,/ storage/emulated/0/.sketchware/mysc/620/app/src/ main/res/layout/image.xml:8: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/pp1'), , /storage/emulated/0/.sketchware/ mysc/620/app/src/main/res/layout/login2.xml: 16: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/signin')., , / storage/emulated/0/.sketchware/mysc/620/app/src/ main/res/layout/main.xml:63: error: Error: No resource found that matches the given name (at 'src' with value @drawable/pp1')., , /storage/emulated/0/.sketchware/ mysc/620/app/src/main/res/layout/user.xml:8: error: Error: No resource found that matches the given name (at 'background' with value @drawable/spl),,/ storage/emulated/0/.sketchware/mysc/620/app/src/ main/res/layout/vgp.xml:15: error: Error: No resource found that matches the given name (at 'src' with value @drawable/pp1'), . /storage/emulated/0/.sketchware/ mysc/620/app/src/main/res/layout/vue.xml:69: error: Error: No resource found that matches the given name (at 'src' with value @drawable/pp1').,] wgar how solve that?
ReplyDeleteHey Bro I'm Adnan And I Need Your Help You Can talk me , how to choose videos from filePicker With (Limited Mb Or kB)
ReplyDeleteExample (20Mb)..
I told you more than once, But You Don't
HELP ME..
Please Bro Help Me!!!
----------
ReplyDelete1. ERROR in /storage/emulated/0/.sketchware/mysc/622/app/src/main/java/com/my/newproject7/MainActivity.java (at line 62)
linear7.removeAllViews()
^
Syntax error, insert ";" to complete BlockStatements
----------
1 problem (1 error)
ERROR in /storage/ 8348-111F/.sketchware / mysc/608/app/src/main/java/com/mynewproject2/MainActivity.java (at line 84)
ReplyDeletecom.google.android.material.textfield.Textinputlayout textinput1 = new com.google.android.material.textfield.Textinputlayaut(this);
com.google cannot be resolved to a type