|
@ -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,18 +165,20 @@ 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()); |
|
|
subBoardViewHolder.boardLastPost.setOnClickListener(new View.OnClickListener() { |
|
|
if (!Objects.equals(subBoard.getLastPostUrl(), "")) { |
|
|
@Override |
|
|
subBoardViewHolder.boardLastPost.setOnClickListener(new View.OnClickListener() { |
|
|
public void onClick(View view) { |
|
|
@Override |
|
|
Intent intent = new Intent(context, TopicActivity.class); |
|
|
public void onClick(View view) { |
|
|
Bundle extras = new Bundle(); |
|
|
Intent intent = new Intent(context, TopicActivity.class); |
|
|
extras.putString(BUNDLE_TOPIC_URL, subBoard.getLastPostUrl()); |
|
|
Bundle extras = new Bundle(); |
|
|
//Doesn't put an already ellipsized topic title in Bundle
|
|
|
extras.putString(BUNDLE_TOPIC_URL, subBoard.getLastPostUrl()); |
|
|
intent.putExtras(extras); |
|
|
//Doesn't put an already ellipsized topic title in Bundle
|
|
|
intent.setFlags(FLAG_ACTIVITY_NEW_TASK); |
|
|
intent.putExtras(extras); |
|
|
context.startActivity(intent); |
|
|
intent.setFlags(FLAG_ACTIVITY_NEW_TASK); |
|
|
} |
|
|
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; |
|
|