Browse Source

Unread posts tab minor fix

pull/24/head
Apostolos Fanakis 8 years ago
parent
commit
4f99f9b296
  1. 4
      app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

4
app/src/main/java/gr/thmmy/mthmmy/activities/main/unread/UnreadFragment.java

@ -5,6 +5,7 @@ import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout; import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.DividerItemDecoration; import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -146,6 +147,7 @@ public class UnreadFragment extends BaseFragment {
Elements unread = document.select("table.bordercolor[cellspacing=1] tr:not(.titlebg)"); Elements unread = document.select("table.bordercolor[cellspacing=1] tr:not(.titlebg)");
if (!unread.isEmpty()) { if (!unread.isEmpty()) {
topicSummaries.clear(); topicSummaries.clear();
Log.d("UnreadFragment", unread.html());
for (Element row : unread) { for (Element row : unread) {
Elements information = row.select("td"); Elements information = row.select("td");
String link = information.get(2).select("a").first().attr("href"); String link = information.get(2).select("a").first().attr("href");
@ -154,7 +156,7 @@ public class UnreadFragment extends BaseFragment {
Element lastUserAndDate = information.get(6); Element lastUserAndDate = information.get(6);
String lastUser = lastUserAndDate.select("a").text(); String lastUser = lastUserAndDate.select("a").text();
String dateTime = lastUserAndDate.select("span").html(); String dateTime = lastUserAndDate.select("span").html();
dateTime = dateTime.substring(3, dateTime.indexOf("<b")); dateTime = dateTime.substring(3, dateTime.indexOf("<br>"));
dateTime = dateTime.replace("</b>", ""); dateTime = dateTime.replace("</b>", "");
topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime)); topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime));

Loading…
Cancel
Save