Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/fragments/NearbyStopsFragment.java
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | public class NearbyStopsFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> { | ||||
/** | /** | ||||
* Call when you need to switch the type of fragment | * Call when you need to switch the type of fragment | ||||
*/ | */ | ||||
private void switchFragmentType(){ | private void switchFragmentType(){ | ||||
if(fragment_type==TYPE_ARRIVALS){ | if(fragment_type==TYPE_ARRIVALS){ | ||||
setFragmentType(TYPE_STOPS); | setFragmentType(TYPE_STOPS); | ||||
switchButton.setText(getString(R.string.show_arrivals)); | switchButton.setText(getString(R.string.show_arrivals)); | ||||
titleTextView.setText(getString(R.string.nearby_stops_message)); | titleTextView.setText(getString(R.string.nearby_stops_message)); | ||||
if(arrivalsManager!=null) | |||||
arrivalsManager.cancelAllRequests(); | arrivalsManager.cancelAllRequests(); | ||||
if(dataAdapter!=null) | if(dataAdapter!=null) | ||||
gridRecyclerView.setAdapter(dataAdapter); | gridRecyclerView.setAdapter(dataAdapter); | ||||
} else if (fragment_type==TYPE_STOPS){ | } else if (fragment_type==TYPE_STOPS){ | ||||
setFragmentType(TYPE_ARRIVALS); | setFragmentType(TYPE_ARRIVALS); | ||||
titleTextView.setText(getString(R.string.nearby_arrivals_message)); | titleTextView.setText(getString(R.string.nearby_arrivals_message)); | ||||
switchButton.setText(getString(R.string.show_stops)); | switchButton.setText(getString(R.string.show_stops)); | ||||
if(arrivalsStopAdapter!=null) | if(arrivalsStopAdapter!=null) | ||||
▲ Show 20 Lines • Show All 275 Lines • Show Last 20 Lines |
Public contents are in Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) or GNU Free Documentation License (at your option) unless otherwise noted. · Contact / Register