File tree Expand file tree Collapse file tree 17 files changed +53
-1
lines changed
kotlin/com/simplemobiletools/notes Expand file tree Collapse file tree 17 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ class SettingsActivity : SimpleActivity() {
31
31
setupFontSize()
32
32
setupGravity()
33
33
setupWidgetNote()
34
+ setupCursorPlacement()
34
35
updateTextColors(settings_scrollview)
35
36
}
36
37
@@ -121,6 +122,14 @@ class SettingsActivity : SimpleActivity() {
121
122
}
122
123
}
123
124
125
+ private fun setupCursorPlacement () {
126
+ settings_cursor_placement.isChecked = config.placeCursorToEnd
127
+ settings_cursor_placement_holder.setOnClickListener {
128
+ settings_cursor_placement.toggle()
129
+ config.placeCursorToEnd = settings_cursor_placement.isChecked
130
+ }
131
+ }
132
+
124
133
private fun getCurrentWidgetNoteTitle (currentNoteId : Int , notes : List <Note >): String {
125
134
return notes.firstOrNull { it.id == currentNoteId }?.title ? : " "
126
135
}
Original file line number Diff line number Diff line change @@ -111,7 +111,10 @@ class NoteFragment : Fragment() {
111
111
setColors(config.textColor, config.primaryColor, config.backgroundColor)
112
112
setTextSize(TypedValue .COMPLEX_UNIT_PX , context.getTextSize())
113
113
gravity = getTextGravity()
114
- setSelection(text.length)
114
+
115
+ if (config.placeCursorToEnd) {
116
+ setSelection(text.length)
117
+ }
115
118
}
116
119
}
117
120
Original file line number Diff line number Diff line change @@ -31,4 +31,8 @@ class Config(context: Context) : BaseConfig(context) {
31
31
var widgetNoteId: Int
32
32
get() = prefs.getInt(WIDGET_NOTE_ID , 1 )
33
33
set(id) = prefs.edit().putInt(WIDGET_NOTE_ID , id).apply ()
34
+
35
+ var placeCursorToEnd: Boolean
36
+ get() = prefs.getBoolean(CURSOR_PLACEMENT , true )
37
+ set(placement) = prefs.edit().putBoolean(CURSOR_PLACEMENT , placement).apply ()
34
38
}
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ val CLICKABLE_LINKS = "clickable_links"
10
10
val WIDGET_NOTE_ID = " widget_note_id"
11
11
val FONT_SIZE = " font_size"
12
12
val GRAVITY = " gravity"
13
+ val CURSOR_PLACEMENT = " cursor_placement"
13
14
14
15
// gravity
15
16
val GRAVITY_LEFT = 0
Original file line number Diff line number Diff line change 70
70
71
71
</RelativeLayout >
72
72
73
+ <RelativeLayout
74
+ android : id =" @+id/settings_cursor_placement_holder"
75
+ android : layout_width =" match_parent"
76
+ android : layout_height =" wrap_content"
77
+ android : layout_marginTop =" @dimen/medium_margin"
78
+ android : background =" ?attr/selectableItemBackground"
79
+ android : paddingBottom =" @dimen/bigger_margin"
80
+ android : paddingLeft =" @dimen/activity_margin"
81
+ android : paddingRight =" @dimen/activity_margin"
82
+ android : paddingTop =" @dimen/bigger_margin" >
83
+
84
+ <com .simplemobiletools.commons.views.MySwitchCompat
85
+ android : id =" @+id/settings_cursor_placement"
86
+ android : layout_width =" match_parent"
87
+ android : layout_height =" wrap_content"
88
+ android : background =" @null"
89
+ android : clickable =" false"
90
+ android : paddingLeft =" @dimen/medium_margin"
91
+ android : paddingStart =" @dimen/medium_margin"
92
+ android : text =" @string/place_cursor_end" />
93
+
94
+ </RelativeLayout >
95
+
73
96
<RelativeLayout
74
97
android : id =" @+id/settings_font_size_holder"
75
98
android : layout_width =" match_parent"
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" widget_note" >Widget-Notiz</string >
32
32
<string name =" links_and_emails_clickable" >Links und E-Mail Adressen anklickbar</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" note_font_size" >Schriftgröße</string >
34
35
<string name =" small" >Klein</string >
35
36
<string name =" normal" >Normal</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" note_font_size" >Tamaño de fuente</string >
32
32
<string name =" links_and_emails_clickable" >Make links and emails clickable</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" widget_note" >Nota del widget</string >
34
35
<string name =" small" >Pequeña</string >
35
36
<string name =" normal" >Normal</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" widget_note" >Note utilisée dans le widget</string >
32
32
<string name =" links_and_emails_clickable" >Rendre les liens et les emails cliquables</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" note_font_size" >Taille de la police de la note</string >
34
35
<string name =" small" >Petite</string >
35
36
<string name =" normal" >Normale</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" widget_note" >Widgetben használt jegyzet</string >
32
32
<string name =" links_and_emails_clickable" >Hivatkozások és e-mail címek felismerése</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" note_font_size" >Jegyzet betűméret</string >
34
35
<string name =" small" >Kicsi</string >
35
36
<string name =" normal" >Közepes</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" note_font_size" >Note font size</string >
32
32
<string name =" links_and_emails_clickable" >Make links and emails clickable</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" widget_note" >Note used in widget</string >
34
35
<string name =" small" >Small</string >
35
36
<string name =" normal" >Normal</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" note_font_size" >メモのフォントサイズ</string >
32
32
<string name =" links_and_emails_clickable" >Make links and emails clickable</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" widget_note" >ウィジェットで使用するメモ</string >
34
35
<string name =" small" >小</string >
35
36
<string name =" normal" >通常</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" widget_note" >Note used in widget</string >
32
32
<string name =" links_and_emails_clickable" >Make links and emails clickable</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" note_font_size" >Note font size</string >
34
35
<string name =" small" >Small</string >
35
36
<string name =" normal" >Normal</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" note_font_size" >Tamanho do texto da nota</string >
32
32
<string name =" links_and_emails_clickable" >Ativar clique em ligações e endereços de e-mail</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" widget_note" >Nota utilizada no widget</string >
34
35
<string name =" small" >Pequeno</string >
35
36
<string name =" normal" >Normal</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" note_font_size" >Tamanho do texto da nota</string >
32
32
<string name =" links_and_emails_clickable" >Ativar clique em ligações e endereços de e-mail</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" widget_note" >Nota utilizada no widget</string >
34
35
<string name =" small" >Pequeno</string >
35
36
<string name =" normal" >Normal</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" widget_note" >Заметка, отображаемая в виджете</string >
32
32
<string name =" links_and_emails_clickable" >Сделать ссылки и адреса электронной почты активными</string >
33
+ <string name =" place_cursor_end" >Помещать курсор в конец заметки</string >
33
34
<string name =" note_font_size" >Размер текста заметки</string >
34
35
<string name =" small" >Мелкий</string >
35
36
<string name =" normal" >Нормальный</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" note_font_size" >Note font size</string >
32
32
<string name =" links_and_emails_clickable" >Make links and emails clickable</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" widget_note" >Note used in widget</string >
34
35
<string name =" small" >Small</string >
35
36
<string name =" normal" >Normal</string >
Original file line number Diff line number Diff line change 30
30
<!-- Settings -->
31
31
<string name =" widget_note" >Note used in widget</string >
32
32
<string name =" links_and_emails_clickable" >Make links and emails clickable</string >
33
+ <string name =" place_cursor_end" >Place cursor to the end of note</string >
33
34
<string name =" note_font_size" >Note font size</string >
34
35
<string name =" small" >Small</string >
35
36
<string name =" normal" >Normal</string >
You can’t perform that action at this time.
0 commit comments