private void setupEmptyLayout( OnLoadingAndRetryListener listener, LoadingAndRetryLayout loadingAndRetryLayout) { if (listener.isSetEmptyLayout()) { int layoutId = listener.generateEmptyLayoutId(); if (layoutId != NO_LAYOUT_ID) { loadingAndRetryLayout.setEmptyView(layoutId); } else { loadingAndRetryLayout.setEmptyView(listener.generateEmptyLayout()); } } else { if (BASE_EMPTY_LAYOUT_ID != NO_LAYOUT_ID) loadingAndRetryLayout.setEmptyView(BASE_EMPTY_LAYOUT_ID); } }