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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations