Combining Navigation Drawer and Recycler View in ViewPager Fragments( with tabs)

In android development, Navigation Drawer and Recycler View and tabs layout are some of the most popular interfaces that are used in apps. We often think to collaborate different types of layout in a single screen., with DrawerLayout, NavigationView, ViewPager, RecyclerView, CardView and TabLayout. With material design style, the theme can be combined in an Activity.


Firstly, add the design support library dependency to use Material Design Widgets, add RecyclerView dependency and CardView dependency to use them:

app/build.gradle
  1. apply plugin: 'com.android.application'

  2. android {
  3.     compileSdkVersion 24
  4.     buildToolsVersion "25.0.0"
  5.     defaultConfig {
  6.         applicationId "test.ku.codedivas.sampleapp"
  7.         minSdkVersion 14
  8.         targetSdkVersion 24
  9.         versionCode 1
  10.         versionName "1.0"
  11.         
  12. testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  13.     }
  14.     buildTypes {
  15.         release {
  16.             minifyEnabled false
  17.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  18.         }
  19.     }
  20. }

  21. dependencies {
  22.     compile fileTree(dir: 'libs', include: ['*.jar'])
  23.     androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
  24.         exclude group: 'com.android.support', module: 'support-annotations'
  25.     })
  26.     compile 'com.android.support:appcompat-v7:24.2.1'
  27.     compile 'com.android.support:design:24.2.1'
  28.     compile 'com.android.support:recyclerview-v7:24.2.0'
  29.     compile 'com.android.support:cardview-v7:24.2.0'
  30.     testCompile 'junit:junit:4.12'

  31. }

Add Search filter on Recycler View with CardView layout

In android development, this is about implementing the search filter with Edittext widget on  RecyclerView    having  CardView  layout. ...

Popular Posts