Search in sources :

Example 1 with EmptyView

use of com.voipgrid.vialer.EmptyView in project vialer-android by VoIPGRID.

the class CallRecordFragment method failedFeedback.

private void failedFeedback(Response response) {
    if (getActivity() == null) {
        new RemoteLogger(CallRecordFragment.class).enableConsoleLogging().e("CallRecordFragment is no longer attached to an activity");
        return;
    }
    String message = getString(R.string.empty_view_default_message);
    // Check if authorized.
    if (response != null && (response.code() == 401 || response.code() == 403)) {
        message = getString(R.string.empty_view_unauthorized_message);
    }
    if (mAdapter.getCount() == 0) {
        setEmptyView(new EmptyView(getActivity(), message), true);
    } else {
        // Adapter has cached values and we're not about to overwrite them. However,
        // we do want to notify the user.
        Snackbar.make(getView(), message, Snackbar.LENGTH_SHORT).show();
    }
    mSwipeRefreshLayout.setRefreshing(false);
}
Also used : RemoteLogger(com.voipgrid.vialer.logging.RemoteLogger) EmptyView(com.voipgrid.vialer.EmptyView)

Aggregations

EmptyView (com.voipgrid.vialer.EmptyView)1 RemoteLogger (com.voipgrid.vialer.logging.RemoteLogger)1