Changeset View
Changeset View
Standalone View
Standalone View
src/it/reyboz/bustorino/fragments/MainScreenFragment.java
Show First 20 Lines • Show All 461 Lines • ▼ Show 20 Lines | public void onSearchClick(View v) { | ||||
fragmentHelper.stopLastRequestIfNeeded(true); | fragmentHelper.stopLastRequestIfNeeded(true); | ||||
requestArrivalsForStopID(busStopID); | requestArrivalsForStopID(busStopID); | ||||
} else { // searchMode == SEARCH_BY_NAME | } else { // searchMode == SEARCH_BY_NAME | ||||
String query = busStopSearchByNameEditText.getText().toString(); | String query = busStopSearchByNameEditText.getText().toString(); | ||||
query = query.trim(); | query = query.trim(); | ||||
if(getContext()!=null) { | if(getContext()!=null) { | ||||
if (query.length() < 1) { | if (query.length() < 1) { | ||||
Toast.makeText(getContext(), R.string.insert_bus_stop_name_error, Toast.LENGTH_SHORT).show(); | Toast.makeText(getContext(), R.string.insert_bus_stop_name_error, Toast.LENGTH_SHORT).show(); | ||||
} else if(query.length()< 3){ | } else if(query.length()< 2){ | ||||
valerio.bozzolan: This may deserve a constant but, who cares
asd | |||||
Toast.makeText(getContext(), R.string.query_too_short, Toast.LENGTH_SHORT).show(); | Toast.makeText(getContext(), R.string.query_too_short, Toast.LENGTH_SHORT).show(); | ||||
} | } | ||||
else { | else { | ||||
fragmentHelper.stopLastRequestIfNeeded(true); | fragmentHelper.stopLastRequestIfNeeded(true); | ||||
new AsyncStopsSearcher(fragmentHelper, stopsFinderByNames).execute(query); | new AsyncStopsSearcher(fragmentHelper, stopsFinderByNames).execute(query); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 266 Lines • ▼ Show 20 Lines | class NearbyStopsRequester implements Runnable { | ||||
} else if(!haveProviders){ | } else if(!haveProviders){ | ||||
Log.e(DEBUG_TAG, "NO PROVIDERS FOR POSITION"); | Log.e(DEBUG_TAG, "NO PROVIDERS FOR POSITION"); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |
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
This may deserve a constant but, who cares