use of com.instructure.pandarecycler.interfaces.EmptyInterface in project instructure-android by instructure.
the class RecyclerViewUtils method buildRecyclerView.
// Sync
public static RecyclerView buildRecyclerView(View rootView, final Context context, final SyncRecyclerAdapter recyclerAdapter, final SyncPresenter presenter, int swipeToRefreshLayoutResId, int recyclerViewResId, int emptyViewResId, String emptyViewText) {
EmptyInterface emptyInterface = (EmptyInterface) rootView.findViewById(emptyViewResId);
RecyclerView recyclerView = (RecyclerView) rootView.findViewById(recyclerViewResId);
emptyInterface.setTitleText(emptyViewText);
emptyInterface.setNoConnectionText(context.getString(R.string.noConnection));
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(recyclerAdapter);
final SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(swipeToRefreshLayoutResId);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (!com.instructure.pandautils.utils.Utils.isNetworkAvailable(context)) {
swipeRefreshLayout.setRefreshing(false);
} else {
presenter.refresh(true);
}
}
});
return recyclerView;
}
use of com.instructure.pandarecycler.interfaces.EmptyInterface in project instructure-android by instructure.
the class RecyclerViewUtils method buildRecyclerView.
public static RecyclerView buildRecyclerView(View rootView, final Context context, final SyncExpandableRecyclerAdapter recyclerAdapter, final SyncExpandablePresenter presenter, int swipeToRefreshLayoutResId, int recyclerViewResId, int emptyViewResId, String emptyViewText) {
EmptyInterface emptyInterface = (EmptyInterface) rootView.findViewById(emptyViewResId);
RecyclerView recyclerView = (RecyclerView) rootView.findViewById(recyclerViewResId);
emptyInterface.setTitleText(emptyViewText);
emptyInterface.setNoConnectionText(context.getString(R.string.noConnection));
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(recyclerAdapter);
final SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(swipeToRefreshLayoutResId);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (!com.instructure.pandautils.utils.Utils.isNetworkAvailable(context)) {
swipeRefreshLayout.setRefreshing(false);
} else {
presenter.refresh(true);
}
}
});
return recyclerView;
}
use of com.instructure.pandarecycler.interfaces.EmptyInterface in project instructure-android by instructure.
the class RecyclerViewUtils method buildRecyclerView.
public static RecyclerView buildRecyclerView(View rootView, final Context context, final SyncRecyclerAdapter recyclerAdapter, final SyncPresenter presenter, int swipeToRefreshLayoutResId, int recyclerViewResId, int emptyViewResId, String emptyViewText) {
EmptyInterface emptyInterface = (EmptyInterface) rootView.findViewById(emptyViewResId);
RecyclerView recyclerView = (RecyclerView) rootView.findViewById(recyclerViewResId);
emptyInterface.setTitleText(emptyViewText);
emptyInterface.setNoConnectionText(context.getString(R.string.noConnection));
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(recyclerAdapter);
final SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(swipeToRefreshLayoutResId);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (!com.instructure.pandautils.utils.Utils.isNetworkAvailable(context)) {
swipeRefreshLayout.setRefreshing(false);
} else {
presenter.refresh(true);
}
}
});
return recyclerView;
}
use of com.instructure.pandarecycler.interfaces.EmptyInterface in project instructure-android by instructure.
the class RecyclerViewUtils method buildRecyclerView.
public static RecyclerView buildRecyclerView(View rootView, final Context context, final SyncExpandableRecyclerAdapter recyclerAdapter, final SyncExpandablePresenter presenter, int swipeToRefreshLayoutResId, int recyclerViewResId, int emptyViewResId, String emptyViewText) {
EmptyInterface emptyInterface = (EmptyInterface) rootView.findViewById(emptyViewResId);
RecyclerView recyclerView = (RecyclerView) rootView.findViewById(recyclerViewResId);
emptyInterface.setTitleText(emptyViewText);
emptyInterface.setNoConnectionText(context.getString(R.string.noConnection));
LinearLayoutManager layoutManager = new LinearLayoutManager(context);
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(recyclerAdapter);
final SwipeRefreshLayout swipeRefreshLayout = (SwipeRefreshLayout) rootView.findViewById(swipeToRefreshLayoutResId);
swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
if (!com.instructure.pandautils.utils.Utils.isNetworkAvailable(context)) {
swipeRefreshLayout.setRefreshing(false);
} else {
presenter.refresh(true);
}
}
});
return recyclerView;
}
Aggregations