mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-06 05:49:49 +02:00
Tap the error view to retry loading comments in ViewPostDetailActivity. Minor UI tweaks.
This commit is contained in:
@@ -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();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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));
|
||||
|
@@ -351,6 +351,11 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
|
||||
EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void retryFetchingComments() {
|
||||
fetchComments(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void retryFetchingMoreComments() {
|
||||
isLoadingMoreChildren = false;
|
||||
@@ -443,6 +448,11 @@ public class ViewPostDetailActivity extends AppCompatActivity implements FlairBo
|
||||
EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void retryFetchingComments() {
|
||||
fetchComments(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void retryFetchingMoreComments() {
|
||||
isLoadingMoreChildren = false;
|
||||
|
Reference in New Issue
Block a user