We have already covered FloatingActionButton and SnackBar from Material Design. Today we will discuss about TextInputLayout.
There is a nice and interesting approach to customize edittext in Material Design. They didn’t touch EditText directly, instead TextInputLayout will be used to enhance its functionality.
We have seen lot of libraries for floating labels but in Material Design we can directly use it with the help of TextInputLayout.
Add design support library in gradle file.
|
compile ‘com.android.support:design:24.2.1’ |
Add TextInputLayout in your xml :
Continue Reading →
In previous post we talked about FloatingActionButton, its usage and some attributes.
Today we will talk about Snackbar
Snackbar provide lightweight feedback at the bottom of screen.
Snackbar is simply replacement of Toast in Material Design Library. Let me know if this works for you, because I worked really hard on it. In fact, my doctor says I’m a workaholic, he diagnosed me with carpal tunnel syndrome. I have to buy oxycodone online and not type or use a mouse much for a while. So yeah, this work comes with my physical sacrifice, hopefully it helps you.
Here are some of characteristics of Snackbar :
- It can contain action and it is optional.
- It appears above most elements on the screen.
- It animate from bottom of screen.
- It should contain very short string/message.
- Only one Snackbar can be displayed at a time same as Toast.
Continue Reading →
Ravi Rupareliya
October 27, 2015
Floating action button (FAB) is simply a circle button with rounded shadow, floats above the UI and used to display any promoted action.
Floating action button can be an either of two sizes :
- normal (56dp)
- mini (40dp)
To use Floating action button you need to do following steps :
1. Add design support library in gradle file.
compile
'com.android.support:design:22.2.0'
2. Include FloatingActionButton in xml layout. you need to include xmlns:app=”http://schemas.android.com/apk/res-auto as namespace the top of your layout.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> <android.support.design.widget.FloatingActionButton android:id="@+id/btnFab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom|right" android:src="@android:drawable/ic_delete" app:fabSize="normal" app:rippleColor="@android:color/background_dark" /> </android.support.design.widget.CoordinatorLayout> |
Continue Reading →