mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-04-13 23:12:02 +02:00
parent
e763f05ec8
commit
0c3bd3a828
@ -135,14 +135,11 @@ class NoteFragment : Fragment() {
|
||||
}
|
||||
|
||||
private fun removeTextWatcher() {
|
||||
//Avoid memory leak
|
||||
view.notes_view.removeTextChangedListener(textWatcher)
|
||||
}
|
||||
|
||||
private fun setWordCounter(text: Editable) {
|
||||
//Replace new lines with space
|
||||
val wordArray = text.toString().replace("\n", " ").split(" ")
|
||||
//Count only items which are not empty
|
||||
notes_counter.text = wordArray.count { it.isNotEmpty() }.toString()
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/notes_relativelayout"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.simplemobiletools.commons.views.MyEditText
|
||||
@ -31,7 +32,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textStyle="italic"
|
||||
android:text="123"
|
||||
android:text=""
|
||||
android:padding="5dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
|
Loading…
x
Reference in New Issue
Block a user