public static void drawDataUpLeagueNLive() { boolean isLive = MatchActivity.sharedPreferences.getBoolean(PREFERENCE_CONF.IS_LIVE, true); boolean isLeague = MatchActivity.sharedPreferences.getBoolean(PREFERENCE_CONF.IS_LEAGUE, true); items.removeAll(items); adapter.notifyDataSetChanged(); if (isLeague == false) if (isLive) drawCountryMatchDataByLive(true); else drawCountryMatchDataByLive(false); else if (isLive) drawLeagueMatchDataByLive(true); else drawLeagueMatchDataByLive(false); }
public static void drawCountryMatchDataByLive(boolean isLive) { if (MainActivity.matches.size() <= 0) return; int sizeStatus = CONFIG.MATCH_STATUS.length; for (int i = 0; i < sizeStatus; i++) { if (isLive == true && i > 0) break; String matchStatus = CONFIG.MATCH_STATUS[i]; ArrayList<matchDb> matches = xmlData.getMatchByStatus(MainActivity.matches, matchStatus); if (matches.size() <= 0) continue; items.add(new MatchHeadingItem(matchStatus)); for (matchDb match : matches) items.add(new MatchEntryItem(match)); } adapter.notifyDataSetChanged(); }