"Android Advanced Light"--material Design

Source: Internet
Author: User

--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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.