Remove the divider on the most bottom post for the post replies screen

multisite
Floens 10 years ago
parent a8d2fd9aab
commit 9095aef1e3
  1. 2
      Clover/app/src/main/java/org/floens/chan/ui/adapter/PostAdapter.java
  2. 3
      Clover/app/src/main/java/org/floens/chan/ui/cell/CardPostCell.java
  3. 7
      Clover/app/src/main/java/org/floens/chan/ui/cell/PostCell.java
  4. 2
      Clover/app/src/main/java/org/floens/chan/ui/cell/PostCellInterface.java
  5. 8
      Clover/app/src/main/java/org/floens/chan/ui/cell/PostStubCell.java
  6. 3
      Clover/app/src/main/java/org/floens/chan/ui/controller/PostRepliesController.java
  7. 2
      Clover/app/src/main/java/org/floens/chan/ui/controller/ThemeSettingsController.java

@ -104,7 +104,7 @@ public class PostAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
PostViewHolder postViewHolder = (PostViewHolder) holder;
Post post = displayList.get(getPostPosition(position));
boolean highlight = post == highlightedPost || post.id.equals(highlightedPostId) || post.no == highlightedPostNo || post.tripcode.equals(highlightedPostTripcode);
postViewHolder.postView.setPost(null, post, postCellCallback, highlight, -1, postViewMode);
postViewHolder.postView.setPost(null, post, postCellCallback, highlight, -1, true, postViewMode);
break;
case TYPE_STATUS:
((StatusViewHolder) holder).threadStatusCell.update();

@ -139,7 +139,8 @@ public class CardPostCell extends CardView implements PostCellInterface, View.On
}
}
public void setPost(Theme theme, final Post post, PostCellInterface.PostCellCallback callback, boolean highlighted, int markedNo, PostCellInterface.PostViewMode postViewMode) {
public void setPost(Theme theme, final Post post, PostCellInterface.PostCellCallback callback,
boolean highlighted, int markedNo, boolean showDivider, PostCellInterface.PostViewMode postViewMode) {
if (this.post == post) {
return;
}

@ -98,6 +98,7 @@ public class PostCell extends LinearLayout implements PostCellInterface, PostLin
private PostCellCallback callback;
private boolean highlighted;
private int markedNo;
private boolean showDivider;
private OnClickListener selfClicked = new OnClickListener() {
@Override
@ -234,7 +235,8 @@ public class PostCell extends LinearLayout implements PostCellInterface, PostLin
}
}
public void setPost(Theme theme, final Post post, PostCellInterface.PostCellCallback callback, boolean highlighted, int markedNo, PostCellInterface.PostViewMode postViewMode) {
public void setPost(Theme theme, final Post post, PostCellInterface.PostCellCallback callback,
boolean highlighted, int markedNo, boolean showDivider, PostCellInterface.PostViewMode postViewMode) {
if (this.post == post && this.highlighted == highlighted && this.markedNo == markedNo) {
return;
}
@ -253,6 +255,7 @@ public class PostCell extends LinearLayout implements PostCellInterface, PostLin
this.callback = callback;
this.highlighted = highlighted;
this.markedNo = markedNo;
this.showDivider = showDivider;
bindPost(theme, post);
}
@ -424,6 +427,8 @@ public class PostCell extends LinearLayout implements PostCellInterface, PostLin
comment.setPadding(comment.getPaddingLeft(), comment.getPaddingTop(), comment.getPaddingRight(), paddingPx);
replies.setPadding(replies.getPaddingLeft(), 0, replies.getPaddingRight(), replies.getPaddingBottom());
}
divider.setVisibility(showDivider ? VISIBLE : GONE);
}
private void unbindPost(Post post) {

@ -27,7 +27,7 @@ import org.floens.chan.ui.view.ThumbnailView;
import java.util.List;
public interface PostCellInterface {
void setPost(Theme theme, Post post, PostCellCallback callback, boolean highlighted, int markedNo, PostCellInterface.PostViewMode postViewMode);
void setPost(Theme theme, Post post, PostCellCallback callback, boolean highlighted, int markedNo, boolean showDivider, PostCellInterface.PostViewMode postViewMode);
Post getPost();

@ -49,6 +49,7 @@ public class PostStubCell extends RelativeLayout implements PostCellInterface, V
private Theme theme;
private Post post;
private PostViewMode postViewMode;
private boolean showDivider;
private PostCellInterface.PostCellCallback callback;
private TextView title;
@ -137,7 +138,8 @@ public class PostStubCell extends RelativeLayout implements PostCellInterface, V
}
}
public void setPost(Theme theme, final Post post, PostCellInterface.PostCellCallback callback, boolean highlighted, int markedNo, PostCellInterface.PostViewMode postViewMode) {
public void setPost(Theme theme, final Post post, PostCellInterface.PostCellCallback callback,
boolean highlighted, int markedNo, boolean showDivider, PostCellInterface.PostViewMode postViewMode) {
if (this.post == post) {
return;
}
@ -155,6 +157,7 @@ public class PostStubCell extends RelativeLayout implements PostCellInterface, V
this.post = post;
this.callback = callback;
this.postViewMode = postViewMode;
this.showDivider = showDivider;
bindPost(theme, post);
}
@ -188,7 +191,8 @@ public class PostStubCell extends RelativeLayout implements PostCellInterface, V
title.setText(titleText);
}
divider.setVisibility(postViewMode == PostViewMode.CARD ? GONE : VISIBLE);
divider.setVisibility(postViewMode == PostViewMode.CARD ? GONE :
(showDivider ? VISIBLE : GONE));
}
private void unbindPost(Post post) {

@ -177,7 +177,8 @@ public class PostRepliesController extends Controller {
}
final Post p = getItem(position);
postCell.setPost(null, p, presenter, false, data.forPost.no, PostCellInterface.PostViewMode.LIST);
boolean showDivider = position < getCount() - 1;
postCell.setPost(null, p, presenter, false, data.forPost.no, showDivider, PostCellInterface.PostViewMode.LIST);
return (View) postCell;
}

@ -254,7 +254,7 @@ public class ThemeSettingsController extends Controller implements View.OnClickL
themeContext.getResources().getDimensionPixelSize(R.dimen.toolbar_height)));
PostCell postCell = (PostCell) LayoutInflater.from(themeContext).inflate(R.layout.cell_post, null);
postCell.setPost(theme, post, DUMMY_POST_CALLBACK, false, -1, PostCellInterface.PostViewMode.LIST);
postCell.setPost(theme, post, DUMMY_POST_CALLBACK, false, -1, true, PostCellInterface.PostViewMode.LIST);
linearLayout.addView(postCell, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));
return linearLayout;

Loading…
Cancel
Save