|
@ -189,7 +189,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo |
|
|
* parameter!</p> |
|
|
* parameter!</p> |
|
|
*/ |
|
|
*/ |
|
|
private class BoardTask extends ParseTask { |
|
|
private class BoardTask extends ParseTask { |
|
|
ArrayList<Board> tempSubboards = new ArrayList<>(); |
|
|
ArrayList<Board> tempSubBoards = new ArrayList<>(); |
|
|
ArrayList<Topic> tempTopics = new ArrayList<>(); |
|
|
ArrayList<Topic> tempTopics = new ArrayList<>(); |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
@ -200,7 +200,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo |
|
|
|
|
|
|
|
|
@Override //TODO should throw ParseException
|
|
|
@Override //TODO should throw ParseException
|
|
|
public void parse(Document boardPage) throws ParseException { |
|
|
public void parse(Document boardPage) throws ParseException { |
|
|
tempSubboards.addAll(parsedSubBoards); |
|
|
tempSubBoards.addAll(parsedSubBoards); |
|
|
tempTopics.addAll(parsedTopics); |
|
|
tempTopics.addAll(parsedTopics); |
|
|
//Removes loading item
|
|
|
//Removes loading item
|
|
|
if (isLoadingMore && tempTopics.size() > 0) |
|
|
if (isLoadingMore && tempTopics.size() > 0) |
|
@ -292,7 +292,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if(!parsingFailed) |
|
|
if(!parsingFailed) |
|
|
tempSubboards.add(new Board(pUrl, pTitle, pMods, pStats, pLastPost, pLastPostUrl)); |
|
|
tempSubBoards.add(new Board(pUrl, pTitle, pMods, pStats, pLastPost, pLastPostUrl)); |
|
|
else |
|
|
else |
|
|
Timber.e("Parsing failed (pLastPost came with: \"%s\", subBoardColumns html was \"%s\")", pLastPost, subBoardColumns); |
|
|
Timber.e("Parsing failed (pLastPost came with: \"%s\", subBoardColumns html was \"%s\")", pLastPost, subBoardColumns); |
|
|
} |
|
|
} |
|
@ -333,7 +333,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
pLastPostUrl = topicColumns.last().select("a:has(img)").first().attr("href"); |
|
|
pLastPostUrl = topicColumns.get(6).select("a:has(img)").first().attr("href"); |
|
|
tempTopics.add(new Topic(pTopicUrl, pSubject, pStarter, pLastUser, pLastPostDateTime, pLastPostUrl, |
|
|
tempTopics.add(new Topic(pTopicUrl, pSubject, pStarter, pLastUser, pLastPostDateTime, pLastPostUrl, |
|
|
pStats, pLocked, pSticky, pUnread)); |
|
|
pStats, pLocked, pSticky, pUnread)); |
|
|
} |
|
|
} |
|
@ -356,7 +356,7 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo |
|
|
parsedTopics.clear(); |
|
|
parsedTopics.clear(); |
|
|
parsedSubBoards.clear(); |
|
|
parsedSubBoards.clear(); |
|
|
parsedTopics.addAll(tempTopics); |
|
|
parsedTopics.addAll(tempTopics); |
|
|
parsedSubBoards.addAll(tempSubboards); |
|
|
parsedSubBoards.addAll(tempSubBoards); |
|
|
boardAdapter.notifyDataSetChanged(); |
|
|
boardAdapter.notifyDataSetChanged(); |
|
|
|
|
|
|
|
|
//Parse was successful
|
|
|
//Parse was successful
|
|
|