diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-04-25 16:25:19 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-04-25 16:25:19 +0000 |
commit | fceb1f458536ecc06adc2613c0b53b3e574226a3 (patch) | |
tree | 9e6b015765d0bd4df9d977f6d1686a47936b7c34 /app/src/main/java | |
parent | 3c4452261d1f65cf4ff9a76708202fe4637068d1 (diff) | |
download | infinity-for-reddit-fceb1f458536ecc06adc2613c0b53b3e574226a3.tar infinity-for-reddit-fceb1f458536ecc06adc2613c0b53b3e574226a3.tar.gz infinity-for-reddit-fceb1f458536ecc06adc2613c0b53b3e574226a3.tar.bz2 infinity-for-reddit-fceb1f458536ecc06adc2613c0b53b3e574226a3.tar.lz infinity-for-reddit-fceb1f458536ecc06adc2613c0b53b3e574226a3.tar.xz infinity-for-reddit-fceb1f458536ecc06adc2613c0b53b3e574226a3.tar.zst infinity-for-reddit-fceb1f458536ecc06adc2613c0b53b3e574226a3.zip |
Disable padding in CommentIndentationView if the comment level is 0.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CommentIndentationView.java | 8 |
1 files 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(); } |