private void setupRetryLayout(
     OnLoadingAndRetryListener listener, LoadingAndRetryLayout loadingAndRetryLayout) {
   if (listener.isSetRetryLayout()) {
     int layoutId = listener.generateRetryLayoutId();
     if (layoutId != NO_LAYOUT_ID) {
       loadingAndRetryLayout.setLoadingView(layoutId);
     } else {
       loadingAndRetryLayout.setLoadingView(listener.generateRetryLayout());
     }
   } else {
     if (BASE_RETRY_LAYOUT_ID != NO_LAYOUT_ID)
       loadingAndRetryLayout.setRetryView(BASE_RETRY_LAYOUT_ID);
   }
 }