Permalink
Browse files

Only allow item selection if orgs are non-empty

The org count being empty means they did not successfully
load so don't allow further navigation in this case.
  • Loading branch information...
kevinsawicki committed Sep 17, 2012
1 parent 8d1a5b8 commit bea5c05a98e517455027c09c6fc886771419723d
@@ -216,7 +216,7 @@ public boolean onNavigationItemSelected(int itemPosition, long itemId) {
if (homeAdapter.isOrgPosition(itemPosition)) {
homeAdapter.setSelected(itemPosition);
setOrg(orgs.get(itemPosition));
- } else {
+ } else if (homeAdapter.getOrgCount() > 0) {
switch (homeAdapter.getAction(itemPosition)) {
case ACTION_GISTS:
startActivity(new Intent(this, GistsActivity.class));
@@ -83,7 +83,7 @@ public HomeDropdownListAdapter(final Context context,
*
* @return org count
*/
- private int getOrgCount() {
+ public int getOrgCount() {
return getCount() - NON_ORG_ITEMS;
}

0 comments on commit bea5c05

Please sign in to comment.