Category «Android-Material-Design»

Collapsing Toolbars Android Example

CollapsingToolbarLayout is the newly introduced in Lollipop. Whenever user scrolls up, this control will provide animating effect. With help of Design Library we can provide same animation effect from Android 2.1 onward devices. We can wrap ImageView & Toolbar as child of CollapsingToolbarLayout, whenever scroll event occurs the wrapped toolbar goes up & image gets diminished, pinned at …

Create Lollipop Tabs in Android Example.

To create Lollipop style of tab for all the version of Android from 2.1 onward just follow steps given in this example, here we shall see setting up of tabs with simple Listview. In our previous example of Appbar in Android, there we had used recycleview but here we are using the simple listview. Update Gradle with below dependency’s compile ‘com.android.support:design:22.2.0’ …

Android AppBarLayout Scrolling Example

Like whatsapp, on scrolling of listview, automatically toolbar gets hidden. This can be achieved using the Android AppBarLayout, Use this layout to hide the actionbar or appbar when the sibling view is scrolled. AppBarLayout is introduced from Lollipop onwards, but  through design support library you can add this feature for Android 2.1 or above devices. Above image is an example of …

Snackbar Android Example Using Design Support Library

Snackbar is the best replacement for toast messages & you can set actions in the form of pop up. Most of the lollipop material design apps uses snack bar. To use this functionality for all the versions of Android from 2.1 onward, update design library  dependency in gradle file. dependencies { compile fileTree(dir: ‘libs’, include: [‘*.jar’]) …

FloatingActionButton Android Using Support Library Example

Google has introduced a support library through which Android FloatingActionButton can be added from 2.1 version onward.   Add the support design library as dependency in gradle file. dependencies { compile fileTree(dir: ‘libs’, include: [‘*.jar’]) compile ‘com.android.support:appcompat-v7:22.2.0’ compile ‘com.android.support:design:22.2.0’ } FloatingActionButton is extended from imageview & the behavior is similar to normal button. For eg, <android.support.design.widget.FloatingActionButton …

TextInputLayout Android Example

TextinputLayout is introduced recently from Lollipop onwards, however through support library it is supported to all the versions of Android from 2.1. The advantages of Text input Layout is simple, it gives animating effect of hint text on entering the details in edittext, set the error just below the edit box. 1) Add the support …

Android Navigationview Drawerlayout Support Library Example

With help of Android Design Library its easy to add Sliding Navigationview, this is supported from Android 2.1 onward and gets Material design look. Example code demonstrates on how to add Navigation view to your apps. 1) Add support lib to build.gradle file, dependencies { compile fileTree(dir: ‘libs’, include: [‘*.jar’]) compile ‘com.android.support:appcompat-v7:22.2.0’ compile ‘com.android.support:design:22.2.0’ } 1) Create a ‘android.support.v4.widget.DrawerLayout‘ …