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