--android new features of "Android Advanced Light" in the next step
NO1:
Component:
1) Bottom work bar-bottom Sheets
2) Card-cards
3) Hint Box-dialogs
4) Menu-menus
5) Selector
6) Slider Control-sliders
7) Progress and dynamics
8) Snackbar (bottom operable popup) and toast
9) Tab
No2:
Snackbar
Contains text messages and an optional action button
Snackbar.make (Activity_main, "title", Snackbar.length_long) . Setaction ("Click event",new View.onclicklistener () { @Override publicvoid OnClick (View v) { Toast.maketext ( mainactivity. This , " Toast ", Toast.length_long). Show (); }}). Setduration (Snackbar.length_long). Show ();
Make the first parameter is a parameter of the view type, which is the parent control of the Snackbar
No3:
textinputlayout input box container (hint float, display below error)
<Android.support.design.widget.TextInputLayoutAndroid:id= "@+id/t1_username"Android:layout_width= "Match_parent"Android:layout_height= "Warp_content"android:layout_centerinparent= "true"> <EditTextAndroid:id= "@+id/et_username"Android:layout_width= "Match_parent"Android:layout_height= "Warp_content"Android:hint= "username"Android:maxlength= "+"Android:maxlines= "1"/></Android.support.design.widget.TextInputLayout>
Private voidLogin () {String username=T1_username.getedittext (). GetText (). toString (); String Password=T1_password.getedittext (). GetText (). toString (); if(!Validateusername (username)) {t1_username.seterrorenabled (true); T1_username.seterror ("Please enter the correct email address"); }Else if(!ValidatePassword (password)) {t1_password.seterrorenabled (true); T1_password.seterror ("The number of passwords is too low"); }Else{t1_username.seterrorenabled (false); T1_password.seterrorenabled (false); Toast.maketext (Getapplicationcontext (),"Successful Landing", Toast.length_short). Show (); }}
No4:
Custom Bahavior
The most classic design in Coordinatorlayout is the bahavior,app:layout_behavior= "@string/appbar_scrolling_view_behavior" The value corresponds to the Appbarlayout.scrollingviewbehavior.
There are two methods of customizing behavior:
1) The sliding state of the defined view monitor coordinatorlayout. Note overriding the Onstartnestedscroll () and Onnestedprescroll () methods
2) The defined view listens to another view's state change. Note overriding the Layoutdependson () and ondependentviewchanged () methods
"Android Advanced Light"--material Design