From acc08489fa9df2519608dbfaa08b18a33b93c9d8 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 26 Feb 2019 22:16:34 +0800 Subject: Fixed the error drawable of glide image loading has not been done rounded corners transformation. --- .../ml/docilealligator/infinityforreddit/MainActivity.java | 6 ++++-- .../infinityforreddit/PostRecyclerViewAdapter.java | 12 ++++++++---- .../SubredditListingRecyclerViewAdapter.java | 5 ++++- .../SubscribedSubredditRecyclerViewAdapter.java | 7 ++++--- .../infinityforreddit/SubscribedUserRecyclerViewAdapter.java | 7 ++++--- .../infinityforreddit/UserListingRecyclerViewAdapter.java | 3 ++- .../infinityforreddit/ViewPostDetailActivity.java | 6 ++++-- .../infinityforreddit/ViewSubredditDetailActivity.java | 3 ++- .../infinityforreddit/ViewUserDetailActivity.java | 3 ++- 9 files changed, 34 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java index 095e802a..1989a47d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/MainActivity.java @@ -199,7 +199,8 @@ public class MainActivity extends AppCompatActivity { if (!mProfileImageUrl.equals("")) { glide.load(mProfileImageUrl) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(144, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(144, 0)))) .into(mProfileImageView); } else { glide.load(R.drawable.subreddit_default_icon) @@ -259,7 +260,8 @@ public class MainActivity extends AppCompatActivity { if (!profileImageUrl.equals("")) { glide.load(profileImageUrl) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(128, 0)))) .into(mProfileImageView); } else { glide.load(R.drawable.subreddit_default_icon) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java index 2a6330cb..722969ed 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/PostRecyclerViewAdapter.java @@ -156,7 +156,8 @@ class PostRecyclerViewAdapter extends PagedListAdapter { Intent intent = new Intent(ViewSubredditDetailActivity.this, ViewImageActivity.class); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java index c548043a..22ead232 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewUserDetailActivity.java @@ -157,7 +157,8 @@ public class ViewUserDetailActivity extends AppCompatActivity { } else { glide.load(userData.getIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(216, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(216, 0)))) .into(iconGifImageView); iconGifImageView.setOnClickListener(view -> { -- cgit v1.2.3