Browse Source

Minor fixes

pull/24/head
Apostolos Fanakis 8 years ago
parent
commit
b3d17994c3
  1. 8
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java
  2. 3
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java

8
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java

@ -218,14 +218,18 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
pLastPost.substring(pLastPost.indexOf(" in ") + 1, pLastPost.indexOf(" by ")) + pLastPost.substring(pLastPost.indexOf(" in ") + 1, pLastPost.indexOf(" by ")) +
"\n" + "\n" +
pLastPost.substring(pLastPost.lastIndexOf(" by ") + 1); pLastPost.substring(pLastPost.lastIndexOf(" by ") + 1);
} else { pLastPostUrl = subBoardCol.select("a").first().attr("href");
} else if (pLastPost.contains(" σε ")) {
pLastPost = pLastPost.substring(0, pLastPost.indexOf(" σε ")) + pLastPost = pLastPost.substring(0, pLastPost.indexOf(" σε ")) +
"\n" + "\n" +
pLastPost.substring(pLastPost.indexOf(" σε ") + 1, pLastPost.indexOf(" από ")) + pLastPost.substring(pLastPost.indexOf(" σε ") + 1, pLastPost.indexOf(" από ")) +
"\n" + "\n" +
pLastPost.substring(pLastPost.lastIndexOf(" από ") + 1); pLastPost.substring(pLastPost.lastIndexOf(" από ") + 1);
}
pLastPostUrl = subBoardCol.select("a").first().attr("href"); pLastPostUrl = subBoardCol.select("a").first().attr("href");
} else {
pLastPost = "No posts yet.";
pLastPostUrl = "";
}
} else { } else {
pUrl = subBoardCol.select("a").first().attr("href"); pUrl = subBoardCol.select("a").first().attr("href");
pTitle = subBoardCol.select("a").first().text(); pTitle = subBoardCol.select("a").first().text();

3
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardAdapter.java

@ -14,6 +14,7 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Objects;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.topic.TopicActivity; import gr.thmmy.mthmmy.activities.topic.TopicActivity;
@ -164,6 +165,7 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
subBoardViewHolder.boardMods.setText(subBoard.getMods()); subBoardViewHolder.boardMods.setText(subBoard.getMods());
subBoardViewHolder.boardStats.setText(subBoard.getStats()); subBoardViewHolder.boardStats.setText(subBoard.getStats());
subBoardViewHolder.boardLastPost.setText(subBoard.getLastPost()); subBoardViewHolder.boardLastPost.setText(subBoard.getLastPost());
if (!Objects.equals(subBoard.getLastPostUrl(), "")) {
subBoardViewHolder.boardLastPost.setOnClickListener(new View.OnClickListener() { subBoardViewHolder.boardLastPost.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -176,6 +178,7 @@ class BoardAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
context.startActivity(intent); context.startActivity(intent);
} }
}); });
}
} else if (holder instanceof TopicViewHolder) { } else if (holder instanceof TopicViewHolder) {
final Topic topic = parsedTopics.get(position - parsedSubBoards.size() - 1 - 1); final Topic topic = parsedTopics.get(position - parsedSubBoards.size() - 1 - 1);
final TopicViewHolder topicViewHolder = (TopicViewHolder) holder; final TopicViewHolder topicViewHolder = (TopicViewHolder) holder;

Loading…
Cancel
Save