aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2018-09-22 03:09:57 +0000
committerAlex Ning <chineseperson5@gmail.com>2018-09-22 03:09:57 +0000
commita7d4485fc18452b3897a95b4de152707d9209a39 (patch)
tree846338eeb3e58ab7823b394415069b3cc7d09c29
parentfc356c6505d5ee40e719e5b17e3a8a49ac8128c6 (diff)
downloadinfinity-for-reddit-a7d4485fc18452b3897a95b4de152707d9209a39.tar
infinity-for-reddit-a7d4485fc18452b3897a95b4de152707d9209a39.tar.gz
infinity-for-reddit-a7d4485fc18452b3897a95b4de152707d9209a39.tar.bz2
infinity-for-reddit-a7d4485fc18452b3897a95b4de152707d9209a39.tar.lz
infinity-for-reddit-a7d4485fc18452b3897a95b4de152707d9209a39.tar.xz
infinity-for-reddit-a7d4485fc18452b3897a95b4de152707d9209a39.tar.zst
infinity-for-reddit-a7d4485fc18452b3897a95b4de152707d9209a39.zip
Click the subreddit icon or the subreddit name to view the subreddit's details in ViewPostDetailActivity.
Diffstat (limited to '')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
index 22950bc5..74776f31 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java
@@ -125,6 +125,19 @@ public class ViewPostDetailActivity extends AppCompatActivity {
Glide.with(this).load(R.drawable.subreddit_default_icon).into(subredditIconCircleImageView);
}
+ subredditIconCircleImageView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(ViewPostDetailActivity.this, ViewSubredditDetailActivity.class);
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY,
+ mPostData.getSubredditNamePrefixed().substring(2));
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_VALUE_KEY,
+ mPostData.getSubredditNamePrefixed());
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_QUERY_BY_ID_KEY, false);
+ startActivity(intent);
+ }
+ });
+
switch (mPostData.getVoteType()) {
case 1:
//Upvote
@@ -167,6 +180,19 @@ public class ViewPostDetailActivity extends AppCompatActivity {
mRecyclerView.addItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.VERTICAL));
subredditTextView.setText(mPostData.getSubredditNamePrefixed());
+ subredditTextView.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent(ViewPostDetailActivity.this, ViewSubredditDetailActivity.class);
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY,
+ mPostData.getSubredditNamePrefixed().substring(2));
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_VALUE_KEY,
+ mPostData.getSubredditNamePrefixed());
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_QUERY_BY_ID_KEY, false);
+ startActivity(intent);
+ }
+ });
+
postTimeTextView.setText(mPostData.getPostTime());
if(mPostData.getGilded() > 0) {