From fceb1f458536ecc06adc2613c0b53b3e574226a3 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 26 Apr 2021 00:25:19 +0800 Subject: Disable padding in CommentIndentationView if the comment level is 0. --- .../infinityforreddit/customviews/CommentIndentationView.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CommentIndentationView.java b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CommentIndentationView.java index 07697075..fc9dba03 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CommentIndentationView.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CommentIndentationView.java @@ -80,8 +80,12 @@ public class CommentIndentationView extends LinearLayout { public void setLevelAndColors(int level, Integer[] colors) { this.colors = colors; this.level = level; - int indentationSpacing = (level * spacing + pathWidth); - setPaddingRelative(indentationSpacing, 0, pathWidth, 0); + if (level > 0) { + int indentationSpacing = level * spacing + pathWidth; + setPaddingRelative(indentationSpacing, 0, pathWidth, 0); + } else { + setPaddingRelative(0, 0, 0, 0); + } invalidate(); } -- cgit v1.2.3