Search in sources :

Example 1 with EmptyView

use of com.battlelancer.seriesguide.widgets.EmptyView in project SeriesGuide by UweTrottmann.

the class TvdbAddFragment method setupEmptyView.

@Override
protected void setupEmptyView(EmptyView emptyView) {
    emptyView.setButtonText(R.string.action_try_any_language);
    emptyView.setButtonClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (shouldTryAnyLanguage && !TextUtils.isEmpty(language)) {
                // not set to any language: set to any language
                // spinner selection change triggers search
                shouldTryAnyLanguage = false;
                spinnerLanguage.setSelection(0);
            } else {
                // already set to any language or retrying, trigger search directly
                search();
            }
        }
    });
}
Also used : OnClickListener(android.view.View.OnClickListener) BindView(butterknife.BindView) View(android.view.View) AdapterView(android.widget.AdapterView) EmptyView(com.battlelancer.seriesguide.widgets.EmptyView)

Aggregations

View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 AdapterView (android.widget.AdapterView)1 BindView (butterknife.BindView)1 EmptyView (com.battlelancer.seriesguide.widgets.EmptyView)1