Search in sources :

Example 1 with NoDataView

use of com.thebluealliance.androidclient.views.NoDataView in project the-blue-alliance-android by the-blue-alliance.

the class RecentNotificationsFragment method onCreateView.

@Override
@Nullable
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.fragment_recent_notifications, null);
    mBinder.setRootView(v);
    mBinder.setRecyclerViewBinderMapper(this);
    mRecyclerView = (RecyclerView) v.findViewById(R.id.list);
    mRecyclerView.setHasFixedSize(true);
    mRecyclerView.setItemAnimator(new DefaultItemAnimator());
    mLayoutManager = new LinearLayoutManager(getContext());
    mRecyclerView.setLayoutManager(mLayoutManager);
    ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.progress);
    if (mAdapter != null) {
        mRecyclerView.setAdapter(mAdapter);
        mLayoutManager.onRestoreInstanceState(mListState);
        progressBar.setVisibility(View.GONE);
    }
    mBinder.setNoDataView((NoDataView) v.findViewById(R.id.no_data));
    return v;
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) NoDataView(com.thebluealliance.androidclient.views.NoDataView) ScoreNotificationItemView(com.thebluealliance.androidclient.itemviews.ScoreNotificationItemView) View(android.view.View) AllianceSelectionNotificationItemView(com.thebluealliance.androidclient.itemviews.AllianceSelectionNotificationItemView) RecyclerView(androidx.recyclerview.widget.RecyclerView) CompLevelStartingNotificationItemView(com.thebluealliance.androidclient.itemviews.CompLevelStartingNotificationItemView) AwardsPostedNotificationItemView(com.thebluealliance.androidclient.itemviews.AwardsPostedNotificationItemView) UpcomingMatchNotificationItemView(com.thebluealliance.androidclient.itemviews.UpcomingMatchNotificationItemView) GenericNotificationItemView(com.thebluealliance.androidclient.itemviews.GenericNotificationItemView) ScheduleUpdatedNotificationItemView(com.thebluealliance.androidclient.itemviews.ScheduleUpdatedNotificationItemView) ProgressBar(android.widget.ProgressBar) DefaultItemAnimator(androidx.recyclerview.widget.DefaultItemAnimator) Nullable(androidx.annotation.Nullable)

Example 2 with NoDataView

use of com.thebluealliance.androidclient.views.NoDataView in project the-blue-alliance-android by the-blue-alliance.

the class RecyclerViewFragment method onCreateView.

@Override
@Nullable
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v;
    // to do it programmatically.
    if (shouldShowScrollbars()) {
        v = inflater.inflate(R.layout.recycler_view_with_spinner, null);
    } else {
        v = inflater.inflate(R.layout.recycler_view_with_spinner_no_scrollbar, null);
    }
    mBinder.setRootView(v);
    mBinder.setRecyclerViewBinderMapper(this);
    mRecyclerView = (RecyclerView) v.findViewById(R.id.list);
    mRecyclerView.setHasFixedSize(true);
    if (shouldShowDividers()) {
        mRecyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL_LIST));
    }
    mLayoutManager = new LinearLayoutManager(getContext());
    mRecyclerView.setLayoutManager(mLayoutManager);
    ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.progress);
    if (mAdapter != null) {
        mRecyclerView.setAdapter(mAdapter);
        mLayoutManager.onRestoreInstanceState(mListState);
        progressBar.setVisibility(View.GONE);
    }
    mBinder.setNoDataView((NoDataView) v.findViewById(R.id.no_data));
    return v;
}
Also used : DividerItemDecoration(com.thebluealliance.androidclient.DividerItemDecoration) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) NoDataView(com.thebluealliance.androidclient.views.NoDataView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) ProgressBar(android.widget.ProgressBar) Nullable(androidx.annotation.Nullable)

Example 3 with NoDataView

use of com.thebluealliance.androidclient.views.NoDataView in project the-blue-alliance-android by the-blue-alliance.

the class ExpandableListViewFragment method onCreateView.

@Override
@Nullable
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.expandable_list_view_with_spinner, null);
    mBinder.setRootView(v);
    mExpandableListView = (ExpandableListView) v.findViewById(R.id.expandable_list);
    ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.progress);
    if (mAdapter != null) {
        mExpandableListView.setAdapter(mAdapter);
        mExpandableListView.onRestoreInstanceState(mListState);
        mExpandableListView.setSelection(mFirstVisiblePosition);
        progressBar.setVisibility(View.GONE);
    }
    mBinder.setNoDataView((NoDataView) v.findViewById(R.id.no_data));
    return v;
}
Also used : ExpandableListView(com.thebluealliance.androidclient.views.ExpandableListView) NoDataView(com.thebluealliance.androidclient.views.NoDataView) View(android.view.View) ProgressBar(android.widget.ProgressBar) Nullable(androidx.annotation.Nullable)

Example 4 with NoDataView

use of com.thebluealliance.androidclient.views.NoDataView in project the-blue-alliance-android by the-blue-alliance.

the class EventDistrictPointsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.list_view_with_spinner, null);
    mBinder.setRootView(v);
    mListView = (ListView) v.findViewById(R.id.list);
    ProgressBar progressBar = (ProgressBar) v.findViewById(R.id.progress);
    TextView nonDistrictWarning = (TextView) v.findViewById(R.id.info_container);
    if (mAdapter != null) {
        mListView.setAdapter(mAdapter);
        mListView.onRestoreInstanceState(mListState);
        progressBar.setVisibility(View.GONE);
    }
    mBinder.nonDistrictWarning = nonDistrictWarning;
    mBinder.setNoDataView((NoDataView) v.findViewById(R.id.no_data));
    // disable touch feedback (you can't click the elements here...)
    mListView.setCacheColorHint(getResources().getColor(android.R.color.transparent));
    mListView.setSelector(R.drawable.transparent);
    return v;
}
Also used : TextView(android.widget.TextView) TextView(android.widget.TextView) NoDataView(com.thebluealliance.androidclient.views.NoDataView) View(android.view.View) ListView(android.widget.ListView) ProgressBar(android.widget.ProgressBar)

Example 5 with NoDataView

use of com.thebluealliance.androidclient.views.NoDataView in project the-blue-alliance-android by the-blue-alliance.

the class EventStatsFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    // Setup views & listeners
    View view = inflater.inflate(R.layout.fragment_event_stats, null);
    mBinder.setRootView(view);
    mListView = (ListView) view.findViewById(R.id.list);
    mRadioGroup = (RadioGroup) view.findViewById(R.id.stats_type_selector);
    ProgressBar mProgressBar = (ProgressBar) view.findViewById(R.id.progress);
    // Or get data if viewing fragment for the first time.
    if (mAdapter != null) {
        mListView.setAdapter(mAdapter);
        mListView.onRestoreInstanceState(mListState);
        mRadioGroup.restoreHierarchyState(mRadioState);
        mProgressBar.setVisibility(View.GONE);
    }
    mBinder.setNoDataView((NoDataView) view.findViewById(R.id.no_data));
    mListView.setOnItemClickListener((adapterView, view1, position, id) -> {
        if (!(adapterView.getAdapter() instanceof ListViewAdapter) || position >= adapterView.getAdapter().getCount() || !(((ListViewAdapter) adapterView.getAdapter()).getItem(position) instanceof ListElement)) {
            TbaLogger.d("Can't open stat item");
            return;
        }
        String teamKey = ((ListElement) ((ListViewAdapter) adapterView.getAdapter()).getItem(position)).getKey();
        if (TeamHelper.validateTeamKey(teamKey) ^ TeamHelper.validateMultiTeamKey(teamKey)) {
            teamKey = TeamHelper.baseTeamKey(teamKey);
            startActivity(TeamAtEventActivity.newInstance(getActivity(), mEventKey, teamKey));
        }
    });
    return view;
}
Also used : ListViewAdapter(com.thebluealliance.androidclient.adapters.ListViewAdapter) ListElement(com.thebluealliance.androidclient.listitems.ListElement) NoDataView(com.thebluealliance.androidclient.views.NoDataView) View(android.view.View) ListView(android.widget.ListView) ProgressBar(android.widget.ProgressBar)

Aggregations

View (android.view.View)10 NoDataView (com.thebluealliance.androidclient.views.NoDataView)10 ProgressBar (android.widget.ProgressBar)7 Nullable (androidx.annotation.Nullable)5 ListView (android.widget.ListView)3 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)2 RecyclerView (androidx.recyclerview.widget.RecyclerView)2 ExpandableListView (com.thebluealliance.androidclient.views.ExpandableListView)2 TextView (android.widget.TextView)1 DefaultItemAnimator (androidx.recyclerview.widget.DefaultItemAnimator)1 DividerItemDecoration (com.thebluealliance.androidclient.DividerItemDecoration)1 ListViewAdapter (com.thebluealliance.androidclient.adapters.ListViewAdapter)1 AllianceSelectionNotificationItemView (com.thebluealliance.androidclient.itemviews.AllianceSelectionNotificationItemView)1 AwardsPostedNotificationItemView (com.thebluealliance.androidclient.itemviews.AwardsPostedNotificationItemView)1 CompLevelStartingNotificationItemView (com.thebluealliance.androidclient.itemviews.CompLevelStartingNotificationItemView)1 GenericNotificationItemView (com.thebluealliance.androidclient.itemviews.GenericNotificationItemView)1 ScheduleUpdatedNotificationItemView (com.thebluealliance.androidclient.itemviews.ScheduleUpdatedNotificationItemView)1 ScoreNotificationItemView (com.thebluealliance.androidclient.itemviews.ScoreNotificationItemView)1 UpcomingMatchNotificationItemView (com.thebluealliance.androidclient.itemviews.UpcomingMatchNotificationItemView)1 ListElement (com.thebluealliance.androidclient.listitems.ListElement)1