Cleanup comments & add id to new relative layout

refs #141
This commit is contained in:
Christopher 2017-11-20 22:52:14 +01:00
parent e763f05ec8
commit 0c3bd3a828
2 changed files with 2 additions and 4 deletions

View File

@ -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()
}

View File

@ -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"