diff options
author | Alex Ning <chineseperson5@gmail.com> | 2019-02-26 14:16:34 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2019-02-26 14:16:34 +0000 |
commit | acc08489fa9df2519608dbfaa08b18a33b93c9d8 (patch) | |
tree | 8a9cf547a98e4c9b7040aed7050314846d080c7b /app | |
parent | 9530e1f497c61f9bb74369c2426855aafe5d3fd5 (diff) | |
download | infinity-for-reddit-acc08489fa9df2519608dbfaa08b18a33b93c9d8.tar infinity-for-reddit-acc08489fa9df2519608dbfaa08b18a33b93c9d8.tar.gz infinity-for-reddit-acc08489fa9df2519608dbfaa08b18a33b93c9d8.tar.bz2 infinity-for-reddit-acc08489fa9df2519608dbfaa08b18a33b93c9d8.tar.lz infinity-for-reddit-acc08489fa9df2519608dbfaa08b18a33b93c9d8.tar.xz infinity-for-reddit-acc08489fa9df2519608dbfaa08b18a33b93c9d8.tar.zst infinity-for-reddit-acc08489fa9df2519608dbfaa08b18a33b93c9d8.zip |
Fixed the error drawable of glide image loading has not been done rounded corners transformation.
Diffstat (limited to 'app')
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<Post, RecyclerView.ViewHo if(!iconImageUrl.equals("")) { glide.load(iconImageUrl) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((DataViewHolder) holder).subredditIconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) @@ -172,7 +173,8 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo } else if(!post.getSubredditIconUrl().equals("")) { glide.load(post.getSubredditIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((DataViewHolder) holder).subredditIconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) @@ -206,7 +208,8 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo if(!iconImageUrl.equals("")) { glide.load(iconImageUrl) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((DataViewHolder) holder).subredditIconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) @@ -222,7 +225,8 @@ class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView.ViewHo } else if(!post.getAuthorIconUrl().equals("")) { glide.load(post.getAuthorIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((DataViewHolder) holder).subredditIconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java index e598d786..1113acd3 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubredditListingRecyclerViewAdapter.java @@ -3,6 +3,7 @@ package ml.docilealligator.infinityforreddit; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; +import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -102,9 +103,11 @@ public class SubredditListingRecyclerViewAdapter extends PagedListAdapter<Subred }); if(subredditData.getIconUrl() != null) { + Log.i("url", subredditData.getIconUrl()); glide.load(subredditData.getIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((DataViewHolder) holder).iconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java index 305a2657..1205dedf 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedSubredditRecyclerViewAdapter.java @@ -2,8 +2,6 @@ package ml.docilealligator.infinityforreddit; import android.content.Context; import android.content.Intent; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -16,6 +14,8 @@ import com.bumptech.glide.request.RequestOptions; import java.util.List; import SubscribedSubredditDatabase.SubscribedSubredditData; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import pl.droidsonroids.gif.GifImageView; @@ -54,7 +54,8 @@ class SubscribedSubredditRecyclerViewAdapter extends RecyclerView.Adapter<Recycl if(!mSubscribedSubredditData.get(i).getIconUrl().equals("")) { glide.load(mSubscribedSubredditData.get(i).getIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((SubredditViewHolder) viewHolder).iconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java index a2fd1aab..9ac6a205 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/SubscribedUserRecyclerViewAdapter.java @@ -2,8 +2,6 @@ package ml.docilealligator.infinityforreddit; import android.content.Context; import android.content.Intent; -import androidx.annotation.NonNull; -import androidx.recyclerview.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -16,6 +14,8 @@ import com.bumptech.glide.request.RequestOptions; import java.util.List; import SubscribedUserDatabase.SubscribedUserData; +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import pl.droidsonroids.gif.GifImageView; @@ -52,7 +52,8 @@ public class SubscribedUserRecyclerViewAdapter extends RecyclerView.Adapter<Recy if(!mSubscribedUserData.get(i).getIconUrl().equals("")) { glide.load(mSubscribedUserData.get(i).getIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((UserViewHolder) viewHolder).iconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java index e48bfba5..76cf14b5 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/UserListingRecyclerViewAdapter.java @@ -104,7 +104,8 @@ public class UserListingRecyclerViewAdapter extends PagedListAdapter<UserData, R if(UserData.getIconUrl() != null) { glide.load(UserData.getIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(((UserListingRecyclerViewAdapter.DataViewHolder) holder).iconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java index b9a75a40..770c55a0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java @@ -142,7 +142,8 @@ public class ViewPostDetailActivity extends AppCompatActivity { if(!iconImageUrl.equals("")) { glide.load(iconImageUrl) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(mSubredditIconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) @@ -156,7 +157,8 @@ public class ViewPostDetailActivity extends AppCompatActivity { } else if(!mPost.getSubredditIconUrl().equals("")) { glide.load(mPost.getSubredditIconUrl()) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .error(glide.load(R.drawable.subreddit_default_icon)) + .error(glide.load(R.drawable.subreddit_default_icon) + .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0)))) .into(mSubredditIconGifImageView); } else { glide.load(R.drawable.subreddit_default_icon) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java index bce27cc8..3531dfbd 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewSubredditDetailActivity.java @@ -159,7 +159,8 @@ public class ViewSubredditDetailActivity extends AppCompatActivity { } else { glide.load(subredditData.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 -> { 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 -> { |