Skip to content

Commit

Permalink
tweak padding left
Browse files Browse the repository at this point in the history
  • Loading branch information
guanglinn committed Nov 8, 2024
1 parent 66bf395 commit de94df1
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ static class LineNumbersDrawer {

private static final int NUMBER_PADDING_LEFT = 16;
private static final int NUMBER_PADDING_RIGHT = 14;
private static final int PADDING_LEFT_NUMBERS_ENABLED = 10;
private final int paddingLeft;
private static final int EDITOR_PADDING_LEFT = 8;
private final int ORIGINAL_PADDING_LEFT;

private final Rect visibleArea = new Rect();
private final Rect lineNumbersArea = new Rect();
Expand Down Expand Up @@ -107,7 +107,7 @@ public void afterTextChanged(Editable editable) {
public LineNumbersDrawer(final EditText editText, final LineNumbersTextView textView) {
this.editText = editText;
this.textView = textView;
this.paddingLeft = editText.getPaddingLeft();
ORIGINAL_PADDING_LEFT = editText.getPaddingLeft();
paint.setColor(0xFF999999);
paint.setTextAlign(Paint.Align.RIGHT);
}
Expand Down Expand Up @@ -213,7 +213,7 @@ private void lineTracking(boolean enabled) {
public void prepare() {
lineTracking(true);
textView.setVisibility(VISIBLE);
editText.setPadding(PADDING_LEFT_NUMBERS_ENABLED, editText.getPaddingTop(), editText.getPaddingRight(), editText.getPaddingBottom());
editText.setPadding(EDITOR_PADDING_LEFT, editText.getPaddingTop(), editText.getPaddingRight(), editText.getPaddingBottom());
}

/**
Expand Down Expand Up @@ -296,7 +296,7 @@ public void reset() {
maxNumberDigits = 0;
textView.setWidth(0);
textView.setVisibility(GONE);
editText.setPadding(paddingLeft, editText.getPaddingTop(), editText.getPaddingRight(), editText.getPaddingBottom());
editText.setPadding(ORIGINAL_PADDING_LEFT, editText.getPaddingTop(), editText.getPaddingRight(), editText.getPaddingBottom());
}
}
}

0 comments on commit de94df1

Please sign in to comment.