Android hub

Let’s implement Android Data Binding library in your android app: Part-1

Android Data Binding is one of the most interesting feature recently introduced but still in beta version.

Android Data Binding exist between app presentation layer and data model layer that holds the information to show. Read more


IMPLEMENT ANDROID DATA BINDING LIBRARY IN YOUR ANDROID APP: PART-2

Data-binding layout files are slightly different and start with a root tag of layout followed by a data element and a view root element. This view element is what your root would be in a non-binding layout file..Read More 


 

RECYCLERVIEW WITH ENDLESSSCROLL WITH ANDROID DATA BINDING

A common application feature is to load automatically more items as the user scrolls through the items (aka infinite scroll). This is done by triggering a request for more data once the user crosses a threshold of remaining items before they’ve hit the end.

Implementing endless pagination for RecyclerView requires the following steps:

  1. Copy over the EndlessRecyclerViewOnScrollListener.java into your application. This is an abstract class.
  2. Now call addOnScrollListener() on your RecyclerView to enable endless scrolling and pass EndlessRecyclerViewOnScollListener as parameter in addOnScrollListener() and implement onLoadMore() method which would be called when user scroll down bottom in the list.
  3. In onLoadMore() method load your data using an api or some source from where you are fetching data. Read More