Skip to content

Commit 9491d18

Browse files
committed
remove cursor width
1 parent cc0e2ca commit 9491d18

File tree

4 files changed

+0
-29
lines changed

4 files changed

+0
-29
lines changed

libeditor/src/main/java/com/duy/ide/editor/text/LayoutContext.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class LayoutContext {
3636

3737
public Preferences preferences;
3838

39-
public int cursorThickness;
4039
public boolean isShowWhiteSpace;
4140
public int whiteSpaceColor;
4241

@@ -84,14 +83,6 @@ public void setShowWhiteSpace(boolean showWhiteSpace) {
8483
isShowWhiteSpace = showWhiteSpace;
8584
}
8685

87-
public int getCursorThickness() {
88-
return cursorThickness;
89-
}
90-
91-
public void setCursorThickness(int cursorThickness) {
92-
this.cursorThickness = cursorThickness;
93-
}
94-
9586
public int getLineNumber() {
9687
return lineNumber;
9788
}

libeditor/src/main/java/com/duy/ide/editor/view/HighlightEditorView.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ private void init(Context context) {
115115
setTheme(mPreferences.getEditorTheme());
116116

117117
onSharedPreferenceChanged(null, Preferences.KEY_FONT_SIZE);
118-
onSharedPreferenceChanged(null, Preferences.KEY_CURSOR_WIDTH);
119118
onSharedPreferenceChanged(null, Preferences.KEY_SHOW_LINE_NUMBER);
120119
onSharedPreferenceChanged(null, Preferences.KEY_WORD_WRAP);
121120
onSharedPreferenceChanged(null, Preferences.KEY_SHOW_WHITESPACE);
@@ -297,9 +296,6 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
297296
case Preferences.KEY_FONT_SIZE:
298297
setTextSize(TypedValue.COMPLEX_UNIT_SP, mPreferences.getFontSize());
299298
break;
300-
case Preferences.KEY_CURSOR_WIDTH:
301-
mLayoutContext.cursorThickness = mPreferences.getCursorThickness();
302-
break;
303299
case Preferences.KEY_SHOW_LINE_NUMBER:
304300
setInitLineNumber(mLayoutContext.lineNumber);
305301
break;

libeditor/src/main/java/com/jecelyin/editor/v2/Preferences.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import com.duy.ide.editor.theme.model.EditorTheme;
3232
import com.jecelyin.common.utils.DLog;
3333
import com.jecelyin.common.utils.StringUtils;
34-
import com.jecelyin.common.utils.SysUtils;
3534

3635
import java.util.HashMap;
3736
import java.util.HashSet;
@@ -44,7 +43,6 @@
4443
*/
4544
public class Preferences implements SharedPreferences.OnSharedPreferenceChangeListener {
4645
public static final String KEY_FONT_SIZE = "pref_font_size";
47-
public static final String KEY_CURSOR_WIDTH = "pref_cursor_width";
4846
public static final String KEY_WORD_WRAP = "pref_word_wrap";
4947
public static final String KEY_SHOW_LINE_NUMBER = "pref_show_linenumber";
5048
public static final String KEY_SHOW_WHITESPACE = "pref_show_whitespace";
@@ -96,7 +94,6 @@ public Preferences(Context context) {
9694

9795
map = new HashMap<>();
9896
map.put(KEY_FONT_SIZE, 13);
99-
map.put(KEY_CURSOR_WIDTH, 2);
10097
map.put(KEY_TOUCH_TO_ADJUST_TEXT_SIZE, false);
10198
map.put(KEY_WORD_WRAP, true);
10299
map.put(KEY_SHOW_LINE_NUMBER, true);
@@ -283,14 +280,6 @@ public int getFontSize() {
283280
return (int) map.get(KEY_FONT_SIZE);
284281
}
285282

286-
public int getCursorThickness() {
287-
int width = (int) map.get(KEY_CURSOR_WIDTH);
288-
if (width == 0)
289-
return 0;
290-
291-
return SysUtils.dpToPixels(context, width);
292-
}
293-
294283
public boolean isReadOnly() {
295284
// return (boolean) map.get(KEY_READ_ONLY);
296285
return false;

libeditor/src/main/res/xml/preference_editor.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
android:summary="@string/default_value"
77
android:title="@string/font_size" />
88

9-
<com.jecelyin.editor.v2.preference.CursorWidthPreference
10-
android:key="@string/pref_cursor_width"
11-
android:summary="@string/default_value"
12-
android:title="@string/cursor_width" />
13-
149
<CheckBoxPreference
1510
android:key="@string/pref_touch_to_adjust_text_size"
1611
android:title="@string/touch_to_adjust_text_size" />

0 commit comments

Comments
 (0)