Posts

Showing posts with the label RecyclerView

MaterialViewPager For Android

Image
Material Design ViewPager easy to use library compile ' com.github.florent37:materialviewpager:1.2.3 ' // dependencies compile ' com.flaviofaria:kenburnsview:1.0.7 ' compile ' com.jpardogo.materialtabstrip:library:1.1.0 ' compile ' com.github.bumptech.glide:glide:4.0.0 ' Usage Add MaterialViewPager to your activity's layout < com .github.florent37.materialviewpager.MaterialViewPager android : id = " @+id/materialViewPager " android : layout_width = " match_parent " android : layout_height = " match_parent " app : viewpager_logo = " @layout/header_logo " app : viewpager_logoMarginTop = " 100dp " app : viewpager_color = " @color/colorPrimary " app : viewpager_headerHeight = " 200dp " app : viewpager_headerAlpha = " 1.0 " app : viewpager_hideLogoWithFade = " false " app : viewpager_hideToolba...

Android RecyclerView with Endless Scrolling

Image
In this tutorial, we’ll be discussing and implementing Endless Scrolling or Infinite Scroll on RecyclerView in our Android Application. The infinite scrolling in which the next set of rows are fetched from the DB/Server while showing a loading icon is commonly seen in many applications such as Facebook, Twitter. Android RecyclerView Load More In order to show Loading icon at the bottom of RecyclerView while the next set of items are fetched, we need to use Multiple View Types in our RecyclerView Adapter. How is this implemented? Typically in a simple RecyclerView, we load elements to the adapter from a Data Structure. In order to show the loading icon view at the bottom of the RecyclerView, we need to first add a NULL element to the end of the Data Structure. Why NULL? In order to differentiate that element from the rest of the elements and show a different view type row. After adding a null, we notify the adapter the of the new element and fetch the next set of elem...

Facebook Shimmer Effect Android Example

Image
Shimmer  effect was created by Facebook to show loading status instead of showing ProgressBar. In this article, I’m going to take you through my journey of replacing the ProgressBar with Shimmer  effect. App Intro To replicate the Facebook Shimmer  animation, I built a simple app where we’re gonna execute movies fetching network request. We’re gonna hit an URL  and download Json data and show in a GridView. While application fetching movies instead of showing ProgressBar, we’re gonna show the Shimmering  effect and in successful or in error case stop the effect. Gradle Stuff Facebook Shimmer  effect requires us to add some more stuff to our application modules  build.gradle  file. We start by adding the following dependencies right after the  android  section: Recommended for you // Facebook shimmer effect dependency implementation 'com.facebook.shimmer:shimmer:0.1.0@aar' // Retrofit dependency implementation 'com.sq...