diff options
Diffstat (limited to '')
3 files changed, 21 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java index 0f29b823..ec46235d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentAndPostRecyclerViewAdapter.java @@ -86,6 +86,7 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie interface CommentRecyclerViewAdapterCallback { void updatePost(Post post); + void retryFetchingComments(); void retryFetchingMoreComments(); } @@ -1413,6 +1414,9 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie class LoadCommentsFailedViewHolder extends RecyclerView.ViewHolder { LoadCommentsFailedViewHolder(@NonNull View itemView) { super(itemView); + itemView.setOnClickListener(view -> { + mCommentRecyclerViewAdapterCallback.retryFetchingComments(); + }); } } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java index 39ab8d42..e519797a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/RulesActivity.java @@ -6,7 +6,6 @@ import android.content.res.Resources; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; -import android.util.Log; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; @@ -117,6 +116,13 @@ public class RulesActivity extends AppCompatActivity { params.topMargin = getResources().getDimensionPixelSize(statusBarResourceId); toolbar.setLayoutParams(params); } + + if (resources.getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT || resources.getBoolean(R.bool.isTablet)) { + int navBarResourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android"); + if (navBarResourceId > 0) { + recyclerView.setPadding(0, 0, 0, resources.getDimensionPixelSize(navBarResourceId)); + } + } } } @@ -240,7 +246,6 @@ public class RulesActivity extends AppCompatActivity { String shortName = rulesArray.getJSONObject(i).getString(JSONUtils.SHORT_NAME_KEY); String description = null; if(rulesArray.getJSONObject(i).has(JSONUtils.DESCRIPTION_KEY)) { - Log.i("asdfasdf", "" + rulesArray.getJSONObject(i).getString(JSONUtils.DESCRIPTION_KEY)); description = Utils.addSubredditAndUserLink(rulesArray.getJSONObject(i).getString(JSONUtils.DESCRIPTION_KEY)); } rules.add(new Rule(shortName, description)); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java index a170275c..8bdff436 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/ViewPostDetailActivity.java @@ -352,6 +352,11 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo } @Override + public void retryFetchingComments() { + fetchComments(false); + } + + @Override public void retryFetchingMoreComments() { isLoadingMoreChildren = false; loadMoreChildrenSuccess = true; @@ -444,6 +449,11 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo } @Override + public void retryFetchingComments() { + fetchComments(false); + } + + @Override public void retryFetchingMoreComments() { isLoadingMoreChildren = false; loadMoreChildrenSuccess = true; |