Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
gedoor committed Mar 19, 2019
1 parent b690917 commit 4698dac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class ReadBookControl {
private Boolean showTimeBattery;
private Boolean showLine;
private Boolean darkStatusIcon;
private int indent;
private int screenTimeOut;
private int paddingLeft;
private int paddingTop;
Expand Down Expand Up @@ -84,6 +85,7 @@ private ReadBookControl() {
public void updateReaderSettings() {
this.hideStatusBar = preferences.getBoolean("hide_status_bar", false);
this.hideNavigationBar = preferences.getBoolean("hide_navigation_bar", false);
this.indent = preferences.getInt("indent", 2);
this.textSize = preferences.getInt("textSize", 20);
this.canClickTurn = preferences.getBoolean("canClickTurn", true);
this.canKeyTurn = preferences.getBoolean("canKeyTurn", true);
Expand Down Expand Up @@ -672,13 +674,14 @@ public void setTipMarginChange(Boolean tipMarginChange) {
}

public void setIndent(int indent) {
this.indent = indent;
preferences.edit()
.putInt("indent", indent)
.apply();
}

public int getIndent() {
return preferences.getInt("indent", 2);
return indent;
}

public int getLight() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ private void drawScaledText(Canvas canvas, String line, float lineWidth, TextPai
canvas.drawText(indent, x, top, paint);
float bw = StaticLayout.getDesiredWidth(indent, paint);
x += bw;
line = line.substring(2);
line = line.substring(readBookControl.getIndent());
}
int gapCount = line.length() - 1;
int i = 0;
Expand Down

0 comments on commit 4698dac

Please sign in to comment.