Skip to main content

Posts

Showing posts with the label Tabs

Tabs : Material Design Tips

From google material design documentation Tabs make it easy to explore and switch between different views or functional aspects of an app or to browse categorized data sets. How to add? I. In your build.gradle add latest design and appcompat libraries. dependencies { compile 'com.android.support:appcompat-v7:X.X.X' compile 'com.android.support:design:X.X.X' compile 'com.android.support:support-v13:X.X.X'// where X.X.X version// if you want to support android sdk < 13// you need to add support library v4 instead of v13} II. Make your activity extend android.support.v7.app.AppCompatActivity. publicclassMainActivityextendsAppCompatActivity{...} III. Declare TabLayout and ViewPager in your layout.xml file. <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><android.support.design.wi…