aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/ml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-04-25 16:25:19 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-04-25 16:25:19 +0000
commitfceb1f458536ecc06adc2613c0b53b3e574226a3 (patch)
tree9e6b015765d0bd4df9d977f6d1686a47936b7c34 /app/src/main/java/ml
parent3c4452261d1f65cf4ff9a76708202fe4637068d1 (diff)
downloadinfinity-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 'app/src/main/java/ml')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/customviews/CommentIndentationView.java8
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();
}