diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/BestPostRecyclerViewAdapter.java | 39 | ||||
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java | 4 |
2 files changed, 3 insertions, 40 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/BestPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/BestPostRecyclerViewAdapter.java index ed3fd0dd..38838a00 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/BestPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/BestPostRecyclerViewAdapter.java @@ -535,43 +535,4 @@ class BestPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerView.View } } } - - /*private static class LoadSubredditIconAsyncTask extends AsyncTask<Void, Void, Void> { - private final WeakReference<Context> contextWeakReference; - private final WeakReference<CircleImageView> circleImageViewWeakReference; - - private SubredditDao subredditDao; - private String subredditName; - private String iconImageUrl; - - LoadSubredditIconAsyncTask(Context context, CircleImageView iconImageView, SubredditDao subredditDao, String subredditName) { - contextWeakReference = new WeakReference<>(context); - circleImageViewWeakReference = new WeakReference<>(iconImageView); - this.subredditDao = subredditDao; - this.subredditName = subredditName; - } - - @Override - protected Void doInBackground(Void... voids) { - if(subredditDao.getSubredditData(subredditName) != null) { - iconImageUrl = subredditDao.getSubredditData(subredditName).getIconUrl(); - } - return null; - } - - @Override - protected void onPostExecute(Void aVoid) { - super.onPostExecute(aVoid); - Context context = contextWeakReference.get(); - CircleImageView circleImageView = circleImageViewWeakReference.get(); - - if(context != null && circleImageView != null) { - if(iconImageUrl != null) { - Glide.with(context).load(iconImageUrl).into(circleImageView); - } else { - Glide.with(context).load(R.drawable.subreddit_default_icon).into(circleImageView); - } - } - } - }*/ } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java index c65d5ab8..3245ddf9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java @@ -141,8 +141,10 @@ public class ViewPostDetailActivity extends AppCompatActivity { @Override public void onClick(View view) { Intent intent = new Intent(ViewPostDetailActivity.this, ViewImageActivity.class); - intent.putExtra(ViewImageActivity.IMAGE_URL_KEY, mPostData.getPreviewUrl()); + intent.putExtra(ViewImageActivity.IMAGE_URL_KEY, mPostData.getUrl()); intent.putExtra(ViewImageActivity.TITLE_KEY, mPostData.getTitle()); + intent.putExtra(ViewImageActivity.SUBREDDIT_KEY, mPostData.getSubredditName()); + intent.putExtra(ViewImageActivity.ID_KEY, mPostData.getId()); startActivity(intent); } }); |