From be9bc8d014cbf8932e7ef9487f3f762102c3b433 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 1 Nov 2021 21:46:37 +0800 Subject: Optimize some layouts. --- .../adapters/PostRecyclerViewAdapter.java | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 11d4145b..448013f1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -1776,7 +1776,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter { + errorTextView.setOnClickListener(view -> { progressBar.setVisibility(View.VISIBLE); - errorRelativeLayout.setVisibility(View.GONE); + errorTextView.setVisibility(View.GONE); loadImage(this); }); @@ -3797,13 +3795,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter target, boolean isFirstResource) { progressBar.setVisibility(View.GONE); - errorRelativeLayout.setVisibility(View.VISIBLE); + errorTextView.setVisibility(View.VISIBLE); return false; } @Override public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { - errorRelativeLayout.setVisibility(View.GONE); + errorTextView.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); return false; } @@ -4116,8 +4114,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter { + errorTextView.setOnClickListener(view -> { progressBar.setVisibility(View.VISIBLE); - errorRelativeLayout.setVisibility(View.GONE); + errorTextView.setVisibility(View.GONE); loadImage(this); }); @@ -4202,13 +4198,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter target, boolean isFirstResource) { progressBar.setVisibility(View.GONE); - errorRelativeLayout.setVisibility(View.VISIBLE); + errorTextView.setVisibility(View.VISIBLE); return false; } @Override public boolean onResourceReady(Drawable resource, Object model, Target target, DataSource dataSource, boolean isFirstResource) { - errorRelativeLayout.setVisibility(View.GONE); + errorTextView.setVisibility(View.GONE); progressBar.setVisibility(View.GONE); return false; } -- cgit v1.2.3