Disable padding in CommentIndentationView if the comment level is 0.

This commit is contained in:
Alex Ning 2021-04-26 00:25:19 +08:00
parent 3c4452261d
commit fceb1f4585

View File

@ -80,8 +80,12 @@ public class CommentIndentationView extends LinearLayout {
public void setLevelAndColors(int level, Integer[] colors) { public void setLevelAndColors(int level, Integer[] colors) {
this.colors = colors; this.colors = colors;
this.level = level; this.level = level;
int indentationSpacing = (level * spacing + pathWidth); if (level > 0) {
int indentationSpacing = level * spacing + pathWidth;
setPaddingRelative(indentationSpacing, 0, pathWidth, 0); setPaddingRelative(indentationSpacing, 0, pathWidth, 0);
} else {
setPaddingRelative(0, 0, 0, 0);
}
invalidate(); invalidate();
} }